hc
2023-11-22 f743a7adbd6e230d66a6206fa115b59fec2d88eb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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