summaryrefslogtreecommitdiff
path: root/payloads/libpayload/bin/lpgcc
diff options
context:
space:
mode:
Diffstat (limited to 'payloads/libpayload/bin/lpgcc')
-rwxr-xr-xpayloads/libpayload/bin/lpgcc9
1 files changed, 6 insertions, 3 deletions
diff --git a/payloads/libpayload/bin/lpgcc b/payloads/libpayload/bin/lpgcc
index 52a8e554c0..06b9021fbf 100755
--- a/payloads/libpayload/bin/lpgcc
+++ b/payloads/libpayload/bin/lpgcc
@@ -110,26 +110,29 @@ done
if [ "$CONFIG_ARCH_ARMV7" = "y" ]; then
_ARCHINCDIR=$_INCDIR/armv7
_ARCHLIBDIR=$_LIBDIR/armv7
+ _ARCHEXTRA=""
fi
if [ "$CONFIG_ARCH_POWERPC" = "y" ]; then
_ARCHINCDIR=$_INCDIR/powerpc
_ARCHLIBDIR=$_LIBDIR/powerpc
+ _ARCHEXTRA=""
fi
if [ "$CONFIG_ARCH_X86" = "y" ]; then
_ARCHINCDIR=$_INCDIR/x86
_ARCHLIBDIR=$_LIBDIR/x86
+ _ARCHEXTRA="-m32 "
fi
-_CFLAGS="-m32 -nostdinc -nostdlib -I$_INCDIR -I$_ARCHINCDIR -D__LIBPAYLOAD__=1"
+_CFLAGS="$_ARCHEXTRA -nostdinc -nostdlib -I$_INCDIR -I$_ARCHINCDIR -D__LIBPAYLOAD__=1"
# Check for the -fno-stack-protector silliness
trygccoption -fno-stack-protector
[ $? -eq 0 ] && _CFLAGS="$_CFLAGS -fno-stack-protector"
-_CFLAGS="$_CFLAGS -I`$DEFAULT_CC -m32 -print-search-dirs | head -n 1 | cut -d' ' -f2`include"
+_CFLAGS="$_CFLAGS -I`$DEFAULT_CC $_ARCHEXTRA -print-search-dirs | head -n 1 | cut -d' ' -f2`include"
_LDFLAGS="-L$BASE/../lib $_LDSCRIPT -static"
@@ -140,7 +143,7 @@ if [ $DOLINK -eq 0 ]; then
$DEFAULT_CC $_CFLAGS $CMDLINE
else
- _LIBGCC=`$DEFAULT_CC -m32 -print-libgcc-file-name`
+ _LIBGCC=`$DEFAULT_CC $_ARCHEXTRA -print-libgcc-file-name`
if [ $DEBUGME -eq 1 ]; then
echo "$DEFAULT_CC $_CFLAGS $_LDFLAGS $_ARCHLIBDIR/head.o $CMDLINE -lpayload $_LIBGCC"
fi