Bug#885931: gcc-7: Please modify gcc-7 to use internal libunwind for ia64 cross-builds

John Paul Adrian Glaubitz <[email protected]>
Newsgroups gmane.linux.debian.ports.ia64
Message-ID <151472896183.18353.2437010233014081870.reportbug__27944.9619622484$1514729070$gmane$org@z6.physik.fu-berlin.de>
Source: gcc-7
Version: 7.2.0-18
Severity: normal
Tags: patch
User: [email protected]
Usertags: ia64

Hi!

Like with gcc-6 in #885428, we need to patch src:gcc-7 to use the
internal libunwind library when cross-building for a ia64 target.

The attached patch makes the necessary modifications which have
been verified to work in rebootstrap. A second patch by James
Clarke is necessary to modify some linker flags for building
the internal libunwind. I will file a second bug report for that.

Adrian

--
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - [email protected]
`. `'   Freie Universitaet Berlin - [email protected]
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
gcc-use-internal-libunwind-for-ia64-cross-builds.patch (text/plain, 1.6 KB)
diff -Nru old/gcc-7-7.2.0/debian/rules2 new/gcc-7-7.2.0/debian/rules2
--- old/gcc-7-7.2.0/debian/rules2	2017-12-27 15:47:52.000000000 +0100
+++ new/gcc-7-7.2.0/debian/rules2	2017-12-31 14:54:43.386904669 +0100
@@ -492,7 +492,9 @@
 endif
 
 ifneq (,$(findstring ia64-linux,$(DEB_TARGET_GNU_TYPE)))
-  CONFARGS += --with-system-libunwind
+  ifneq ($(with_unwind),yes)
+      CONFARGS += --with-system-libunwind
+  endif
 endif
 
 ifneq (,$(findstring sh4-linux,$(DEB_TARGET_GNU_TYPE)))
diff -Nru old/gcc-7-7.2.0/debian/rules.d/binary-libgcc.mk new/gcc-7-7.2.0/debian/rules.d/binary-libgcc.mk
--- old/gcc-7-7.2.0/debian/rules.d/binary-libgcc.mk	2017-12-27 15:47:52.000000000 +0100
+++ new/gcc-7-7.2.0/debian/rules.d/binary-libgcc.mk	2017-12-31 14:54:43.386904669 +0100
@@ -290,6 +290,11 @@
 			$(d_l)/$(libgcc_dir$(2))/.
 	)
 
+	$(if $(filter yes, $(with_unwind)),
+		mv $(d)/$(usr_lib$(2))/libunwind.* \
+			$(d_l)/$(libgcc_dir$(2))/.
+	)
+
 	debian/dh_doclink -p$(p_l) $(if $(3),$(3),$(p_lbase))
 	debian/dh_doclink -p$(p_d) $(if $(3),$(3),$(p_lbase))
 	debian/dh_rmemptydirs -p$(p_l)
diff -Nru old/gcc-7-7.2.0/debian/rules.defs new/gcc-7-7.2.0/debian/rules.defs
--- old/gcc-7-7.2.0/debian/rules.defs	2017-12-27 15:47:52.000000000 +0100
+++ new/gcc-7-7.2.0/debian/rules.defs	2017-12-31 14:54:43.386904669 +0100
@@ -1354,6 +1354,14 @@
     endif
   endif
 
+  # libunwind -----------------
+  ifneq ($(DEB_STAGE),stage1)
+    with_unwind := no
+    ifeq ($(DEB_CROSS),yes)
+      with_unwind := yes
+    endif
+  endif
+
   # Shared libgcc --------------------
   ifneq ($(DEB_STAGE),stage1)
     with_shared_libgcc := yes
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.