This is the mail archive of the glibc-cvs@sourceware.org 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 C Library master sources branch master updated. glibc-2.23-540-g8321286


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  8321286846970af562a2ff6b7272f1cd0860d6c1 (commit)
      from  00068ce40c3885ae0598e55a163632d78dfe42bf (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=8321286846970af562a2ff6b7272f1cd0860d6c1

commit 8321286846970af562a2ff6b7272f1cd0860d6c1
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Jul 5 15:01:33 2016 -0700

    Make copies of cstdlib/cmath and use them [BZ #20314]
    
    If C++ headers <cstdlib> or <cmath> are used, GCC 6 will include
    /usr/include/stdlib.h or /usr/include/math.h from "#include_next"
    (instead of stdlib/stdlib.h or math/math.h in the glibc source
    directory), and this turns up as a make dependency.  An implicit
    rule will kick in and make will try to install stdlib/stdlib.h or
    math/math.h as /usr/include/stdlib.h or /usr/include/math.h because
    the target is out of date.  We make a copy of <cstdlib> and <cmath>
    in the glibc build directory so that stdlib/stdlib.h and math/math.h
    will be used instead of /usr/include/stdlib.h and /usr/include/math.h.
    
    	[BZ #20314]
    	* Makeconfig (CXXFLAGS): Prepend -I$(common-objpfx).
    	* Makerules (before-compile): Add $(common-objpfx)cstdlib and
    	$(common-objpfx)cmath.
    	($(common-objpfx)cstdlib): New target.
    	($(common-objpfx)cmath): Likewise.

diff --git a/ChangeLog b/ChangeLog
index fc313b4..8b1fa85 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2016-07-05  H.J. Lu  <hongjiu.lu@intel.com>
+
+	[BZ #20314]
+	* Makeconfig (CXXFLAGS): Prepend -I$(common-objpfx).
+	* Makerules (before-compile): Add $(common-objpfx)cstdlib and
+	$(common-objpfx)cmath.
+	($(common-objpfx)cstdlib): New target.
+	($(common-objpfx)cmath): Likewise.
+
 2016-07-05  Chris Metcalf  <cmetcalf@mellanox.com>
 
 	* malloc/tst-malloc-thread-fail.c (TIMEOUT): Bump up to 30s.
diff --git a/Makeconfig b/Makeconfig
index 901e253..03fd89c 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -889,7 +889,8 @@ override CFLAGS	= -std=gnu11 -fgnu89-inline $(config-extra-cflags) \
 		  $(CFLAGS-$(@F)) $(tls-model) \
 		  $(foreach lib,$(libof-$(basename $(@F))) \
 				$(libof-$(<F)) $(libof-$(@F)),$(CFLAGS-$(lib)))
-override CXXFLAGS = $(c++-sysincludes) \
+# Use our copies of cstdlib and cmath.
+override CXXFLAGS = -I$(common-objpfx) $(c++-sysincludes) \
 		    $(filter-out %frame-pointer,$(+cflags)) $(sysdep-CFLAGS) \
 		    $(CFLAGS-$(suffix $@)) $(CFLAGS-$(<F)) $(CFLAGS-$(@F))
 
diff --git a/Makerules b/Makerules
index f1ecd40..7e4077e 100644
--- a/Makerules
+++ b/Makerules
@@ -109,6 +109,30 @@ endif # avoid-generated
 endif # $(build-shared) = yes
 
 ifndef avoid-generated
+ifneq (,$(CXX))
+# If C++ headers <cstdlib> or <cmath> are used, GCC 6 will include
+# /usr/include/stdlib.h or /usr/include/math.h from "#include_next"
+# (instead of stdlib/stdlib.h or math/math.h in the glibc source
+# directory), and this turns up as a make dependency.  An implicit
+# rule will kick in and make will try to install stdlib/stdlib.h or
+# math/math.h as /usr/include/stdlib.h or /usr/include/math.h because
+# the target is out of date.  We make a copy of <cstdlib> and <cmath>
+# in the glibc build directory so that stdlib/stdlib.h and math/math.h
+# will be used instead of /usr/include/stdlib.h and /usr/include/math.h.
+before-compile := $(common-objpfx)cstdlib $(common-objpfx)cmath \
+	          $(before-compile)
+cstdlib=$(shell echo "\#include <cstdlib>" | $(CXX) -M -MP -x c++ - \
+		| sed -n "/cstdlib:/{s/:$$//;p}")
+$(common-objpfx)cstdlib: $(cstdlib)
+	$(INSTALL_DATA) $< $@T
+	$(move-if-change) $@T $@
+cmath=$(shell echo "\#include <cmath>" | $(CXX) -M -MP -x c++ - \
+		| sed -n "/cmath:/{s/:$$//;p}")
+$(common-objpfx)cmath: $(cmath)
+	$(INSTALL_DATA) $< $@T
+	$(move-if-change) $@T $@
+endif
+
 before-compile := $(common-objpfx)libc-abis.h $(before-compile)
 $(common-objpfx)libc-abis.h: $(common-objpfx)libc-abis.stamp; @:
 $(common-objpfx)libc-abis.stamp: $(..)scripts/gen-libc-abis \

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog  |    9 +++++++++
 Makeconfig |    3 ++-
 Makerules  |   24 ++++++++++++++++++++++++
 3 files changed, 35 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


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