diff options
| author | Christopher Clark <christopher.w.clark@gmail.com> | 2019-02-20 16:52:03 -0800 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2019-04-18 09:09:30 -0400 |
| commit | 9b568b6ae1bf1bebcb9552703ee40f9b880e07ed (patch) | |
| tree | 5d2cf951c6c1a5778517873afea92f5356142029 | |
| parent | 9e8c0c96b443828a255e7d6ca6291598347672ac (diff) | |
| download | meta-virtualization-9b568b6ae1bf1bebcb9552703ee40f9b880e07ed.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>
| -rw-r--r-- | recipes-extended/ipxe/files/ipxe-fix-hostcc-nopie-cflags.patch | 68 | ||||
| -rw-r--r-- | recipes-extended/ipxe/ipxe_git.bb | 15 |
2 files changed, 80 insertions, 3 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 @@ | |||
| 1 | Fix detection of host compiler "no-pie"/"nopie" and link flags. | ||
| 2 | |||
| 3 | Detection of the "no-pie" vs "nopie" flag needs to be performed for both | ||
| 4 | the host and target compilers; cannot assume that one works for the other. | ||
| 5 | |||
| 6 | Use EXTRA_HOST_CFLAGS and EXTRA_HOST_LDFLAGS variables for passing | ||
| 7 | host tool parameters if required. Removes previous hardcoded "-O2 -g". | ||
| 8 | |||
| 9 | Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com> | ||
| 10 | diff --git a/Makefile.housekeeping b/Makefile.housekeeping | ||
| 11 | index 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] $@" | ||
| 40 | diff --git a/arch/i386/Makefile b/arch/i386/Makefile | ||
| 41 | index 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 | ||
diff --git a/recipes-extended/ipxe/ipxe_git.bb b/recipes-extended/ipxe/ipxe_git.bb index 18c92d2b..1de0f21e 100644 --- a/recipes-extended/ipxe/ipxe_git.bb +++ b/recipes-extended/ipxe/ipxe_git.bb | |||
| @@ -4,15 +4,24 @@ LICENSE = "GPLv2" | |||
| 4 | DEPENDS = "binutils-native perl-native syslinux mtools-native cdrtools-native xz" | 4 | DEPENDS = "binutils-native perl-native syslinux mtools-native cdrtools-native xz" |
| 5 | LIC_FILES_CHKSUM = "file://../COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263" | 5 | LIC_FILES_CHKSUM = "file://../COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263" |
| 6 | 6 | ||
| 7 | SRCREV = "133f4c47baef6002b2ccb4904a035cda2303c6e5" | 7 | SRCREV = "64b4452bca04af433f1c98ab782c0e93cd5c88c0" |
| 8 | PV = "gitr${SRCPV}" | 8 | PV = "gitr${SRCPV}" |
| 9 | PR = "r0" | 9 | PR = "r0" |
| 10 | 10 | ||
| 11 | SRC_URI = "git://git.ipxe.org/ipxe.git;protocol=https" | 11 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" |
| 12 | |||
| 13 | SRC_URI = " \ | ||
| 14 | git://git.ipxe.org/ipxe.git;protocol=https \ | ||
| 15 | file://ipxe-fix-hostcc-nopie-cflags.patch \ | ||
| 16 | " | ||
| 12 | 17 | ||
| 13 | FILES_${PN} = "/usr/share/firmware/*.rom" | 18 | FILES_${PN} = "/usr/share/firmware/*.rom" |
| 14 | 19 | ||
| 15 | EXTRA_OEMAKE = "NO_WERROR=1 ISOLINUX_BIN="${STAGING_DIR_TARGET}/usr/share/syslinux/isolinux.bin" CROSS_COMPILE="${TARGET_PREFIX}"" | 20 | EXTRA_OEMAKE = " \ |
| 21 | ISOLINUX_BIN="${STAGING_DIR_TARGET}/usr/share/syslinux/isolinux.bin" \ | ||
| 22 | CROSS_COMPILE="${TARGET_PREFIX}" \ | ||
| 23 | EXTRA_HOST_CFLAGS="${BUILD_CFLAGS}" \ | ||
| 24 | EXTRA_HOST_LDFLAGS="${BUILD_LDFLAGS}"" | ||
| 16 | 25 | ||
| 17 | S = "${WORKDIR}/git/src" | 26 | S = "${WORKDIR}/git/src" |
| 18 | 27 | ||
