* [LTP] [PATCH] ltp: Fix cross-compile issue
@ 2014-12-16 14:34 Mats Liljegren
2014-12-16 14:34 ` Mats Liljegren
0 siblings, 1 reply; 8+ messages in thread
From: Mats Liljegren @ 2014-12-16 14:34 UTC (permalink / raw)
To: ltp-list
I had problems compiling LTP using Yocto (https://www.yoctoproject.org/).
The provided patch here fixed my problem. I haven't tried a "normal", i.e.
non-cross compile.
Mats Liljegren (1):
ltp: Fix cross-compile issue
include/mk/config.mk.default | 2 +-
m4/ltp-tirpc.m4 | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
--
1.9.1
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 8+ messages in thread
* [LTP] [PATCH] ltp: Fix cross-compile issue
2014-12-16 14:34 [LTP] [PATCH] ltp: Fix cross-compile issue Mats Liljegren
@ 2014-12-16 14:34 ` Mats Liljegren
2014-12-17 12:09 ` Cyril Hrubis
2015-02-16 5:17 ` Mike Frysinger
0 siblings, 2 replies; 8+ messages in thread
From: Mats Liljegren @ 2014-12-16 14:34 UTC (permalink / raw)
To: ltp-list
Compilation included the flag "-I/usr/include/tirpc" which ignores sysroot.
This makes a cross-compile to suddenly use host files rather than the files
installed in the compiler sysroot.
By prepending path with "=", the "=" will be replaced with the sysroot path.
Example of error in a Yocto build of ltp:
arm-enea-linux-gnueabi-gcc -march=armv7-a -mthumb-interwork -mfloat-abi=softfp -mfpu=neon -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed --sysroot=/media/data/fb/mlil/yocto-builds/build-keystone-evm-nohzfull/tmp/sysroots/keystone-evm -O2 -pipe -g -feliminate-unused-debug-types -g -O2 -fno-strict-aliasing -pipe -Wall -W -O2 -pipe -g -feliminate-unused-debug-types -Wold-style-definition -D_FORTIFY_SOURCE=2 -I/usr/include/tirpc -I/media/data/fb/mlil/yocto-builds/build-keystone-evm-nohzfull/tmp/work/armv7a-vfp-neon-enea-linux-gnueabi/ltp/20140508-r32/git/testcases/network/rpc/rpc-tirpc/tests_pack/lib -pthread -I../../../../../../../../include -I../../../../../../../../include -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -L/media/data/fb/mlil/yocto-builds/build-keystone-evm-nohzfull/tmp/work/armv7a-vfp-neon-enea-linux-gnueabi/ltp/20140508-r32/git/testcases/network/rpc/rpc-tirpc/tests_pack/lib -L../../../../../../../../lib rpc_get_myaddress.c -ltirpc -lrpc-tirpc -o rpc_get_myaddress
cc1: warning: include location "/usr/include/tirpc" is unsafe for cross-compilation [-Wpoison-system-directories]
make
Signed-off-by: Mats Liljegren <mats.liljegren@enea.com>
---
include/mk/config.mk.default | 2 +-
m4/ltp-tirpc.m4 | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/mk/config.mk.default b/include/mk/config.mk.default
index c20f901..462ddcf 100644
--- a/include/mk/config.mk.default
+++ b/include/mk/config.mk.default
@@ -42,7 +42,7 @@ YACC := bison -y
#NUMA_CPPFLAGS := -DNUMA_VERSION1_COMPATIBILITY
#NUMA_LIBS := -lnuma
#SELINUX_LIBS := -lselinux
-#TIRPC_CPPFLAGS := -I/usr/include/tirpc
+#TIRPC_CPPFLAGS := -I=/usr/include/tirpc
#TIRPC_LIBS := -ltirpc
prefix := /opt/ltp
diff --git a/m4/ltp-tirpc.m4 b/m4/ltp-tirpc.m4
index 73fde51..f4df239 100644
--- a/m4/ltp-tirpc.m4
+++ b/m4/ltp-tirpc.m4
@@ -25,7 +25,7 @@ AC_DEFUN([LTP_CHECK_TIRPC],[
TIRPC_LIBS=""
AC_CHECK_HEADER(tirpc/netconfig.h,[
- TIRPC_CPPFLAGS="-I/usr/include/tirpc"
+ TIRPC_CPPFLAGS="-I=/usr/include/tirpc"
AC_DEFINE(HAVE_LIBTIRPC, 1, [Define to 1 if you have libtirpc headers installed])
AC_CHECK_LIB(tirpc, rpcb_set, [TIRPC_LIBS="-ltirpc"])])
--
1.9.1
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [LTP] [PATCH] ltp: Fix cross-compile issue
2014-12-16 14:34 ` Mats Liljegren
@ 2014-12-17 12:09 ` Cyril Hrubis
[not found] ` <20141217154739.69e91b2a@mats-desktop>
2015-02-16 5:17 ` Mike Frysinger
1 sibling, 1 reply; 8+ messages in thread
From: Cyril Hrubis @ 2014-12-17 12:09 UTC (permalink / raw)
To: Mats Liljegren; +Cc: ltp-list
Hi!
> Compilation included the flag "-I/usr/include/tirpc" which ignores sysroot.
> This makes a cross-compile to suddenly use host files rather than the files
> installed in the compiler sysroot.
>
> By prepending path with "=", the "=" will be replaced with the sysroot path.
Unfortunatelly this does not work for me. The compiler fails to find the
header after the change.
> diff --git a/m4/ltp-tirpc.m4 b/m4/ltp-tirpc.m4
> index 73fde51..f4df239 100644
> --- a/m4/ltp-tirpc.m4
> +++ b/m4/ltp-tirpc.m4
> @@ -25,7 +25,7 @@ AC_DEFUN([LTP_CHECK_TIRPC],[
> TIRPC_LIBS=""
>
> AC_CHECK_HEADER(tirpc/netconfig.h,[
> - TIRPC_CPPFLAGS="-I/usr/include/tirpc"
I've looked around for a solution and the internet seems to suggest to
add ${SYSROOT} before the /usr/include/tirpc:
+ TIRPC_CPPFLAGS="-I${SYSROOT}/usr/include/tirpc"
Does that work for you?
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [LTP] [PATCH] ltp: Fix cross-compile issue
[not found] ` <20141217154739.69e91b2a@mats-desktop>
@ 2014-12-17 14:54 ` Cyril Hrubis
0 siblings, 0 replies; 8+ messages in thread
From: Cyril Hrubis @ 2014-12-17 14:54 UTC (permalink / raw)
To: Mats Liljegren; +Cc: ltp-list
Hi!
> Yes, it worked.
>
> Will you make the change, or do you want a new patch from me?
I will fix that.
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [LTP] [PATCH] ltp: Fix cross-compile issue
2014-12-16 14:34 ` Mats Liljegren
2014-12-17 12:09 ` Cyril Hrubis
@ 2015-02-16 5:17 ` Mike Frysinger
2015-02-16 8:15 ` Mats Liljegren
2015-02-17 16:49 ` Cyril Hrubis
1 sibling, 2 replies; 8+ messages in thread
From: Mike Frysinger @ 2015-02-16 5:17 UTC (permalink / raw)
To: Mats Liljegren; +Cc: ltp-list
[-- Attachment #1.1: Type: text/plain, Size: 625 bytes --]
On 16 Dec 2014 15:34, Mats Liljegren wrote:
> --- a/m4/ltp-tirpc.m4
> +++ b/m4/ltp-tirpc.m4
> @@ -25,7 +25,7 @@ AC_DEFUN([LTP_CHECK_TIRPC],[
> TIRPC_LIBS=""
>
> AC_CHECK_HEADER(tirpc/netconfig.h,[
> - TIRPC_CPPFLAGS="-I/usr/include/tirpc"
> + TIRPC_CPPFLAGS="-I=/usr/include/tirpc"
> AC_DEFINE(HAVE_LIBTIRPC, 1, [Define to 1 if you have libtirpc headers installed])
> AC_CHECK_LIB(tirpc, rpcb_set, [TIRPC_LIBS="-ltirpc"])])
this m4 is fatally flawed and tweaking the flags won't help. we should switch
to use pkg-config here. a cursory glance suggests acl/cap should also be
updated.
-mike
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
[-- Attachment #2: Type: text/plain, Size: 441 bytes --]
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
[-- Attachment #3: Type: text/plain, Size: 155 bytes --]
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [LTP] [PATCH] ltp: Fix cross-compile issue
2015-02-16 5:17 ` Mike Frysinger
@ 2015-02-16 8:15 ` Mats Liljegren
2015-02-16 9:10 ` Mike Frysinger
2015-02-17 16:49 ` Cyril Hrubis
1 sibling, 1 reply; 8+ messages in thread
From: Mats Liljegren @ 2015-02-16 8:15 UTC (permalink / raw)
To: Mike Frysinger; +Cc: ltp-list
My change never made it into the repository. Instead, Cyril prepended the path with ${SYSROOT}, where your cross-compile environment needs to setup SYSROOT path in order to make a proper cross-compile of LTP. See commit d4ab5d27d5ad666547d7b4d8e269e00921960c58. Cludgy, but it is simple and it works. This "=" thing I proposed apparently didn't work for everyone.
As for using pkg-config, I have no idea how that will work out in a cross-compile environment. But I guess it should be possible to go down that route as well...
/Mats
________________________________________
From: Mike Frysinger [vapier@gentoo.org]
Sent: Monday, February 16, 2015 6:17 AM
To: Mats Liljegren
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH] ltp: Fix cross-compile issue
On 16 Dec 2014 15:34, Mats Liljegren wrote:
> --- a/m4/ltp-tirpc.m4
> +++ b/m4/ltp-tirpc.m4
> @@ -25,7 +25,7 @@ AC_DEFUN([LTP_CHECK_TIRPC],[
> TIRPC_LIBS=""
>
> AC_CHECK_HEADER(tirpc/netconfig.h,[
> - TIRPC_CPPFLAGS="-I/usr/include/tirpc"
> + TIRPC_CPPFLAGS="-I=/usr/include/tirpc"
> AC_DEFINE(HAVE_LIBTIRPC, 1, [Define to 1 if you have libtirpc headers installed])
> AC_CHECK_LIB(tirpc, rpcb_set, [TIRPC_LIBS="-ltirpc"])])
this m4 is fatally flawed and tweaking the flags won't help. we should switch
to use pkg-config here. a cursory glance suggests acl/cap should also be
updated.
-mike
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [LTP] [PATCH] ltp: Fix cross-compile issue
2015-02-16 8:15 ` Mats Liljegren
@ 2015-02-16 9:10 ` Mike Frysinger
0 siblings, 0 replies; 8+ messages in thread
From: Mike Frysinger @ 2015-02-16 9:10 UTC (permalink / raw)
To: Mats Liljegren; +Cc: ltp-list
[-- Attachment #1.1: Type: text/plain, Size: 787 bytes --]
On 16 Feb 2015 08:15, Mats Liljegren wrote:
please don't top post
> My change never made it into the repository. Instead, Cyril prepended the path with ${SYSROOT}, where your cross-compile environment needs to setup SYSROOT path in order to make a proper cross-compile of LTP. See commit d4ab5d27d5ad666547d7b4d8e269e00921960c58. Cludgy, but it is simple and it works. This "=" thing I proposed apparently didn't work for everyone.
i'm aware. that's not really the way to go about it either.
> As for using pkg-config, I have no idea how that will work out in a cross-compile environment. But I guess it should be possible to go down that route as well...
pkg-config works fine for cross-compiling. it's pretty much how library lookup
should be done nowadays.
-mike
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
[-- Attachment #2: Type: text/plain, Size: 441 bytes --]
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
[-- Attachment #3: Type: text/plain, Size: 155 bytes --]
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [LTP] [PATCH] ltp: Fix cross-compile issue
2015-02-16 5:17 ` Mike Frysinger
2015-02-16 8:15 ` Mats Liljegren
@ 2015-02-17 16:49 ` Cyril Hrubis
1 sibling, 0 replies; 8+ messages in thread
From: Cyril Hrubis @ 2015-02-17 16:49 UTC (permalink / raw)
To: Mats Liljegren, ltp-list
Hi!
> > --- a/m4/ltp-tirpc.m4
> > +++ b/m4/ltp-tirpc.m4
> > @@ -25,7 +25,7 @@ AC_DEFUN([LTP_CHECK_TIRPC],[
> > TIRPC_LIBS=""
> >
> > AC_CHECK_HEADER(tirpc/netconfig.h,[
> > - TIRPC_CPPFLAGS="-I/usr/include/tirpc"
> > + TIRPC_CPPFLAGS="-I=/usr/include/tirpc"
> > AC_DEFINE(HAVE_LIBTIRPC, 1, [Define to 1 if you have libtirpc headers installed])
> > AC_CHECK_LIB(tirpc, rpcb_set, [TIRPC_LIBS="-ltirpc"])])
>
> this m4 is fatally flawed and tweaking the flags won't help. we should switch
> to use pkg-config here. a cursory glance suggests acl/cap should also be
> updated.
Looking pkg-config on my system only libtirpc supported.
There seems to be nothing nothing for libacl nor for libcap (not to be
confused with libcap-ng).
I guess that we may fix the ltp-tirpc.m4 to use pkg-config, if available
but not much more than that.
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2015-02-17 16:50 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-16 14:34 [LTP] [PATCH] ltp: Fix cross-compile issue Mats Liljegren
2014-12-16 14:34 ` Mats Liljegren
2014-12-17 12:09 ` Cyril Hrubis
[not found] ` <20141217154739.69e91b2a@mats-desktop>
2014-12-17 14:54 ` Cyril Hrubis
2015-02-16 5:17 ` Mike Frysinger
2015-02-16 8:15 ` Mats Liljegren
2015-02-16 9:10 ` Mike Frysinger
2015-02-17 16:49 ` Cyril Hrubis
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.