start-stop-daemon: Recognise musleabi triplet in dpkg
PATCH 1/2 start-stop-daemon: Recognise musleabi triplet in dpkg
--- .../0001-Add-linux-musleabi-to-ostable.patch | 39 +++++++++++++++++++ .../start-stop-daemon_1.17.25.bb | 1 + 2 files changed, 40 insertions(+) create mode 100644 meta-oe/recipes-support/start-stop-daemon/start-stop-daemon/0001-Add-linux-musleabi-to-ostable.patch
meta-oe/recipes-support/start-stop-daemon/start-stop-daemon/0001-Add-linux-musleabi-to-ostable.patch new file +39 -0
@@ -0,0 +1,39 @@ +From 087840efdbc86b1432ebdd81f25b4cb78c75f818 Mon Sep 17 00:00:00 2001 +From: Khem Raj <[email protected]> +Date: Tue, 11 Sep 2018 12:28:10 -0700 +Subject: [PATCH] Add linux-musleabi to ostable + +Upstream-Status: Pending +Signed-off-by: Khem Raj <[email protected]> +--- + ostable | 1 + + triplettable | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/ostable b/ostable +index 3bb6819..d0ffdc7 100644 +--- a/ostable ++++ b/ostable +@@ -15,6 +15,7 @@ + uclibceabi-linux linux-uclibceabi linux[^-]*-uclibceabi + uclibc-linux linux-uclibc linux[^-]*-uclibc + musleabihf-linux linux-musleabihf linux[^-]*-musleabihf ++musleabi-linux linux-musleabi linux[^-]*-musleabi + musl-linux linux-musl linux[^-]*-musl + gnueabihf-linux linux-gnueabihf linux[^-]*-gnueabihf + gnueabi-linux linux-gnueabi linux[^-]*-gnueabi +diff --git a/triplettable b/triplettable +index 7257744..45864c3 100644 +--- a/triplettable ++++ b/triplettable +@@ -6,6 +6,7 @@ + uclibceabi-linux-arm uclibc-linux-armel + uclibc-linux-<cpu> uclibc-linux-<cpu> + musleabihf-linux-arm musl-linux-armhf ++musleabi-linux-arm musl-linux-arm + musl-linux-<cpu> musl-linux-<cpu> + gnueabihf-linux-arm armhf + gnueabi-linux-arm armel +-- +2.18.0 +
meta-oe/recipes-support/start-stop-daemon/start-stop-daemon_1.17.25.bb +1 -0
@@ -9,6 +9,7 @@ RCONFLICTS_${PN} = "dpkg" SRC_URI = " \ ${DEBIAN_MIRROR}/main/d/dpkg/dpkg_${PV}.tar.xz \ file://0001-dpkg-start-stop-daemon-Accept-SIG-prefixed-signal-na.patch \ + file://0001-Add-linux-musleabi-to-ostable.patch \ " SRC_URI[md5sum] = "e48fcfdb2162e77d72c2a83432d537ca"
Signature · 1 line
2.18.0
PATCH 2/2 klibc: Fix build with security flags
Drop -Os which is also causing the relro
Fixes
| x86_64-bec-linux-musl-ld.bfd: discarded output section: `.got.plt'
--- ...libc-Kbuild-Accept-EXTRA_KLIBCAFLAGS.patch | 28 +++++++++++++++++++ .../recipes-devtools/klibc/klibc.inc | 9 +++--- 2 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-klibc-Kbuild-Accept-EXTRA_KLIBCAFLAGS.patch
meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-klibc-Kbuild-Accept-EXTRA_KLIBCAFLAGS.patch new file +28 -0
@@ -0,0 +1,28 @@ +From cdc6edc2cfcd0ce88d6e66654d605dad303b1a75 Mon Sep 17 00:00:00 2001 +From: Khem Raj <[email protected]> +Date: Tue, 11 Sep 2018 17:03:36 -0700 +Subject: [PATCH] klibc/Kbuild: Accept EXTRA_KLIBCAFLAGS + +For passing additional assembler flags + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <[email protected]> +--- + usr/klibc/Kbuild | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/usr/klibc/Kbuild b/usr/klibc/Kbuild +index 98caf2e9..b34521e0 100644 +--- a/usr/klibc/Kbuild ++++ b/usr/klibc/Kbuild +@@ -168,7 +168,8 @@ $(SOHASH): $(SOLIB) $(SOLIB).hash + targets += interp.o + + quiet_cmd_interp = BUILD $@ +- cmd_interp = $(KLIBCCC) $(klibccflags) -D__ASSEMBLY__ \ ++ cmd_interp = $(KLIBCCC) $(klibccflags) $(EXTRA_KLIBCAFLAGS) \ ++ -D__ASSEMBLY__ \ + -DLIBDIR=\"$(SHLIBDIR)\" \ + -DSOHASH=\"$(SOLIBHASH)\" \ + -c -o $@ $<
meta-initramfs/recipes-devtools/klibc/klibc.inc +5 -4
@@ -21,9 +21,10 @@ SRC_URI = "git://git.kernel.org/pub/scm/libs/klibc/klibc.git \ file://0001-Kbuild.klibc-Use-print-libgcc-file-name-instead-of-p.patch \ file://0001-Kbuild.klibc-Add-path-to-compiler-headers-via-isyste.patch \ file://0001-arm-Do-not-set-a-fallback-march-and-mtune.patch \ - file://0001-klibc_2.0.4-add-kexec_file_load-syscall.patch \ + file://0001-klibc_2.0.4-add-kexec_file_load-syscall.patch \ file://0001-klibc-add-getrandom-syscall.patch \ -" + file://0001-klibc-Kbuild-Accept-EXTRA_KLIBCAFLAGS.patch \ + " ARMPATCHES ?= ""
@@ -31,7 +32,6 @@ ARMPATCHES_arm = "file://klibc-config-eabi.patch \ file://armv4-fix-v4bx.patch \ " - S = "${WORKDIR}/git" PARALLEL_MAKE = ""
@@ -44,9 +44,10 @@ EXTRA_OEMAKE = "'KLIBCARCH=${KLIBC_ARCH}' \ 'INSTALLDIR=${libdir}/klibc' \ 'SHLIBDIR=${libdir}' \ '${KLIBCTHUMB}' \ - 'KLIBCOPTFLAGS=${TUNE_CCARGS} -Os' \ + 'KLIBCOPTFLAGS=${TUNE_CCARGS}' \ V=1 \ " +EXTRA_OEMAKE += 'EXTRA_KLIBCAFLAGS="-Wa,--noexecstack" EXTRA_KLIBCLDFLAGS="-z noexecstack"' export FIX_ARMV4_EABI_BX = "${FIX_V4BX}" KLIBCTHUMB = "${@['CONFIG_KLIBC_THUMB=n', 'CONFIG_KLIBC_THUMB=y'][(d.getVar('ARM_INSTRUCTION_SET') == 'thumb')]}"
Signature · 1 line
2.18.0
Re: [meta-initramfs][PATCH 2/2] klibc: Fix build with security flags
Khem,
build with gcc still fails:
# i586-oe-linux-musl-ld.bfd -m elf_i386 -o usr/kinit/ipconfig/shared/ipc onfig -z noexecstack -e main usr/klibc/interp.o --start-group usr/kinit/ipconfig/main.o usr/kinit/ipconfig/netdev.o usr/kinit/ipconfig/packet.o usr/kinit/ipconfig/dhcp_proto.o usr/kinit/ipconfig/bootp_proto.o -R usr/klibc/libc.so /tmp/build/tmp-musl/work/i586-oe-linux-musl/klibc/2.0.4-r0/recipe-sysroot/usr/lib/i586-oe-linux-musl/*/libgcc.a --end-group i586-oe-linux-musl-ld.bfd: discarded output section: `.got.plt'
However, adding -pie to ld invocation seems solving the problem.
root@andrea-ThinkPad-T520:/tmp/build/tmp-musl/work/i586-oe-linux-musl/klibc/2.0.4-r0/git# i586-oe-linux-musl-ld.bfd -m elf_i386 -o usr/kinit/ipconfig/shared/ipc
onfig -z noexecstack -e main usr/klibc/interp.o --start-groupusr/kinit/ipconfig/main.o usr/kinit/ipconfig/netdev.ousr/kinit/ipconfig/packet.o usr/kinit/ipconfig/dhcp_proto.ousr/kinit/ipconfig/bootp_proto.o -R usr/klibc/libc.so /tmp/build/tmp-musl/work/i586-oe-linux-musl/klibc/2.0.4-r0/recipe-sysroot/usr/lib/i586-oe-linux-musl/*/libgcc.a --end-group -pie root@andrea-ThinkPad-T520:/tmp/build/tmp-musl/work/i586-oe-linux-musl/klibc/2.0.4-r0/git#
Cheers
Andrea
Quoted 87 lines · Khem Raj
Drop -Os which is also causing the relro
Fixes
| x86_64-bec-linux-musl-ld.bfd: discarded output section: `.got.plt'Signed-off-by Khem Raj <[email protected]>Cc Andrea Adami <[email protected]>--- ...libc-Kbuild-Accept-EXTRA_KLIBCAFLAGS.patch | 28 +++++++++++++++++++ .../recipes-devtools/klibc/klibc.inc | 9 +++--- 2 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-klibc-Kbuild-Accept-EXTRA_KLIBCAFLAGS.patchmeta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-klibc-Kbuild-Accept-EXTRA_KLIBCAFLAGS.patch new file +28
-0@@ -0,0 +1,28 @@ +From cdc6edc2cfcd0ce88d6e66654d605dad303b1a75 Mon Sep 17 00:00:00 2001 +From: Khem Raj <[email protected]> +Date: Tue, 11 Sep 2018 17:03:36 -0700 +Subject: [PATCH] klibc/Kbuild: Accept EXTRA_KLIBCAFLAGS + +For passing additional assembler flags + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <[email protected]> +--- + usr/klibc/Kbuild | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/usr/klibc/Kbuild b/usr/klibc/Kbuild +index 98caf2e9..b34521e0 100644 +--- a/usr/klibc/Kbuild ++++ b/usr/klibc/Kbuild +@@ -168,7 +168,8 @@ $(SOHASH): $(SOLIB) $(SOLIB).hash + targets += interp.o + + quiet_cmd_interp = BUILD $@ +- cmd_interp = $(KLIBCCC) $(klibccflags) -D__ASSEMBLY__ \ ++ cmd_interp = $(KLIBCCC) $(klibccflags) $(EXTRA_KLIBCAFLAGS) \ ++ -D__ASSEMBLY__ \ + -DLIBDIR=\"$(SHLIBDIR)\" \ + -DSOHASH=\"$(SOLIBHASH)\" \ + -c -o $@ $<meta-initramfs/recipes-devtools/klibc/klibc.inc +5
-5@@ -21,9 +21,10 @@ SRC_URI = "git://git.kernel.org/pub/scm/libs/klibc/klibc.git \ file://0001-Kbuild.klibc-Use-print-libgcc-file-name-instead-of-p.patch \ file://0001-Kbuild.klibc-Add-path-to-compiler-headers-via-isyste.patch \ file://0001-arm-Do-not-set-a-fallback-march-and-mtune.patch \ - file://0001-klibc_2.0.4-add-kexec_file_load-syscall.patch \ + file://0001-klibc_2.0.4-add-kexec_file_load-syscall.patch \ file://0001-klibc-add-getrandom-syscall.patch \ -" + file://0001-klibc-Kbuild-Accept-EXTRA_KLIBCAFLAGS.patch \ + " ARMPATCHES ?= ""@@ -31,7 +32,6 @@ ARMPATCHES_arm = "file://klibc-config-eabi.patch \ file://armv4-fix-v4bx.patch \ " - S = "${WORKDIR}/git" PARALLEL_MAKE = ""@@ -44,9 +44,10 @@ EXTRA_OEMAKE = "'KLIBCARCH=${KLIBC_ARCH}' \ 'INSTALLDIR=${libdir}/klibc' \ 'SHLIBDIR=${libdir}' \ '${KLIBCTHUMB}' \ - 'KLIBCOPTFLAGS=${TUNE_CCARGS} -Os' \ + 'KLIBCOPTFLAGS=${TUNE_CCARGS}' \ V=1 \ " +EXTRA_OEMAKE += 'EXTRA_KLIBCAFLAGS="-Wa,--noexecstack" EXTRA_KLIBCLDFLAGS="-z noexecstack"' export FIX_ARMV4_EABI_BX = "${FIX_V4BX}" KLIBCTHUMB = "${@['CONFIG_KLIBC_THUMB=n', 'CONFIG_KLIBC_THUMB=y'][(d.getVar('ARM_INSTRUCTION_SET') == 'thumb')]}" --2.18.0
Re: [meta-initramfs][PATCH 2/2] klibc: Fix build with security flags
Khem,
with this fix it builds (I removed the two bottom lines)
(quoted diff) +0 -0
b/meta-initramfs/recipes-devtools/klibc/klibc.inc
index 3d25e96..57f32ac 100644
meta-initramfs/recipes-devtools/klibc/klibc.inc +0 -1
@@ -47,7 +47,7 @@ EXTRA_OEMAKE = "'KLIBCARCH=${KLIBC_ARCH}' \ 'KLIBCOPTFLAGS=${TUNE_CCARGS}' \ V=1 \ " -EXTRA_OEMAKE += 'EXTRA_KLIBCAFLAGS="-Wa,--noexecstack"
EXTRA_KLIBCLDFLAGS="-z noexecstack"' +EXTRA_OEMAKE += 'EXTRA_KLIBCAFLAGS="-Wa,--noexecstack" EXTRA_KLIBCLDFLAGS="-pie it -z noexecstack"'
export FIX_ARMV4_EABI_BX = "${FIX_V4BX}" KLIBCTHUMB = "${@['CONFIG_KLIBC_THUMB=n',
'CONFIG_KLIBC_THUMB=y'][(d.getVar('ARM_INSTRUCTION_SET') == 'thumb')]}"
@@ -73,6 +73,3 @@ KLIBC_ARCH_x86-64 = "x86_64"
KLIBC_ARCH_powerpc = "ppc"
KLIBC_ARCH_powerpc64 = "ppc64"
THIS_LIBKLIBC = "libklibc (= ${PV}-${PR})"
-
-SECURITY_CFLAGS = "-fno-PIE -no-pie" -SECURITY_LDFLAGS = "-no-pie"
Quoted 119 lines · Andrea Adami
Khem,
build with gcc still fails:
# i586-oe-linux-musl-ld.bfd -m elf_i386 -o usr/kinit/ipconfig/shared/ipc onfig -z noexecstack -e main usr/klibc/interp.o --start-group usr/kinit/ipconfig/main.o usr/kinit/ipconfig/netdev.o usr/kinit/ipconfig/packet.o usr/kinit/ipconfig/dhcp_proto.o usr/kinit/ipconfig/bootp_proto.o -R usr/klibc/libc.so /tmp/build/tmp-musl/work/i586-oe-linux-musl/klibc/2.0.4-r0/recipe-sysroot/usr/lib/i586-oe-linux-musl/*/libgcc.a --end-group i586-oe-linux-musl-ld.bfd: discarded output section: `.got.plt'However, adding -pie to ld invocation seems solving the problem.
root@andrea-ThinkPad-T520:/tmp/build/tmp-musl/work/i586-oe-linux-musl/klibc/2.0.4-r0/git# i586-oe-linux-musl-ld.bfd -m
elf_i386-ousr/kinit/ipconfig/shared/ipc
onfig -z noexecstack -e mainusr/klibc/interp.o--start-groupusr/kinit/ipconfig/main.ousr/kinit/ipconfig/netdev.ousr/kinit/ipconfig/packet.ousr/kinit/ipconfig/dhcp_proto.ousr/kinit/ipconfig/bootp_proto.o-Rusr/klibc/libc.so/tmp/build/tmp-musl/work/i586-oe-linux-musl/klibc/2.0.4-r0/recipe-sysroot/usr/lib/i586-oe-linux-musl/*/libgcc.a--end-group -pie root@andrea-ThinkPad-T520:/tmp/build/tmp-musl/work/i586-oe-linux-musl/klibc/2.0.4-r0/git#Cheers
AndreaQuoted 87 lines · Khem Raj
Drop -Os which is also causing the relro
Fixes
| x86_64-bec-linux-musl-ld.bfd: discarded output section: `.got.plt'Signed-off-by Khem Raj <[email protected]>Cc Andrea Adami <[email protected]>--- ...libc-Kbuild-Accept-EXTRA_KLIBCAFLAGS.patch | 28 +++++++++++++++++++ .../recipes-devtools/klibc/klibc.inc | 9 +++--- 2 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-klibc-Kbuild-Accept-EXTRA_KLIBCAFLAGS.patchmeta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-klibc-Kbuild-Accept-EXTRA_KLIBCAFLAGS.patch new file +28
-0@@ -0,0 +1,28 @@ +From cdc6edc2cfcd0ce88d6e66654d605dad303b1a75 Mon Sep 17 00:00:00 2001 +From: Khem Raj <[email protected]> +Date: Tue, 11 Sep 2018 17:03:36 -0700 +Subject: [PATCH] klibc/Kbuild: Accept EXTRA_KLIBCAFLAGS + +For passing additional assembler flags + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <[email protected]> +--- + usr/klibc/Kbuild | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/usr/klibc/Kbuild b/usr/klibc/Kbuild +index 98caf2e9..b34521e0 100644 +--- a/usr/klibc/Kbuild ++++ b/usr/klibc/Kbuild +@@ -168,7 +168,8 @@ $(SOHASH): $(SOLIB) $(SOLIB).hash + targets += interp.o + + quiet_cmd_interp = BUILD $@ +- cmd_interp = $(KLIBCCC) $(klibccflags) -D__ASSEMBLY__ \ ++ cmd_interp = $(KLIBCCC) $(klibccflags) $(EXTRA_KLIBCAFLAGS) \ ++ -D__ASSEMBLY__ \ + -DLIBDIR=\"$(SHLIBDIR)\" \ + -DSOHASH=\"$(SOLIBHASH)\" \ + -c -o $@ $<meta-initramfs/recipes-devtools/klibc/klibc.inc +5
-5@@ -21,9 +21,10 @@ SRC_URI = "git://git.kernel.org/pub/scm/libs/klibc/klibc.git \ file://0001-Kbuild.klibc-Use-print-libgcc-file-name-instead-of-p.patch \ file://0001-Kbuild.klibc-Add-path-to-compiler-headers-via-isyste.patch \ file://0001-arm-Do-not-set-a-fallback-march-and-mtune.patch \ - file://0001-klibc_2.0.4-add-kexec_file_load-syscall.patch \ + file://0001-klibc_2.0.4-add-kexec_file_load-syscall.patch \ file://0001-klibc-add-getrandom-syscall.patch \ -" + file://0001-klibc-Kbuild-Accept-EXTRA_KLIBCAFLAGS.patch \ + " ARMPATCHES ?= ""@@ -31,7 +32,6 @@ ARMPATCHES_arm = "file://klibc-config-eabi.patch \ file://armv4-fix-v4bx.patch \ " - S = "${WORKDIR}/git" PARALLEL_MAKE = ""@@ -44,9 +44,10 @@ EXTRA_OEMAKE = "'KLIBCARCH=${KLIBC_ARCH}' \ 'INSTALLDIR=${libdir}/klibc' \ 'SHLIBDIR=${libdir}' \ '${KLIBCTHUMB}' \ - 'KLIBCOPTFLAGS=${TUNE_CCARGS} -Os' \ + 'KLIBCOPTFLAGS=${TUNE_CCARGS}' \ V=1 \ " +EXTRA_OEMAKE += 'EXTRA_KLIBCAFLAGS="-Wa,--noexecstack" EXTRA_KLIBCLDFLAGS="-z noexecstack"' export FIX_ARMV4_EABI_BX = "${FIX_V4BX}" KLIBCTHUMB = "${@['CONFIG_KLIBC_THUMB=n', 'CONFIG_KLIBC_THUMB=y'][(d.getVar('ARM_INSTRUCTION_SET') == 'thumb')]}" --2.18.0
Re: [meta-initramfs][PATCH 2/2] klibc: Fix build with security flags
Thanks! can you cook a patch and send
Quoted 149 lines · Andrea Adami
Khem,
with this fix it builds (I removed the two bottom lines)
meta-initramfs/recipes-devtools/klibc/klibc.inc +0
-1@@ -47,7 +47,7 @@ EXTRA_OEMAKE = "'KLIBCARCH=${KLIBC_ARCH}' \ 'KLIBCOPTFLAGS=${TUNE_CCARGS}' \ V=1 \ " -EXTRA_OEMAKE += 'EXTRA_KLIBCAFLAGS="-Wa,--noexecstack"EXTRA_KLIBCLDFLAGS="-z noexecstack"' +EXTRA_OEMAKE += 'EXTRA_KLIBCAFLAGS="-Wa,--noexecstack" EXTRA_KLIBCLDFLAGS="-pie it -z noexecstack"'
export
FIX_ARMV4_EABI_BX= "${FIX_V4BX}" KLIBCTHUMB = "${@['CONFIG_KLIBC_THUMB=n',
'CONFIG_KLIBC_THUMB=y'][(d.getVar('ARM_INSTRUCTION_SET')== 'thumb')]}"meta-initramfs/recipes-devtools/klibc/klibc.inc +0
-3@@ -73,6 +73,3 @@ KLIBC_ARCH_x86-64 = "x86_64" KLIBC_ARCH_powerpc = "ppc" KLIBC_ARCH_powerpc64 = "ppc64" THIS_LIBKLIBC = "libklibc (= ${PV}-${PR})" - -SECURITY_CFLAGS = "-fno-PIE -no-pie" -SECURITY_LDFLAGS = "-no-pie"Quoted 119 lines · Andrea Adami
Khem,
build with gcc still fails:
# i586-oe-linux-musl-ld.bfd -m elf_i386 -o usr/kinit/ipconfig/shared/ipc onfig -z noexecstack -e main usr/klibc/interp.o --start-group usr/kinit/ipconfig/main.o usr/kinit/ipconfig/netdev.o usr/kinit/ipconfig/packet.o usr/kinit/ipconfig/dhcp_proto.o usr/kinit/ipconfig/bootp_proto.o -R usr/klibc/libc.so /tmp/build/tmp-musl/work/i586-oe-linux-musl/klibc/2.0.4-r0/recipe-sysroot/usr/lib/i586-oe-linux-musl/*/libgcc.a --end-group i586-oe-linux-musl-ld.bfd: discarded output section: `.got.plt'However, adding -pie to ld invocation seems solving the problem.
root@andrea-ThinkPad-T520:/tmp/build/tmp-musl/work/i586-oe-linux-musl/klibc/2.0.4-r0/git# i586-oe-linux-musl-ld.bfd -m
elf_i386-ousr/kinit/ipconfig/shared/ipc
onfig -z noexecstack -e mainusr/klibc/interp.o--start-groupusr/kinit/ipconfig/main.ousr/kinit/ipconfig/netdev.ousr/kinit/ipconfig/packet.ousr/kinit/ipconfig/dhcp_proto.ousr/kinit/ipconfig/bootp_proto.o-Rusr/klibc/libc.so/tmp/build/tmp-musl/work/i586-oe-linux-musl/klibc/2.0.4-r0/recipe-sysroot/usr/lib/i586-oe-linux-musl/*/libgcc.a--end-group -pie root@andrea-ThinkPad-T520:/tmp/build/tmp-musl/work/i586-oe-linux-musl/klibc/2.0.4-r0/git#Cheers
AndreaQuoted 87 lines · Khem Raj
Drop -Os which is also causing the relro
Fixes
| x86_64-bec-linux-musl-ld.bfd: discarded output section: `.got.plt'Signed-off-by Khem Raj <[email protected]>Cc Andrea Adami <[email protected]>--- ...libc-Kbuild-Accept-EXTRA_KLIBCAFLAGS.patch | 28 +++++++++++++++++++ .../recipes-devtools/klibc/klibc.inc | 9 +++--- 2 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-klibc-Kbuild-Accept-EXTRA_KLIBCAFLAGS.patchmeta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-klibc-Kbuild-Accept-EXTRA_KLIBCAFLAGS.patch new file +28
-0@@ -0,0 +1,28 @@ +From cdc6edc2cfcd0ce88d6e66654d605dad303b1a75 Mon Sep 17 00:00:00 2001 +From: Khem Raj <[email protected]> +Date: Tue, 11 Sep 2018 17:03:36 -0700 +Subject: [PATCH] klibc/Kbuild: Accept EXTRA_KLIBCAFLAGS + +For passing additional assembler flags + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <[email protected]> +--- + usr/klibc/Kbuild | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/usr/klibc/Kbuild b/usr/klibc/Kbuild +index 98caf2e9..b34521e0 100644 +--- a/usr/klibc/Kbuild ++++ b/usr/klibc/Kbuild +@@ -168,7 +168,8 @@ $(SOHASH): $(SOLIB) $(SOLIB).hash + targets += interp.o + + quiet_cmd_interp = BUILD $@ +- cmd_interp = $(KLIBCCC) $(klibccflags) -D__ASSEMBLY__ \ ++ cmd_interp = $(KLIBCCC) $(klibccflags) $(EXTRA_KLIBCAFLAGS) \ ++ -D__ASSEMBLY__ \ + -DLIBDIR=\"$(SHLIBDIR)\" \ + -DSOHASH=\"$(SOLIBHASH)\" \ + -c -o $@ $<meta-initramfs/recipes-devtools/klibc/klibc.inc +5
-5@@ -21,9 +21,10 @@ SRC_URI = "git://git.kernel.org/pub/scm/libs/klibc/klibc.git \ file://0001-Kbuild.klibc-Use-print-libgcc-file-name-instead-of-p.patch \ file://0001-Kbuild.klibc-Add-path-to-compiler-headers-via-isyste.patch \ file://0001-arm-Do-not-set-a-fallback-march-and-mtune.patch \ - file://0001-klibc_2.0.4-add-kexec_file_load-syscall.patch \ + file://0001-klibc_2.0.4-add-kexec_file_load-syscall.patch \ file://0001-klibc-add-getrandom-syscall.patch \ -" + file://0001-klibc-Kbuild-Accept-EXTRA_KLIBCAFLAGS.patch \ + " ARMPATCHES ?= ""@@ -31,7 +32,6 @@ ARMPATCHES_arm = "file://klibc-config-eabi.patch \ file://armv4-fix-v4bx.patch \ " - S = "${WORKDIR}/git" PARALLEL_MAKE = ""@@ -44,9 +44,10 @@ EXTRA_OEMAKE = "'KLIBCARCH=${KLIBC_ARCH}' \ 'INSTALLDIR=${libdir}/klibc' \ 'SHLIBDIR=${libdir}' \ '${KLIBCTHUMB}' \ - 'KLIBCOPTFLAGS=${TUNE_CCARGS} -Os' \ + 'KLIBCOPTFLAGS=${TUNE_CCARGS}' \ V=1 \ " +EXTRA_OEMAKE += 'EXTRA_KLIBCAFLAGS="-Wa,--noexecstack" EXTRA_KLIBCLDFLAGS="-z noexecstack"' export FIX_ARMV4_EABI_BX = "${FIX_V4BX}" KLIBCTHUMB = "${@['CONFIG_KLIBC_THUMB=n', 'CONFIG_KLIBC_THUMB=y'][(d.getVar('ARM_INSTRUCTION_SET') == 'thumb')]}" --2.18.0