xref: /OK3568_Linux_fs/buildroot/boot/syslinux/0004-utils-Use-the-host-toolchain-to-build.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1From e000251144056c99e390a2a4449d06cbd2a19c0a Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Beno=C3=AEt=20Allard?= <benoit.allard@greenbone.net>
3Date: Wed, 5 Apr 2017 14:25:02 +0200
4Subject: [PATCH] utils: Use the host toolchain to build.
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9The utilities are meant to run on the host machine, hence must be built using
10the host toolchain.
11
12Signed-off-by: Benoît Allard <benoit.allard@greenbone.net>
13---
14 utils/Makefile | 12 ++++++------
15 1 file changed, 6 insertions(+), 6 deletions(-)
16
17diff --git a/utils/Makefile b/utils/Makefile
18index dfe6259..ac91aaa 100644
19--- a/utils/Makefile
20+++ b/utils/Makefile
21@@ -17,8 +17,8 @@
22 VPATH = $(SRC)
23 include $(MAKEDIR)/syslinux.mk
24
25-CFLAGS   = $(GCCWARN) -Os -fomit-frame-pointer -D_FILE_OFFSET_BITS=64 -I$(SRC)
26-LDFLAGS  = -O2
27+CFLAGS   = $(CFLAGS_FOR_BUILD) $(GCCWARN) -Os -fomit-frame-pointer -D_FILE_OFFSET_BITS=64 -I$(SRC)
28+LDFLAGS  = $(LDFLAGS_FOR_BUILD) -O2
29
30 C_TARGETS	 = isohybrid gethostip memdiskfind
31 SCRIPT_TARGETS	 = mkdiskimage
32@@ -35,7 +35,7 @@ ISOHDPFX = $(addprefix $(OBJ)/,../mbr/isohdpfx.bin ../mbr/isohdpfx_f.bin \
33 all: $(TARGETS)
34
35 %.o: %.c
36-	$(CC) $(UMAKEDEPS) $(CFLAGS) -c -o $@ $<
37+	$(CC_FOR_BUILD) $(UMAKEDEPS) $(CFLAGS) -c -o $@ $<
38
39 mkdiskimage: mkdiskimage.in ../mbr/mbr.bin bin2hex.pl
40 	$(PERL) $(SRC)/bin2hex.pl < $(OBJ)/../mbr/mbr.bin | cat $(SRC)/mkdiskimage.in - > $@
41@@ -51,13 +51,13 @@ isohdpfx.c: $(ISOHDPFX) isohdpfxarray.pl
42 	$(PERL) $(SRC)/isohdpfxarray.pl $(ISOHDPFX) > $@
43
44 isohybrid: isohybrid.o isohdpfx.o
45-	$(CC) $(LDFLAGS) -o $@ $^ -luuid
46+	$(CC_FOR_BUILD) $(LDFLAGS) -o $@ $^ -luuid
47
48 gethostip: gethostip.o
49-	$(CC) $(LDFLAGS) -o $@ $^
50+	$(CC_FOR_BUILD) $(LDFLAGS) -o $@ $^
51
52 memdiskfind: memdiskfind.o
53-	$(CC) $(LDFLAGS) -o $@ $^
54+	$(CC_FOR_BUILD) $(LDFLAGS) -o $@ $^
55
56 tidy dist:
57 	rm -f *.o .*.d isohdpfx.c
58--
592.1.4
60
61