Hi,

When cross-compiling, configuration stops with an error:


        configure: error: cannot run test program while cross compiling


With the patch applied:


        checking whether malloc(0) returns NULL... yes


Colin wrote in bug 24460:


        add fourth argument to AC_RUN_IFELSE
        
        libX11 fails to cross-compile unless --enable-malloc0returnsnull is 
given
        during configuration, since configure can't run test programs in this
        situation. This is a sensible conservative default that should be used 
by
        default when cross-compiling rather than requiring it to be forced 
explicitly.


Regards,
Gaetan


>From a572da405d2d0be4743a476b6a614860c6082428 Mon Sep 17 00:00:00 2001
From: Colin Watson <[email protected]>
Date: Sat, 10 Oct 2009 13:28:28 +0100
Subject: [PATCH] Use conservative default for malloc(0) when cross-compiling #24460

When cross-compiling, AC_RUN_IFELSE can't run test programs.
MALLOC_ZERO_RETURNS_NULL=yes is a conservative default in this case.

Signed-off-by: Colin Watson <[email protected]>
Signed-off-by: Gaetan Nadon <[email protected]>
---
 xorg-macros.m4.in |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xorg-macros.m4.in b/xorg-macros.m4.in
index 6f9635f..393186f 100644
--- a/xorg-macros.m4.in
+++ b/xorg-macros.m4.in
@@ -339,7 +339,8 @@ main() {
     exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
 }],
 		[MALLOC_ZERO_RETURNS_NULL=yes],
-		[MALLOC_ZERO_RETURNS_NULL=no])
+		[MALLOC_ZERO_RETURNS_NULL=no],
+		[MALLOC_ZERO_RETURNS_NULL=yes])
 fi
 AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
 
-- 
1.6.0.4

_______________________________________________
xorg-devel mailing list
[email protected]
http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to