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

Bug#861073: libxinerama failed to cross build at configure



Source: libxinerama
Version: 2:1.1.3-1
Severity: normal
Tags: patch

Hi,

libxinerama fails when cross-compile with dpkg-buildpackage:
$ CONFIG_SITE=/etc/dpkg-cross/cross-config.armhf DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -aarmhf

By default, in configure, "malloc0returnsnull" is "auto" and it requires compile and run a test code
which cannot execute when cross build.
Error:
  | checking whether malloc(0) returns NULL... configure: error: in `libxinerama-1.1.3/build':
  | configure: error: cannot run test program while cross compiling


The cross-compile could pass if option "malloc0returnsnull" is specified ("enable" or "disable").
I think we could add this option to debian/rules. I've attached a patch for this.
In the patch, option "--disable-malloc0returnsnull" is default,
but option "--enable-malloc0returnsnull" will be called if
param "malloc0returnsnull" is passed to DEB_BUILD_OPTIONS.


Trung.


-- System Information:
Debian Release: 9.0
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64
 (x86_64)
Foreign Architectures: armhf

Kernel: Linux 3.16.0-4-amd64 (SMP w/16 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

--- libxinerama-1.1.3/debian/rules	2017-04-20 03:52:14.000000000 -0400
+++ libxinerama-1.1.3/debian/rules	2017-04-20 03:52:35.400000000 -0400
@@ -28,6 +28,15 @@
 endif
 confflags += $(shell DEB_CFLAGS_MAINT_APPEND=-Wall dpkg-buildflags --export=configure)
 
+# cannot run test code for malloc0returnsnull when cross compile 
+ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
+	ifeq (,$(findstring malloc0returnsnull,$(DEB_BUILD_OPTIONS)))
+		confflags += --disable-malloc0returnsnull
+	else
+		confflags += --enable-malloc0returnsnull
+	endif
+endif
+
 build: build-arch build-indep
 build-arch: build-stamp
 build-indep:
-- 
This mail was scanned by BitDefender
For more information please visit http://www.bitdefender.com

Reply to: