summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorKevin Tian <kevin.tian@intel.com>2010-09-29 08:54:33 +0800
committerSaul Wold <Saul.Wold@intel.com>2010-09-30 10:18:00 -0700
commit2a066e7ca90a28d5681c5fa895a29e999ed7c88b (patch)
tree552919ae32fd247a8dde876242ca029317c69065 /meta
parentb07cc5a74abb93862f13191cd15d4aa3e1205079 (diff)
downloadpoky-2a066e7ca90a28d5681c5fa895a29e999ed7c88b.tar.gz
gcc: fix check for target libc ssp support
gcc uses hardcoded path "${with-build-sysroot}/usr/include" to check target libc ssp support. Based on GLIBC version strings in features.h in that search path, gcc knows whether target (e)glibc implements stack protector itself. However this breaks meta-toolchain, which actually has target libc headers installed under {with-build-sysroot}/opt/... This way features.h is not found and thus gcc-crosssdk-intermediate thinks that target (e)glibc doesn't support ssp. Later when building eglibc-nativesdk, undefined reference to "__stack_chk_guard" occurs which was caused by: o eglibc do_configure found that gcc-crosssdk-intermediate supports ssp, and thus enable -fstack-protector for nscd o eglibc itself supports stack smash proctection for some architectures such as i386, x86-64, etc. It's expected to use its own method to provide stack protection, instead of relying on gcc. So eglibc rtld.os doesn't export __stack_chk_guard to other modules o then when installing nscd objects, gcc-crosssdk-intermediate sees the flag "-fstack-protector", while it thought this eglibc doesn't implement ssp itself, so gcc turns to the alternative to find a valid __stack_chk_guard exported. eglibc doesn'g export it, while gcc-crosssdk-intermediate itself disables libssp. Then the undefined reference happens. If enabling libssp for gcc-crosssdk- intermediate, it may also work-around this issue. But the ideal fix is still to replace hard coded path with the actual one where target libc gets installed. glibc-nativesdk doesn't encounter this issue because it thinks gcc doesn't support ssp, and thus doesn't enable "-fstack-protector" for nscd. Don't know the reason yet This fix [BUGID #366] Signed-off-by: Dexuan Cui <dexuan.cui@intel.com> Signed-off-by: Kevin Tian <kevin.tian@intel.com>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-devtools/gcc/gcc-configure-common.inc4
-rw-r--r--meta/recipes-devtools/gcc/gcc-cross-canadian_4.5.0.bb2
-rw-r--r--meta/recipes-devtools/gcc/gcc-cross-initial_4.5.0.bb2
-rw-r--r--meta/recipes-devtools/gcc/gcc-cross-intermediate_4.5.0.bb2
-rw-r--r--meta/recipes-devtools/gcc/gcc-cross_4.5.0.bb2
-rw-r--r--meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.5.0.bb2
-rw-r--r--meta/recipes-devtools/gcc/gcc-crosssdk-intermediate_4.5.0.bb2
-rw-r--r--meta/recipes-devtools/gcc/gcc-crosssdk_4.5.0.bb2
-rw-r--r--meta/recipes-devtools/gcc/gcc-runtime_4.5.0.bb2
-rw-r--r--meta/recipes-devtools/gcc/gcc_4.5.0.bb2
10 files changed, 13 insertions, 9 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-configure-common.inc b/meta/recipes-devtools/gcc/gcc-configure-common.inc
index 9dd8feef7c..43937778f1 100644
--- a/meta/recipes-devtools/gcc/gcc-configure-common.inc
+++ b/meta/recipes-devtools/gcc/gcc-configure-common.inc
@@ -87,6 +87,10 @@ do_configure () {
87 export ARCH_FLAGS_FOR_TARGET="${ARCH_FLAGS_FOR_TARGET}" 87 export ARCH_FLAGS_FOR_TARGET="${ARCH_FLAGS_FOR_TARGET}"
88 (cd ${S} && gnu-configize) || die "failure running gnu-configize" 88 (cd ${S} && gnu-configize) || die "failure running gnu-configize"
89 89
90 # teach gcc to find correct target includedir when checking libc ssp support
91 sed -i 's:^\([ ]*\)glibc_header_dir=\"${with_build_sysroot}/usr/include\":\1glibc_header_dir=\"${with_build_sysroot}${SYSTEMHEADERS}\":g' ${S}/gcc/configure.ac
92 sed -i 's:^\([ ]*\)glibc_header_dir=\"${with_build_sysroot}/usr/include\":\1glibc_header_dir=\"${with_build_sysroot}${SYSTEMHEADERS}\":g' ${S}/gcc/configure
93
90 # splice our idea of where the headers live into gcc's world 94 # splice our idea of where the headers live into gcc's world
91 echo "NATIVE_SYSTEM_HEADER_DIR = ${SYSTEMHEADERS}" > ${T}/t-oe 95 echo "NATIVE_SYSTEM_HEADER_DIR = ${SYSTEMHEADERS}" > ${T}/t-oe
92 sed 's%^tmake_file=.*$%& ${T}/t-oe%' < ${S}/gcc/Makefile.in >${S}/gcc/Makefile.in.new 96 sed 's%^tmake_file=.*$%& ${T}/t-oe%' < ${S}/gcc/Makefile.in >${S}/gcc/Makefile.in.new
diff --git a/meta/recipes-devtools/gcc/gcc-cross-canadian_4.5.0.bb b/meta/recipes-devtools/gcc/gcc-cross-canadian_4.5.0.bb
index 37a0933bd2..4c48b8345d 100644
--- a/meta/recipes-devtools/gcc/gcc-cross-canadian_4.5.0.bb
+++ b/meta/recipes-devtools/gcc/gcc-cross-canadian_4.5.0.bb
@@ -5,7 +5,7 @@ require gcc-cross-canadian.inc
5require gcc-configure-sdk.inc 5require gcc-configure-sdk.inc
6require gcc-package-sdk.inc 6require gcc-package-sdk.inc
7 7
8PR = "r9" 8PR = "r10"
9 9
10DEPENDS += "gmp-nativesdk mpfr-nativesdk libmpc-nativesdk elfutils-nativesdk" 10DEPENDS += "gmp-nativesdk mpfr-nativesdk libmpc-nativesdk elfutils-nativesdk"
11RDEPENDS_${PN} += "mpfr-nativesdk libmpc-nativesdk elfutils-nativesdk" 11RDEPENDS_${PN} += "mpfr-nativesdk libmpc-nativesdk elfutils-nativesdk"
diff --git a/meta/recipes-devtools/gcc/gcc-cross-initial_4.5.0.bb b/meta/recipes-devtools/gcc/gcc-cross-initial_4.5.0.bb
index 7072fdf4a0..3ce5ca0a2c 100644
--- a/meta/recipes-devtools/gcc/gcc-cross-initial_4.5.0.bb
+++ b/meta/recipes-devtools/gcc/gcc-cross-initial_4.5.0.bb
@@ -1,5 +1,5 @@
1require gcc-cross_${PV}.bb 1require gcc-cross_${PV}.bb
2require gcc-cross-initial.inc 2require gcc-cross-initial.inc
3 3
4PR = "r9" 4PR = "r10"
5 5
diff --git a/meta/recipes-devtools/gcc/gcc-cross-intermediate_4.5.0.bb b/meta/recipes-devtools/gcc/gcc-cross-intermediate_4.5.0.bb
index bb145710c1..0fc54e2cca 100644
--- a/meta/recipes-devtools/gcc/gcc-cross-intermediate_4.5.0.bb
+++ b/meta/recipes-devtools/gcc/gcc-cross-intermediate_4.5.0.bb
@@ -1,4 +1,4 @@
1require gcc-cross_${PV}.bb 1require gcc-cross_${PV}.bb
2require gcc-cross-intermediate.inc 2require gcc-cross-intermediate.inc
3PR = "r9" 3PR = "r10"
4 4
diff --git a/meta/recipes-devtools/gcc/gcc-cross_4.5.0.bb b/meta/recipes-devtools/gcc/gcc-cross_4.5.0.bb
index 72032762bf..545beebd1a 100644
--- a/meta/recipes-devtools/gcc/gcc-cross_4.5.0.bb
+++ b/meta/recipes-devtools/gcc/gcc-cross_4.5.0.bb
@@ -1,4 +1,4 @@
1PR = "r10" 1PR = "r11"
2 2
3require gcc-${PV}.inc 3require gcc-${PV}.inc
4require gcc-cross4.inc 4require gcc-cross4.inc
diff --git a/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.5.0.bb b/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.5.0.bb
index c14846a397..69afbae2fc 100644
--- a/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.5.0.bb
+++ b/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.5.0.bb
@@ -1,4 +1,4 @@
1require gcc-cross-initial_${PV}.bb 1require gcc-cross-initial_${PV}.bb
2require gcc-crosssdk-initial.inc 2require gcc-crosssdk-initial.inc
3 3
4PR = "r9" 4PR = "r10"
diff --git a/meta/recipes-devtools/gcc/gcc-crosssdk-intermediate_4.5.0.bb b/meta/recipes-devtools/gcc/gcc-crosssdk-intermediate_4.5.0.bb
index b8204c4dc6..934ae644a7 100644
--- a/meta/recipes-devtools/gcc/gcc-crosssdk-intermediate_4.5.0.bb
+++ b/meta/recipes-devtools/gcc/gcc-crosssdk-intermediate_4.5.0.bb
@@ -1,4 +1,4 @@
1require gcc-cross-intermediate_${PV}.bb 1require gcc-cross-intermediate_${PV}.bb
2require gcc-crosssdk-intermediate.inc 2require gcc-crosssdk-intermediate.inc
3 3
4PR = "r9" 4PR = "r10"
diff --git a/meta/recipes-devtools/gcc/gcc-crosssdk_4.5.0.bb b/meta/recipes-devtools/gcc/gcc-crosssdk_4.5.0.bb
index df4807d5ad..48a68bed1a 100644
--- a/meta/recipes-devtools/gcc/gcc-crosssdk_4.5.0.bb
+++ b/meta/recipes-devtools/gcc/gcc-crosssdk_4.5.0.bb
@@ -1,4 +1,4 @@
1require gcc-cross_${PV}.bb 1require gcc-cross_${PV}.bb
2require gcc-crosssdk.inc 2require gcc-crosssdk.inc
3 3
4PR = "r9" 4PR = "r10"
diff --git a/meta/recipes-devtools/gcc/gcc-runtime_4.5.0.bb b/meta/recipes-devtools/gcc/gcc-runtime_4.5.0.bb
index 2bfc0df1cb..fc3ab0711e 100644
--- a/meta/recipes-devtools/gcc/gcc-runtime_4.5.0.bb
+++ b/meta/recipes-devtools/gcc/gcc-runtime_4.5.0.bb
@@ -1,4 +1,4 @@
1PR = "r9" 1PR = "r10"
2 2
3require gcc-${PV}.inc 3require gcc-${PV}.inc
4require gcc-configure-runtime.inc 4require gcc-configure-runtime.inc
diff --git a/meta/recipes-devtools/gcc/gcc_4.5.0.bb b/meta/recipes-devtools/gcc/gcc_4.5.0.bb
index 880c99c8e9..7bb61fd790 100644
--- a/meta/recipes-devtools/gcc/gcc_4.5.0.bb
+++ b/meta/recipes-devtools/gcc/gcc_4.5.0.bb
@@ -1,4 +1,4 @@
1PR = "r9" 1PR = "r10"
2 2
3require gcc-${PV}.inc 3require gcc-${PV}.inc
4require gcc-configure-target.inc 4require gcc-configure-target.inc