Mail Archives: djgpp-workers/2001/06/13/05:27:49
stubXXXX.S files generated by mkstubs triggers gcc-3.0 preprocessor bug
(See http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=3081&database=gcc):
preprocessor errorously merges first 2 lines (if these are not preprocessor
instructions) when -imacros command line option is being used. It's rather
harmless for most real life situations (we have #include ... at start of
program), but it causes syntax errors in this case (stubXXXX.S)
I got a respsonse that it's rather unlikely to be fixed in gcc-3.0 release
Fortunatelly it's easy to workaround this bug by simply adding
blank line at start of .S file:
Index: mkstubs.c
===================================================================
RCS file: /cvs/djgpp/djgpp/src/libc/stubs/mkstubs.c,v
retrieving revision 1.1
diff -p -3 -r1.1 mkstubs.c
*** mkstubs.c 1997/12/29 17:21:46 1.1
--- mkstubs.c 2001/06/13 09:17:03
*************** main(int argc, char **argv)
*** 37,43 ****
sprintf(fn, "stub%04d.S", i);
as = fopen(fn, "w");
! fprintf(as, "\t.file \"%s.stub\"\n\t.global _%s\n_%s:\n\tjmp ___%s\n",
buf, buf, buf, buf);
fclose(as);
--- 37,43 ----
sprintf(fn, "stub%04d.S", i);
as = fopen(fn, "w");
! fprintf(as, "\n\t.file \"%s.stub\"\n\t.global _%s\n_%s:\n\tjmp ___%s\n",
buf, buf, buf, buf);
fclose(as);
Andris
- Raw text -