diff options
| author | Andrea Adami <andrea.adami@gmail.com> | 2014-09-19 23:09:29 +0200 |
|---|---|---|
| committer | Martin Jansa <Martin.Jansa@gmail.com> | 2014-09-26 05:41:54 +0200 |
| commit | 0a67b9f3fd164b808c66286ff0435c65421e5352 (patch) | |
| tree | 844fedb8ee378aa6924c4cf457b869e384efc66a | |
| parent | 2b32463cfc617a5497544e67afab50b1f3d0fc3c (diff) | |
| download | meta-openembedded-0a67b9f3fd164b808c66286ff0435c65421e5352.tar.gz | |
klibc: klcc: consider --sysroot option and override gcc-cross encoded sysroot
For the recipes built with klcc-cross it is necessary to
pass --sysroot otherwise we default to the one encoded in gcc-cross which
actually is the 'first one' built.
The issue was revealed when building for armv4 after having built for armv5te:
the produced binaries did contain Illegal Instruction (bx lr).
Use ${TOOLCHAIN_OPTIONS} variable to specify --sysroot=${STAGING_DIR_TARGET}
Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
| -rw-r--r-- | meta-initramfs/classes/klibc.bbclass | 4 | ||||
| -rw-r--r-- | meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/klcc-consider-sysroot.patch | 14 | ||||
| -rw-r--r-- | meta-initramfs/recipes-devtools/klibc/klibc.inc | 1 |
3 files changed, 17 insertions, 2 deletions
diff --git a/meta-initramfs/classes/klibc.bbclass b/meta-initramfs/classes/klibc.bbclass index ca741cd8b7..f864104cfb 100644 --- a/meta-initramfs/classes/klibc.bbclass +++ b/meta-initramfs/classes/klibc.bbclass | |||
| @@ -4,8 +4,8 @@ DEPENDS =+ "klcc-cross" | |||
| 4 | # Default for klcc is to build static binaries. | 4 | # Default for klcc is to build static binaries. |
| 5 | # Set CC = "${TARGET_PREFIX}klcc -shared" to build the dynamic version. | 5 | # Set CC = "${TARGET_PREFIX}klcc -shared" to build the dynamic version. |
| 6 | 6 | ||
| 7 | export CC = "${TARGET_PREFIX}klcc" | 7 | export CC = "${TARGET_PREFIX}klcc ${TOOLCHAIN_OPTIONS}" |
| 8 | export CC_armv4_linux-gnueabi = "${TARGET_PREFIX}klcc -march=armv4 -mthumb-interwork" | 8 | export CC_armv4_linux-gnueabi = "${TARGET_PREFIX}klcc ${TOOLCHAIN_OPTIONS} -march=armv4 -mthumb-interwork" |
| 9 | 9 | ||
| 10 | export CPP = "${CC} -E" | 10 | export CPP = "${CC} -E" |
| 11 | 11 | ||
diff --git a/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/klcc-consider-sysroot.patch b/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/klcc-consider-sysroot.patch new file mode 100644 index 0000000000..9bc4835dcd --- /dev/null +++ b/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/klcc-consider-sysroot.patch | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | diff --git a/klcc/klcc.in b/klcc/klcc.in | ||
| 2 | index 43d0984..61e9385 100644 | ||
| 3 | --- a/klcc/klcc.in | ||
| 4 | +++ b/klcc/klcc.in | ||
| 5 | @@ -204,6 +204,9 @@ while ( defined($a = shift(@ARGV)) ) { | ||
| 6 | # Libraries | ||
| 7 | push(@libs, $a); | ||
| 8 | push(@libs, shift(@ARGV)) if ( $2 eq '' ); | ||
| 9 | + } elsif ( $a =~ /^--([sysroot=])(.*)$/ ) { | ||
| 10 | + # Override gcc encoded sysroot | ||
| 11 | + push(@ccopt, $a); | ||
| 12 | } else { | ||
| 13 | die "$0: unknown option: $a\n"; | ||
| 14 | } | ||
diff --git a/meta-initramfs/recipes-devtools/klibc/klibc.inc b/meta-initramfs/recipes-devtools/klibc/klibc.inc index 0209b205e0..f3e9972a4f 100644 --- a/meta-initramfs/recipes-devtools/klibc/klibc.inc +++ b/meta-initramfs/recipes-devtools/klibc/klibc.inc | |||
| @@ -16,6 +16,7 @@ SRC_URI_append_linux-uclibceabi = " file://klibc-config-eabi.patch \ | |||
| 16 | " | 16 | " |
| 17 | SRC_URI += "file://klibc-linux-libc-dev.patch \ | 17 | SRC_URI += "file://klibc-linux-libc-dev.patch \ |
| 18 | file://staging.patch \ | 18 | file://staging.patch \ |
| 19 | file://klcc-consider-sysroot.patch \ | ||
| 19 | " | 20 | " |
| 20 | 21 | ||
| 21 | S = "${WORKDIR}/git" | 22 | S = "${WORKDIR}/git" |
