[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#665997: libbsd uses wrong compiler when cross-building



Source: libbsd
Version: 0.3.0-2
Tags: Patch
User: crossbuild@debian.org
Usertags: cross

As part of making debian 'bootstrappable' we are making sure that at
least the core system is cross-buildable.

libbsd uses 'gcc' directly, so cross-compiling fails. The attached patch
fixes that.

This bug corresponds to ubuntu bug:
https://bugs.launchpad.net/ubuntu/+source/libbsd/+bug/963060


Wookey
-- 
Principal hats:  Linaro, Emdebian, Wookware, Balloonboard, ARM
http://wookware.org/
diff -ur origs/libbsd-0.3.0/Makefile patched/libbsd-0.3.0/Makefile
--- origs/libbsd-0.3.0/Makefile	2011-06-02 17:20:55.000000000 +0000
+++ patched/libbsd-0.3.0/Makefile	2012-03-27 16:46:52.000000000 +0000
@@ -119,7 +119,6 @@
 LIB_SHARED_OBJS := $(LIB_SRCS:%.c=%.lo)
 
 AR = ar
-CC = gcc
 CCLD = $(CC)
 
 # Set default values for user variables
diff -ur origs/libbsd-0.3.0/debian/rules patched/libbsd-0.3.0/debian/rules
--- origs/libbsd-0.3.0/debian/rules	2012-02-25 19:41:15.000000000 +0000
+++ patched/libbsd-0.3.0/debian/rules	2012-03-27 16:45:48.000000000 +0000
@@ -4,6 +4,7 @@
 #export DH_VERBOSE=1
 
 DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
+DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 
 CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS)
 CFLAGS := -Wall $(shell dpkg-buildflags --get CFLAGS)
@@ -20,7 +21,7 @@
 build-arch:
 	dh_testdir
 
-	$(MAKE) CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
+	$(MAKE) CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" CC="$(DEB_HOST_GNU_TYPE)-gcc"
 
 build: build-indep build-arch
 

Reply to: