[PATCH] Fix annexc test

Jakub Jelinek jakub@redhat.com
Fri Dec 6 07:45:00 GMT 2002


Hi!

With nptl annexc test spits out
In file included from ../nptl/sysdeps/i386/i686/tls.h:34,
                 from ../include/tls.h:3,
                 from ../sysdeps/generic/bits/libc-tsd.h:45,
                 from ../locale/localeinfo.h:190,
                 from ../include/ctype.h:14,
                 from <stdin>:1:
../nptl/sysdeps/i386/tls.h:48:3: #error "TLS support is required."
In file included from ../nptl/sysdeps/i386/i686/tls.h:34,
                 from ../include/tls.h:3,
                 from ../include/errno.h:22,
                 from <stdin>:1:
../nptl/sysdeps/i386/tls.h:48:3: #error "TLS support is required."
and similarly to linuxthreads build outputs lots of invalid macro errors
which are not relevant to installed headers, but solely to glibc build.
The following patch seems to cure it, I've verified it only looks at
libc headers from current tree (plus linux headers and gcc headers),
never installed libc headers.

2002-12-06  Jakub Jelinek  <jakub@redhat.com>

	* posix/Makefile (annexc.out): Add -I../dir for all sorted-dirs.
	* posix/annexc.c (fmt, testfmt): Remove -D_LIBC.

--- libc/posix/Makefile.jj	2002-11-25 00:11:20.000000000 +0100
+++ libc/posix/Makefile	2002-12-06 18:03:01.000000000 +0100
@@ -155,7 +155,7 @@ endif
 
 $(objpfx)annexc.out: $(objpfx)annexc
 	-$(dir $<)$(notdir $<) '$(CC)' \
-			       '-I../include -I.. $(+sysdep-includes) $(sysincludes)' > $@
+	  '$(patsubst %,-I../%,$(sorted-subdirs)) -I../include -I.. $(+sysdep-includes) $(sysincludes)' > $@
 
 annexc-CFLAGS = -O
 $(objpfx)annexc: annexc.c
--- libc/posix/annexc.c.jj	2001-07-06 06:55:38.000000000 +0200
+++ libc/posix/annexc.c	2002-12-06 17:47:39.000000000 +0100
@@ -615,12 +615,12 @@ static struct header
 /* Format string to build command to invoke compiler.  */
 static const char fmt[] = "\
 echo \"#include <%s>\" |\
-%s -E -dM -D_POSIX_SOURCE -D_LIBC %s \
+%s -E -dM -D_POSIX_SOURCE %s \
 -isystem `%s --print-prog-name=include` - > %s";
 
 static const char testfmt[] = "\
 echo \"#include <unistd.h>\n#if !defined %s || %s == -1\n#error not defined\n#endif\n\" |\
-%s -E -dM -D_POSIX_SOURCE -D_LIBC %s \
+%s -E -dM -D_POSIX_SOURCE %s \
 -isystem `%s --print-prog-name=include` - 2> /dev/null > %s";
 
 

	Jakub



More information about the Libc-hacker mailing list