diff options
| author | Khem Raj <raj.khem@gmail.com> | 2012-06-09 09:43:02 -0700 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-06-11 13:49:50 +0100 |
| commit | f6a4d74d8b4a204a5c4a7cea36dc851eac4e4205 (patch) | |
| tree | 79959319ccfe297f2dc2a0add6af85a63014e08f /meta | |
| parent | 1988bc0ad4f310a8b44d169510ac22e0d8cc3893 (diff) | |
| download | poky-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>
Diffstat (limited to 'meta')
| -rw-r--r-- | meta/recipes-devtools/libtool/libtool-2.4.2.inc | 3 | ||||
| -rw-r--r-- | meta/recipes-devtools/libtool/libtool/respect-fstack-protector.patch | 53 |
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 c1ef7c45ac..05a2e6d2c9 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" | |||
| 8 | LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \ | 8 | LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \ |
| 9 | file://libltdl/COPYING.LIB;md5=e3eda01d9815f8d24aae2dbd89b68b06" | 9 | file://libltdl/COPYING.LIB;md5=e3eda01d9815f8d24aae2dbd89b68b06" |
| 10 | 10 | ||
| 11 | INC_PR = "r3" | 11 | INC_PR = "r4" |
| 12 | 12 | ||
| 13 | SRC_URI = "${GNU_MIRROR}/libtool/libtool-${PV}.tar.gz \ | 13 | SRC_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 | ||
| 23 | SRC_URI[md5sum] = "d2f3b7d4627e69e13514a40e72a24d50" | 24 | SRC_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 0000000000..a82b2ec5a1 --- /dev/null +++ b/meta/recipes-devtools/libtool/libtool/respect-fstack-protector.patch | |||
| @@ -0,0 +1,53 @@ | |||
| 1 | Source: http://permalink.gmane.org/gmane.comp.gnu.libtool.bugs/7341 | ||
| 2 | |||
| 3 | Bug confirmed. When code is compiled with -fstack-protector{,-all}, | ||
| 4 | GCC "emits extra code to check for buffer overflows, such as stack | ||
| 5 | smashing attacks". This extra code uses symbols from libssp, and | ||
| 6 | therefore (at least) Cygwin's GCC specs contain: | ||
| 7 | |||
| 8 | *link_ssp: | ||
| 9 | %{fstack-protector|fstack-protector-all:-lssp_nonshared -lssp} | ||
| 10 | |||
| 11 | Therefore, when libtool fails to pass -fstack-protector{,-all} at link | ||
| 12 | stage, the link fails. | ||
| 13 | |||
| 14 | Patch attached. (Yes, I have a copyright assignment on file.) | ||
| 15 | |||
| 16 | Yaakov | ||
| 17 | Cygwin/X | ||
| 18 | |||
| 19 | From b79f4e117b6f73cc461a2e232063e08481d33300 Mon Sep 17 00:00:00 2001 | ||
| 20 | From: Yaakov Selkowitz <yselkowitz <at> users.sourceforge.net> | ||
| 21 | Date: Tue, 1 Jun 2010 22:18:51 -0500 | ||
| 22 | Subject: [PATCH] Fix linking with -fstack-protector | ||
| 23 | |||
| 24 | * libltdl/config/ltmain.m4sh (func_mode_link): Pass -fstack-protector* | ||
| 25 | to the linker as it is required at link time to resolve libssp symbols. | ||
| 26 | |||
| 27 | Signed-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 | |||
| 32 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 33 | Upstream-Status: Pending | ||
| 34 | Index: 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" | ||
