ia32-libs: Patch to make 'ia32-libs' work again on amd64/sarge
retitle 307521 ia32-libs: Broken on amd64 / Compilation with 'gcc-3.4 -m32' does not work
tags 307521 +patch
thanks
I made some tests and finally found a small patch which makes ia32-libs
work again on amd64/sarge without any change to other packages, i.e.
without changing the 'gcc-3.4' package from sarge.
The attached patch does the following:
* Remove the (Build-)Depends on 'lsb-release' from debian/control.
* Change debian/rules, debian/ia32-libs.postinst and debian/ia32-libs/postrm
to use 'ROOT=' and 'SUFFIX=32' also for Debian amd64.
* Change debian/ia32-libs.postinst and debian/ia32-libs/postrm to create
and remove a symlink from /emul/ia32-linux/usr/lib/libgcc_s.so.1 to
/usr/lib32/libgcc_s.so.1.
This symlink is necessary for sarge because the lib32gcc1 package
from gcc-3.4 installs libgcc_s.so.1 in /emul/ia32-linux/usr/lib
instead of /usr/lib32. Once the gcc-3.4 package is corrected to
use /usr/lib32, this symlink can simply be dropped.
* Change a sed rule in debian/rules so that it does not remove the leading
'/' in the first commentary lines of libc.so and libpthread.so.
With this patch, it is possible to compile 32 bit binaries with 'gcc-3.4 -m32'
and to run those binaries.
If going back to the old working ia32-libs version 0.7 is not an option
for some reason, this small patch could be used to make ia32-libs work
again on amd64.
Regards
Andreas Jochens
diff -urN ../tmp-orig/ia32-libs-1.3/debian/control ./debian/control
--- ../tmp-orig/ia32-libs-1.3/debian/control 2005-04-25 03:33:40.000000000 +0200
+++ ./debian/control 2005-05-05 10:16:18.953931574 +0200
@@ -2,12 +2,12 @@
Section: libs
Priority: optional
Maintainer: Bdale Garbee <bdale@gag.com>
-Build-Depends: debhelper (>> 3.0.0), dpkg-dev (>= 1.10.23), lsb-release
+Build-Depends: debhelper (>> 3.0.0), dpkg-dev (>= 1.10.23)
Standards-Version: 3.6.1.0
Package: ia32-libs
Architecture: amd64 ia64
-Depends: lsb-release, lib32gcc1
+Depends: lib32gcc1
Replaces: ia32-libs-openoffice.org
Description: ia32 shared libraries for use on amd64 and ia64 systems
This package contains runtime libraries for the ia32/i386
diff -urN ../tmp-orig/ia32-libs-1.3/debian/ia32-libs.postinst ./debian/ia32-libs.postinst
--- ../tmp-orig/ia32-libs-1.3/debian/ia32-libs.postinst 2005-04-11 18:08:38.000000000 +0200
+++ ./debian/ia32-libs.postinst 2005-05-05 10:15:54.642627454 +0200
@@ -2,13 +2,8 @@
set -e
-if [ $(lsb_release -i -s) = "Debian" ]; then
- ROOT=/emul/ia32-linux
- SUFFIX=
-else
- ROOT=
- SUFFIX=32
-fi
+ROOT=
+SUFFIX=32
addlineifmissing () {
if ! grep -q "^$1$" "$2" ; then
@@ -23,4 +18,8 @@
ldconfig
fi
+if [ "`uname -m`" != "ia64" ] && ! [ -e /usr/lib32/libgcc_s.so.1 ]; then
+ ln -s /emul/ia32-linux/usr/lib/libgcc_s.so.1 /usr/lib32
+fi
+
#DEBHELPER#
diff -urN ../tmp-orig/ia32-libs-1.3/debian/ia32-libs.postrm ./debian/ia32-libs.postrm
--- ../tmp-orig/ia32-libs-1.3/debian/ia32-libs.postrm 2005-04-11 18:15:06.000000000 +0200
+++ ./debian/ia32-libs.postrm 2005-05-05 10:15:54.642627454 +0200
@@ -2,13 +2,8 @@
set -e
-if [ $(lsb_release -i -s) = "Debian" ]; then
- ROOT=/emul/ia32-linux
- SUFFIX=
-else
- ROOT=
- SUFFIX=32
-fi
+ROOT=
+SUFFIX=32
removeline () {
if grep -q "^/$1$" "$2"; then
@@ -28,4 +23,8 @@
dpkg-divert --divert /usr/bin/ldd.ia32-libs --quiet --rename --package ia32-libs --remove /usr/bin/ldd
fi
+if [ "`uname -m`" != "ia64" ] && [ -L /usr/lib32/libgcc_s.so.1 ]; then
+ rm /usr/lib32/libgcc_s.so.1
+fi
+
#DEBHELPER#
diff -urN ../tmp-orig/ia32-libs-1.3/debian/rules ./debian/rules
--- ../tmp-orig/ia32-libs-1.3/debian/rules 2005-04-25 03:26:00.000000000 +0200
+++ ./debian/rules 2005-05-05 10:15:54.643627302 +0200
@@ -5,14 +5,8 @@
# Lowest version with fully ABI compatible libraries
SHLIB_VERSION=0.2
-OSVER=$(shell lsb_release -s -i)
-ifeq (Debian,$(OSVER))
- ROOT=emul/ia32-linux
- SUFFIX=
-else
- ROOT=
- SUFFIX=32
-endif
+ROOT=
+SUFFIX=32
build:
# ./fetch-and-build
@@ -53,11 +47,6 @@
mv debian/ia32-libs/usr/lib debian/ia32-libs/$(ROOT)/usr/lib$(SUFFIX)
mv debian/ia32-libs/usr/X11R6/lib debian/ia32-libs/$(ROOT)/usr/X11R6/lib$(SUFFIX)
-ifeq (Debian,$(OSVER))
- mkdir -p debian/ia32-libs/$(ROOT)/bin
- mv debian/ia32-libs/bin/uname debian/ia32-libs/$(ROOT)/bin
-endif
-
rm -r debian/ia32-libs/usr/include
rm -r debian/ia32-libs/usr/X11R6
@@ -127,7 +116,7 @@
# Fix up GROUP commands in linker scripts
for lib in libc.so libpthread.so; do \
cat debian/ia32-libs/$(ROOT)/usr/lib$(SUFFIX)/$$lib \
- | sed -e 's,^/,$(ROOT),' -e 's,/lib/,/lib$(SUFFIX)/,g' > $$lib; \
+ | sed -e 's, /, /$(ROOT),g' -e 's,/lib/,/lib$(SUFFIX)/,g' > $$lib; \
mv -f $$lib debian/ia32-libs/$(ROOT)/usr/lib$(SUFFIX)/$$lib; \
done
Reply to: