Skip to contentSkip to conversation

rpm: don't put LDFLAGS into the .pc file

PATCH New Ross Burton 1 participant 2 messages Mar 4, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 rpm: don't put LDFLAGS into the .pc file

The LDFLAGS are not generally useful with pkg-config and mean that the .pc file contains references to the sysroot directory, so remove it.

---
 .../rpm/rpm/no-ldflags-in-pkgconfig.patch                |   14 ++++++++++++++
 meta/recipes-devtools/rpm/rpm_5.4.14.bb                  |    1 +
 2 files changed, 15 insertions(+)
 create mode 100644 meta/recipes-devtools/rpm/rpm/no-ldflags-in-pkgconfig.patch
meta/recipes-devtools/rpm/rpm/no-ldflags-in-pkgconfig.patch new file +14 -0
new file mode 100644
index 0000000..410623f
@@ -0,0 +1,14 @@
+Don't put LDFLAGS into the Libs.private, all it generally contains is a linker
+hash selection (harmless) and the absolute path to the libdir in the sysroot
+(actively harmful).
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <[email protected]>
+
+diff --git a/scripts/rpm.pc.in b/scripts/rpm.pc.in
+index 8293471..2ea469c 100644
+--- a/scripts/rpm.pc.in
++++ b/scripts/rpm.pc.in
+@@ -17 +17 @@ Libs: -L${libdir} -lrpmbuild${suffix} -lrpm${suffix} -lrpmdb${suffix} -lrpmio${s
+-Libs.private: @LDFLAGS@ @LIBS@
++Libs.private: @LIBS@
meta/recipes-devtools/rpm/rpm_5.4.14.bb +1 -0
index d99a300..03a24f0 100644
@@ -95,6 +95,7 @@ SRC_URI = "http://www.rpm5.org/files/rpm/rpm-5.4/rpm-5.4.14-0.20131024.src.rpm;e
 	   file://rpmqv_cc_b_gone.patch \
 	   file://rpm-realpath.patch \
 	   file://0001-using-poptParseArgvString-to-parse-the-_gpg_check_pa.patch \
+	   file://no-ldflags-in-pkgconfig.patch \
 	  "
 
 # Uncomment the following line to enable platform score debugging
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH 2/2 pkg-config: strip system library paths reliably

pkg-config was skipping every other link flag due to a list manipulation bug, backport a commit from git to fix this.

This will stop users of zlib.pc from inserting the sysroot directory indirectly into builds.

---
 ...Strip-system-library-directories-reliably.patch |   30 ++++++++++++++++++++
 meta/recipes-devtools/pkgconfig/pkgconfig_0.28.bb  |    1 +
 2 files changed, 31 insertions(+)
 create mode 100644 meta/recipes-devtools/pkgconfig/pkgconfig-0.28/0001-Strip-system-library-directories-reliably.patch
meta/recipes-devtools/pkgconfig/pkgconfig-0.28/0001-Strip-system-library-directories-reliably.patch new file +30 -0
new file mode 100644
index 0000000..84d0dd8
@@ -0,0 +1,30 @@
+Upstream-Status: Backport (will be in 0.29)
+Signed-off-by: Ross Burton <[email protected]>
+
+From ce1a2416ce0f0bd9a8a8a5caaf7dad20cda4d47d Mon Sep 17 00:00:00 2001
+From: Andrew Oakley <[email protected]>
+Date: Tue, 29 Apr 2014 13:14:35 +0100
+Subject: [PATCH] Strip system library directories reliably
+
+This loop was changed from a while loop to a for loop in commit
+9bf6277b, but the iterator is now advanced twice each time round the
+loop.
+---
+ pkg.c |    1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/pkg.c b/pkg.c
+index 3697fec..c847c95 100644
+--- a/pkg.c
++++ b/pkg.c
+@@ -917,7 +917,6 @@ verify_package (Package *pkg)
+             }
+           system_dir_iter = system_dir_iter->next;
+         }
+-      iter = iter->next;
+     }
+   g_list_free (system_directories);
+ 
+-- 
+1.7.10.4
+
meta/recipes-devtools/pkgconfig/pkgconfig_0.28.bb +1 -0
index 3070da9..57a22d4 100644
@@ -4,6 +4,7 @@ SRC_URI += " \
             file://pkg-config-native.in \
             file://fix-glib-configure-libtool-usage.patch \
             file://obsolete_automake_macros.patch \
+            file://0001-Strip-system-library-directories-reliably.patch \
            "
 
 SRC_URI[md5sum] = "aa3c86e67551adc3ac865160e34a2a0d"
Signature · 1 line
1.7.10.4