Bug#577674: gcc-4.4/cross: broken bi-arch architectures
Hello Matthias,
I have started to do some work in this way, it is still WIP, but I
would like you to check if this way is OK with you then prepare
something more mergeable
There are two merge patches below:
>From 024f597bbe0aa95fe967cc60abb0edec6f2694b3 Mon Sep 17 00:00:00 2001
From: Hector Oron <hector.oron@gmail.com>
Date: Wed, 21 Apr 2010 00:34:38 +0200
Subject: [PATCH 1/4] Merge rules.d/binary-cpp-cross.mk into binary-cpp.mk
Signed-off-by: Hector Oron <hector.oron@gmail.com>
---
debian/rules.d/binary-cpp.mk | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/debian/rules.d/binary-cpp.mk b/debian/rules.d/binary-cpp.mk
index 6e1060f..efaad9e 100644
--- a/debian/rules.d/binary-cpp.mk
+++ b/debian/rules.d/binary-cpp.mk
@@ -8,9 +8,18 @@ dirs_cpp = \
$(PF)/share/man/man1 \
$(PF)/bin
+ifeq ($(DEB_CROSS),yes)
+dirs_cpp += \
+ $(gcc_lexec_dir)
+files_cpp = \
+ $(PF)/bin/$(DEB_TARGET_GNU_TYPE)-cpp$(pkg_ver) \
+ $(PF)/share/man/man1/$(DEB_TARGET_GNU_TYPE)-cpp$(pkg_ver).1 \
+ $(gcc_lexec_dir)/cc1
+else
files_cpp = \
$(PF)/bin/cpp$(pkg_ver) \
$(gcc_lexec_dir)/cc1
+endif
ifneq ($(GFDL_INVARIANT_FREE),yes)
files_cpp += \
@@ -27,6 +36,14 @@ $(binary_stamp)-cpp: $(install_stamp)
dh_installdirs -p$(p_cpp) $(dirs_cpp)
DH_COMPAT=2 dh_movefiles -p$(p_cpp) $(files_cpp)
+ifeq ($(DEB_CROSS),yes)
+ifeq ($(with_unversioned),yes)
+ ln -sf $(DEB_TARGET_GNU_TYPE)-cpp$(pkg_ver) \
+ $(d_cpp)/$(PF)/bin/$(DEB_TARGET_GNU_TYPE)-cpp
+ ln -sf $(DEB_TARGET_GNU_TYPE)-cpp$(pkg_ver).1 \
+ $(d_cpp)/$(PF)/share/man/man1/$(DEB_TARGET_GNU_TYPE)-cpp.1
+endif
+else
ln -sf cpp$(pkg_ver) \
$(d_cpp)/$(PF)/bin/$(DEB_TARGET_GNU_TYPE)-cpp$(pkg_ver)
ln -sf cpp$(pkg_ver) \
@@ -47,6 +64,11 @@ endif
dh_shlibdeps -p$(p_cpp)
dh_gencontrol -p$(p_cpp) -- -v$(DEB_VERSION) $(common_substvars)
dh_installdeb -p$(p_cpp)
+ifeq ($(DEB_CROSS),yes)
+ sed 's/cross-/$(DEB_TARGET_GNU_TYPE)-/g;s/-ver/$(pkg_ver)/g;s/gcc/cpp/g'
< debian/gcc-cross.postinst > debian/$(p_cpp)/DEBIAN/postinst
+ sed 's/cross-/$(DEB_TARGET_GNU_TYPE)-/g;s/-ver/$(pkg_ver)/g;s/gcc/cpp/g'
< debian/gcc-cross.prerm > debian/$(p_cpp)/DEBIAN/prerm
+ chmod 755 debian/$(p_cpp)/DEBIAN/{postinst,prerm}
+endif
dh_md5sums -p$(p_cpp)
dh_builddeb -p$(p_cpp)
--
1.7.0
================================================================
>From 8b4746e67bc69667477bfbd83176eb36005ca7f5 Mon Sep 17 00:00:00 2001
From: Hector Oron <hector.oron@gmail.com>
Date: Wed, 21 Apr 2010 00:52:47 +0200
Subject: [PATCH 2/4] Merge rules.d/binary-cxx-cross.mk into binary-cxx.mk
Signed-off-by: Hector Oron <hector.oron@gmail.com>
---
debian/rules.d/binary-cxx.mk | 46 +++++++++++++++++++++++++++++++++++++----
1 files changed, 41 insertions(+), 5 deletions(-)
diff --git a/debian/rules.d/binary-cxx.mk b/debian/rules.d/binary-cxx.mk
index 08bb327..f26b6bb 100644
--- a/debian/rules.d/binary-cxx.mk
+++ b/debian/rules.d/binary-cxx.mk
@@ -3,6 +3,18 @@ ifneq (,$(filter yes, $(biarch64) $(biarch32) $(biarchn32)))
endif
arch_binaries := $(arch_binaries) cxx
+# XXX This can probably be refactored better
+ifeq($(DEB_CROSS),yes)
+dirs_cxx = \
+ $(docdir) \
+ $(PF)/bin \
+ $(gcc_lib_dir) \
+ $(PF)/share/man/man1
+files_cxx = \
+ $(PF)/bin/$(DEB_TARGET_GNU_TYPE)-g++$(pkg_ver) \
+ $(PF)/share/man/man1/$(DEB_TARGET_GNU_TYPE)-g++$(pkg_ver).1 \
+ $(gcc_lib_dir)/cc1plus
+else
dirs_cxx = \
$(docdir)/$(p_base)/C++ \
$(PF)/bin \
@@ -12,15 +24,15 @@ dirs_cxx = \
files_cxx = \
$(PF)/bin/g++$(pkg_ver) \
$(gcc_lexec_dir)/cc1plus
+p_cxx_m = g++$(pkg_ver)-multilib
+d_cxx_m = debian/$(p_cxx_m)
+endif
ifneq ($(GFDL_INVARIANT_FREE),yes)
files_cxx += \
$(PF)/share/man/man1/g++$(pkg_ver).1
endif
-p_cxx_m = g++$(pkg_ver)-multilib
-d_cxx_m = debian/$(p_cxx_m)
-
# ----------------------------------------------------------------------
$(binary_stamp)-cxx: $(install_stamp)
dh_testdir
@@ -30,14 +42,27 @@ $(binary_stamp)-cxx: $(install_stamp)
rm -rf $(d_cxx)
dh_installdirs -p$(p_cxx) $(dirs_cxx)
DH_COMPAT=2 dh_movefiles -p$(p_cxx) $(files_cxx)
-
+ifneq ($(DEB_CROSS),yes)
ln -sf g++$(pkg_ver) \
$(d_cxx)/$(PF)/bin/$(DEB_TARGET_GNU_TYPE)-g++$(pkg_ver)
ln -sf g++$(pkg_ver) \
$(d_cxx)/$(PF)/bin/$(TARGET_ALIAS)-g++$(pkg_ver)
+endif
ifneq ($(GFDL_INVARIANT_FREE),yes)
# g++ man page is a .so link
+# XXX HO: Need better integration
+ifneq ($(DEB_CROSS),yes)
+ rm -f $(d_cxx)/$(PF)/share/man/man1/$(DEB_TARGET_GNU_TYPE)-g++$(pkg_ver).1
+ ln -sf $(DEB_TARGET_GNU_TYPE)-gcc$(pkg_ver).1.gz \
+ $(d_cxx)/$(PF)/share/man/man1/$(DEB_TARGET_GNU_TYPE)-g++$(pkg_ver).1.gz
+ifeq ($(with_unversioned),yes)
+ ln -sf $(DEB_TARGET_GNU_TYPE)-g++$(pkg_ver) \
+ $(d_cxx)/$(PF)/bin/$(DEB_TARGET_GNU_TYPE)-g++
+ ln -sf $(DEB_TARGET_GNU_TYPE)-g++$(pkg_ver).1 \
+ $(d_cxx)/$(PF)/share/man/man1/$(DEB_TARGET_GNU_TYPE)-g++.1
+
+else
rm -f $(d_cxx)/$(PF)/share/man/man1/g++$(pkg_ver).1
ln -sf gcc$(pkg_ver).1.gz \
$(d_cxx)/$(PF)/share/man/man1/g++$(pkg_ver).1.gz
@@ -48,11 +73,15 @@ ifneq ($(GFDL_INVARIANT_FREE),yes)
endif
debian/dh_doclink -p$(p_cxx) $(p_base)
+# For cross targets we do not need it
+ifneq($(DEB_CROSS),yes)
cp -p debian/README.C++ $(d_cxx)/$(docdir)/$(p_base)/C++/
cp -p $(srcdir)/gcc/cp/ChangeLog \
$(d_cxx)/$(docdir)/$(p_base)/C++/changelog
+endif
debian/dh_rmemptydirs -p$(p_cxx)
-
+# For cross targets we do not need it
+ifneq($(DEB_CROSS),yes)
mkdir -p $(d_cxx)/$(docdir)/$(p_base)/test-summaries
echo "TEST COMPARE BEGIN"
ifeq ($(with_check),yes)
@@ -79,6 +108,7 @@ else
echo "Nothing to compare (testsuite not run)"
endif
echo "TEST COMPARE END"
+endif # end DEB_CROSS
dh_strip -p$(p_cxx)
dh_compress -p$(p_cxx)
@@ -86,12 +116,18 @@ endif
dh_shlibdeps -p$(p_cxx)
dh_gencontrol -p$(p_cxx) -- -v$(DEB_VERSION) $(common_substvars)
dh_installdeb -p$(p_cxx)
+ifeq($(DEB_CROSS),yes)
+ sed 's/cross-/$(DEB_TARGET_GNU_TYPE)-/g;s/-ver/$(pkg_ver)/g;s/gcc/g++/g'
< debian/gcc-cross.postinst > debian/$(p_cxx)/DEBIAN/postinst
+ sed 's/cross-/$(DEB_TARGET_GNU_TYPE)-/g;s/-ver/$(pkg_ver)/g;s/gcc/g++/g'
< debian/gcc-cross.prerm > debian/$(p_cxx)/DEBIAN/prerm
+ chmod 755 debian/$(p_cxx)/DEBIAN/{postinst,prerm}
+endif
dh_md5sums -p$(p_cxx)
dh_builddeb -p$(p_cxx)
trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
# ----------------------------------------------------------------------
+# XXX HO: Only for native builds, do we want to implement cross targets here?
$(binary_stamp)-cxx-multi: $(install_stamp)
dh_testdir
dh_testroot
--
1.7.0
OK to proceed with the rest?
Kind regards,
--
Héctor Orón
"Our Sun unleashes tremendous flares expelling hot gas into the Solar
System, which one day will disconnect us."
Reply to: