dev-libs/libaio: link against stdlib to pull the fortified functions #558406
authorGokturk Yuksek <gokturk@binghamton.edu>
Sun, 29 Nov 2015 01:29:51 +0000 (20:29 -0500)
committerGokturk Yuksek <gokturk@binghamton.edu>
Sat, 5 Dec 2015 21:39:13 +0000 (16:39 -0500)
When '-fstack-protector-strong' is included in CFLAGS, the function
'__stack_chk_fail_local' needs to be pulled from libc. However,
upstream uses '-nostdlib' to avoid linking against any C library or
gcc libs. Remove '-nostdlib' and '-nostartfiles' to pull the required
symbols from libc.

Gentoo-Bug: https://bugs.gentoo.org/show_bug.cgi?id=558406

Package-Manager: portage-2.2.20.1

dev-libs/libaio/files/libaio-0.3.110-link-stdlib.patch [new file with mode: 0644]
dev-libs/libaio/libaio-0.3.110.ebuild

diff --git a/dev-libs/libaio/files/libaio-0.3.110-link-stdlib.patch b/dev-libs/libaio/files/libaio-0.3.110-link-stdlib.patch
new file mode 100644 (file)
index 0000000..696a928
--- /dev/null
@@ -0,0 +1,21 @@
+From: Gokturk Yuksek <gokturk@binghamton.edu>
+Subject: [PATCH] Link against stdlib to resolve fortified functions
+
+When '-fstack-protector-strong' is included in CFLAGS, the function
+'__stack_chk_fail_local' needs to be pulled from libc. However, upstream
+uses '-nostdlib' to avoid linking against any C library or gcc libs. Remove
+'-nostdlib' and '-nostartfiles' to pull the required symbols from libc.
+
+Gentoo-Bug: https://bugs.gentoo.org/show_bug.cgi?id=558406
+
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -4,7 +4,7 @@
+ usrlibdir=$(libdir)
+ 
+ CFLAGS ?= -g -fomit-frame-pointer -O2
+-CFLAGS += -nostdlib -nostartfiles -Wall -I. -fPIC
++CFLAGS += -Wall -I. -fPIC
+ CFLAGS += $(CPPFLAGS)
+ SO_CFLAGS=-shared $(CFLAGS)
+ L_CFLAGS=$(CFLAGS)
index a772baf97c403dccdbac2a2907d3d4d61ed9c2c6..0605dbed076af2f87ca46041df85bf0d989c423f 100644 (file)
@@ -21,7 +21,8 @@ src_prepare() {
                "${FILESDIR}"/${PN}-0.3.109-x32.patch \
                "${FILESDIR}"/${PN}-0.3.109-testcase-8.patch \
                "${FILESDIR}"/${PN}-0.3.110-cppflags.patch \
-               "${FILESDIR}"/${PN}-0.3.110-optional-werror.patch
+               "${FILESDIR}"/${PN}-0.3.110-optional-werror.patch \
+               "${FILESDIR}"/${PN}-0.3.110-link-stdlib.patch #558406
 
        local sed_args=(
                -e "/^prefix=/s:/usr:${EPREFIX}/usr:"