6e432d5ecb
Until now, the host toolchain was used to build syslinux, as it was not possible to build a 32-bit syslinux with a x86-64 toolchain. However, syslinux requires gnu-efi, and gnu-efi is built using the target toolchain. Mixing different toolchains doesn't work well, so this commit changes the syslinux package to use the target toolchain for syslinux as well. This is made possible by patches 0003-Fix-ldlinux.elf-Not-enough-room-for-program-headers-.patch and 0004-memdisk-Force-ld-output-format-to-32-bits.patch. Since syslinux also contains some utilities that have to run on the host, those have to continue being built with the host toolchain, which requires patch 0005-utils-Use-the-host-toolchain-to-build.patch. Patch 0006-lzo-Use-the-host-toolchain-for-prepcore.patch is about building prepcore, another utility with the host toolchain as it is required at build-time. This was tested using a Buildroot's built x86_64 toolchain, and checked that the output binaries are 32-bits. It was tested as well if they actually boot on hardware. Signed-off-by: Benoît Allard <benoit.allard@greenbone.net> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
61 lines
1.9 KiB
Diff
61 lines
1.9 KiB
Diff
From e000251144056c99e390a2a4449d06cbd2a19c0a Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Beno=C3=AEt=20Allard?= <benoit.allard@greenbone.net>
|
|
Date: Wed, 5 Apr 2017 14:25:02 +0200
|
|
Subject: [PATCH] utils: Use the host toolchain to build.
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
The utilities are meant to run on the host machine, hence must be built using
|
|
the host toolchain.
|
|
|
|
Signed-off-by: Benoît Allard <benoit.allard@greenbone.net>
|
|
---
|
|
utils/Makefile | 12 ++++++------
|
|
1 file changed, 6 insertions(+), 6 deletions(-)
|
|
|
|
diff --git a/utils/Makefile b/utils/Makefile
|
|
index dfe6259..ac91aaa 100644
|
|
--- a/utils/Makefile
|
|
+++ b/utils/Makefile
|
|
@@ -17,8 +17,8 @@
|
|
VPATH = $(SRC)
|
|
include $(MAKEDIR)/syslinux.mk
|
|
|
|
-CFLAGS = $(GCCWARN) -Os -fomit-frame-pointer -D_FILE_OFFSET_BITS=64 -I$(SRC)
|
|
-LDFLAGS = -O2
|
|
+CFLAGS = $(CFLAGS_FOR_BUILD) $(GCCWARN) -Os -fomit-frame-pointer -D_FILE_OFFSET_BITS=64 -I$(SRC)
|
|
+LDFLAGS = $(LDFLAGS_FOR_BUILD) -O2
|
|
|
|
C_TARGETS = isohybrid gethostip memdiskfind
|
|
SCRIPT_TARGETS = mkdiskimage
|
|
@@ -35,7 +35,7 @@ ISOHDPFX = $(addprefix $(OBJ)/,../mbr/isohdpfx.bin ../mbr/isohdpfx_f.bin \
|
|
all: $(TARGETS)
|
|
|
|
%.o: %.c
|
|
- $(CC) $(UMAKEDEPS) $(CFLAGS) -c -o $@ $<
|
|
+ $(CC_FOR_BUILD) $(UMAKEDEPS) $(CFLAGS) -c -o $@ $<
|
|
|
|
mkdiskimage: mkdiskimage.in ../mbr/mbr.bin bin2hex.pl
|
|
$(PERL) $(SRC)/bin2hex.pl < $(OBJ)/../mbr/mbr.bin | cat $(SRC)/mkdiskimage.in - > $@
|
|
@@ -51,13 +51,13 @@ isohdpfx.c: $(ISOHDPFX) isohdpfxarray.pl
|
|
$(PERL) $(SRC)/isohdpfxarray.pl $(ISOHDPFX) > $@
|
|
|
|
isohybrid: isohybrid.o isohdpfx.o
|
|
- $(CC) $(LDFLAGS) -o $@ $^ -luuid
|
|
+ $(CC_FOR_BUILD) $(LDFLAGS) -o $@ $^ -luuid
|
|
|
|
gethostip: gethostip.o
|
|
- $(CC) $(LDFLAGS) -o $@ $^
|
|
+ $(CC_FOR_BUILD) $(LDFLAGS) -o $@ $^
|
|
|
|
memdiskfind: memdiskfind.o
|
|
- $(CC) $(LDFLAGS) -o $@ $^
|
|
+ $(CC_FOR_BUILD) $(LDFLAGS) -o $@ $^
|
|
|
|
tidy dist:
|
|
rm -f *.o .*.d isohdpfx.c
|
|
--
|
|
2.1.4
|
|
|