On 24/10/07 14:11 -0600, Myles Watson wrote:
I checked out the latest buildrom and tried to build L-A-B for two targets,
Serengeti cheetah and Tyan s2891.
It fails to build the kernel because it passes KERNEL_CC=gcc -m32 to make,
and make interprets the -m32 as an option to make.
I'm assuming that there's something wrong with my environment, but I'm not
sure how to fix it.
I'm using Fedora Core 4 and gcc 4
Any suggestions?
Try this patch to buildrom - it should make everybody happy.
Jordan
--
Jordan Crouse
Systems Software Development Engineer
Advanced Micro Devices, Inc.
[BUILDROM] Fix building 32 bit on 64 bit hosts
Re-adjust my previous patch a little bit, its not smart to be passing the
-m32 flag into the kernel, it already knows how to do the right thing (TM).
So pull the 32 bit flags from the default CC, AS and LD variable and pass
them in individually. Also, add quotes to the variables passed into the
kernel, since thats obviously buggy.
Signed-off-by: Jordan Crouse
jordan.crouse@amd.com
Index: buildrom-devel/packages/kernel/kernel.inc
===================================================================
--- buildrom-devel.orig/packages/kernel/kernel.inc 2007-10-24 14:30:48.000000000 -0600
+++ buildrom-devel/packages/kernel/kernel.inc 2007-10-24 14:31:16.000000000 -0600
@@ -45,7 +45,7 @@
$(KERNEL_SRC_DIR)/arch/i386/boot/bzImage: $(KERNEL_SRC_DIR)/.config
@ echo "Building kernel..."
@ $(MAKE) -C $(KERNEL_SRC_DIR) ARCH=i386 \
- KERNEL_CC=$(CC) KERNEL_LD=$(LD) > $(KERNEL_BUILD_LOG) 2>&1
+ KERNEL_CC="$(CC)" KERNEL_LD="$(LD)" > $(KERNEL_BUILD_LOG) 2>&1
$(OUTPUT_DIR)/bzImage: $(KERNEL_SRC_DIR)/arch/i386/boot/bzImage
@ install -d $(OUTPUT_DIR)
Index: buildrom-devel/packages/memtest/memtest.mk
===================================================================
--- buildrom-devel.orig/packages/memtest/memtest.mk 2007-10-24 14:29:06.000000000 -0600
+++ buildrom-devel/packages/memtest/memtest.mk 2007-10-24 14:29:56.000000000 -0600
@@ -36,7 +36,7 @@
$(MEMTEST_SRC_DIR)/memtest: $(MEMTEST_CONFIG_TARGET)
@ echo "Building memtest..."
- @ $(MAKE) -C $(MEMTEST_SRC_DIR) AS="$(AS)" CC="$(CC)" LD="$(LD)" CCFLAGS="$(CFLAGS)" memtest > $(MEMTEST_BUILD_LOG) 2>&1
+ @ $(MAKE) -C $(MEMTEST_SRC_DIR) AS="$(AS) $(CROSS_ASFLAGS)" CC="$(CC) $(CROSS_CFLAGS)" LD="$(LD) $(CROSS_LDFLAGS)" CCFLAGS="$(CFLAGS)" memtest > $(MEMTEST_BUILD_LOG) 2>&1
$(MEMTEST_STAMP_DIR) $(MEMTEST_LOG_DIR):
@ mkdir -p $@
Index: buildrom-devel/scripts/Build.settings
===================================================================
--- buildrom-devel.orig/scripts/Build.settings 2007-10-24 14:28:32.000000000 -0600
+++ buildrom-devel/scripts/Build.settings 2007-10-24 14:35:23.000000000 -0600
@@ -30,11 +30,7 @@
ifeq ($(BUILD_ARCH),x86_64)
ifneq ($(BUILD_ARCH), $(TARGET_ARCH))
-CC += -m32
-AS += --32
-LD += -melf_i386
-
-CROSS_ASFLAGS=-m32
+CROSS_ASFLAGS=--32
CROSS_CFLAGS=-m32
CROSS_LDFLAGS=-melf_i386
Index: buildrom-devel/packages/uclibc/uclibc.mk
===================================================================
--- buildrom-devel.orig/packages/uclibc/uclibc.mk 2007-10-24 14:32:42.000000000 -0600
+++ buildrom-devel/packages/uclibc/uclibc.mk 2007-10-24 14:32:46.000000000 -0600
@@ -32,7 +32,7 @@
@ echo "Building uclibc..."
@ ( unset CFLAGS; unset LDFLAGS; \
$(MAKE) -C $(UCLIBC_SRC_DIR) TARGET_ARCH="$(UCLIBC_ARCH)" \
- CC="$(CC)" LD="$(LD)" \
+ CC="$(CC) $(CROSS_CFLAGS)" LD="$(LD) $(CROSS_LDFLAGS)" \
HOSTCC="$(HOST_CC)" KERNEL_SOURCE="$(KERNEL_SRC_DIR)" \
RUNTIME_PREFIX="/" \
SHARED_LIB_LOADER_PATH="/lib" \