[Pkg-alsa-devel] Bug#447879: debian/rules biarch code doesn't work for new archictures

Martin Michlmayr tbm at cyrius.com
Wed Oct 24 14:03:21 UTC 2007


Package: alsa-lib
Version: 1.0.14a-2
Tags: patch

Say you're porting Debian to a new PowerPC based architecture.  In
that case, DEB_BUILD_ARCH_CPU will be powerpc but DEB_BUILD_ARCH will
be some new string, let's say ppc405.  The biarch code in debian/rules
will look at DEB_BUILD_ARCH_CPU and see that powerpc is a biarch
together with ppc64.  It will then look for certain known
architectures and set $bi.  In my case, $bi remains unset and
configure is called with CC="gcc -m" which obviously doesn't work.

The correct fix is to do the biarch magic only when $bi actually gets
set by the code above, i.e. when the architecture is actually known to
be biarch.

--- debian/rules	(revision 796)
+++ debian/rules	(working copy)
@@ -30,11 +30,13 @@
       bilibdir = emul/ia32-linux/usr/lib
     endif
   endif
-  configure_biarch_stamp = configure-biarch-stamp
-  build_biarch_stamp = build-biarch-stamp
-  BIARCH_CC = gcc -m$(bi)
-  dpkg_ctrl_args = -- '-Vbilib:depends=libc6-$(biarch_cpu)' \
+  ifneq (,$(bi))
+    configure_biarch_stamp = configure-biarch-stamp
+    build_biarch_stamp = build-biarch-stamp
+    BIARCH_CC = gcc -m$(bi)
+    dpkg_ctrl_args = -- '-Vbilib:depends=libc6-$(biarch_cpu)' \
 	'-Vbidev:depends=libc6-dev-$(biarch_cpu)'
+  endif
 endif
 
 CFLAGS = -g -Wall


Build failure:
mkdir bibuild/include
cd bibuild && CC="gcc -m" ../configure --prefix=/usr \
                    --mandir=\${prefix}/share/man \
                    --infodir=\${prefix}/share/info \
                    --datadir=\${prefix}/share \
                    --host=powerpc-linux-gnuppc405 \
                    --enable-static --disable-maintainer-mode
configure: WARNING: If you wanted to set the --build type, don't use --host.
    If a cross compiler is detected then cross compile mode will be used.
checking build system type... powerpc-unknown-linux-gnu
checking host system type... powerpc-unknown-linux-gnuppc405
checking target system type... powerpc-unknown-linux-gnuppc405
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for powerpc-linux-gnuppc405-strip... no
checking for strip... strip
checking whether to enable maintainer-specific portions of Makefiles... no
checking for powerpc-linux-gnuppc405-gcc... gcc -m
checking for C compiler default output file name...
configure: error: C compiler cannot create executables
See `config.log' for more details.

-- 
Martin Michlmayr
http://www.cyrius.com/





More information about the Pkg-alsa-devel mailing list