From patchwork Wed Jan 24 04:09:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Weber X-Patchwork-Id: 865165 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zRBXj4J14z9ryr for ; Wed, 24 Jan 2018 15:10:29 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id E770187F95; Wed, 24 Jan 2018 04:10:27 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id a45FYo5EMSmG; Wed, 24 Jan 2018 04:10:24 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id E7AB287E92; Wed, 24 Jan 2018 04:10:22 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 3F9FF1CF03D for ; Wed, 24 Jan 2018 04:09:58 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 383F687F55 for ; Wed, 24 Jan 2018 04:09:58 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qRphmGrBGL1n for ; Wed, 24 Jan 2018 04:09:56 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from ch3vs01.rockwellcollins.com (ch3vs01.rockwellcollins.com [205.175.226.27]) by hemlock.osuosl.org (Postfix) with ESMTPS id A776A8758E for ; Wed, 24 Jan 2018 04:09:56 +0000 (UTC) Received: from ofwch3n02.rockwellcollins.com (HELO ciulimr02.rockwellcollins.com) ([205.175.226.14]) by ch3vs01.rockwellcollins.com with ESMTP; 23 Jan 2018 22:09:55 -0600 X-Received: from largo.rockwellcollins.com (unknown [192.168.140.76]) by ciulimr02.rockwellcollins.com (Postfix) with ESMTP id BF45920075; Tue, 23 Jan 2018 22:09:55 -0600 (CST) From: Matt Weber To: buildroot@buildroot.org Date: Tue, 23 Jan 2018 22:09:52 -0600 Message-Id: <1516766992-48428-13-git-send-email-matthew.weber@rockwellcollins.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1516766992-48428-1-git-send-email-matthew.weber@rockwellcollins.com> References: <1516766992-48428-1-git-send-email-matthew.weber@rockwellcollins.com> Subject: [Buildroot] [PATCH v4 13/13] libcap: corrected linker flag sequence X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Yann E. MORIN" MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Patches 0001 - added upstream note as we had to submit it upstream along with 0004 0004 - corrects the sequence of -pie and -shared options. When used together, -pie should be provided to the linker before -shared. Upstream: (Emailed to morgan@kernel.org) Signed-off-by: Matthew Weber CC: "Yann E. MORIN" --- Changes v3 -> v4 - New --- ...-build-system-fixes-for-cross-compilation.patch | 2 + ...cap-patch-to-correct-linker-flag-sequence.patch | 76 ++++++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 package/libcap/0004-libcap-patch-to-correct-linker-flag-sequence.patch diff --git a/package/libcap/0001-build-system-fixes-for-cross-compilation.patch b/package/libcap/0001-build-system-fixes-for-cross-compilation.patch index de24090..58217b5 100644 --- a/package/libcap/0001-build-system-fixes-for-cross-compilation.patch +++ b/package/libcap/0001-build-system-fixes-for-cross-compilation.patch @@ -5,6 +5,8 @@ Subject: [PATCH] build-system: fixes for cross-compilation Avoid the libcap buildsys forcing CC/CFLAGS/LDFLAGS/AR/RANLIB +Upstream: (Emailed to morgan@kernel.org) + Signed-off-by: Gustavo Zacarias [yann.morin.1998@free.fr: dont chmod +x the shared lib] Signed-off-by: "Yann E. MORIN" diff --git a/package/libcap/0004-libcap-patch-to-correct-linker-flag-sequence.patch b/package/libcap/0004-libcap-patch-to-correct-linker-flag-sequence.patch new file mode 100644 index 0000000..173325f --- /dev/null +++ b/package/libcap/0004-libcap-patch-to-correct-linker-flag-sequence.patch @@ -0,0 +1,76 @@ +From 147ad6b4c6b5035061196473c2b3d129fa650392 Mon Sep 17 00:00:00 2001 +From: Yogesh Prasad +Date: Tue, 26 Sep 2017 13:47:05 -0500 +Subject: [PATCH 1/1] libcap: patch to correct linker flag sequence. + +Description + This patch will correct the sequence of -pie and -shared options. + When used together, -pie should be provided to the linker before + -shared. If -pie is provided after -shared, the linker throws + below error. +------------------------------------------------------------------------- +/host/powerpc-buildroot-linux-gnu/sysroot/usr/lib/Scrt1.o:(.data+0x4): + undefined reference to `main' + /host/lib/gcc/powerpc-buildroot-linux-gnu/6.4.0/../../../../ + powerpc-buildroot-linux-gnu/bin/ld: BFD (GNU Binutils) 2.28.1 + assertion fail elf32-ppc.c:8923 +collect2: error: ld returned 1 exit status +make[2]: *** [libcap.so.2.25] Error 1 +--------------------------------------------------------------------------- + +Upstream: (Emailed to morgan@kernel.org) + +Signed-off-by: Yogesh Prasad +-- +Changes +v3 -> v4 + - New + +--- + Make.Rules | 2 +- + libcap/Makefile | 2 +- + pam_cap/Makefile | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/Make.Rules b/Make.Rules +index 8a07a3f..03b3680 100644 +--- a/Make.Rules ++++ b/Make.Rules +@@ -59,7 +59,7 @@ WARNINGS=-Wall -Wwrite-strings \ + -Wpointer-arith -Wcast-qual -Wcast-align \ + -Wstrict-prototypes -Wmissing-prototypes \ + -Wnested-externs -Winline -Wshadow +-LD=$(CC) -Wl,-x -shared ++LDOPTS= -Wl,-x -shared + LDFLAGS ?= #-g + BUILD_GPERF := $(shell which gperf >/dev/null 2>/dev/null && echo yes) + +diff --git a/libcap/Makefile b/libcap/Makefile +index 44ddb27..c80a5e6 100644 +--- a/libcap/Makefile ++++ b/libcap/Makefile +@@ -52,7 +52,7 @@ $(STALIBNAME): $(OBJS) + $(RANLIB) $@ + + $(MINLIBNAME): $(OBJS) +- $(LD) $(CFLAGS) $(LDFLAGS) -Wl,-soname,$(MAJLIBNAME) -o $@ $^ ++ $(CC) $(CFLAGS) $(LDFLAGS) $(LDOPTS) -Wl,-soname,$(MAJLIBNAME) -o $@ $^ + ln -sf $(MINLIBNAME) $(MAJLIBNAME) + ln -sf $(MAJLIBNAME) $(LIBNAME) + +diff --git a/pam_cap/Makefile b/pam_cap/Makefile +index cc32fb6..6772075 100644 +--- a/pam_cap/Makefile ++++ b/pam_cap/Makefile +@@ -17,7 +17,7 @@ install: all + install -m 0755 pam_cap.so $(FAKEROOT)$(LIBDIR)/security + + pam_cap.so: pam_cap.o +- $(LD) $(LDFLAGS) -o pam_cap.so $< $(LDLIBS) ++ $(CC) $(LDFLAGS) $(LDOPTS) -o pam_cap.so $< $(LDLIBS) + + pam_cap.o: pam_cap.c + $(CC) $(CFLAGS) $(IPATH) -c $< -o $@ +-- +1.9.1 +