Memtest86 wasn't too happy about compiling on a native 64 bit machine.
This fixes that.
--
Jordan Crouse
Systems Software Development Engineer
Advanced Micro Devices, Inc.
[BUILDROM] fix memtest errors when building on a 64 bit system
Make sure we pass the 32 bit flags for the GNU tools - this allows
memtest to build correctly on a 64 bit machine.
Signed-off-by: Jordan Crouse
jordan.crouse@amd.com
Index: buildrom-devel/packages/memtest/memtest.mk
===================================================================
--- buildrom-devel.orig/packages/memtest/memtest.mk
+++ buildrom-devel/packages/memtest/memtest.mk
@@ -36,7 +36,7 @@ $(MEMTEST_STAMP_DIR)/.configured: $(MEMT
$(MEMTEST_SRC_DIR)/memtest: $(MEMTEST_CONFIG_TARGET)
@ echo "Building memtest..."
- @ $(MAKE) -C $(MEMTEST_SRC_DIR) CCFLAGS="$(CFLAGS)" memtest > $(MEMTEST_BUILD_LOG) 2>&1
+ @ $(MAKE) -C $(MEMTEST_SRC_DIR) AS="$(AS)" CC="$(CC)" LD="$(LD)" CCFLAGS="$(CFLAGS)" memtest > $(MEMTEST_BUILD_LOG) 2>&1
$(MEMTEST_STAMP_DIR) $(MEMTEST_LOG_DIR):
@ mkdir -p $@
Index: buildrom-devel/packages/uclibc/uclibc.mk
===================================================================
--- buildrom-devel.orig/packages/uclibc/uclibc.mk
+++ buildrom-devel/packages/uclibc/uclibc.mk
@@ -32,7 +32,7 @@ $(UCLIBC_SRC_DIR)/lib/libc.a: $(UCLIBC_S
@ echo "Building uclibc..."
@ ( unset CFLAGS; unset LDFLAGS; \
$(MAKE) -C $(UCLIBC_SRC_DIR) TARGET_ARCH="$(UCLIBC_ARCH)" \
- CC="$(CC) $(CROSS_CFLAGS)" LD="$(LD) $(CROSS_LDFLAGS)" \
+ CC="$(CC)" LD="$(LD)" \
HOSTCC="$(HOST_CC)" KERNEL_SOURCE="$(KERNEL_SRC_DIR)" \
RUNTIME_PREFIX="/" \
SHARED_LIB_LOADER_PATH="/lib" \
Index: buildrom-devel/scripts/Build.settings
===================================================================
--- buildrom-devel.orig/scripts/Build.settings
+++ buildrom-devel/scripts/Build.settings
@@ -15,6 +15,7 @@ cc-option= $(call try-run,\
find-tool=$(shell set -e; if which $(1) > /dev/null 2>&1; \
then echo "y"; else echo "n"; fi)
+
CC ?= gcc
STRIP ?= strip
AS ?= as
@@ -28,9 +29,15 @@ CROSS_LDFLAGS=
ifeq ($(BUILD_ARCH),x86_64)
ifneq ($(BUILD_ARCH), $(TARGET_ARCH))
+
+CC += -m32
+AS += --32
+LD += -melf_i386
+
CROSS_ASFLAGS=-m32
CROSS_CFLAGS=-m32
CROSS_LDFLAGS=-melf_i386
+
endif
endif
@@ -73,4 +80,4 @@ HOST_LDFLAGS=
HOSTCC=$(HOST_CC)
-export CC CFLAGS LDFLAGS ASFLAGS LIBS
+export CC AS CFLAGS LDFLAGS ASFLAGS LIBS