This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gnu/stubs.h misgenerated using 3.4ish gcc


Recent versions of GCC don't necessarily output Makefile dependencies
in the order the glibc stubs generating script expects.  For example,
for setlogin, I had:

$(common-objpfx)posix/setlogin.os:  \
 ./../include/libc-symbols.h \
[...] \
  [...] ../sysdeps/generic/setlogin.c \
[...]
  [...] ../include/stub-tag.h

This causes the stubs extractor to look for __stub_warning in
libc-symbols.h.  Oops.

This patch fixes the problem.  Ok to install?

Index: ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* Makerules ($(objpfx)stubs): Rewrite.  Fixes bugzilla bug 157.

Index: Makerules
===================================================================
RCS file: /cvs/glibc/libc/Makerules,v
retrieving revision 1.420
diff -u -p -r1.420 Makerules
--- Makerules 3 Apr 2004 08:50:52 -0000 1.420
+++ Makerules 12 May 2004 22:18:56 -0000
@@ -1385,13 +1385,13 @@ $(objpfx)stubs: $(+depfiles)
 ifneq (,$(strip $(+depfiles)))
 # Use /dev/null since `...` might expand to empty.
 	c=`($(patsubst %/,cd % &&,$(objpfx)) \
-	    sed -n -e 's@\$$(common-objpfx)@$(common-objpfx)@g' \
-		   -e 's@\$$(objpfx)@$(objpfx)@g' \
-		   -e '/stub-tag\.h/{; g; s/./&/p; }' \
-		   -e '/:/{x; s/^.*$$//; x; }' \
-		   -e 's/^.*://;s/\\$$//;s/^ *\([^ ][^ ]*\) .*$$/\1/' \
-		   -e '/^[^ ][^ ]*$$/{G;s/^.*\n\(..*\)/\1/;s/\n//;h; }' \
-		   $(patsubst $(objpfx)%,%,$^)) | sort | uniq`; \
+	    grep -l '/stub-tag\.h' $(patsubst $(objpfx)%,%,$^) | \
+	    xargs sed -n -e 's@\$$(common-objpfx)@$(common-objpfx)@g' \
+		         -e 's@\$$(objpfx)@$(objpfx)@g' -e 's,:.*,,p') | \
+	   awk '{ split($$0, files); \
+		  for (var in files) \
+		    if (files[var] ~ /\.[ho][Sspgb]?$$/) continue; \
+		    else print files[var]; }' | sort | uniq`; \
 	sed -n 's/^stub_warning *(\([^)]*\).*$$/#define __stub_\1/p' \
 	    $$c /dev/null > $@T
 	mv -f $@T $@
-- 
Alexandre Oliva             http://www.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]