Bug#250225: grub build patch for amd64

Frederik Schueler Frederik Schueler <fs@lowpingbastards.de>, 250225@bugs.debian.org
Thu, 30 Sep 2004 22:44:31 +0200


--PEIAKu/WMn1b1Hv9
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

tags 250225 +patch
thanks

Hi Robert,

good news: gcc-3.4 can build 32bit binaries using ia32-libs-dev on
amd64, see attached patch. 

Kind regards
Frederik Schueler

-- 
ENOSIG

--PEIAKu/WMn1b1Hv9
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: attachment; filename="grub-amd64-fs.patch"
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by defiant.lowpingbastards.de id i8UKiVpE004803

diff -ruN grub-0.95+cvs20040624.orig/debian/changelog grub-0.95+cvs200406=
24/debian/changelog
--- grub-0.95+cvs20040624.orig/debian/changelog	2004-09-30 22:13:24.79049=
4884 +0200
+++ grub-0.95+cvs20040624/debian/changelog	2004-09-30 22:15:08.952387426 =
+0200
@@ -1,3 +1,15 @@
+grub (0.95+cvs20040624-8.1) unstable; urgency=3Dlow
+
+  * Tollef Fog Heen
+    - use -static for compilation on amd64.
+    - fix up grub-disk to look in the correct pkglibdir
+    - Add ia32-libs-dev to build-depends for amd64.
+  * Frederik Schueler
+    - Added gcc-3.4 to build-depends for amd64.
+    - Added $CC handling to rules file.
+
+ -- Frederik Sch=C3=BCler <fschueler@gmx.net>  Thu, 30 Sep 2004 22:14:22=
 +0200
+
 grub (0.95+cvs20040624-8) unstable; urgency=3Dlow
=20
   * patches/2gb_limit.diff: New.  Fix problem with systems with more tha=
n
diff -ruN grub-0.95+cvs20040624.orig/debian/control grub-0.95+cvs20040624=
/debian/control
--- grub-0.95+cvs20040624.orig/debian/control	2004-09-30 22:13:24.7914947=
20 +0200
+++ grub-0.95+cvs20040624/debian/control	2004-09-30 22:12:25.192283242 +0=
200
@@ -3,12 +3,12 @@
 Priority: optional
 Maintainer: Grub Maintainers <pkg-grub-devel@lists.alioth.debian.org>
 Uploaders: Jason Thomas <jason@debian.org>, Robert Millan <rmh@debian.or=
g>
-Build-Depends: debhelper (>=3D 4.0.0), automake1.8, autoconf, texinfo, l=
ibncurses5-dev | libncurses-dev, type-handling (>=3D 0.2.0)
+Build-Depends: debhelper (>=3D 4.0.0), automake1.8, autoconf, texinfo, l=
ibncurses5-dev | libncurses-dev, type-handling (>=3D 0.2.0), ia32-libs-de=
v [amd64], gcc-3.4 [amd64]
 Build-Depends-Indep: texi2html, e2tools, e2fsprogs, mkisofs
 Standards-Version: 3.6.1.0
=20
 Package: grub
-Architecture: darwin-i386 freebsd-i386 hurd-i386 kfreebsd-i386 knetbsd-i=
386 i386 netbsd-i386 openbsd-i386
+Architecture: amd64 darwin-i386 freebsd-i386 hurd-i386 kfreebsd-i386 kne=
tbsd-i386 i386 netbsd-i386 openbsd-i386
 Depends: ${shlibs:Depends}
 Suggests: grub-doc, grubconf
 Description: GRand Unified Bootloader
diff -ruN grub-0.95+cvs20040624.orig/debian/control.in grub-0.95+cvs20040=
624/debian/control.in
--- grub-0.95+cvs20040624.orig/debian/control.in	2004-09-30 22:13:24.7964=
93899 +0200
+++ grub-0.95+cvs20040624/debian/control.in	2004-09-30 22:12:39.149990841=
 +0200
@@ -3,12 +3,12 @@
 Priority: optional
 Maintainer: Grub Maintainers <pkg-grub-devel@lists.alioth.debian.org>
 Uploaders: Jason Thomas <jason@debian.org>, Robert Millan <rmh@debian.or=
g>
-Build-Depends: debhelper (>=3D 4.0.0), automake1.8, autoconf, texinfo, l=
ibncurses5-dev | libncurses-dev, type-handling (>=3D 0.2.0)
+Build-Depends: debhelper (>=3D 4.0.0), automake1.8, autoconf, texinfo, l=
ibncurses5-dev | libncurses-dev, type-handling (>=3D 0.2.0), ia32-libs-de=
v [amd64], gcc-3.4 [amd64]
 Build-Depends-Indep: texi2html, e2tools, e2fsprogs, mkisofs
 Standards-Version: 3.6.1.0
=20
 Package: grub
-Architecture: @i386@
+Architecture: amd64 @i386@
 Depends: ${shlibs:Depends}
 Suggests: grub-doc, grubconf
 Description: GRand Unified Bootloader
diff -ruN grub-0.95+cvs20040624.orig/debian/grub-floppy grub-0.95+cvs2004=
0624/debian/grub-floppy
--- grub-0.95+cvs20040624.orig/debian/grub-floppy	2004-09-30 22:13:24.916=
474193 +0200
+++ grub-0.95+cvs20040624/debian/grub-floppy	2004-09-30 21:54:23.57992631=
3 +0200
@@ -19,7 +19,8 @@
=20
 # Initialize some variables.
 dd=3D`which dd`
-pkglibdir=3D/lib/grub/i386-pc
+pkglibdir=3D$( [ -d /lib/grub/i386-pc ] && echo /lib/grub/i386-pc || \
+             [ -d /lib/grub/x64_64-pc ] && echo /lib/grub/x86_64-pc )
 stage1=3D$pkglibdir/stage1
 stage2=3D$pkglibdir/stage2
=20
diff -ruN grub-0.95+cvs20040624.orig/debian/rules grub-0.95+cvs20040624/d=
ebian/rules
--- grub-0.95+cvs20040624.orig/debian/rules	2004-09-30 22:13:24.796493899=
 +0200
+++ grub-0.95+cvs20040624/debian/rules	2004-09-30 21:59:49.143456043 +020=
0
@@ -48,6 +48,13 @@
 filesystems=3De2fs ffs ufs2
 endif
=20
+ifeq (amd64,$(shell dpkg-architecture -qDEB_BUILD_ARCH))
+	LDFLAGS=3D-static
+	CC=3Dgcc-3.4
+else
+	CC=3Dgcc-3.3
+endif
+
 patch: patch-stamp
 patch-stamp:
 	dh_testdir
@@ -81,7 +88,7 @@
=20
 	# Add here commands to configure the package.
 	aclocal-1.8 && automake-1.8 && autoconf
-	./configure \
+	CC=3D$(CC) LDFLAGS=3D$(LDFLAGS) ./configure \
 		--host=3D$(DEB_HOST_GNU_TYPE) \
 		--build=3D$(DEB_BUILD_GNU_TYPE) \
 		--prefix=3D/ \
@@ -178,7 +185,7 @@
=20
 	# grub-disk
 	mkdir -p $(CURDIR)/debian/tmp/root/boot/grub
-	cp $(CURDIR)/debian/grub/lib/grub/i386-*/{stage1,e2fs_stage1_5,stage2} =
\
+	cp $(CURDIR)/debian/grub/lib/grub/*-*/{stage1,e2fs_stage1_5,stage2} \
 		$(CURDIR)/docs/menu.lst \
 		$(CURDIR)/debian/tmp/root/boot/grub
 	tar -C $(CURDIR)/debian/tmp/root \
@@ -189,7 +196,7 @@
 		-f $(CURDIR)/debian/tmp/grub.tar.gz
=20
 	rm -f $(CURDIR)/debian/tmp/root/boot/grub/*stage*
-	cp $(CURDIR)/debian/grub/lib/grub/i386-*/stage2_eltorito \
+	cp $(CURDIR)/debian/grub/lib/grub/*-*/stage2_eltorito \
 		$(CURDIR)/debian/tmp/root/boot/grub
=20
 	mkisofs \
@@ -222,11 +229,11 @@
 	# Cleanup filesystems not used natively in Debian.
 	# (non-native filesystems are supported via stage2)
 	mkdir debian/grub/lib/grub/tmp/
-	mv debian/grub/lib/grub/i386-*/*_stage1_5 \
+	mv debian/grub/lib/grub/*-*/*_stage1_5 \
 		debian/grub/lib/grub/tmp/
 	for i in $(filesystems) ; do \
 		mv debian/grub/lib/grub/tmp/$${i}_stage1_5 \
-		debian/grub/lib/grub/i386-*/ ; \
+		debian/grub/lib/grub/*-*/ ; \
 	done
 	rm -rf debian/grub/lib/grub/tmp/
=20

--PEIAKu/WMn1b1Hv9--