Patchwork [1/1] nfs-utils: use cross toolchain to compile testlk

login
register
mail settings
Submitter Chong.Lu@windriver.com
Date May 29, 2014, 9:10 a.m.
Message ID <e6a039546ac6da09a55950978189b3bc3b75fb8d.1401354584.git.Chong.Lu@windriver.com>
Download mbox | patch
Permalink /patch/72959/
State New
Headers show

Comments

Chong.Lu@windriver.com - May 29, 2014, 9:10 a.m.
testlk is built with host gcc at do_compile stage, which leads to unrecognized
some flags for special architecture. Using cross toolchain instead.

Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
---
 .../nfs-utils-use-cross-toolchain-to-compile.patch | 26 ++++++++++++++++++++++
 .../nfs-utils/nfs-utils_1.3.0.bb                   |  3 ++-
 2 files changed, 28 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-use-cross-toolchain-to-compile.patch
Ross Burton - May 29, 2014, 10:15 a.m.
On 29 May 2014 10:10, Chong Lu <Chong.Lu@windriver.com> wrote:
> testlk is built with host gcc at do_compile stage, which leads to unrecognized
> some flags for special architecture. Using cross toolchain instead.

The makefile explicitly uses the host compiler, so presumably there's
a good reason for this.  If the problem is that the host compiler is
being passed target CFLAGS, then you should set AM_CFLAGS to
CFLAGS_FOR_BUILD and so on.

Ross
Chong.Lu@windriver.com - May 30, 2014, 2:11 a.m.
On 05/29/2014 06:15 PM, Burton, Ross wrote:
> On 29 May 2014 10:10, Chong Lu <Chong.Lu@windriver.com> wrote:
>> testlk is built with host gcc at do_compile stage, which leads to unrecognized
>> some flags for special architecture. Using cross toolchain instead.
> The makefile explicitly uses the host compiler, so presumably there's
> a good reason for this.  If the problem is that the host compiler is
> being passed target CFLAGS, then you should set AM_CFLAGS to
> CFLAGS_FOR_BUILD and so on.
>
> Ross
>
>
Hi Ross,

I remove "CC=$(CC_FOR_BUILD)" in order to inherit compiler.
Do you mean that I should reset CFLAGS in makefile rather than inherit 
compiler?
If I reset CFLAGS, this makefile will use host compiler.
Moreover, testlk can't execute in target.

Best Regards
Chong
Ross Burton - May 30, 2014, 12:22 p.m.
On 30 May 2014 03:11, Chong Lu <Chong.Lu@windriver.com> wrote:
> I remove "CC=$(CC_FOR_BUILD)" in order to inherit compiler.
> Do you mean that I should reset CFLAGS in makefile rather than inherit
> compiler?
> If I reset CFLAGS, this makefile will use host compiler.
> Moreover, testlk can't execute in target.

I just had a proper look and it *should* be working as they're also
overriding CFLAGS.  Then again this is a test program that isn't
installed so instead of changing the makefile, why not just stop
recursing into testlock?

Ross

Patch

diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-use-cross-toolchain-to-compile.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-use-cross-toolchain-to-compile.patch
new file mode 100644
index 0000000..52a02e1
--- /dev/null
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-use-cross-toolchain-to-compile.patch
@@ -0,0 +1,26 @@ 
+nfs-utils: use cross toolchain to compile testlk
+
+testlk is built with host gcc at do_compile stage, which leads to unrecognized
+some flags for special architecture. Using cross toolchain instead.
+
+Upstream-Status: Pending
+
+Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
+---
+ tools/locktest/Makefile.am |    1 -
+ 1 file changed, 1 deletion(-)
+
+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
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.0.bb b/meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.0.bb
index 73cfa6b..1eee798 100644
--- a/meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.0.bb
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.0.bb
@@ -28,7 +28,8 @@  SRC_URI = "${KERNELORG_MIRROR}/linux/utils/nfs-utils/${PV}/nfs-utils-${PV}.tar.x
            file://nfs-utils.conf \
            file://nfs-server.service \
            file://nfs-mountd.service \
-           file://nfs-statd.service "
+           file://nfs-statd.service \
+           file://nfs-utils-use-cross-toolchain-to-compile.patch"
 
 SRC_URI[md5sum] = "6e93a7997ca3a1eac56bf219adab72a8"
 SRC_URI[sha256sum] = "ab8384d0e487ed6a18c5380d5df28015f7dd98680bf08f3247c97d9f7d99e56f"