Bug#127909: glibc: cross compile support
Package: glibc
Version: 2.2.4-7
Tags: patch
Hi,
It seems glibc source package is aware of cross compile, but I feel
current version is not very useful. I'm using dpkg-cross and applying
following patch to glibc.
* makerules.dpatch: Disable check for make -e. It checks $(PATH),
but $(PATH) is overriden by dpkg-buildpackage of dpkg-cross via
MAKEFLAGS, so the check always fails.
* linux.mk: cross compile support.
- Checking building host's kernel-headers packages is useless.
- LINUX_SOURCE variable must be set for later use.
My target architecture is mainly SuperH, but I want to hear about
other architecture's circumstances.
diff -ruN glibc-2.2.4/debian/patches/0list glibc-2.2.4-new/debian/patches/0list
--- glibc-2.2.4/debian/patches/0list Sat Jan 5 20:32:22 2002
+++ glibc-2.2.4-new/debian/patches/0list Sat Jan 5 20:02:09 2002
@@ -19,3 +19,4 @@
glibc22-locales
sparc64-fixups
glibc22-getdents-fix
+makerules
diff -ruN glibc-2.2.4/debian/patches/makerules.dpatch glibc-2.2.4-new/debian/patches/makerules.dpatch
--- glibc-2.2.4/debian/patches/makerules.dpatch Thu Jan 1 09:00:00 1970
+++ glibc-2.2.4-new/debian/patches/makerules.dpatch Sat Jan 5 20:01:15 2002
@@ -0,0 +1,35 @@
+#! /bin/sh -e
+
+# All lines beginning with `# DP:' are a description of the patch.
+# DP: Prevent -e option checking.
+
+if [ $# -ne 2 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch) patch -d "$2" -f --no-backup-if-mismatch -p1 < $0;;
+ -unpatch) patch -d "$2" -f --no-backup-if-mismatch -R -p1 < $0;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+# append the patch here and adjust the -p? flag in the patch calls.
+--- glibc-2.2.4/Makerules.orig Mon Dec 10 23:49:08 2001
++++ glibc-2.2.4/Makerules Mon Dec 10 23:49:22 2001
+@@ -44,13 +44,6 @@
+ sources :=
+ endif
+
+-oPATH := $(PATH)
+-PATH := this definition should take precedence over $(oPATH)
+-ifeq ($(PATH),$(oPATH))
+-You must not use the -e flag when building the GNU C library.
+-else
+-PATH := $(oPATH)
+-endif
+
+ ifndef +included-Makeconfig
+ include $(..)Makeconfig
diff -ruN glibc-2.2.4/debian/sysdeps/linux.mk glibc-2.2.4-new/debian/sysdeps/linux.mk
--- glibc-2.2.4/debian/sysdeps/linux.mk Sat Jan 5 20:32:22 2002
+++ glibc-2.2.4-new/debian/sysdeps/linux.mk Sat Jan 5 21:56:12 2002
@@ -48,8 +48,18 @@
endif
with_headers := --with-headers=$(LINUX_SOURCE)/include
else
- # Cross compiles can just use sys-include
- with_headers :=
+ ifndef LINUX_SOURCE
+ # Building host's kernel-headers package must not be used for cross compile.
+ # Give a probable default instead.
+ # But this may cause unnessesary headers get mixed into libc-dev package.
+ LINUX_SOURCE := /usr/$(DEB_HOST_GNU_TYPE)
+ num_headers := 1
+ else
+ # Get it from the environment
+ LINUX_SOURCE := $(strip $(shell echo ${LINUX_SOURCE}))
+ num_headers := 1
+ endif
+ with_headers := --with-headers=$(LINUX_SOURCE)/include
endif
# Minimum Kernel supported
--
YAEGASHI Takeshi <t@keshi.org> <takeshi@yaegashi.jp> <yaegashi@dodes.org>
Reply to: