nfs-utils: build tools with target compiler
PATCH 1/1 nfs-utils: build tools with target compiler
Some tools were built with CC_FOR_BUILD which points to the target compiler. The current patch avoided issues by deleting some of the binaries during install.
This patch replaces the CC_FOR_BUILD with CC so the tools are built with the target compiler. This means the binaries no longer need to be deleted.
I stumbled upon this by trying to globally add "--ffile-prefix-map", which is not supported by my host GCC, to get rid of some "buildpaths" QA Warnings.
--- .../0001-Don-t-build-tools-with-CC_FOR_BUILD.patch | 40 +++++++++++++++++++++ ...-Do-not-pass-CFLAGS-to-gcc-while-building.patch | 42 ---------------------- .../nfs-utils/nfs-utils_2.3.3.bb | 7 +--- 3 files changed, 41 insertions(+), 48 deletions(-) create mode 100644 meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Don-t-build-tools-with-CC_FOR_BUILD.patch delete mode 100644 meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-Do-not-pass-CFLAGS-to-gcc-while-building.patch
meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Don-t-build-tools-with-CC_FOR_BUILD.patch new file +40 -0
@@ -0,0 +1,40 @@ +From 79019d976584c598f8d0a9d8de43c989946f974b Mon Sep 17 00:00:00 2001 +From: Pascal Bach <[email protected]> +Date: Wed, 13 Feb 2019 09:28:07 +0100 +Subject: [PATCH] Don't build tools with CC_FOR_BUILD + +The tools are intended for the target not for the host. + +Upstream-Status: Pending + +Signed-off-by: Pascal Bach <[email protected]> +--- + tools/locktest/Makefile.am | 1 - + tools/rpcgen/Makefile.am | 1 - + 2 files changed, 2 deletions(-) + +diff --git a/tools/locktest/Makefile.am b/tools/locktest/Makefile.am +index 3156815..87d0bac 100644 +--- a/tools/locktest/Makefile.am ++++ b/tools/locktest/Makefile.am +@@ -1,6 +1,5 @@ + ## Process this file with automake to produce Makefile.in + +-CC=$(CC_FOR_BUILD) + LIBTOOL = @LIBTOOL@ --tag=CC + + noinst_PROGRAMS = testlk +diff --git a/tools/rpcgen/Makefile.am b/tools/rpcgen/Makefile.am +index 8a9ec89..3e092c9 100644 +--- a/tools/rpcgen/Makefile.am ++++ b/tools/rpcgen/Makefile.am +@@ -1,6 +1,5 @@ + ## Process this file with automake to produce Makefile.in + +-CC=$(CC_FOR_BUILD) + LIBTOOL = @LIBTOOL@ --tag=CC + + noinst_PROGRAMS = rpcgen +-- +2.11.0 +
meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-Do-not-pass-CFLAGS-to-gcc-while-building.patch deleted +0 -42
42 lines not on this page · raw message
meta/recipes-connectivity/nfs-utils/nfs-utils_2.3.3.bb +1 -6
@@ -26,7 +26,6 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/nfs-utils/${PV}/nfs-utils-${PV}.tar.x file://nfs-mountd.service \ file://nfs-statd.service \ file://proc-fs-nfsd.mount \ - file://nfs-utils-Do-not-pass-CFLAGS-to-gcc-while-building.patch \ file://nfs-utils-debianize-start-statd.patch \ file://bugfix-adjust-statd-service-name.patch \ file://nfs-utils-musl-limits.patch \
@@ -35,6 +34,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/nfs-utils/${PV}/nfs-utils-${PV}.tar.x file://clang-format-string.patch \ file://0001-Makefile.am-update-the-path-of-libnfs.a.patch \ file://0001-Makefile.am-fix-undefined-function-for-libnsm.a.patch \ + file://0001-Don-t-build-tools-with-CC_FOR_BUILD.patch \ " SRC_URI_append_libc-glibc = " file://0001-configure.ac-Do-not-fatalize-Wmissing-prototypes.patch" SRC_URI_append_libc-musl = " file://nfs-utils-musl-res_querydomain.patch"
@@ -147,11 +147,6 @@ do_install_append () { chown -R rpcuser:rpcuser ${D}${localstatedir}/lib/nfs/statd chmod 0644 ${D}${localstatedir}/lib/nfs/statd/state - # the following are built by CC_FOR_BUILD - rm -f ${D}${sbindir}/rpcdebug - rm -f ${D}${sbindir}/rpcgen - rm -f ${D}${sbindir}/locktest - # Make python tools use python 3 sed -i -e '1s,#!.*python.*,#!${bindir}/python3,' ${D}${sbindir}/mountstats ${D}${sbindir}/nfsiostat
Signature · 1 line
2.11.0
Will you be sending that fix upstream too?
Quoted 156 lines · Pascal Bach
Some tools were built with
CC_FOR_BUILDwhich points to the target compiler. The current patch avoided issues by deleting some of the binaries during install.This patch replaces the
CC_FOR_BUILDwith CC so the tools are built with the target compiler. This means the binaries no longer need to be deleted.I stumbled upon this by trying to globally add "--ffile-prefix-map", which is not supported by my host GCC, to get rid of some "buildpaths" QA Warnings.
Cc Robert Yang <[email protected]>Signed-off-by Pascal Bach <[email protected]>--- .../0001-Don-t-build-tools-with-CC_FOR_BUILD.patch | 40 +++++++++++++++++++++ ...-Do-not-pass-CFLAGS-to-gcc-while-building.patch | 42 ---------------------- .../nfs-utils/nfs-utils_2.3.3.bb | 7 +--- 3 files changed, 41 insertions(+), 48 deletions(-) create mode 100644 meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Don-t-build-tools-with-CC_FOR_BUILD.patch delete mode 100644 meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-Do-not-pass-CFLAGS-to-gcc-while-building.patchmeta/recipes-connectivity/nfs-utils/nfs-utils/0001-Don-t-build-tools-with-CC_FOR_BUILD.patch new file +40
-0@@ -0,0 +1,40 @@ +From 79019d976584c598f8d0a9d8de43c989946f974b Mon Sep 17 00:00:00 2001 +From: Pascal Bach <[email protected]> +Date: Wed, 13 Feb 2019 09:28:07 +0100 +Subject: [PATCH] Don't build tools with CC_FOR_BUILD + +The tools are intended for the target not for the host. + +Upstream-Status: Pending + +Signed-off-by: Pascal Bach <[email protected]> +--- + tools/locktest/Makefile.am | 1 - + tools/rpcgen/Makefile.am | 1 - + 2 files changed, 2 deletions(-) + +diff --git a/tools/locktest/Makefile.am b/tools/locktest/Makefile.am +index 3156815..87d0bac 100644 +--- a/tools/locktest/Makefile.am ++++ b/tools/locktest/Makefile.am +@@ -1,6 +1,5 @@ + ## Process this file with automake to produce Makefile.in + +-CC=$(CC_FOR_BUILD) + LIBTOOL = @LIBTOOL@ --tag=CC + + noinst_PROGRAMS = testlk +diff --git a/tools/rpcgen/Makefile.am b/tools/rpcgen/Makefile.am +index 8a9ec89..3e092c9 100644 +--- a/tools/rpcgen/Makefile.am ++++ b/tools/rpcgen/Makefile.am +@@ -1,6 +1,5 @@ + ## Process this file with automake to produce Makefile.in + +-CC=$(CC_FOR_BUILD) + LIBTOOL = @LIBTOOL@ --tag=CC + + noinst_PROGRAMS = rpcgen +-- +2.11.0 +meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-Do-not-pass-CFLAGS-to-gcc-while-building.patch deleted +0
-42@@ -1,42 +0,0 @@ -nfs-utils: Do not pass CFLAGS to gcc while building - -Do not pass CFLAGS/LDFLAGS to gcc while building, The needed flags has -been passed by xxx_CFLAGS=$(CFLAGS_FOR_BUILD). - -Upstream-Status: Pending - -Signed-off-by: Chong Lu <[email protected]> ---- - tools/locktest/Makefile.am | 2 ++ - tools/rpcgen/Makefile.am | 2 ++ - 2 files changed, 4 insertions(+) - -diff --git a/tools/locktest/Makefile.am b/tools/locktest/Makefile.am -index 3156815..1729fd1 100644 ---- a/tools/locktest/Makefile.am -+++ b/tools/locktest/Makefile.am -@@ -1,6 +1,8 @@ - ## Process this file with automake to produce Makefile.in - - CC=$(CC_FOR_BUILD) -+CFLAGS= -+LDFLAGS= - LIBTOOL = @LIBTOOL@ --tag=CC - - noinst_PROGRAMS = testlk -diff --git a/tools/rpcgen/Makefile.am b/tools/rpcgen/Makefile.am -index 8a9ec89..8bacdaa 100644 ---- a/tools/rpcgen/Makefile.am -+++ b/tools/rpcgen/Makefile.am -@@ -1,6 +1,8 @@ - ## Process this file with automake to produce Makefile.in - - CC=$(CC_FOR_BUILD) -+CFLAGS= -+LDFLAGS= - LIBTOOL = @LIBTOOL@ --tag=CC - - noinst_PROGRAMS = rpcgen --- -1.7.9.5 -meta/recipes-connectivity/nfs-utils/nfs-utils_2.3.3.bb +1
-7@@ -26,7 +26,6 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/nfs-utils/${PV}/nfs-utils-${PV}.tar.x file://nfs-mountd.service \ file://nfs-statd.service \ file://proc-fs-nfsd.mount \ - file://nfs-utils-Do-not-pass-CFLAGS-to-gcc-while-building.patch \ file://nfs-utils-debianize-start-statd.patch \ file://bugfix-adjust-statd-service-name.patch \ file://nfs-utils-musl-limits.patch \@@ -35,6 +34,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/nfs-utils/${PV}/nfs-utils-${PV}.tar.x file://clang-format-string.patch \ file://0001-Makefile.am-update-the-path-of-libnfs.a.patch \ file://0001-Makefile.am-fix-undefined-function-for-libnsm.a.patch \ + file://0001-Don-t-build-tools-with-CC_FOR_BUILD.patch \ " SRC_URI_append_libc-glibc = " file://0001-configure.ac-Do-not-fatalize-Wmissing-prototypes.patch" SRC_URI_append_libc-musl = " file://nfs-utils-musl-res_querydomain.patch"@@ -147,11 +147,6 @@ do_install_append () { chown -R rpcuser:rpcuser ${D}${localstatedir}/lib/nfs/statd chmod 0644 ${D}${localstatedir}/lib/nfs/statd/state - # the following are built by CC_FOR_BUILD - rm -f ${D}${sbindir}/rpcdebug - rm -f ${D}${sbindir}/rpcgen - rm -f ${D}${sbindir}/locktest - # Make python tools use python 3 sed -i -e '1s,#!.*python.*,#!${bindir}/python3,' ${D}${sbindir}/mountstats ${D}${sbindir}/nfsiostat --2.11.0
--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Quoted 1 line
Will you be sending that fix upstream too?
I'm planning to. However I'm struggling a bit to figure out where exactly I should send this patch. It's not clear to me how the nfs-utils project is structured.
Quoted 183 lines
Quoted 11 lines · Pascal Bach
Some tools were built with
CC_FOR_BUILDwhich points to the target compiler. The current patch avoided issues by deleting some of the binaries during install.This patch replaces the
CC_FOR_BUILDwith CC so the tools are built with the target compiler. This means the binaries no longer need to be deleted.I stumbled upon this by trying to globally add "--ffile-prefix-map", which is not supported by my host GCC, to get rid of some "buildpaths" QA
Warnings.
Quoted 6 lines
Cc Robert Yang <[email protected]>Signed-off-by Pascal Bach <[email protected]>--- .../0001-Don-t-build-tools-with-CC_FOR_BUILD.patch | 40+++++++++++++++++++++ ...-Do-not-pass-CFLAGS-to-gcc-while-
building.patch | 42 ----------------------
meta/recipes-connectivity/nfs-utils/nfs-utils_2.3.3.bb SRC_URI = "${KERNELORG_MIRROR}/linux/utils/nfs-
Quoted 120 lines
.../nfs-utils/nfs-utils_2.3.3.bb | 7 +--- 3 files changed, 41 insertions(+), 48 deletions(-) create mode100644 meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Don-t-build-tools-w ith-CC_FOR_BUILD.patch delete mode 100644 meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-Do-not-pass-CF LAGS-to-gcc-while-building.patch
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Don-t-build-tools -with-CC_FOR_BUILD.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Don-t-build-tools -with-CC_FOR_BUILD.patch
new file mode 100644
index 0000000000..23bc3eaf72meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Don-t-build-t new file +42
-0+++ ools-with-CC_FOR_BUILD.patch@@ -0,0 +1,40 @@ +From 79019d976584c598f8d0a9d8de43c989946f974b Mon Sep 17 00:00:00 +2001 +From: Pascal Bach <[email protected]> +Date: Wed, 13 Feb 2019 09:28:07 +0100 +Subject: [PATCH] Don't build tools with CC_FOR_BUILD + +The tools are intended for the target not for the host. + +Upstream-Status: Pending + +Signed-off-by: Pascal Bach <[email protected]> +--- + tools/locktest/Makefile.am | 1 - + tools/rpcgen/Makefile.am | 1 - + 2 files changed, 2 deletions(-) + +diff --git a/tools/locktest/Makefile.am b/tools/locktest/Makefile.am +index 3156815..87d0bac 100644 +--- a/tools/locktest/Makefile.am ++++ b/tools/locktest/Makefile.am +@@ -1,6 +1,5 @@ + ## Process this file with automake to produce Makefile.in + +-CC=$(CC_FOR_BUILD) + LIBTOOL = @LIBTOOL@ --tag=CC + + noinst_PROGRAMS = testlk +diff --git a/tools/rpcgen/Makefile.am b/tools/rpcgen/Makefile.am +index 8a9ec89..3e092c9 100644 +--- a/tools/rpcgen/Makefile.am ++++ b/tools/rpcgen/Makefile.am +@@ -1,6 +1,5 @@ + ## Process this file with automake to produce Makefile.in + +-CC=$(CC_FOR_BUILD) + LIBTOOL = @LIBTOOL@ --tag=CC + + noinst_PROGRAMS = rpcgen +-- +2.11.0 +diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-Do-not-pass- CFLAGS-to-gcc-while-building.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-Do-not-pass- CFLAGS-to-gcc-while-building.patch
deleted file mode 100644
index 993f1e5ea5..0000000000
---
a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-Do-not-pass- CFLAGS-to-gcc-while-building.patch
+++/dev/nullmeta/recipes-connectivity/nfs-utils/nfs-utils/0001-Don-t-build-t new file +0
-3@@ -1,42 +0,0 @@ -nfs-utils: Do not pass CFLAGS to gcc while building - -Do not pass CFLAGS/LDFLAGS to gcc while building, The needed flagshas -been passed by xxx_CFLAGS=$(CFLAGS_FOR_BUILD).
meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Don-t-build-t new file +0
-38- -Upstream-Status: Pending - -Signed-off-by: Chong Lu <[email protected]> ---- - tools/locktest/Makefile.am | 2 ++ - tools/rpcgen/Makefile.am | 2 ++ - 2 files changed, 4 insertions(+) - -diff --git a/tools/locktest/Makefile.am b/tools/locktest/Makefile.am -index 3156815..1729fd1 100644 ---- a/tools/locktest/Makefile.am -+++ b/tools/locktest/Makefile.am -@@ -1,6 +1,8 @@ - ## Process this file with automake to produce Makefile.in - - CC=$(CC_FOR_BUILD) -+CFLAGS= -+LDFLAGS= - LIBTOOL = @LIBTOOL@ --tag=CC - - noinst_PROGRAMS = testlk -diff --git a/tools/rpcgen/Makefile.am b/tools/rpcgen/Makefile.am -index 8a9ec89..8bacdaa 100644 ---- a/tools/rpcgen/Makefile.am -+++ b/tools/rpcgen/Makefile.am -@@ -1,6 +1,8 @@ - ## Process this file with automake to produce Makefile.in - - CC=$(CC_FOR_BUILD) -+CFLAGS= -+LDFLAGS= - LIBTOOL = @LIBTOOL@ --tag=CC - - noinst_PROGRAMS = rpcgen --- -1.7.9.5 -meta/recipes-connectivity/nfs-utils/nfs-utils_2.3.3.bb +0
-0@@ -26,7 +26,6 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/nfs-utils/${PV}/nfs-utils-${PV}.tar.x
Quoted 8 lines
meta/recipes-connectivity/nfs-utils/nfs-utils_2.3.3.bb +0
-1file://nfs-mountd.service \ file://nfs-statd.service \ file://proc-fs-nfsd.mount \ - file://nfs-utils-Do-not-pass-CFLAGS-to-gcc-while-building.patch \ file://nfs-utils-debianize-start-statd.patch \ file://bugfix-adjust-statd-service-name.patch \ file://nfs-utils-musl-limits.patch \ @@ -35,6 +34,7 @@
SRC_URI= "${KERNELORG_MIRROR}/linux/utils/nfs-utils/${PV}/nfs-utils-${PV}.tar.x
Quoted 7 lines
file://clang-format-string.patch \ file://0001-Makefile.am-update-the-path-of-libnfs.a.patch \file://0001-Makefile.am-fix-undefined-function-for-libnsm.a.patch \
+ file://0001-Don-t-build-tools-with-CC_FOR_BUILD.patch \
"
SRC_URI_append_libc-glibc = " file://0001-configure.ac-Do-not-fatalize-Wmissing-prototypes.patch"
Quoted 1 line
SRC_URI_append_libc-musl = " file://nfs-utils-musl-
res_querydomain.patch"
Quoted 21 lines
meta/recipes-connectivity/nfs-utils/nfs-utils_2.3.3.bb +0
-5@@ -147,11 +147,6 @@ do_install_append () { chown -R rpcuser:rpcuser ${D}${localstatedir}/lib/nfs/statd chmod 0644 ${D}${localstatedir}/lib/nfs/statd/state - # the following are built by CC_FOR_BUILD - rm -f ${D}${sbindir}/rpcdebug - rm -f ${D}${sbindir}/rpcgen - rm -f ${D}${sbindir}/locktest - # Make python tools use python 3 sed -i -e '1s,#!.*python.*,#!${bindir}/python3,'${D}${sbindir}/mountstats ${D}${sbindir}/nfsiostat
--
2.11.0--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core