diff mbox

[v1.1,20/20] Include config.h in MIN-CPPFLAGS

Message ID 20140822183052.GK16835@spoyarek.pnq.redhat.com
State New
Headers show

Commit Message

Siddhesh Poyarekar Aug. 22, 2014, 6:30 p.m. UTC
On Fri, Aug 22, 2014 at 03:31:41PM +0200, Stefan Liebler wrote:
> But building the testsuite fails while building nptl_db/db-symbols.v.iT
> because NOT_IN is not defined in structs.def:
> structs.def:81:12: error: missing binary operator before token "("
>  #if NOT_IN (libpthread) || TLS_TCB_AT_TP

Stefan,

Can you please try this patch?  It should fix everything except the
conformtest failures.  The fix for conformtest failures is fairly
straightforward and I'll add it as a modification of another patch.

Thanks,
Siddhesh

commit bc387f3bcc5059a32f8cd60336b06c5027f0cc88
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Fri Aug 22 23:21:13 2014 +0530

    Use regular CPPFLAGS for everything except shlib-versions
    
    There was a circular dependency between shlib-versions.v.i and
    libc-modules, which I had attempted to break earlier by excluding
    libc-symbols.h from CPPFLAGS for %.v.i targets.  This caused a few
    other problems like _LIBC not being defined in nptl_db/structs.def and
    ABI breakage in s390x (and probably also in m68k and alpha).
    
    This patch breaks libc-modules.h out of libc-symbols.h and includes it
    in the commandline instead.  Additionally, the header is not included
    in the commandline when generating shlib-versions.v.i, but is present
    everywhere else.

Comments

Stefan Liebler Aug. 25, 2014, 7:28 a.m. UTC | #1
On 08/22/2014 08:30 PM, Siddhesh Poyarekar wrote:
> On Fri, Aug 22, 2014 at 03:31:41PM +0200, Stefan Liebler wrote:
>> But building the testsuite fails while building nptl_db/db-symbols.v.iT
>> because NOT_IN is not defined in structs.def:
>> structs.def:81:12: error: missing binary operator before token "("
>>   #if NOT_IN (libpthread) || TLS_TCB_AT_TP
>
> Stefan,
>
> Can you please try this patch?  It should fix everything except the
> conformtest failures.  The fix for conformtest failures is fairly
> straightforward and I'll add it as a modification of another patch.
>
> Thanks,
> Siddhesh


Hi Siddhesh,

tested it on s390x. Now building the testsuite is okay. Thanks.
The conformtests are failing as you said.

Bye
diff mbox

Patch

diff --git a/Makeconfig b/Makeconfig
index c6eae06..ccd5d84 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -818,15 +818,20 @@  in-module = $(strip $(foreach lib,$(libof-$(basename $(@F))) $(libof-$(<F)) \
 
 module-def = $(if $(in-module),$(in-module),-DIN_MODULE=MODULE_libc)
 
+# We don't need libc-modules.h and the IN_MODULE definition for
+# shlib-version.v.i.
+module-cppflags = $(if $(filter shlib-versions.v.i,$(@F)),,-include \
+		       $(common-objpfx)libc-modules.h $(module-def))
+
 # These are the variables that the implicit compilation rules use.
 # Note that we can't use -std=* in CPPFLAGS, because it overrides
 # the implicit -lang-asm and breaks cpp behavior for .S files--notably
 # it causes cpp to stop predefining __ASSEMBLER__.
 CPPFLAGS = $(config-extra-cppflags) $(CPPUNDEFS) $(CPPFLAGS-config) \
 	   $($(subdir)-CPPFLAGS) \
-	   $(+includes) $(defines) \
+	   $(+includes) $(defines) $(module-cppflags) \
 	   -include $(..)include/libc-symbols.h $(sysdep-CPPFLAGS) \
-	   $(CPPFLAGS-$(suffix $@)) $(module-def) \
+	   $(CPPFLAGS-$(suffix $@)) \
 	   $(foreach lib,$(libof-$(basename $(@F))) \
 			 $(libof-$(<F)) $(libof-$(@F)),$(CPPFLAGS-$(lib))) \
 	   $(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F)))
@@ -840,16 +845,6 @@  override CXXFLAGS = $(c++-sysincludes) \
 		    $(filter-out %frame-pointer,$(+cflags)) $(sysdep-CFLAGS) \
 		    $(CFLAGS-$(suffix $@)) $(CFLAGS-$(<F)) $(CFLAGS-$(@F))
 
-# Minimal CPPFLAGS for the initial compilations, i.e. syscall stubs, %.v.i,
-# etc.
-MIN-CPPFLAGS = $(config-extra-cppflags) $(CPPUNDEFS) $(CPPFLAGS-config) \
-	   $($(subdir)-CPPFLAGS) \
-	   $(+includes) $(defines) $(sysdep-CPPFLAGS) \
-	   -D_LIBC -include $(common-objpfx)config.h \
-	   $(CPPFLAGS-$(suffix $@)) \
-	   $(foreach lib,$(libof-$(basename $(@F))) \
-			 $(libof-$(<F)) $(libof-$(@F)),$(CPPFLAGS-$(lib))) \
-	   $(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F)))
 # If everything is compiled with -fPIC (implicitly) we must tell this by
 # defining the PIC symbol.
 ifeq (yes,$(build-pic-default))
@@ -938,7 +933,7 @@  subdir-srcdirs = $(foreach dir,$(subdirs),\
 %.v.i: $(common-objpfx)config.h $(..)Makeconfig
 	sed '/^[ 	]*%/!s/#.*$$//;/^[ 	]*$$/d;s/^[ 	]*%/#/' \
 	    $(filter-out FORCE %.h $(..)Makeconfig,$^) \
-	| $(CC) -E -undef $(MIN-CPPFLAGS) -x assembler-with-cpp - \
+	| $(CC) -E -undef $(CPPFLAGS) -x assembler-with-cpp - \
 		   > $@T
 	mv -f $@T $@
 %.v: %.v.i
diff --git a/include/libc-symbols.h b/include/libc-symbols.h
index 0081301..4155083 100644
--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -20,8 +20,6 @@ 
 #ifndef _LIBC_SYMBOLS_H
 #define _LIBC_SYMBOLS_H	1
 
-#include "libc-modules.h"
-
 #define IS_IN(lib) (IN_MODULE == MODULE_##lib)
 #define NOT_IN(lib) !IS_IN (lib)