Skip to contentSkip to conversation

gawk: ensure cross compiling doesn't try to remove host files

PATCH New Paul Gortmaker 1 participant 1 message Jun 13, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gawk: ensure cross compiling doesn't try to remove host files

Fixes [YOCTO #6440]

When cross compiling gawk, it is possible to see this fail:

make[4]: Entering directory '/mnt/home/paul/poky/build/tmp/work/corei7-64-poky- linux/gawk/4.1.1-r0/build/extension'
for i in filefuncs.la fnmatch.la fork.la inplace.la ordchr.la readdir.la readfi

le.la revoutput.la revtwoway.la rwarray.la testext.la time.la ; do \
        rm -f /usr/lib/gawk/$i ; \

done
rm: cannot remove '/usr/lib/gawk/filefuncs.la': Permission denied
rm: cannot remove '/usr/lib/gawk/fnmatch.la': Permission denied
rm: cannot remove '/usr/lib/gawk/fork.la': Permission denied
rm: cannot remove '/usr/lib/gawk/inplace.la': Permission denied
rm: cannot remove '/usr/lib/gawk/ordchr.la': Permission denied
rm: cannot remove '/usr/lib/gawk/readdir.la': Permission denied
rm: cannot remove '/usr/lib/gawk/readfile.la': Permission denied
rm: cannot remove '/usr/lib/gawk/revoutput.la': Permission denied
rm: cannot remove '/usr/lib/gawk/revtwoway.la': Permission denied
rm: cannot remove '/usr/lib/gawk/rwarray.la': Permission denied
rm: cannot remove '/usr/lib/gawk/testext.la': Permission denied
rm: cannot remove '/usr/lib/gawk/time.la': Permission denied Makefile:1235: recipe for target 'install-data-hook' failed

The problem only manifests itself on hosts where the above files are already present; for if they are absent then the rm -f does not fail with -EPERM.

Before looking in mainline gawk for a fix, I fixed it myself. Then in comparing with mainline gawk, I found their fix was not 100% complete. So here we get a backport of the mainline gawk commit, plus the delta as a commit that I've sent to the gawk mailing list.

meta/recipes-extended/gawk/gawk-4.1.1/Use-DESTDIR-in-extension-Makefile.am-when-removing-..patch new file +56 -0
new file mode 100644
index 000000000000..b8b1fcaea767
@@ -0,0 +1,56 @@
+From 976f73ab03569bb836aa5c949be1c1cc973b2d2e Mon Sep 17 00:00:00 2001
+From: "Arnold D. Robbins" <[email protected]>
+Date: Fri, 11 Apr 2014 07:42:16 +0300
+Subject: [PATCH] Use $(DESTDIR) in extension/Makefile.am when removing .la
+ files.
+
+commit 976f73ab03569bb836aa5c949be1c1cc973b2d2e upstream.
+
+[PG: note there was no Author SOB or long log in original.]
+Upstream-Status: Backport [ gawk-4.1.1-3-g976f73ab0356 ]
+Signed-off-by: Paul Gortmaker <[email protected]>
+---
+
+diff --git a/extension/ChangeLog b/extension/ChangeLog
+index afd64ff764b6..f3a1c7a81e7d 100644
+--- a/extension/ChangeLog
++++ b/extension/ChangeLog
+@@ -1,3 +1,9 @@
++2014-04-11         Arnold D. Robbins     <[email protected]>
++
++	* Makefile.am (install-data-hook): Use $(DESTDIR) when removing
++	the .la files. Thanks to Lars Wendler <[email protected]>
++	for the report and fix.
++
+ 2014-04-08         Arnold D. Robbins     <[email protected]>
+ 
+ 	* 4.1.1: Release tar ball made.
+diff --git a/extension/Makefile.am b/extension/Makefile.am
+index 9c49bb81abb2..11826e2b315e 100644
+--- a/extension/Makefile.am
++++ b/extension/Makefile.am
+@@ -100,7 +100,7 @@ testext_la_LIBADD     = $(MY_LIBS)
+ 
+ install-data-hook:
+ 	for i in $(pkgextension_LTLIBRARIES) ; do \
+-		$(RM) $(pkgextensiondir)/$$i ; \
++		$(RM) $(DESTDIR)$(pkgextensiondir)/$$i ; \
+ 	done
+ 
+ # Keep the uninstall check working:
+diff --git a/extension/Makefile.in b/extension/Makefile.in
+index 040cdb8f4e23..d81b16960935 100644
+--- a/extension/Makefile.in
++++ b/extension/Makefile.in
+@@ -1231,7 +1231,7 @@ uninstall-man: uninstall-man3
+ 
+ install-data-hook:
+ 	for i in $(pkgextension_LTLIBRARIES) ; do \
+-		$(RM) $(pkgextensiondir)/$$i ; \
++		$(RM) $(DESTDIR)$(pkgextensiondir)/$$i ; \
+ 	done
+ 
+ # Keep the uninstall check working:
+-- 
+1.9.1
+
meta/recipes-extended/gawk/gawk-4.1.1/extension-Add-DESTDIR-prefix-to-remaining-pkgextensi.patch new file +86 -0

86 lines not on this page · raw message

meta/recipes-extended/gawk/gawk_4.1.1.bb +2 -0
index a81be3137a9c..1298ee2f4ce1 100644
@@ -15,6 +15,8 @@ DEPENDS += "readline"
 
 SRC_URI = "${GNU_MIRROR}/gawk/gawk-${PV}.tar.gz \
            file://run-ptest \
+           file://Use-DESTDIR-in-extension-Makefile.am-when-removing-..patch \
+           file://extension-Add-DESTDIR-prefix-to-remaining-pkgextensi.patch \
 "
 
 SRC_URI[md5sum] = "45f5b09aa87b4744c4c53bf274e96ed0"
Signature · 1 line
1.9.1