Bug#682689: buildcross fails to build gcc-4.7

Alban Browaeys <[email protected]>
Newsgroups gmane.linux.debian.devel.embedded
Message-ID <20120916232430.20068.98225.reportbug__12246.1053579629$1347838041$gmane$org@admin.thetrendwatch11-premerge.fullsix.local.f6.fr>
Package: buildcross
Followup-For: Bug #682689

Here is a set of patches for sid to let gcc-4.7 build.

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.6.0-rc3test0-00207-g318e151-dirty (SMP w/2 CPU cores)
Locale: LANG=fr_FR.utf8, LC_CTYPE=fr_FR.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages buildcross depends on:
ii  autoconf                          2.69-1
ii  autoconf2.13                      2.13-62
ii  autogen                           1:5.16.2-2
ii  automake1.4                       1:1.4-p6-13.1
ii  automake1.9                       1.9.6+nogfdl-4
ii  bison                             1:2.5.dfsg-2.1
ii  build-essential                   11.5
ii  bzip2                             1.0.6-4
ii  cdbs                              0.4.117
ii  chrpath                           0.13-2
ii  dctrl-tools                       2.22.2
ii  debhelper                         9.20120909
ii  dejagnu                           1.5-3
ii  devscripts                        2.12.3
ii  dh-make                           0.61
ii  dpatch                            2.0.35
ii  dpkg-cross                        2.6.7
ii  fakeroot                          1.18.4-2
ii  flex                              2.5.35-10.1
ii  gawk                              1:4.0.1+dfsg-2
ii  gobjc                             4:4.7.1-1
ii  gperf                             3.0.3-1+b1
ii  libcloog-ppl-dev                  0.15.11-4
ii  libmpfr-dev                       3.1.0-5
ii  libncurses5-dev [libncurses-dev]  5.9-10
ii  libreadline-dev                   6.2-8
ii  libtool                           2.4.2-1.1
ii  liburi-perl                       1.60-1
ii  lsb-release                       4.1+Debian7
ii  patchutils                        0.3.2-1.1
ii  pbuilder                          0.212
ii  quilt                             0.60-2
ii  realpath                          1.17
ii  reprepro                          4.12.4-1
ii  sharutils                         1:4.11.1-1
ii  sudo                              1.8.5p2-1
ii  texinfo                           4.13a.dfsg.1-10
ii  time                              1.7-24
ii  wget                              1.14-1

Versions of packages buildcross recommends:
ii  xapt  2.2.18

buildcross suggests no packages.

-- Configuration Files:
/etc/buildcross.conf changed:
PKGLIST=${PKGLIST:-"gcc-4.7 libs binutils gcc-4.6"}
ARCHLIST=${ARCHLIST:-"armel armhf"}
SRCSUITE=${SRCSUITE:-"unstable"}
SUITE=${SUITE:-"unstable"}
WARNMSG=${WARNMSG:-"no"}
LOCALREPO=${LOCALREPO:-"no"}
VERBOSEMODE=${VERBOSEMODE:-"yes"}
CURDIR=${CURDIR:-"$(pwd)"}
SRCDIR=${SRCDIR:-"$CURDIR/cache/src"}
APTCACHE=${APTCACHE:-"$CURDIR/cache/apt"}
REPOPATH=${REPOPATH:-"$CURDIR/cache/repo"}
BUILDPATH=${BUILDPATH:-"$CURDIR/cache/build"}
CLEANTREE=${CLEANTREE:-"yes"}
CLEANDIRS=${CLEANDIRS:-"yes"}
HOSTARCH=$(dpkg-architecture -qDEB_HOST_ARCH)
DPKGFLAGS="--force-overwrite"
FETCH=${FETCH:-"wget"}
ONLINE=${ONLINE:-"no"}
LOGHTMLPATH=${LOGHTMLPATH:-"$CURDIR"}
LOGPATH="$LOGHTMLPATH/logs/"
LOGHTML="index.html"
MIRROR=${MIRROR:-"http://cdn.debian.net/debian/"}
ROOTCMD=${ROOTCMD:-sudo}
FORCE_REBUILD=${FORCE_REBUILD:-yes}
FORCE_UPGRADE=${FORCE_UPGRADE:-yes}
export DEBIAN_FRONTEND=noninteractive
export DEBIAN_PRIORITY=critical
export DEBCONF_NONINTERACTIVE_SEEN=true
export LANG=C
export LANGUAGE=C
export LC_ALL=C
export LC_PAPER=C
export LC_MONETARY=C


-- no debconf information
0001-up-automake-dependency-.-1.7-is-no-more-in-debian-test.txt (text/x-diff, 1.9 KB)
>From 0dbaf3cd5ac5c7940767058ce149778743c90e3d Mon Sep 17 00:00:00 2001
From: Alban Browaeys <[email protected]>
Date: Mon, 3 Sep 2012 00:59:31 +0200
Subject: [PATCH 1/6] up automake dependency . 1.7 is no more in debian
 testing.

---
 debian/changelog |    8 ++++++++
 debian/control   |    2 +-
 functions        |    2 +-
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index fb954d3..829b1ad 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+buildcross (0.0.12+nmu1) UNRELEASED; urgency=low
+
+  * Non-maintainer upload.
+  * up automake runtime dependency from 1.7 to automake plain
+    (1.11 as of now).
+
+ -- Alban Browaeys <[email protected]>  Mon, 03 Sep 2012 00:38:46 +0200
+
 buildcross (0.0.12) experimental; urgency=low
 
   * Drop type-handling dependencies (Closes: #639332)
diff --git a/debian/control b/debian/control
index 17675de..98c5c7f 100644
--- a/debian/control
+++ b/debian/control
@@ -16,7 +16,7 @@ Recommends: xapt
 Depends: ${misc:Depends}, dpkg-cross (>=2.4.0), fakeroot, dpatch, time,
  patchutils, bzip2, lsb-release, autoconf, autoconf2.13, automake1.9,
  libtool, autogen, gawk, bison, flex, realpath, texinfo, devscripts,
- automake1.4, automake1.7, dh-make, debhelper, libncurses-dev,
+ automake1.4, automake, dh-make, debhelper, libncurses-dev,
  libreadline-dev, gobjc, cdbs, quilt, build-essential,
  dejagnu, gperf, libmpfr-dev, sharutils, chrpath, liburi-perl, dctrl-tools,
  wget, pbuilder, dctrl-tools, sudo, reprepro, libcloog-ppl-dev
diff --git a/functions b/functions
index 4d2be8b..314e55c 100644
--- a/functions
+++ b/functions
@@ -151,8 +151,8 @@ sanitycheck () {
 	checkinstalled liburi-perl
 	checkinstalled less 
 	checkinstalled coreutils
+	checkinstalled automake
 	checkinstalled automake1.4
-	checkinstalled automake1.7
 	checkinstalled dh-make
 	checkinstalled debhelper
 	#checkinstalled xapt
-- 
1.7.10.4
0002-armhf-is-now-hosted-on-debian-per-se-no-debian-ports.txt (text/x-diff, 703 B)
>From bd40dcb243dcd5cde91387cb504759706fd58bd1 Mon Sep 17 00:00:00 2001
From: Alban Browaeys <[email protected]>
Date: Mon, 3 Sep 2012 14:10:24 +0200
Subject: [PATCH 2/6] armhf is now hosted on debian per se no debian-ports

---
 functions |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/functions b/functions
index 314e55c..3ce77c3 100644
--- a/functions
+++ b/functions
@@ -1311,7 +1311,7 @@ for DEBARCH in $ARCHLIST; do
 	web_arch
 	if [ x$SUITE = xunstable ] || [ x$SUITE = xsid ] ; then
 		case ${DEBARCH} in
-		sh4|armhf|powerpcspe|sparc64|m68k)
+		sh4|powerpcspe|sparc64|m68k)
 			unset MIRROR
 			MIRROR=${MIRROR:="http://ftp.debian-ports.org/debian/"}
 		;;
-- 
1.7.10.4
0003-expand-gcc-to-4.7-was-4.6.txt (text/x-diff, 683 B)
>From c738452954292887477ba76f5e3813e9b191e694 Mon Sep 17 00:00:00 2001
From: Alban Browaeys <[email protected]>
Date: Mon, 3 Sep 2012 14:11:20 +0200
Subject: [PATCH 3/6] expand gcc to 4.7 (was < 4.6)

---
 functions |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/functions b/functions
index 3ce77c3..f5226e3 100644
--- a/functions
+++ b/functions
@@ -1092,7 +1092,7 @@ case ${1} in
 	svn) 
 		myecho INFO "I: Building SVN HEAD"
 		build-gcc-snapshot > $LOGPATH/$HOSTARCH-$DEBARCH-$PKG.log 2>&1;;
-	gcc-3.[3-4]|gcc-4.[0-6])
+	gcc-3.[3-4]|gcc-4.[0-7])
 		GCCVER=${1#gcc-}
 		myecho INFO "I: Building GCC ${GCCVER}"
 		checkinstalled gcc-${GCCVER}
-- 
1.7.10.4
0004-upgrade-libgmp-dependencies.txt (text/x-diff, 949 B)
>From 39085b81d261f345df5e2416aaa808cf06b8b270 Mon Sep 17 00:00:00 2001
From: Alban Browaeys <[email protected]>
Date: Mon, 3 Sep 2012 14:13:00 +0200
Subject: [PATCH 4/6] upgrade libgmp dependencies

libgmp3 is no more - use libgmp10 instead,
libgmp10-dev becomes libgmp-dev,
---
 functions |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/functions b/functions
index f5226e3..c40a70c 100644
--- a/functions
+++ b/functions
@@ -713,10 +713,10 @@ build-libs () {
 	make-cross-arch-package zlib1g
 	make-cross-arch-package zlib1g-dev
 
-	make-cross-arch-package libgmp3-dev 
-	make-cross-arch-package libgmp10-dev 
-	make-cross-arch-package libgmp3c2 
- 	make-cross-arch-package libgmpxx4ldbl 
+	make-cross-arch-package libgmp10
+	make-cross-arch-package libgmpxx4ldbl
+	make-cross-arch-package libgmp-dev
+	make-cross-arch-package libgmp3-dev
 	case $SUITE in
 	lenny)
  	  #make-cross-arch-package libmpfr
-- 
1.7.10.4
0005-COSMETIC-avoid-error-from-dpkg-when-a-version-is-missi.txt (text/x-diff, 2.3 KB)
>From ef5596b98517780a164d42c8490d0cf46b4ae4d7 Mon Sep 17 00:00:00 2001
From: Alban Browaeys <[email protected]>
Date: Mon, 3 Sep 2012 14:14:22 +0200
Subject: [PATCH 5/6] [COSMETIC] avoid error from dpkg when a version is
 missing

quote the arguments so there are always 3 even when
version is missing (due to wrong repo Packages location, etc)
---
 functions |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/functions b/functions
index c40a70c..dfe65a2 100644
--- a/functions
+++ b/functions
@@ -333,14 +333,14 @@ is_new_package () {
 	echo " &nbsp; &nbsp; $1-$TS: <b> $emdebver </b>::<b> $debver </b> :$1 <br>" >> $LOGPATH/$DEBARCH-$LOGHTML
 
 	# Fylesystem check
-	if [ -z $emdebver ] ; then
+	if [ -z "$emdebver" ] ; then
 		emdebver=none
 		return 3
 	elif [ x$FORCE_REBUILD = xyes ] ; then
 		return 3
-	elif dpkg --compare-versions $emdebver gt $debver ; then
+	elif dpkg --compare-versions "$emdebver" gt "$debver" ; then
 		return 2
-	elif dpkg --compare-versions $emdebver eq $debver ; then
+	elif dpkg --compare-versions "$emdebver" eq "$debver" ; then
 		return 1
 	else
 		return 0
@@ -375,9 +375,9 @@ is_new_source () {
 	local debver=$(srcver $1)
 	local emdebver=$(grep-aptavail -PX $1 -s Version: -n ${SRCDIR}/Sources)
 
-	if [ -z $emdebver ] ; then
+	if [ -z "$emdebver" ] ; then
 		return 0
-	elif dpkg --compare-versions $debver gt $emdebver ; then
+	elif dpkg --compare-versions "$debver" gt "$emdebver" ; then
 		return 0
 	else
 		# It is not new source
@@ -782,7 +782,7 @@ build-binutils () {
 	 		apply-patches binutils
 		fi
 		${ROOTCMD} /usr/lib/pbuilder/pbuilder-satisfydepends-classic
-		if dpkg --compare-versions ${_version} lt "2.20.51" ; then
+		if dpkg --compare-versions "${_version}" lt "2.20.51" ; then
 			TARGET=${DEBARCH} fakeroot debian/rules binary-cross
 		else
 			TARGET=${DEBARCH} dpkg-buildpackage -b -uc -us
@@ -1294,7 +1294,7 @@ scan_srcdir
 # dpkg-cross version check
 #if [[ "2.4.0" > $(dpkg-cross --help 2>&1 |awk '{print $3; exit;}') ]]; then
 # armhf needs 2.6.0
-if dpkg --compare-versions $(dpkg-query -W -f='${Version}\n' dpkg-cross) lt "2.4.0" ; then
+if dpkg --compare-versions "$(dpkg-query -W -f='${Version}\n' dpkg-cross)" lt "2.4.0" ; then
 	myecho WARN "W: dpkg-cross is too old."
 	${ROOTCMD} apt-get install -f dpkg-cross > /dev/null 2>&1
 fi
-- 
1.7.10.4
0006-add-gcc-4.7-base-to-the-dependencies-to-strip-from-the.txt (text/x-diff, 1.1 KB)
>From 0020c15edacd0ec35430d0784069c149a7661e15 Mon Sep 17 00:00:00 2001
From: Alban Browaeys <[email protected]>
Date: Mon, 3 Sep 2012 14:27:25 +0200
Subject: [PATCH 6/6] add gcc-4.7-base to the dependencies to strip from the
 libs

avoid circular dependency while getting build deps for gcc-4.7:
gcc-4.7 depends on libc6-dev- which depends on on libgcc1- which
itself depends on gcc-4.7-base- (which latest version we build)
---
 functions |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/functions b/functions
index dfe65a2..33b772b 100644
--- a/functions
+++ b/functions
@@ -515,7 +515,8 @@ make-cross-arch-package () {
 			[ -f ${_origfile} ] || wget -nv -nd -N ${MIRROR}/${_origfile2}
 			[ -f ${_crossfile} ] || dpkg-cross -A -M -X gcc-4.3-base \
 				-X gcc-4.4-base -X debconf -X debconf-2.0 \
-				-X gcc-4.5-base -X gcc-4.6-base -X multiarch-support \
+				-X gcc-4.5-base -X gcc-4.6-base -X gcc-4.7-base \
+				-X multiarch-support \
 				${_force_dummy} -a ${DEBARCH} -b ${_origfile}
 			$ROOTCMD dpkg --force-depends -i ${_crossfile}
 		;;
-- 
1.7.10.4
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.