1 |
vapier 13/09/29 00:55:52 |
2 |
|
3 |
Added: |
4 |
busybox-1.21.1-trylink-only-prefix-libs-with-l.patch |
5 |
Log: |
6 |
Fix static linking against selinux #484560 by thaehaid. |
7 |
|
8 |
(Portage version: 2.2.0/cvs/Linux x86_64, signed Manifest commit with key FB7C4156) |
9 |
|
10 |
Revision Changes Path |
11 |
1.1 sys-apps/busybox/files/busybox-1.21.1-trylink-only-prefix-libs-with-l.patch |
12 |
|
13 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/busybox/files/busybox-1.21.1-trylink-only-prefix-libs-with-l.patch?rev=1.1&view=markup |
14 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/busybox/files/busybox-1.21.1-trylink-only-prefix-libs-with-l.patch?rev=1.1&content-type=text/plain |
15 |
|
16 |
Index: busybox-1.21.1-trylink-only-prefix-libs-with-l.patch |
17 |
=================================================================== |
18 |
https://bugs.gentoo.org/484560 |
19 |
|
20 |
From 3eab2b7675fc7e2889cd69285a2a31980a4bf504 Mon Sep 17 00:00:00 2001 |
21 |
From: Mike Frysinger <vapier@g.o> |
22 |
Date: Thu, 12 Sep 2013 00:29:40 -0400 |
23 |
Subject: [PATCH] trylink: only prefix libs with -l |
24 |
|
25 |
If our pkg-config queries pass back a flag like -pthread, the trylink |
26 |
script will expand that to -l-pthread. So change trylink to only add |
27 |
the -l prefix to a value that doesn't have a - prefix already. |
28 |
|
29 |
Reported-by: thaehaid@×××××××××××××.org |
30 |
Signed-off-by: Mike Frysinger <vapier@g.o> |
31 |
--- |
32 |
scripts/trylink | 6 +++--- |
33 |
1 file changed, 3 insertions(+), 3 deletions(-) |
34 |
|
35 |
diff --git a/scripts/trylink b/scripts/trylink |
36 |
index a8b0b2e..e471699 100755 |
37 |
--- a/scripts/trylink |
38 |
+++ b/scripts/trylink |
39 |
@@ -117,7 +117,7 @@ LDLIBS=`echo "$LDLIBS" | xargs -n1 | sort | uniq | xargs` |
40 |
# First link with all libs. If it fails, bail out |
41 |
echo "Trying libraries: $LDLIBS" |
42 |
# "lib1 lib2 lib3" -> "-llib1 -llib2 -llib3" |
43 |
-l_list=`echo "$LDLIBS" | sed -e 's/ / -l/g' -e 's/^/-l/' -e 's/^-l$//'` |
44 |
+l_list=`echo " $LDLIBS " | sed -e 's: \([^- ][^ ]*\): -l\1:g'` |
45 |
test "x$l_list" != "x" && l_list="$START_GROUP $l_list $END_GROUP" |
46 |
try $CC $CFLAGS $LDFLAGS \ |
47 |
-o $EXE \ |
48 |
@@ -141,7 +141,7 @@ while test "$LDLIBS"; do |
49 |
for one in $LDLIBS; do |
50 |
without_one=`echo " $LDLIBS " | sed "s/ $one / /g" | xargs` |
51 |
# "lib1 lib2 lib3" -> "-llib1 -llib2 -llib3" |
52 |
- l_list=`echo "$without_one" | sed -e 's/ / -l/g' -e 's/^/-l/' -e 's/^-l$//'` |
53 |
+ l_list=`echo " $without_one " | sed -e 's: \([^- ][^ ]*\): -l\1:g'` |
54 |
test x"$l_list" != x"" && l_list="$START_GROUP $l_list $END_GROUP" |
55 |
$debug && echo "Trying -l options: '$l_list'" |
56 |
try $CC $CFLAGS $LDFLAGS \ |
57 |
@@ -172,7 +172,7 @@ done |
58 |
|
59 |
# Make the binary with final, minimal list of libs |
60 |
echo "Final link with: ${LDLIBS:-<none>}" |
61 |
-l_list=`echo "$LDLIBS" | sed -e 's/ / -l/g' -e 's/^/-l/' -e 's/^-l$//'` |
62 |
+l_list=`echo " $LDLIBS " | sed -e 's: \([^- ][^ ]*\): -l\1:g'` |
63 |
test "x$l_list" != "x" && l_list="$START_GROUP $l_list $END_GROUP" |
64 |
# --verbose gives us gobs of info to stdout (e.g. linker script used) |
65 |
if ! test -f busybox_ldscript; then |
66 |
-- |
67 |
1.8.3.2 |