public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 20/20] Include config.h in MIN-CPPFLAGS
@ 2014-08-21 18:00 Siddhesh Poyarekar
  2014-08-22  5:31 ` [PATCH v1.1 " Siddhesh Poyarekar
  0 siblings, 1 reply; 6+ messages in thread
From: Siddhesh Poyarekar @ 2014-08-21 18:00 UTC (permalink / raw)
  To: libc-alpha

[-- Attachment #1: Type: text/plain, Size: 1071 bytes --]

This is needed when processing the Versions files since they could
refer to macros defined in config.h.  config.h was earlier included
through libc-symbols.h but since MIN-CPPFLAGS does not include the
latter anymore, it needs to at least include config.h.

This was causing a difference in generated code on s390x.  With this
change, s390x code is also unchanged with this and other 19 patches
(barring the IN_LIB patch of course).

	* Makeconfig (MIN-CPPFLAGS): Include config.h.
---
 Makeconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Makeconfig b/Makeconfig
index df26cd0..38f4851 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -845,6 +845,7 @@ override CXXFLAGS = $(c++-sysincludes) \
 MIN-CPPFLAGS = $(config-extra-cppflags) $(CPPUNDEFS) $(CPPFLAGS-config) \
 	   $($(subdir)-CPPFLAGS) \
 	   $(+includes) $(defines) $(sysdep-CPPFLAGS) \
+	   -include $(common-objpfx)config.h \
 	   $(CPPFLAGS-$(suffix $@)) \
 	   $(foreach lib,$(libof-$(basename $(@F))) \
 			 $(libof-$(<F)) $(libof-$(@F)),$(CPPFLAGS-$(lib))) \
-- 
1.9.3


[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v1.1 20/20] Include config.h in MIN-CPPFLAGS
  2014-08-21 18:00 [PATCH 20/20] Include config.h in MIN-CPPFLAGS Siddhesh Poyarekar
@ 2014-08-22  5:31 ` Siddhesh Poyarekar
  2014-08-22 13:32   ` Stefan Liebler
  0 siblings, 1 reply; 6+ messages in thread
From: Siddhesh Poyarekar @ 2014-08-22  5:31 UTC (permalink / raw)
  To: libc-alpha

[-- Attachment #1: Type: text/plain, Size: 1399 bytes --]

On Thu, Aug 21, 2014 at 11:29:54PM +0530, Siddhesh Poyarekar wrote:
> This is needed when processing the Versions files since they could
> refer to macros defined in config.h.  config.h was earlier included
> through libc-symbols.h but since MIN-CPPFLAGS does not include the
> latter anymore, it needs to at least include config.h.
> 
> This was causing a difference in generated code on s390x.  With this
> change, s390x code is also unchanged with this and other 19 patches
> (barring the IN_LIB patch of course).
> 
> 	* Makeconfig (MIN-CPPFLAGS): Include config.h.

config.h checks a few macros, most of which are set at command line,
with the exception of _LIBC, which is set in libc-symbols.h.  Set it
on the commandline to be consistent with the behaviour we ought to get
with libc-symbols.h included.

    
	* Makeconfig (MIN-CPPFLAGS): Include config.h.

diff --git a/Makeconfig b/Makeconfig
index df26cd0..c6eae06 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -845,6 +845,7 @@ override CXXFLAGS = $(c++-sysincludes) \
 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))) \

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v1.1 20/20] Include config.h in MIN-CPPFLAGS
  2014-08-22  5:31 ` [PATCH v1.1 " Siddhesh Poyarekar
@ 2014-08-22 13:32   ` Stefan Liebler
  2014-08-22 14:22     ` Siddhesh Poyarekar
  2014-08-22 18:31     ` Siddhesh Poyarekar
  0 siblings, 2 replies; 6+ messages in thread
From: Stefan Liebler @ 2014-08-22 13:32 UTC (permalink / raw)
  To: libc-alpha

Hi Siddhesh,

I´ve tested your is_in_module branch on s390x.

Now there are only Wundef warnings with _POSIX*/_XBS*, which are 
mentioned in release wiki.
Thanks.

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
             ^

The defining NOT_IN to zero of patch 19 is not done, because of patch 
v1.1 20.

patch 19:
+#ifndef _LIBC
+# define NOT_IN(lib) (0)
+#endif

patch v1.1 20:
+	   -D_LIBC -include $(common-objpfx)config.h \


After changing patch 19 to
#ifndef NOT_IN
# define NOT_IN(lib) (0)
#endif
the following tests are failing:
FAIL: conform/ISO/stdlib.h/conform
FAIL: conform/ISO11/stdlib.h/conform
FAIL: conform/ISO99/stdlib.h/conform
FAIL: conform/POSIX/mqueue.h/conform
FAIL: conform/POSIX/stdlib.h/conform
FAIL: conform/POSIX2008/mqueue.h/conform
FAIL: conform/POSIX2008/stdlib.h/conform
FAIL: conform/UNIX98/mqueue.h/conform
FAIL: conform/XOPEN2K/stdlib.h/conform
FAIL: conform/XOPEN2K8/mqueue.h/conform
FAIL: conform/XOPEN2K8/stdlib.h/conform
with either:
 >Namespace violation: "IS_IN"
or:
 >../include/bits/stdlib-float.h:2:12: error: missing binary operator 
before token "("
      #if NOT_IN (rtld)
                 ^

FAIL: stdlib/isomac:
 >...
stdlib.h
system() returned nonzero
...


I´ve also compared the obj-files and got the mentioned diffs of patch 5.

Bye

On 08/22/2014 07:31 AM, Siddhesh Poyarekar wrote:
> On Thu, Aug 21, 2014 at 11:29:54PM +0530, Siddhesh Poyarekar wrote:
>> This is needed when processing the Versions files since they could
>> refer to macros defined in config.h.  config.h was earlier included
>> through libc-symbols.h but since MIN-CPPFLAGS does not include the
>> latter anymore, it needs to at least include config.h.
>>
>> This was causing a difference in generated code on s390x.  With this
>> change, s390x code is also unchanged with this and other 19 patches
>> (barring the IN_LIB patch of course).
>>
>> 	* Makeconfig (MIN-CPPFLAGS): Include config.h.
>
> config.h checks a few macros, most of which are set at command line,
> with the exception of _LIBC, which is set in libc-symbols.h.  Set it
> on the commandline to be consistent with the behaviour we ought to get
> with libc-symbols.h included.
>
>
> 	* Makeconfig (MIN-CPPFLAGS): Include config.h.
>
> diff --git a/Makeconfig b/Makeconfig
> index df26cd0..c6eae06 100644
> --- a/Makeconfig
> +++ b/Makeconfig
> @@ -845,6 +845,7 @@ override CXXFLAGS = $(c++-sysincludes) \
>   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))) \
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v1.1 20/20] Include config.h in MIN-CPPFLAGS
  2014-08-22 13:32   ` Stefan Liebler
@ 2014-08-22 14:22     ` Siddhesh Poyarekar
  2014-08-22 18:31     ` Siddhesh Poyarekar
  1 sibling, 0 replies; 6+ messages in thread
From: Siddhesh Poyarekar @ 2014-08-22 14:22 UTC (permalink / raw)
  To: Stefan Liebler; +Cc: GNU C Library

On 22 August 2014 19:01, Stefan Liebler <stli@linux.vnet.ibm.com> wrote:
> Hi Siddhesh,
>
> I扉e tested your is_in_module branch on s390x.

Thanks!

> 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
>             ^
>
> The defining NOT_IN to zero of patch 19 is not done, because of patch v1.1
> 20.
>
> patch 19:
> +#ifndef _LIBC
> +# define NOT_IN(lib) (0)
> +#endif
>
> patch v1.1 20:
> +          -D_LIBC -include $(common-objpfx)config.h \
>
>
> After changing patch 19 to
> #ifndef NOT_IN
> # define NOT_IN(lib) (0)
> #endif

I think I need to generate libc-modules.h without depending on soversions.i.

> the following tests are failing:
> FAIL: conform/ISO/stdlib.h/conform
> FAIL: conform/ISO11/stdlib.h/conform
> FAIL: conform/ISO99/stdlib.h/conform
> FAIL: conform/POSIX/mqueue.h/conform
> FAIL: conform/POSIX/stdlib.h/conform
> FAIL: conform/POSIX2008/mqueue.h/conform
> FAIL: conform/POSIX2008/stdlib.h/conform
> FAIL: conform/UNIX98/mqueue.h/conform
> FAIL: conform/XOPEN2K/stdlib.h/conform
> FAIL: conform/XOPEN2K8/mqueue.h/conform
> FAIL: conform/XOPEN2K8/stdlib.h/conform
> with either:
>>Namespace violation: "IS_IN"
> or:

OK, that's porobably a good reason to not try to define IS_IN or
NOT_IN and just use _LIBC in the conditionals.

I'll fix these things up and update the branch.

Thanks,
Siddhesh
-- 
http://siddhesh.in

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v1.1 20/20] Include config.h in MIN-CPPFLAGS
  2014-08-22 13:32   ` Stefan Liebler
  2014-08-22 14:22     ` Siddhesh Poyarekar
@ 2014-08-22 18:31     ` Siddhesh Poyarekar
  2014-08-25  7:28       ` Stefan Liebler
  1 sibling, 1 reply; 6+ messages in thread
From: Siddhesh Poyarekar @ 2014-08-22 18:31 UTC (permalink / raw)
  To: Stefan Liebler; +Cc: libc-alpha

[-- Attachment #1: Type: text/plain, Size: 4213 bytes --]

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.

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)
 

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v1.1 20/20] Include config.h in MIN-CPPFLAGS
  2014-08-22 18:31     ` Siddhesh Poyarekar
@ 2014-08-25  7:28       ` Stefan Liebler
  0 siblings, 0 replies; 6+ messages in thread
From: Stefan Liebler @ 2014-08-25  7:28 UTC (permalink / raw)
  To: libc-alpha

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-08-25  7:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-21 18:00 [PATCH 20/20] Include config.h in MIN-CPPFLAGS Siddhesh Poyarekar
2014-08-22  5:31 ` [PATCH v1.1 " Siddhesh Poyarekar
2014-08-22 13:32   ` Stefan Liebler
2014-08-22 14:22     ` Siddhesh Poyarekar
2014-08-22 18:31     ` Siddhesh Poyarekar
2014-08-25  7:28       ` Stefan Liebler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).