[gcc-6] 16/401: * Allow unstripped, non-optimized debug builds with setting DEB_BUILD_OPTIONS including gccdebug.

Ximin Luo infinity0 at debian.org
Wed Apr 5 15:47:56 UTC 2017


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch pu/reproducible_builds
in repository gcc-6.

commit 55b6363481a84088534b5b913c9cc08897c81838
Author: doko <doko at 6ca36cf4-e1d1-0310-8c6f-e303bb2178ca>
Date:   Sun Dec 13 13:13:15 2015 +0000

      * Allow unstripped, non-optimized debug builds with setting DEB_BUILD_OPTIONS
        including gccdebug.
    
    
    git-svn-id: svn://anonscm.debian.org/gcccvs/branches/sid/gcc-6@8513 6ca36cf4-e1d1-0310-8c6f-e303bb2178ca
---
 debian/changelog                   |  2 ++
 debian/rules.d/binary-libstdcxx.mk |  4 ++--
 debian/rules.defs                  | 12 ++++++++---
 debian/rules2                      | 42 +++++++++++++++++++++++++++++++++++++-
 4 files changed, 54 insertions(+), 6 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 5c52622..1d6b6fb 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,8 @@ gcc-6 (6-20151211-2) UNRELEASED; urgency=medium
   * Update the ada-kfreebsd patch.
   * Fix cross-building without having the common cross libraries installed.
   * Update ada-m68k patch.
+  * Allow unstripped, non-optimized debug builds with setting DEB_BUILD_OPTIONS
+    including gccdebug.
 
  -- Matthias Klose <doko at debian.org>  Sun, 13 Dec 2015 12:20:23 +0100
 
diff --git a/debian/rules.d/binary-libstdcxx.mk b/debian/rules.d/binary-libstdcxx.mk
index d220b9d..3baa3a7 100644
--- a/debian/rules.d/binary-libstdcxx.mk
+++ b/debian/rules.d/binary-libstdcxx.mk
@@ -247,7 +247,7 @@ define __do_libstdcxx_dbg
 		rm -f $(d_d)/$(usr_lib$(2))/libstdc++.so.*[0-9]
 	)
 
-	$(if $(filter yes,$(with_debug)),
+	$(if $(filter yes,$(with_cxx_debug)),
 		mkdir -p $(d_d)/$(usr_lib$(2))/debug;
 		mv $(d)/$(usr_lib$(2))/debug/libstdc++* $(d_d)/$(usr_lib$(2))/debug;
 		rm -f $(d_d)/$(usr_lib$(2))/debug/libstdc++_pic.a
@@ -393,7 +393,7 @@ $(binary_stamp)-libstdcxx-dev: $(libcxxdev_deps)
 
 	$(dh_compat2) dh_movefiles -p$(p_dev) $(files_dev)
 	$(dh_compat2) dh_movefiles -p$(p_pic) $(files_pic)
-ifeq ($(with_debug),yes)
+ifeq ($(with_cxx_debug),yes)
 	$(dh_compat2) dh_movefiles -p$(p_dbg) $(files_dbg)
 endif
 
diff --git a/debian/rules.defs b/debian/rules.defs
index 360b75d..abc460d 100644
--- a/debian/rules.defs
+++ b/debian/rules.defs
@@ -275,6 +275,12 @@ ifneq ($(findstring nostrap, $(DEB_BUILD_OPTIONS)),)
   with_bootstrap := off
 endif
 
+ifneq ($(findstring gccdebug, $(DEB_BUILD_OPTIONS)),)
+  with_bootstrap := off
+  DEB_BUILD_OPTIONS := $(DEB_BUILD_OPTIONS) nostrip
+  export DEB_BUILD_OPTIONS
+endif
+
 # -------------------------------------------------------------------
 # stage options
 ifdef DEB_STAGE
@@ -694,14 +700,14 @@ ifeq ($(with_cxx),yes)
   # debugging versions of libstdc++
   ifneq (,$(findstring gcc-, $(PKGSOURCE)))
   ifeq ($(with_cxxdev),yes)
-    with_debug := yes
+    with_cxx_debug := yes
     debug_no_cpus :=
     ifneq (,$(findstring $(DEB_TARGET_ARCH_CPU),$(debug_no_cpus)))
-      with_debug := disabled for cpu $(DEB_TARGET_GNU_CPU)
+      with_cxx_debug := disabled for cpu $(DEB_TARGET_GNU_CPU)
     endif
   endif
   endif
-  with_debug := $(call envfilt, debug, , , $(with_debug))
+  with_cxx_debug := $(call envfilt, debug, , , $(with_cxx_debug))
 
   enabled_languages += c++
 endif
diff --git a/debian/rules2 b/debian/rules2
index 6c98e3f..104c1c8 100644
--- a/debian/rules2
+++ b/debian/rules2
@@ -139,10 +139,24 @@ ifneq (,$(findstring static,$(DEB_BUILD_OPTIONS)))
   LDFLAGS	+= -static
 endif
 
+ifneq ($(findstring gccdebug, $(DEB_BUILD_OPTIONS)),)
+  CFLAGS		= -O0 -g3 -fno-inline
+  CXXFLAGS		= -O0 -g3 -fno-inline
+  CFLAGS_FOR_BUILD	= -O0 -g3 -fno-inline
+  CXXFLAGS_FOR_BUILD	= -O0 -g3 -fno-inline
+  CFLAGS_FOR_TARGET	= -O0 -g3 -fno-inline
+  CXXFLAGS_FOR_TARGET	= -O0 -g3 -fno-inline
+  BOOT_CFLAGS		=
+  BOOT_LDFLAGS		=
+  STAGE1_CFLAGS		=
+  STAGE1_LDFLAGS	=
+endif
+
 # set CFLAGS/LDFLAGS for the configure step only, maybe be modifed for some target
 # all other flags are passed to the make step.
 CFLAGS_TO_PASS = \
 	$(if $(CFLAGS),CFLAGS="$(CFLAGS)") \
+	$(if $(CXXFLAGS),CXXFLAGS="$(CXXFLAGS)") \
 	$(if $(LIBCFLAGS),LIBCFLAGS="$(LIBCFLAGS)") \
 	$(if $(LIBCXXFLAGS),LIBCXXFLAGS="$(LIBCXXFLAGS)")
 LDFLAGS_TO_PASS = \
@@ -158,8 +172,17 @@ BOOT_CFLAGS_TO_PASS = \
 BOOT_LDFLAGS_TO_PASS = \
 	$(if $(BOOT_LDFLAGS),BOOT_LDFLAGS="$(BOOT_LDFLAGS)")
 
+CFLAGS_FOR_BUILD_TO_PASS = \
+	$(if $(CFLAGS_FOR_BUILD),CFLAGS_FOR_BUILD="$(CFLAGS_FOR_BUILD)")
+CXXFLAGS_FOR_BUILD_TO_PASS = \
+	$(if $(CXXFLAGS_FOR_BUILD),CXXFLAGS_FOR_BUILD="$(CXXFLAGS_FOR_BUILD)")
+LDFLAGS_FOR_BUILD_TO_PASS = \
+	$(if $(LDFLAGS_FOR_BUILD),LDFLAGS_FOR_BUILD="$(LDFLAGS_FOR_BUILD)")
+
 CFLAGS_FOR_TARGET_TO_PASS = \
 	$(if $(CFLAGS_FOR_TARGET),CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)")
+CXXFLAGS_FOR_TARGET_TO_PASS = \
+	$(if $(CXXFLAGS_FOR_TARGET),CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)")
 LDFLAGS_FOR_TARGET_TO_PASS = \
 	$(if $(LDFLAGS_FOR_TARGET),LDFLAGS_FOR_TARGET="$(LDFLAGS_FOR_TARGET)")
 
@@ -247,7 +270,7 @@ ifeq ($(force_gnu_locales),yes)
   CONFARGS += --enable-clocale=gnu
 endif
 
-ifeq ($(with_cxx)-$(with_debug),yes-yes)
+ifeq ($(with_cxx)-$(with_cxx_debug),yes-yes)
   CONFARGS += --enable-libstdcxx-debug
 endif
 CONFARGS += --enable-libstdcxx-time=yes
@@ -701,6 +724,9 @@ else ifeq ($(with_bootstrap),)
   ifneq (, $(filter $(PKGSOURCE),gcc-$(BASE_VERSION) gcj-$(BASE_VERSION) gnat-$(BASE_VERSION) gcc-snapshot))
     bootstrap_target = bootstrap
   endif
+  ifneq (,$(DEB_STAGE))
+    bootstrap_target = bootstrap
+  endif
 
   ifeq ($(derivative),Debian)
     # disable profiled bootstrap for backports
@@ -1117,7 +1143,14 @@ endif
 		CC="$(CC)" \
 		CXX="$(CXX)" \
 		$(CFLAGS_TO_PASS) \
+		$(CXXFLAGS_TO_PASS) \
 		$(LDFLAGS_TO_PASS) \
+		$(CFLAGS_FOR_BUILD_TO_PASS) \
+		$(CXXFLAGS_FOR_BUILD_TO_PASS) \
+		$(LDFLAGS_FOR_BUILD_TO_PASS) \
+		$(CFLAGS_FOR_TARGET_TO_PASS) \
+		$(CXXFLAGS_FOR_TARGET_TO_PASS) \
+		$(LDFLAGS_FOR_TARGET_TO_PASS) \
 		$(SET_SHELL) \
 	LD_LIBRARY_PATH=$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}$(builddir)/gcc/ada/rts \
 		../src/configure $(subst ___, ,$(CONFARGS))
@@ -1209,7 +1242,14 @@ ifeq ($(build_type),build-native)
 		$(STAGE1_LDFLAGS_TO_PASS) \
 		$(BOOT_CFLAGS_TO_PASS) \
 		$(BOOT_LDFLAGS_TO_PASS) \
+		$(CFLAGS_TO_PASS) \
+		$(CXXFLAGS_TO_PASS) \
+		$(LDFLAGS_TO_PASS) \
+		$(CFLAGS_FOR_BUILD_TO_PASS) \
+		$(CXXFLAGS_FOR_BUILD_TO_PASS) \
+		$(LDFLAGS_FOR_BUILD_TO_PASS) \
 		$(CFLAGS_FOR_TARGET_TO_PASS) \
+		$(CXXFLAGS_FOR_TARGET_TO_PASS) \
 		$(LDFLAGS_FOR_TARGET_TO_PASS) \
 		; \
 	  echo $$? > status; \

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/gcc-6.git



More information about the Reproducible-commits mailing list