On 02/10/08 09:09 +0100, Stephen Crocker wrote:
> I have noticed a problem with lpgcc under Fedora Core 9 when building
> Tint. Instead of calling gcc, it calls itself. Looking at the Makefile
> and the script itself, I think I can see why:
>
> From lpgcc:
> if [ "$CC" != "" ]; then
> DEFAULT_CC=$CC
> else
> DEFAULT_CC=gcc
> fi
>
> From the tint Makefile:
> CC := $(LIBPAYLOAD_DIR)/bin/lpgcc
>
> Is this a bug in tint or a bug in libpayload?
Attached is a patch to libpayload to fix that problem. This
patch just removes the entire if statement for now, but we do
need some way to pass a compiler that isn't named 'gcc' to the
script - options for doing that are welcome.
Also, this patch includes a -ldscript option for bayou and
FILO to pass a custom ldscript to the process while retaining
the other lpgcc benefits.
Jordan
--
Jordan Crouse
Systems Software Development Engineer
Advanced Micro Devices, Inc.
libpayload: lpgcc - remove circular reference and add -ldscript option
Remove a circular reference that was causing pain - this needs to be
readdressed at some point soon. Add a -ldscript option for payloads
to pass in a "custom" ldscript - Bayou and FILO currently take
advantage of this.
Signed-off-by: Jordan Crouse <[EMAIL PROTECTED]>
Index: libpayload/bin/lpgcc
===================================================================
--- libpayload.orig/bin/lpgcc 2008-10-02 10:10:42.000000000 -0600
+++ libpayload/bin/lpgcc 2008-10-02 13:09:43.000000000 -0600
@@ -28,12 +28,18 @@
# GCC wrapper for libpayload
-if [ "$CC" != "" ]; then
-DEFAULT_CC=$CC
-else
-DEFAULT_CC=gcc
-fi
+# This causes a circular loop when CC is defined to be lpgcc.
+# We need a way to be able to pass in a cross compiler, but
+# that magic will likely have to happen in the individual
+# Makefiles. Fow now, assume gcc to get things moving again.
+
+#if [ "$CC" != "" ]; then
+#DEFAULT_CC=$CC
+#else
+#DEFAULT_CC=gcc
+#fi
+DEFAULT_CC=gcc
BASE=`dirname $0`
# This will set the _LIBDIR and _INCDIR variables used below
@@ -53,6 +59,7 @@
# pass to gas
CMDLINE=
+LDSCRIPT=$_LIBDIR/libpayload.ldscript
# Process various flags that would change our behavior
@@ -73,6 +80,11 @@
shift
continue
;;
+ -ldscript)
+ LDSCRIPT=$2
+ shift 2
+ continue
+ ;;
*)
;;
esac
@@ -90,7 +102,7 @@
_CFLAGS="$_CFLAGS -I`$DEFAULT_CC -m32 -print-search-dirs | head -n 1 | cut -d' ' -f2`include"
-_LDFLAGS="-Wl,-T,$_LIBDIR/libpayload.ldscript -static"
+_LDFLAGS="-Wl,-T,$LDSCRIPT -static"
if [ $DOLINK -eq 0 ]; then
if [ $DEBUGME -eq 1 ]; then
--
coreboot mailing list: [email protected]
http://www.coreboot.org/mailman/listinfo/coreboot