commit: 208727cd120aff0f241c9ee0a5f033fe6b41987f Author: Gokturk Yuksek <gokturk <AT> binghamton <DOT> edu> AuthorDate: Sun Nov 29 01:29:51 2015 +0000 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> CommitDate: Sat Dec 5 21:39:13 2015 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=208727cd
dev-libs/libaio: link against stdlib to pull the fortified functions #558406 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 .../libaio/files/libaio-0.3.110-link-stdlib.patch | 21 +++++++++++++++++++++ dev-libs/libaio/libaio-0.3.110.ebuild | 3 ++- 2 files changed, 23 insertions(+), 1 deletion(-) 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 index 0000000..696a928 --- /dev/null +++ b/dev-libs/libaio/files/libaio-0.3.110-link-stdlib.patch @@ -0,0 +1,21 @@ +From: Gokturk Yuksek <gokt...@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) diff --git a/dev-libs/libaio/libaio-0.3.110.ebuild b/dev-libs/libaio/libaio-0.3.110.ebuild index a772baf..0605dbe 100644 --- a/dev-libs/libaio/libaio-0.3.110.ebuild +++ b/dev-libs/libaio/libaio-0.3.110.ebuild @@ -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:"