delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/06/13/05:27:49

Message-Id: <200106130926.f5D9QAX03971@hal.astr.lu.lv>
From: Andris Pavenis <pavenis AT latnet DOT lv>
To: djgpp-workers AT delorie DOT com
Subject: GCC-3.0 related problem with src/libc/stubs/stubXXXX.S
Date: Wed, 13 Jun 2001 12:26:10 +0300
X-Mailer: KMail [version 1.2.2]
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019