This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: support '# line "file" flags' and '# 0 "" 2'
Alexandre Oliva wrote:
> Thanks, here's what I'm checking in. Please let me know if you'd like
> any further changes.
Unfortunately this causes a regression with dlltool. I get the
following when building mingw-runtime from a combined tree, i.e. using
the just-built gas/dlltool:
/build/combined/./binutils/dlltool --as /build/combined/./gas/as-new
--output-def mingwthrd.def mthr.o mthr_init.o
gcc -Wl,--base-file=mingwthrd.base -B./ -mdll -mno-cygwin
-Wl,--image-base,0x6FBC0000 -Wl,--entry,_DllMainCRTStartup@12 mthr.o
mthr_init.o -Lmingwex \
-o mingwthrd_dummy.exe
/build/combined/./binutils/dlltool --as=/build/combined/./gas/as-new
--dllname mingwm10.dll --def mingwthrd.def --base-file mingwthrd.base
--output-exp mingwthrd.exp
dyqic.s: Assembler messages:
dyqic.s:2: Error: missing string
dyqic.s:2: Error: junk at end of line, first unrecognized character
valued 0x9
/build/combined/./binutils/dlltool: /build/combined/./gas/as-new exited
with status 1
The problem is that the temporary assembler file that dlltool creates
begins like this:
# /build/combined/./binutils/dlltool -vn
--as=/build/combined/./gas/as-new --dllname mingwm10.dll --def
mingwthrd.def --base-file mingwthrd.base --output-exp mi
# 0 = __mingwthr_key_dtor __mingwthr_key_dtor @ 1
# 1 = __mingwthr_remove_key_dtor __mingwthr_remove_key_dtor @ 2
You can reproduce this by itself like this:
$ echo 'EXPORTS
__mingwthr_key_dtor @ 1
__mingwthr_remove_key_dtor @ 2' >mingwthrd.def && \
dlltool -vn --as=/build/combined/gas/as-new --def mingwthrd.def
--output-exp foo
dlltool: Processing def file: mingwthrd.def
dlltool: Processed def file
dlltool: Processing definitions
dlltool: Processed definitions
dlltool: Generating export file: foo
dlltool: Opened temporary file: daecc.s
dlltool: run: /build/combined/gas/as-new -o foo daecc.s
daecc.s: Assembler messages:
daecc.s:2: Error: missing string
daecc.s:2: Error: junk at end of line, first unrecognized character
valued 0x9
dlltool: /build/combined/gas/as-new exited with status 1
dlltool: Generated exports file
The comments at the top of that temporary assembler file are created by
dump_def_info() in dlltool.c. The trivial patch below just adds the
text 'export' to the comment so that it no longer looks like a line
number. This allows the build of MinGW to finish successfully.
Brian
2007-03-09 Brian Dessent <brian@dessent.net
* dlltool.c (dump_def_info): Disambiguate comment in temporary
assembler file to not look like a line number.
Index: dlltool.c
===================================================================
RCS file: /cvs/src/src/binutils/dlltool.c,v
retrieving revision 1.74
diff -u -p -u -p -r1.74 dlltool.c
--- dlltool.c 17 Feb 2007 13:33:54 -0000 1.74
+++ dlltool.c 9 Mar 2007 18:21:51 -0000
@@ -1565,7 +1565,7 @@ dump_def_info (FILE *f)
fprintf (f, "\n");
for (i = 0, exp = d_exports; exp; i++, exp = exp->next)
{
- fprintf (f, "%s %d = %s %s @ %d %s%s%s%s\n",
+ fprintf (f, "%s export %d = %s %s @ %d %s%s%s%s\n",
ASM_C,
i,
exp->name,