[Debian-astro-commits] [xpa] 02/03: make mklib work with cross compilation

Ole Streicher olebole at moszumanska.debian.org
Thu Aug 10 12:11:39 UTC 2017


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

olebole pushed a commit to branch master
in repository xpa.

commit 781afaa2d11a2a95e2d1a388bfa6a8531e6e4df9
Author: Ole Streicher <olebole at debian.org>
Date:   Thu Aug 10 14:01:42 2017 +0200

    make mklib work with cross compilation
---
 .../Recognise-the-exit-status-of-mklibs.patch      |  2 +-
 .../make-mklib-work-with-cross-compilation.patch   | 78 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 3 files changed, 80 insertions(+), 1 deletion(-)

diff --git a/debian/patches/Recognise-the-exit-status-of-mklibs.patch b/debian/patches/Recognise-the-exit-status-of-mklibs.patch
index 9a25a2a..1a635ac 100644
--- a/debian/patches/Recognise-the-exit-status-of-mklibs.patch
+++ b/debian/patches/Recognise-the-exit-status-of-mklibs.patch
@@ -18,7 +18,7 @@ index edb1a91..8b599cb 100644
  		rm -f lib$(PACKAGE).tmp/tcl*.o; \
  		CC='$(CC)' CXX=$(CXX) \
 -		./mklib -ldflags "$(LDFLAGS)" -o $(PACKAGE) `LC_ALL=C ls lib$(PACKAGE).tmp/*.o`; \
-+		./mklib -ldflags "$(LDFLAGS)" -o $(PACKAGE) `LC_ALL=C ls lib$(PACKAGE).tmp/*.o`&& \
++		./mklib -ldflags "$(LDFLAGS)" -o $(PACKAGE) `LC_ALL=C ls lib$(PACKAGE).tmp/*.o` && \
  		rm -rf lib$(PACKAGE).tmp)
  
  mingw-dll:	$(LIBOBJS)
diff --git a/debian/patches/make-mklib-work-with-cross-compilation.patch b/debian/patches/make-mklib-work-with-cross-compilation.patch
new file mode 100644
index 0000000..3b7992f
--- /dev/null
+++ b/debian/patches/make-mklib-work-with-cross-compilation.patch
@@ -0,0 +1,78 @@
+From: Helmut Grohne <helmut at subdivi.de>
+Date: Thu, 10 Aug 2017 14:00:39 +0200
+Subject: make mklib work with cross compilation
+
+The first hunk makes it use the compiler discovered by ./configure and thus
+will work with cross compilers. Since Makefile.in exports CC and CXX, it seems
+like mklib should be picking these up and not doing so is an upstream bug.
+
+Then remove insertion of -m32, because this is not universally understood by
+cross compilers. On Debian, the provided compiler will always choose the
+correct ABI, so no -m32 or -m64 is necessary. This part likely is not
+upstreamable.
+---
+ mklib | 29 +++--------------------------
+ 1 file changed, 3 insertions(+), 26 deletions(-)
+
+diff --git a/mklib b/mklib
+index c900b3e..bb070ac 100755
+--- a/mklib
++++ b/mklib
+@@ -211,9 +211,9 @@ case $ARCH in
+ 	if [ "x$LINK" = "x" ] ; then
+ 	    # -linker was not specified so set default link command now
+             if [ $CPLUSPLUS = 1 ] ; then
+-                LINK=g++
++                LINK=${CXX:-g++}
+             else
+-                LINK=gcc
++                LINK=${CC:-gcc}
+             fi
+ 	fi
+ 
+@@ -228,14 +228,6 @@ case $ARCH in
+ 	    ;;
+ 	    esac
+ 
+-	    # Check if objects are 32-bit and we're running in 64-bit
+-	    # environment.  If so, pass -m32 flag to linker.
+-	    set ${OBJECTS}
+-	    ABI32=`file $1 | grep 32-bit`
+-	    if [ "${ABI32}" -a `uname -m` = "x86_64" ] ; then
+-		OPTS="-m32 ${OPTS}"
+-	    fi
+-
+             if [ "${ALTOPTS}" ] ; then
+                 OPTS=${ALTOPTS}
+             fi
+@@ -281,13 +273,6 @@ case $ARCH in
+ 		# exptmp is removed below
+ 	    fi
+ 
+-	    # Check if objects are 32-bit and we're running in 64-bit
+-	    # environment.  If so, pass -m32 flag to linker.
+-	    set ${OBJECTS}
+-	    ABI32=`file $1 | grep 32-bit`
+-	    if [ "${ABI32}" -a `uname -m` = "x86_64" ] ; then
+-		OPTS="-m32 ${OPTS}"
+-	    fi
+             if [ "${ALTOPTS}" ] ; then
+                 OPTS=${ALTOPTS}
+             fi
+@@ -355,15 +340,7 @@ case $ARCH in
+ 		OPTS="-G"
+ 	    else
+ 		# gcc linker
+-		# Check if objects are 32-bit and we're running in 64-bit
+-		# environment.  If so, pass -m32 flag to linker.
+-		set ${OBJECTS}
+-		ABI32=`file $1 | grep 32-bit`
+-		if [ "${ABI32}" ] ; then
+-		    OPTS="-m32 -shared -Wl,-Bdynamic"
+-		else
+-		    OPTS="-m64 -shared -Wl,-Bdynamic"
+-		fi
++		OPTS="-shared -Wl,-Bdynamic"
+ 	    fi
+ 
+ 	    # Check if objects are SPARC v9
diff --git a/debian/patches/series b/debian/patches/series
index 84eee0c..bf7bd56 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -5,3 +5,4 @@ Install-the-tcl-interface-to-usr-lib-tcltk-xpa-according-.patch
 Add-hardening-flags.patch
 Sort-.o-files.patch
 Recognise-the-exit-status-of-mklibs.patch
+make-mklib-work-with-cross-compilation.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-astro/packages/xpa.git



More information about the Debian-astro-commits mailing list