bug-bash
[Top][All Lists]
Advanced

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

Cross compiling with wrong [C|LD] flags


From: Robert Schwebel
Subject: Cross compiling with wrong [C|LD] flags
Date: Mon, 21 Jun 2004 10:47:02 +0200
User-agent: Mutt/1.5.5.1+cvs20040105i

Configuration Information [Automatically generated, do not change]:
Machine: i386
OS: linux-gnu
Compiler: i386-unknown-linux-gnu-gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i386' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i386-unknown-linux-gnu' 
-DCONF_VENDOR='unknown' -DSHELL -DHAVE_CONFIG_H  -I.  -I. -I./include -I./lib 
-I/tmp/ptxdist-local/i386-unknown-linux-gnu/include 
-I/tmp/ptxdist-local/i386-unknown-linux-gnu/include
uname output: Linux ganymed 2.6.5-1-686 #5 Fri Apr 30 20:26:13 EST 2004 i686 
GNU/Linux
Machine Type: i386-unknown-linux-gnu

Bash Version: 2.05b
Patch Level: 0
Release Status: release

Description:
        While cross compiling bash, CPPFLAGS_FOR_BUILD and LDFLAGS_FOR_BUILD 
        are set incorrectly. Additionally, it is no good idea to set 
        LDFLAGS_FOR_BUILD in builtins/Makefile.in to $LDFLAGS (which contains
        the flags for the target). 

Repeat-By:
        
ac_cv_func_setvbuf_reversed=no bash_cv_have_mbstate_t=yes 
AR="i386-unknown-linux-gnu"-ar AS="i386-unknown-linux-gnu"-as 
CXX="i386-unknown-linux-gnu"-g++ CC="i386-unknown-linux-gnu"-gcc 
LD="i386-unknown-linux-gnu"-ld NM="i386-unknown-linux-gnu"-nm 
OBJCOPY="i386-unknown-linux-gnu"-objcopy 
OBJDUMP="i386-unknown-linux-gnu"-objdump RANLIB="i386-unknown-linux-gnu"-ranlib 
STRIP="i386-unknown-linux-gnu"-strip 
CFLAGS='-I/tmp/ptxdist-local/i386-unknown-linux-gnu/include' 
CPPFLAGS='-I/tmp/ptxdist-local/i386-unknown-linux-gnu/include' 
LDFLAGS='-L/tmp/ptxdist-local/i386-unknown-linux-gnu/lib' 
CXXFLAGS='-I/tmp/ptxdist-local/i386-unknown-linux-gnu/include' 
ac_cv_func_getpgrp_void=yes ac_cv_func_setpgrp_void=yes 
ac_cv_sizeof_long_long=8 ac_cv_func_memcmp_clean=yes 
ac_cv_func_setvbuf_reversed=no ac_cv_func_getrlimit=yes ./configure 
--build=i686-host-linux-gnu --host="i386-unknown-linux-gnu" 
--target="i386-unknown-linux-gnu" --disable-sanity-checks --prefix=/usr 
--bindir=/bin --enable-dparen-arithmetic --disable-minimal-config 
--enable-alias --enable-arith-for-command --disable-array-variables 
--enable-bang-history --enable-brace-expansion --enable-cond-command 
--disable-directory-stack --enable-extended-glob --disable-help-builtin 
--enable-history --disable-job-control --disable-largefile 
--disable-process-substitution --enable-progcomp 
--disable-prompt-string-decoding --enable-readline --disable-restricted 
--disable-select --disable-profiling --disable-static -link

Fix:

----------8<----------8<----------8<----------8<----------8<----------
diff -urN bash-2.05b-orig/builtins/Makefile.in bash-2.05b/builtins/Makefile.in
--- bash-2.05b-orig/builtins/Makefile.in        2002-04-23 15:24:23.000000000 
+0200
+++ bash-2.05b/builtins/Makefile.in     2004-06-21 10:23:24.000000000 +0200
@@ -54,7 +54,7 @@
 
 LIBS = @LIBS@
 LDFLAGS = @LDFLAGS@ $(LOCAL_LDFLAGS) $(CFLAGS)
-LDFLAGS_FOR_BUILD = $(LDFLAGS)
+LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@
 LOCAL_LDFLAGS = @LOCAL_LDFLAGS@
 #LIBS_FOR_BUILD = @LIBS_FOR_BUILD@
 LIBS_FOR_BUILD = $(LIBS)
diff -urN bash-2.05b-orig/configure.in bash-2.05b/configure.in
--- bash-2.05b-orig/configure.in        2002-07-16 15:31:25.000000000 +0200
+++ bash-2.05b/configure.in     2004-06-21 10:19:50.000000000 +0200
@@ -403,7 +403,13 @@
        fi
 fi
 
-test -z "$CPPFLAGS_FOR_BUILD" && CPPFLAGS_FOR_BUILD="$CPPFLAGS"
+if test "x$cross_compiling" = "xno"; then
+       CPPFLAGS_FOR_BUILD = ${CPPFLAGS_FOR_BUILD-"$CPPFLAGS"}
+       LDFLAGS_FOR_BUILD  = ${LDFLAGS_FOR_BUILD-"$LDFLAGS"}
+else
+       CPPFLAGS_FOR_BUILD = ${CPPFLAGS_FOR_BUILD-""}
+       LDFLAGS_FOR_BUILD  = ${LDFLAGS_FOR_BUILD-""}
+fi     
 test -z "$CFLAGS_FOR_BUILD" && CFLAGS_FOR_BUILD="-g"
 
 AC_SUBST(CFLAGS)
----------8<----------8<----------8<----------8<----------8<----------

Robert
-- 
 Dipl.-Ing. Robert Schwebel | http://www.pengutronix.de
 Pengutronix - Linux Solutions for Science and Industry
   Handelsregister:  Amtsgericht Hildesheim, HRA 2686
     Hornemannstra├če 12,  31137 Hildesheim, Germany
    Phone: +49-5121-28619-0 |  Fax: +49-5121-28619-4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]