Skip to content

Commit a06c29b

Browse files
andrea-adamikraj
authored andcommitted
klibc: fix build with GCC and -pie for mips, mips64, aarch64
The MCONFIG makefiles for mips/mips64 do disable pic so we do not insist linking it with -pie. For aarch64 we have to readd the -Os optimization to avoid | usr/dash/shell.h:103:25: error: '-mgeneral-regs-only' is incompatible with floating-point argument as committed (c296fb7 klibc: Pass Optimization with KLIBCOPTFLAGS) but reverted (76bc58e klibc: Fix build with security flags) trying to fix the i386 build (see ld.bfd: discarded output section: `.got.plt'). This latter issue was fixed for i386 passing -pie to the linker. Signed-off-by: Andrea Adami <andrea.adami@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
1 parent a95dde2 commit a06c29b

File tree

1 file changed

+3
-1
lines changed
  • meta-initramfs/recipes-devtools/klibc

1 file changed

+3
-1
lines changed

meta-initramfs/recipes-devtools/klibc/klibc.inc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ EXTRA_OEMAKE = "'KLIBCARCH=${KLIBC_ARCH}' \
4444
'INSTALLDIR=${libdir}/klibc' \
4545
'SHLIBDIR=${libdir}' \
4646
'${KLIBCTHUMB}' \
47-
'KLIBCOPTFLAGS=${TUNE_CCARGS}' \
47+
'KLIBCOPTFLAGS=${TUNE_CCARGS} -Os' \
4848
V=1 \
4949
"
5050
EXTRA_OEMAKE += "'EXTRA_KLIBCAFLAGS=${SECURITY_CFLAGS} -Wa,--noexecstack' \
@@ -76,3 +76,5 @@ KLIBC_ARCH_powerpc64 = "ppc64"
7676
THIS_LIBKLIBC = "libklibc (= ${PV}-${PR})"
7777

7878
SECURITY_LDFLAGS = "${@'-z relro -z now -pie' if '${GCCPIE}' else ''}"
79+
SECURITY_LDFLAGS_mips = ""
80+
SECURITY_LDFLAGS_mips64 = ""

0 commit comments

Comments
 (0)