libaio: don't disable linking to the system libraries

For some reason that I don't understand (a decade-old attempt at optimisation?)
libaio disables linkage to the system libraries.  Enabling fortify means linking
to the system libraries, so remove the existing addition of -lc for x86 (the
problem also happens on at least PPC) and just link to the system libraries on
all platforms.

Also remove the sed of src/Makefile as the build not respecting LDFLAGS has been
fixed upstream.

(From OE-Core rev: f435ac9db0581d8313a38d586b00c2b3de419298)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Ross Burton 2015-11-06 15:30:58 +00:00 committed by Richard Purdie
parent 11a9c24d6c
commit 649b6bcfe8
2 changed files with 39 additions and 7 deletions

View File

@ -0,0 +1,37 @@
From 94bba6880b1f10c6b3bf33a17ac40935d65a81ae Mon Sep 17 00:00:00 2001
From: Ross Burton <ross.burton@intel.com>
Date: Fri, 6 Nov 2015 15:19:46 +0000
Subject: [PATCH] Don't remove the system libraries and startup files from
libaio, as in some build configurations these are required. For example,
including conf/include/security_flags.inc on PPC results in:
io_queue_init.os: In function `io_queue_init':
tmp/work/ppce300c3-poky-linux/libaio/0.3.110-r0/libaio-0.3.110/src/io_queue_init.c:33:
undefined reference to `__stack_chk_fail_local'
Upstream-Status: Pending
Signed-off-by: Ross Burton <ross.burton@intel.com>
---
src/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/Makefile b/src/Makefile
index eadb336..56ab701 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -3,10 +3,10 @@ includedir=$(prefix)/include
libdir=$(prefix)/lib
CFLAGS ?= -g -fomit-frame-pointer -O2
-CFLAGS += -nostdlib -nostartfiles -Wall -I. -fPIC
+CFLAGS += -Wall -I. -fPIC
SO_CFLAGS=-shared $(CFLAGS)
L_CFLAGS=$(CFLAGS)
-LINK_FLAGS=
+LINK_FLAGS=$(LDFLAGS)
LINK_FLAGS+=$(LDFLAGS)
soname=libaio.so.1
--
2.1.4

View File

@ -11,18 +11,13 @@ SRC_URI = "${DEBIAN_MIRROR}/main/liba/libaio/libaio_${PV}.orig.tar.gz \
file://destdir.patch \
file://libaio_fix_for_x32.patch \
file://libaio_fix_for_mips_syscalls.patch \
"
file://system-linkage.patch \
"
SRC_URI[md5sum] = "2a35602e43778383e2f4907a4ca39ab8"
SRC_URI[sha256sum] = "e019028e631725729376250e32b473012f7cb68e1f7275bfc1bbcdd0f8745f7e"
EXTRA_OEMAKE =+ "prefix=${prefix} includedir=${includedir} libdir=${libdir}"
# Need libc for stack-protector's __stack_chk_fail_local() bounce function
LDFLAGS_append_x86 = " -lc"
do_configure () {
sed -i 's#LINK_FLAGS=.*#LINK_FLAGS=$(LDFLAGS)#' src/Makefile
}
do_install () {
oe_runmake install DESTDIR=${D}