summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2012-06-09 16:43:02 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-06-11 12:49:50 (GMT)
commitf6a4d74d8b4a204a5c4a7cea36dc851eac4e4205 (patch)
tree79959319ccfe297f2dc2a0add6af85a63014e08f
parent1988bc0ad4f310a8b44d169510ac22e0d8cc3893 (diff)
downloadpoky-f6a4d74d8b4a204a5c4a7cea36dc851eac4e4205.tar.gz
libtool: Let -fstack-protector passed to link step
linker should add -lssp to linker cmdline when -fstack-protector therefore add this knowledge to libtool otherwise packages will fail to link (From OE-Core rev: d1756ff379ab310bfa6323d8643b7e9d764f94bf) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-devtools/libtool/libtool-2.4.2.inc3
-rw-r--r--meta/recipes-devtools/libtool/libtool/respect-fstack-protector.patch53
2 files changed, 55 insertions, 1 deletions
diff --git a/meta/recipes-devtools/libtool/libtool-2.4.2.inc b/meta/recipes-devtools/libtool/libtool-2.4.2.inc
index c1ef7c4..05a2e6d 100644
--- a/meta/recipes-devtools/libtool/libtool-2.4.2.inc
+++ b/meta/recipes-devtools/libtool/libtool-2.4.2.inc
@@ -8,7 +8,7 @@ LICENSE = "GPLv2 & LGPLv2.1"
8LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \ 8LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
9 file://libltdl/COPYING.LIB;md5=e3eda01d9815f8d24aae2dbd89b68b06" 9 file://libltdl/COPYING.LIB;md5=e3eda01d9815f8d24aae2dbd89b68b06"
10 10
11INC_PR = "r3" 11INC_PR = "r4"
12 12
13SRC_URI = "${GNU_MIRROR}/libtool/libtool-${PV}.tar.gz \ 13SRC_URI = "${GNU_MIRROR}/libtool/libtool-${PV}.tar.gz \
14 file://trailingslash.patch \ 14 file://trailingslash.patch \
@@ -18,6 +18,7 @@ SRC_URI = "${GNU_MIRROR}/libtool/libtool-${PV}.tar.gz \
18 file://fix-final-rpath.patch \ 18 file://fix-final-rpath.patch \
19 file://avoid_absolute_paths_for_general_utils.patch \ 19 file://avoid_absolute_paths_for_general_utils.patch \
20 file://fix-rpath.patch \ 20 file://fix-rpath.patch \
21 file://respect-fstack-protector.patch \
21 " 22 "
22 23
23SRC_URI[md5sum] = "d2f3b7d4627e69e13514a40e72a24d50" 24SRC_URI[md5sum] = "d2f3b7d4627e69e13514a40e72a24d50"
diff --git a/meta/recipes-devtools/libtool/libtool/respect-fstack-protector.patch b/meta/recipes-devtools/libtool/libtool/respect-fstack-protector.patch
new file mode 100644
index 0000000..a82b2ec
--- /dev/null
+++ b/meta/recipes-devtools/libtool/libtool/respect-fstack-protector.patch
@@ -0,0 +1,53 @@
1Source: http://permalink.gmane.org/gmane.comp.gnu.libtool.bugs/7341
2
3Bug confirmed. When code is compiled with -fstack-protector{,-all},
4GCC "emits extra code to check for buffer overflows, such as stack
5smashing attacks". This extra code uses symbols from libssp, and
6therefore (at least) Cygwin's GCC specs contain:
7
8*link_ssp:
9%{fstack-protector|fstack-protector-all:-lssp_nonshared -lssp}
10
11Therefore, when libtool fails to pass -fstack-protector{,-all} at link
12stage, the link fails.
13
14Patch attached. (Yes, I have a copyright assignment on file.)
15
16Yaakov
17Cygwin/X
18
19From b79f4e117b6f73cc461a2e232063e08481d33300 Mon Sep 17 00:00:00 2001
20From: Yaakov Selkowitz <yselkowitz <at> users.sourceforge.net>
21Date: Tue, 1 Jun 2010 22:18:51 -0500
22Subject: [PATCH] Fix linking with -fstack-protector
23
24* libltdl/config/ltmain.m4sh (func_mode_link): Pass -fstack-protector*
25to the linker as it is required at link time to resolve libssp symbols.
26
27Signed-off-by: Yaakov Selkowitz <yselkowitz <at> users.sourceforge.net>
28---
29 libltdl/config/ltmain.m4sh | 4 +++-
30 1 files changed, 3 insertions(+), 1 deletions(-)
31
32Signed-off-by: Khem Raj <raj.khem@gmail.com>
33Upstream-Status: Pending
34Index: libtool-2.4.2/libltdl/config/ltmain.m4sh
35===================================================================
36--- libtool-2.4.2.orig/libltdl/config/ltmain.m4sh 2012-06-01 12:35:44.089638130 -0700
37+++ libtool-2.4.2/libltdl/config/ltmain.m4sh 2012-06-01 12:37:25.789643055 -0700
38@@ -5067,13 +5067,14 @@
39 # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
40 # -F/path path to uninstalled frameworks, gcc on darwin
41 # -p, -pg, --coverage, -fprofile-* profiling flags for GCC
42+ # -fstack-protector* stack protector flags for GCC
43 # @file GCC response files
44 # -tp=* Portland pgcc target processor selection
45 # --sysroot=* for sysroot support
46 # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
47 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
48 -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
49- -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
50+ -O*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*)
51 func_quote_for_eval "$arg"
52 arg="$func_quote_for_eval_result"
53 func_append compile_command " $arg"