This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch hjl/pr20314 created. glibc-2.23-526-g3f0850b
- From: hjl at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 30 Jun 2016 13:56:45 -0000
- Subject: GNU C Library master sources branch hjl/pr20314 created. glibc-2.23-526-g3f0850b
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, hjl/pr20314 has been created
at 3f0850b88f60bf739e865231141efbfa61539eaf (commit)
- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=3f0850b88f60bf739e865231141efbfa61539eaf
commit 3f0850b88f60bf739e865231141efbfa61539eaf
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Thu Jun 30 06:56:19 2016 -0700
Use our copies of cstdlib and cmath
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..6033e73 100644
--- a/Makerules
+++ b/Makerules
@@ -109,6 +109,30 @@ endif # avoid-generated
endif # $(build-shared) = yes
ifndef avoid-generated
+ifneq (,$(CXX))
+# If C++ headers such as <cstdlib> or <cmath> are used, GCC 6 will
+# include /usr/include/stdlib.h or /usr/include/math.h (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 <cstdlib> and <cmath> to here so that
+# stdlib/stdlib.h and math/math.h will be used of /usr/include/stdlib.h
+# and /usr/include/math.h.
+before-compile := $(common-objpfx)cstdlib $(before-compile)
+cstdlib=$(shell echo "\#include <cstdlib>" | $(CXX) -M -MP -x c++ - \
+ | grep cstdlib: | sed -e "s/:$$//")
+$(common-objpfx)cstdlib: $(cstdlib)
+ $(INSTALL_DATA) $< $@T
+ $(move-if-change) $@T $@
+before-compile := $(common-objpfx)cmath $(before-compile)
+cmath=$(shell echo "\#include <cmath>" | $(CXX) -M -MP -x c++ - \
+ | grep cmath: | sed -e "s/:$$//")
+$(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 \
-----------------------------------------------------------------------
hooks/post-receive
--
GNU C Library master sources