blob: 3f9ebd964f19d90654f9a009882b329fdbee10ef [file] [log] [blame]
Tim Windelschmidt12240f92025-04-28 14:59:33 +02001EDK2 doens't respect HOSTCFLAGS and HOSTLDFLAGS which we need to pass the sysroot
2and target flags to the compiler and linker.
3
4diff --git a/BaseTools/Source/C/VfrCompile/Pccts/dlg/makefile b/BaseTools/Source/C/VfrCompile/Pccts/dlg/makefile
5--- a/BaseTools/Source/C/VfrCompile/Pccts/dlg/makefile
6+++ b/BaseTools/Source/C/VfrCompile/Pccts/dlg/makefile
7@@ -131,16 +131,17 @@
8 COPT=-O
9 ANTLR=${BIN_DIR}/antlr
10 DLG=${BIN_DIR}/dlg
11 CFLAGS= $(COPT) -I. -I$(SET) -I$(PCCTS_H) -DUSER_ZZSYN -DZZLEXBUFSIZE=65536 -std=gnu11
12+CFLAGS += $(HOSTCFLAGS)
13 CPPFLAGS=
14 OBJ_EXT=o
15 OUT_OBJ = -o
16 OBJ = dlg_p.o dlg_a.o main.o err.o set.o support.o output.o \
17 relabel.o automata.o
18
19 $(BIN_DIR)/dlg : $(OBJ) $(SRC)
20- $(CC) $(CFLAGS) -o $(BIN_DIR)/dlg $(OBJ)
21+ $(CC) $(HOSTLDFLAGS) -o $(BIN_DIR)/dlg $(OBJ)
22
23 SRC = dlg_p.c dlg_a.c main.c err.c $(SET)/set.c support.c output.c \
24 relabel.c automata.c
25
26diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile b/BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile
27--- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile
28+++ b/BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile
29@@ -176,8 +176,9 @@
30 DLG=${BIN_DIR}/dlg
31 OBJ_EXT=o
32 OUT_OBJ = -o
33 CFLAGS= $(COPT) -I. -I$(SET) -I$(PCCTS_H) -DUSER_ZZSYN $(COTHER) -DZZLEXBUFSIZE=65536 -std=gnu11
34+CFLAGS += $(HOSTCFLAGS)
35 CPPFLAGS=
36 #
37 # SGI Users, use this CFLAGS
38 #
39@@ -185,9 +186,9 @@
40 OBJ=antlr.o scan.o err.o bits.o build.o fset2.o fset.o gen.o \
41 globals.o hash.o lex.o main.o misc.o set.o pred.o egman.o mrhoist.o fcache.o
42
43 $(BIN_DIR)/antlr : $(OBJ) $(SRC)
44- $(CC) $(CFLAGS) -o $(BIN_DIR)/antlr $(OBJ)
45+ $(CC) $(HOSTLDFLAGS) -o $(BIN_DIR)/antlr $(OBJ)
46
47 # what files does PCCTS generate (both ANTLR and DLG)
48 PCCTS_GEN=antlr.c scan.c err.c tokens.h mode.h parser.dlg stdpccts.h remap.h
49
50diff --git a/BaseTools/Source/C/GNUmakefile b/BaseTools/Source/C/GNUmakefile
51--- a/BaseTools/Source/C/GNUmakefile
52+++ b/BaseTools/Source/C/GNUmakefile
53@@ -50,9 +50,8 @@
54
55 LIBRARIES = Common
56 VFRAUTOGEN = VfrCompile/VfrLexer.h
57 APPLICATIONS = \
58- BrotliCompress \
59 VfrCompile \
60 EfiRom \
61 GenFfs \
62 GenFv \