libseccomp: Remove the use of /proc when installing pc files
authorMaxime Ripard <maxime.ripard@free-electrons.com>
Mon, 17 Dec 2012 23:14:35 +0000 (23:14 +0000)
committerPeter Korsgaard <jacmet@sunsite.dk>
Tue, 18 Dec 2012 09:27:43 +0000 (10:27 +0100)
Fixes http://autobuild.buildroot.org/results/d9e12bb0f5b2df9064adf3772bcf479b51d72468

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
package/libseccomp/libseccomp-0001-use-system-headers-from-sysroot.patch [new file with mode: 0644]
package/libseccomp/libseccomp-0002-Remove-the-dependency-on-proc.patch [new file with mode: 0644]
package/libseccomp/libseccomp-use-system-headers-from-sysroot.patch [deleted file]

diff --git a/package/libseccomp/libseccomp-0001-use-system-headers-from-sysroot.patch b/package/libseccomp/libseccomp-0001-use-system-headers-from-sysroot.patch
new file mode 100644 (file)
index 0000000..0997edd
--- /dev/null
@@ -0,0 +1,17 @@
+configure: check headers in sysroot, not in host's system headers
+
+Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
+
+diff -durN libseccomp-1.0.0.orig/configure libseccomp-1.0.0/configure
+--- libseccomp-1.0.0.orig/configure    2012-07-27 22:35:05.000000000 +0200
++++ libseccomp-1.0.0/configure 2012-10-27 00:12:50.739196219 +0200
+@@ -205,7 +205,8 @@
+ #
+ # system seccomp includes
+-if [[ -r "/usr/include/linux/seccomp.h" ]]; then
++# ${SYSROOT} added by buildroot for cross-compilation
++if [[ -r "${SYSROOT}/usr/include/linux/seccomp.h" ]]; then
+       opt_sysinc_seccomp="yes"
+ else
+       opt_sysinc_seccomp="no"
diff --git a/package/libseccomp/libseccomp-0002-Remove-the-dependency-on-proc.patch b/package/libseccomp/libseccomp-0002-Remove-the-dependency-on-proc.patch
new file mode 100644 (file)
index 0000000..82ae44a
--- /dev/null
@@ -0,0 +1,42 @@
+From 58c34ae1343e2a452e08cd160936a231bcdb67a1 Mon Sep 17 00:00:00 2001
+From: Maxime Ripard <maxime.ripard@free-electrons.com>
+Date: Tue, 18 Dec 2012 09:57:47 +0100
+Subject: [PATCH] Remove the dependency on /proc
+
+The Makefile relied on a broken logic for the INSTALL_PC_MACRO.
+It was used like this: $(INSTALL_PC_MACRO) file.
+
+The INSTALL_PC_MACRO was then expanded with a trailing sharp, to pass
+the name of the file to install as a comment at the end of the command.
+
+And then, to retrieve the file to copy, it used the $NF variable of awk
+on the /proc/self/cmdline file to happily reinvent the argument
+mechanism.
+
+This patch removes of this crazy stuff by using the -t option of
+install, that keeps the same calling convention.
+
+Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
+---
+ macros.mk |    5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/macros.mk b/macros.mk
+index 6162900..eb61ead 100644
+--- a/macros.mk
++++ b/macros.mk
+@@ -150,9 +150,8 @@ endif
+ INSTALL_PC_MACRO += \
+               $(INSTALL) -o $(INSTALL_OWNER) -g $(INSTALL_GROUP) \
+                       -d "$(INSTALL_LIB_DIR)/pkgconfig"; \
+-              $(INSTALL) -o $(INSTALL_OWNER) -g $(INSTALL_GROUP) -m 0644 \
+-                      "$$(cat /proc/$$$$/cmdline | awk '{print $$(NF)}')" \
+-                      "$(INSTALL_LIB_DIR)/pkgconfig"; \#
++              $(INSTALL) -t -o $(INSTALL_OWNER) -g $(INSTALL_GROUP) -m 0644 \
++                      "$(INSTALL_LIB_DIR)/pkgconfig"
+ ifeq ($(V),0)
+       INSTALL_INC_MACRO = @echo " INSTALL $^ ($(INSTALL_INC_DIR))";
+-- 
+1.7.9.5
+
diff --git a/package/libseccomp/libseccomp-use-system-headers-from-sysroot.patch b/package/libseccomp/libseccomp-use-system-headers-from-sysroot.patch
deleted file mode 100644 (file)
index 0997edd..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-configure: check headers in sysroot, not in host's system headers
-
-Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
-
-diff -durN libseccomp-1.0.0.orig/configure libseccomp-1.0.0/configure
---- libseccomp-1.0.0.orig/configure    2012-07-27 22:35:05.000000000 +0200
-+++ libseccomp-1.0.0/configure 2012-10-27 00:12:50.739196219 +0200
-@@ -205,7 +205,8 @@
- #
- # system seccomp includes
--if [[ -r "/usr/include/linux/seccomp.h" ]]; then
-+# ${SYSROOT} added by buildroot for cross-compilation
-+if [[ -r "${SYSROOT}/usr/include/linux/seccomp.h" ]]; then
-       opt_sysinc_seccomp="yes"
- else
-       opt_sysinc_seccomp="no"