summaryrefslogtreecommitdiffstats
path: root/recipes-extended/ipxe/files
diff options
context:
space:
mode:
authorChristopher Clark <christopher.w.clark@gmail.com>2019-02-20 16:52:03 -0800
committerBruce Ashfield <bruce.ashfield@gmail.com>2019-02-21 03:15:23 +0000
commit4cbd6c2b467c1f4caa32b2f782072739ab373065 (patch)
treee5a1030c245f5af901ffb321523289e2ae8574b4 /recipes-extended/ipxe/files
parentaea2a3531a11beca9b7cb769b2f6ea6c699b06a6 (diff)
downloadmeta-virtualization-4cbd6c2b467c1f4caa32b2f782072739ab373065.tar.gz
ipxe: Uprev and fix host compiler and linker flags.
Adds patch to fix detection of the "no-pie" vs "nopie" flag, which needs to be performed for both the host and target compilers; cannot assume that one works for the other. Use EXTRA_HOST_CFLAGS and EXTRA_HOST_LDFLAGS variables for passing the host tool build parameters: BUILD_CFLAGS and BUILD_LDFLAGS. Drop unneeded 'NO_WERROR=1' from the recipe and rewrap line. Uprev commit to latest git revision. Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Diffstat (limited to 'recipes-extended/ipxe/files')
-rw-r--r--recipes-extended/ipxe/files/ipxe-fix-hostcc-nopie-cflags.patch68
1 files changed, 68 insertions, 0 deletions
diff --git a/recipes-extended/ipxe/files/ipxe-fix-hostcc-nopie-cflags.patch b/recipes-extended/ipxe/files/ipxe-fix-hostcc-nopie-cflags.patch
new file mode 100644
index 00000000..da154a6f
--- /dev/null
+++ b/recipes-extended/ipxe/files/ipxe-fix-hostcc-nopie-cflags.patch
@@ -0,0 +1,68 @@
1Fix detection of host compiler "no-pie"/"nopie" and link flags.
2
3Detection of the "no-pie" vs "nopie" flag needs to be performed for both
4the host and target compilers; cannot assume that one works for the other.
5
6Use EXTRA_HOST_CFLAGS and EXTRA_HOST_LDFLAGS variables for passing
7host tool parameters if required. Removes previous hardcoded "-O2 -g".
8
9Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com>
10diff --git a/Makefile.housekeeping b/Makefile.housekeeping
11index f833492..5451c39 100644
12--- a/Makefile.housekeeping
13+++ b/Makefile.housekeeping
14@@ -133,6 +133,7 @@ eval :
15 WORKAROUND_CFLAGS :=
16 WORKAROUND_ASFLAGS :=
17 WORKAROUND_LDFLAGS :=
18+WORKAROUND_HOST_CFLAGS :=
19
20 # Make syntax does not allow use of comma or space in certain places.
21 # This ugly workaround is suggested in the manual.
22@@ -445,7 +446,7 @@ endif
23 CFLAGS += $(WORKAROUND_CFLAGS) $(EXTRA_CFLAGS)
24 ASFLAGS += $(WORKAROUND_ASFLAGS) $(EXTRA_ASFLAGS)
25 LDFLAGS += $(WORKAROUND_LDFLAGS) $(EXTRA_LDFLAGS)
26-HOST_CFLAGS += $(WORKAROUND_CFLAGS) -O2 -g
27+HOST_CFLAGS += $(WORKAROUND_HOST_CFLAGS) $(EXTRA_HOST_CFLAGS)
28
29 # Inhibit -Werror if NO_WERROR is specified on make command line
30 #
31@@ -1375,7 +1376,7 @@ endif # defined(BIN)
32 # The compression utilities
33 #
34
35-ZBIN_LDFLAGS := -llzma
36+ZBIN_LDFLAGS := -llzma $(EXTRA_HOST_LDFLAGS)
37
38 $(ZBIN) : util/zbin.c $(MAKEDEPS)
39 $(QM)$(ECHO) " [HOSTCC] $@"
40diff --git a/arch/i386/Makefile b/arch/i386/Makefile
41index b7c2792..4a637ad 100644
42--- a/arch/i386/Makefile
43+++ b/arch/i386/Makefile
44@@ -78,11 +78,20 @@ CFLAGS += -Ui386
45 # -nopie. We therefore test for both.
46 #
47 ifeq ($(CCTYPE),gcc)
48-PIE_TEST = [ -z "`$(CC) -fno-PIE -no-pie -x c -c /dev/null -o /dev/null 2>&1`" ]
49-PIE_FLAGS := $(shell $(PIE_TEST) && $(ECHO) '-fno-PIE -no-pie')
50-PIE_TEST2 = [ -z "`$(CC) -fno-PIE -nopie -x c -c /dev/null -o /dev/null 2>&1`" ]
51+PIE_TEST1_FLAGS = "-fno-PIE -no-pie -x c -c /dev/null -o /dev/null 2>&1"
52+PIE_TEST2_FLAGS = "-fno-PIE -nopie -x c -c /dev/null -o /dev/null 2>&1"
53+
54+PIE_TEST1 = [ -z "`$(CC) "$(PIE_TEST1_FLAGS)"`" ]
55+PIE_TEST2 = [ -z "`$(CC) "$(PIE_TEST2_FLAGS)"`" ]
56+PIE_FLAGS1 := $(shell $(PIE_TEST1) && $(ECHO) '-fno-PIE -no-pie')
57 PIE_FLAGS2 := $(shell $(PIE_TEST2) && $(ECHO) '-fno-PIE -nopie')
58-WORKAROUND_CFLAGS += $(PIE_FLAGS) $(PIE_FLAGS2)
59+WORKAROUND_CFLAGS += $(PIE_FLAGS1) $(PIE_FLAGS2)
60+
61+HOST_PIE_TEST1 = [ -z "`$(HOSTCC) "$(PIE_TEST1_FLAGS)"`" ]
62+HOST_PIE_TEST2 = [ -z "`$(HOSTCC) "$(PIE_TEST2_FLAGS)"`" ]
63+HOST_PIE_FLAGS1 := $(shell $(HOST_PIE_TEST1) && $(ECHO) '-fno-PIE -no-pie')
64+HOST_PIE_FLAGS2 := $(shell $(HOST_PIE_TEST2) && $(ECHO) '-fno-PIE -nopie')
65+WORKAROUND_HOST_CFLAGS += $(HOST_PIE_FLAGS1) $(HOST_PIE_FLAGS2)
66 endif
67
68 # i386-specific directories containing source files