ltp-testsuite: support building with toolchains without native RPC
PATCH 1/1 ltp-testsuite: support building with toolchains without native RPC
From: Thomas De Schampheleire <[email protected]>
ltp-testsuite needs RPC, but this could also be provided by libtirpc.
Since musl toolchains never have RPC support, this change would now allow building of ltp-testsuite on musl toolchains. Unfortunately, ltp-testsuite does not build yet with musl, so a specific check on musl is added.
--- package/ltp-testsuite/Config.in | 7 ++++--- package/ltp-testsuite/ltp-testsuite.mk | 14 ++++++++++++-- 2 files changed, 16 insertions(+), 5 deletions(-)
package/ltp-testsuite/Config.in +4 -3
@@ -6,7 +6,8 @@ config BR2_PACKAGE_LTP_TESTSUITE bool "ltp-testsuite" depends on BR2_USE_MMU # fork() depends on BR2_TOOLCHAIN_HAS_THREADS - depends on BR2_TOOLCHAIN_HAS_NATIVE_RPC + depends on !BR2_TOOLCHAIN_USES_MUSL + select BR2_PACKAGE_LIBTIRPC if !BR2_TOOLCHAIN_HAS_NATIVE_RPC # does not build, cachectl.h issue depends on !BR2_nios2 help
@@ -21,7 +22,7 @@ config BR2_PACKAGE_LTP_TESTSUITE http://ltp.sourceforge.net/ -comment "ltp-testsuite needs a toolchain w/ RPC, threads" +comment "ltp-testsuite needs a non-musl toolchain w/ threads" depends on !BR2_nios2 depends on BR2_USE_MMU - depends on !BR2_TOOLCHAIN_HAS_THREADS || !BR2_TOOLCHAIN_HAS_NATIVE_RPC + depends on !BR2_TOOLCHAIN_HAS_THREADS || BR2_TOOLCHAIN_USES_MUSL
package/ltp-testsuite/ltp-testsuite.mk +12 -2
@@ -19,8 +19,18 @@ endif # ltp-testsuite uses <fts.h>, which isn't compatible with largefile # support. +LTP_TESTSUITE_CFLAGS = $(filter-out -D_FILE_OFFSET_BITS=64,$(TARGET_CFLAGS)) +LTP_TESTSUITE_CPPFLAGS = $(filter-out -D_FILE_OFFSET_BITS=64,$(TARGET_CPPFLAGS)) + +ifeq ($(BR2_PACKAGE_LIBTIRPC),y) +LTP_TESTSUITE_DEPENDENCIES += libtirpc +LTP_TESTSUITE_CFLAGS += -I$(STAGING_DIR)/usr/include/tirpc/ +LTP_TESTSUITE_LDFLAGS += -ltirpc +endif + LTP_TESTSUITE_CONF_ENV += \ - CFLAGS="$(filter-out -D_FILE_OFFSET_BITS=64,$(TARGET_CFLAGS))" \ - CPPFLAGS="$(filter-out -D_FILE_OFFSET_BITS=64,$(TARGET_CPPFLAGS))" + CFLAGS="$(LTP_TESTSUITE_CFLAGS)" \ + CPPFLAGS="$(LTP_TESTSUITE_CPPFLAGS)" \ + LDFLAGS="$(LTP_TESTSUITE_LDFLAGS)" $(eval $(autotools-package))
Signature · 1 line
1.8.5.1
PATCH 1/1 ltp-testsuite: support building with toolchains without native RPC
Thmoas, All,
On 2015-07-24 22:08 +0200, Thomas De Schampheleire spake thusly:
Quoted 43 lines
From: Thomas De Schampheleire <[email protected]>
ltp-testsuite needs RPC, but this could also be provided by libtirpc.
Since musl toolchains never have RPC support, this change would now allow building of ltp-testsuite on musl toolchains. Unfortunately, ltp-testsuite does not build yet with musl, so a specific check on musl is added.
Signed-off-by Thomas De Schampheleire <[email protected]>--- package/ltp-testsuite/Config.in | 7 ++++--- package/ltp-testsuite/ltp-testsuite.mk | 14 ++++++++++++-- 2 files changed, 16 insertions(+), 5 deletions(-)package/ltp-testsuite/Config.in +4
-3@@ -6,7 +6,8 @@ config BR2_PACKAGE_LTP_TESTSUITE bool "ltp-testsuite" depends on BR2_USE_MMU # fork() depends on BR2_TOOLCHAIN_HAS_THREADS - depends on BR2_TOOLCHAIN_HAS_NATIVE_RPC + depends on !BR2_TOOLCHAIN_USES_MUSL + select BR2_PACKAGE_LIBTIRPC if !BR2_TOOLCHAIN_HAS_NATIVE_RPC # does not build, cachectl.h issue depends on !BR2_nios2 help@@ -21,7 +22,7 @@ config BR2_PACKAGE_LTP_TESTSUITE http://ltp.sourceforge.net/ -comment "ltp-testsuite needs a toolchain w/ RPC, threads" +comment "ltp-testsuite needs a non-musl toolchain w/ threads" depends on !BR2_nios2 depends on BR2_USE_MMU - depends on !BR2_TOOLCHAIN_HAS_THREADS || !BR2_TOOLCHAIN_HAS_NATIVE_RPC + depends on !BR2_TOOLCHAIN_HAS_THREADS || BR2_TOOLCHAIN_USES_MUSLpackage/ltp-testsuite/ltp-testsuite.mk +0
-0
package/ltp-testsuite/ltp-testsuite.mk endif · line 23
Quoted 5 lines
package/ltp-testsuite/ltp-testsuite.mk +2
-0@@ -19,8 +19,18 @@ endif # ltp-testsuite uses <fts.h>, which isn't compatible with largefile # support. +LTP_TESTSUITE_CFLAGS = $(filter-out -D_FILE_OFFSET_BITS=64,$(TARGET_CFLAGS)) +LTP_TESTSUITE_CPPFLAGS = $(filter-out -D_FILE_OFFSET_BITS=64,$(TARGET_CPPFLAGS))
This hunk does not seem to have anything to do with the issue at hand, namely RPC and musl, nor is it explained in the commit log. Care to explain why filtering it out is needed (in the commit log and a comment in the code), please?
Regards,
Yann E. MORIN.
Quoted 21 lines
package/ltp-testsuite/ltp-testsuite.mk +9
-2+ifeq ($(BR2_PACKAGE_LIBTIRPC),y) +LTP_TESTSUITE_DEPENDENCIES += libtirpc +LTP_TESTSUITE_CFLAGS += -I$(STAGING_DIR)/usr/include/tirpc/ +LTP_TESTSUITE_LDFLAGS += -ltirpc +endif + LTP_TESTSUITE_CONF_ENV += \ - CFLAGS="$(filter-out -D_FILE_OFFSET_BITS=64,$(TARGET_CFLAGS))" \ - CPPFLAGS="$(filter-out -D_FILE_OFFSET_BITS=64,$(TARGET_CPPFLAGS))" + CFLAGS="$(LTP_TESTSUITE_CFLAGS)" \ + CPPFLAGS="$(LTP_TESTSUITE_CPPFLAGS)" \ + LDFLAGS="$(LTP_TESTSUITE_LDFLAGS)" $(eval $(autotools-package))Signature · 6 lines
1.8.5.1 _______________________________________________ buildroot mailing list buildroot at busybox.net http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH 1/1 ltp-testsuite: support building with toolchains without native RPC
Hi Yann,
Quoted 57 lines · Yann E. MORIN
Thmoas, All,
On 2015-07-24 22:08 +0200, Thomas De Schampheleire spake thusly:
Quoted 5 lines
From: Thomas De Schampheleire <[email protected]>
ltp-testsuite needs RPC, but this could also be provided by libtirpc.
Since musl toolchains never have RPC support, this change would now
allow
Quoted 1 line
building of ltp-testsuite on musl toolchains. Unfortunately,
ltp-testsuite
Quoted 3 lines
does not build yet with musl, so a specific check on musl is added.
Signed-off-by Thomas De SchampheleireReview
Quoted 6 lines
--- package/ltp-testsuite/Config.in | 7 ++++--- package/ltp-testsuite/ltp-testsuite.mk | 14 ++++++++++++-- 2 files changed, 16 insertions(+), 5 deletions(-)(quoted diff) +0
-0b/package/ltp-testsuite/Config.in
Quoted 14 lines
index 52c02ce..91b09ce 100644
package/ltp-testsuite/Config.in +2
-1@@ -6,7 +6,8 @@ config BR2_PACKAGE_LTP_TESTSUITE bool "ltp-testsuite" depends on BR2_USE_MMU # fork() depends on BR2_TOOLCHAIN_HAS_THREADS - depends on BR2_TOOLCHAIN_HAS_NATIVE_RPC + depends on !BR2_TOOLCHAIN_USES_MUSL + select BR2_PACKAGE_LIBTIRPC if !BR2_TOOLCHAIN_HAS_NATIVE_RPC # does not build, cachectl.h issue depends on !BR2_nios2 helppackage/ltp-testsuite/Config.in config BR2_PACKAGE_LTP_TESTSUITE · line 27
Quoted 8 lines
package/ltp-testsuite/Config.in +1
-2@@ -21,7 +22,7 @@ config BR2_PACKAGE_LTP_TESTSUITE http://ltp.sourceforge.net/ -comment "ltp-testsuite needs a toolchain w/ RPC, threads" +comment "ltp-testsuite needs a non-musl toolchain w/ threads" depends on !BR2_nios2 depends on BR2_USE_MMU - depends on !BR2_TOOLCHAIN_HAS_THREADS ||!BR2_TOOLCHAIN_HAS_NATIVE_RPC
Review
Quoted 2 lines
package/ltp-testsuite/Config.in +1
-0+ depends on !BR2_TOOLCHAIN_HAS_THREADS || BR2_TOOLCHAIN_USES_MUSL(quoted diff) +0
-0
b/package/ltp-testsuite/ltp-testsuite.mkpackage/ltp-testsuite/ltp-testsuite.mk endif · line 22
Quoted 8 lines
index 2d4f286..05ffaf1 100644
package/ltp-testsuite/ltp-testsuite.mk +1
-0@@ -19,8 +19,18 @@ endif # ltp-testsuite uses <fts.h>, which isn't compatible with largefile # support. +LTP_TESTSUITE_CFLAGS = $(filter-out-D_FILE_OFFSET_BITS=64,$(TARGET_CFLAGS))
Quoted 7 lines
package/ltp-testsuite/ltp-testsuite.mk endif · line 23
Quoted 1 line
package/ltp-testsuite/ltp-testsuite.mk +1
-0+LTP_TESTSUITE_CPPFLAGS = $(filter-out-D_FILE_OFFSET_BITS=64,$(TARGET_CPPFLAGS))
This hunk does not seem to have anything to do with the issue at hand, namely RPC and musl, nor is it explained in the commit log. Care to explain why filtering it out is needed (in the commit log and a comment in the code), please?
These lines were already in that file (see removes below); I left the comment clarifying it. I just introduced intermediate variables to cleanly handle the tirpc changes.
Quoted 10 lines
package/ltp-testsuite/ltp-testsuite.mk endif · line 24
Quoted 10 lines
package/ltp-testsuite/ltp-testsuite.mk +6
-2+ifeq ($(BR2_PACKAGE_LIBTIRPC),y) +LTP_TESTSUITE_DEPENDENCIES += libtirpc +LTP_TESTSUITE_CFLAGS += -I$(STAGING_DIR)/usr/include/tirpc/ +LTP_TESTSUITE_LDFLAGS += -ltirpc +endif + LTP_TESTSUITE_CONF_ENV += \ - CFLAGS="$(filter-out -D_FILE_OFFSET_BITS=64,$(TARGET_CFLAGS))" \ - CPPFLAGS="$(filter-out -D_FILE_OFFSET_BITS=64,$(TARGET_CPPFLAGS))"
---------^
Quoted 5 lines
package/ltp-testsuite/ltp-testsuite.mk endif · line 36
Quoted 5 lines
package/ltp-testsuite/ltp-testsuite.mk +3
-0+ CFLAGS="$(LTP_TESTSUITE_CFLAGS)" \ + CPPFLAGS="$(LTP_TESTSUITE_CPPFLAGS)" \ + LDFLAGS="$(LTP_TESTSUITE_LDFLAGS)" $(eval $(autotools-package))
/Thomas
PATCH 1/1 ltp-testsuite: support building with toolchains without native RPC
Thomas, All,
On 2015-07-25 15:12 +0200, Thomas De Schampheleire spake thusly:
Quoted 2 lines · Yann E. MORIN
Quoted 1 line
On 2015-07-24 22:08 +0200, Thomas De Schampheleire spake thusly:
[--SNIP--]
Quoted 12 lines
Quoted 12 lines
package/ltp-testsuite/ltp-testsuite.mk endif · line 22
Quoted 8 lines
index 2d4f286..05ffaf1 100644
package/ltp-testsuite/ltp-testsuite.mk +1
-0@@ -19,8 +19,18 @@ endif # ltp-testsuite uses <fts.h>, which isn't compatible with largefile # support. +LTP_TESTSUITE_CFLAGS = $(filter-out-D_FILE_OFFSET_BITS=64,$(TARGET_CFLAGS))
package/ltp-testsuite/ltp-testsuite.mk endif · line 23
Quoted 1 line
package/ltp-testsuite/ltp-testsuite.mk +1
-0+LTP_TESTSUITE_CPPFLAGS = $(filter-out-D_FILE_OFFSET_BITS=64,$(TARGET_CPPFLAGS))
Quoted 7 lines
Quoted 4 lines
This hunk does not seem to have anything to do with the issue at hand, namely RPC and musl, nor is it explained in the commit log. Care to explain why filtering it out is needed (in the commit log and a comment in the code), please?
These lines were already in that file (see removes below); I left the comment clarifying it. I just introduced intermediate variables to cleanly handle the tirpc changes.
Indeed, my bad.
Regards,
Yann E. MORIN.
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH 1/1 ltp-testsuite: support building with toolchains without native RPC
In reply to Thomas De SchampheleireThomas, All,
On 2015-07-24 22:08 +0200, Thomas De Schampheleire spake thusly:
Quoted 19 lines
From: Thomas De Schampheleire <[email protected]>
ltp-testsuite needs RPC, but this could also be provided by libtirpc.
Since musl toolchains never have RPC support, this change would now allow building of ltp-testsuite on musl toolchains. Unfortunately, ltp-testsuite does not build yet with musl, so a specific check on musl is added.
Signed-off-by Thomas De Schampheleire <[email protected]>--- package/ltp-testsuite/Config.in | 7 ++++--- package/ltp-testsuite/ltp-testsuite.mk | 14 ++++++++++++-- 2 files changed, 16 insertions(+), 5 deletions(-)package/ltp-testsuite/Config.in +0
-0
package/ltp-testsuite/Config.in config BR2_PACKAGE_LTP_TESTSUITE · line 10
Quoted 6 lines
package/ltp-testsuite/Config.in +2
-1@@ -6,7 +6,8 @@ config BR2_PACKAGE_LTP_TESTSUITE bool "ltp-testsuite" depends on BR2_USE_MMU # fork() depends on BR2_TOOLCHAIN_HAS_THREADS - depends on BR2_TOOLCHAIN_HAS_NATIVE_RPC + depends on !BR2_TOOLCHAIN_USES_MUSL + select BR2_PACKAGE_LIBTIRPC if !BR2_TOOLCHAIN_HAS_NATIVE_RPC
libtirpc depends on !BR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX_2012R2 so I wonder why you did not propagate this dependency here.
However, that is not necessary, since that toolchain does provide native RPC, so we would not be selecting libtirpc with that toolchain.
Maybe worth a comment?
package/ltp-testsuite/Config.in config BR2_PACKAGE_LTP_TESTSUITE · line 25
Quoted 9 lines
package/ltp-testsuite/Config.in +1
-1# does not build, cachectl.h issue depends on !BR2_nios2 help@@ -21,7 +22,7 @@ config BR2_PACKAGE_LTP_TESTSUITE http://ltp.sourceforge.net/ -comment "ltp-testsuite needs a toolchain w/ RPC, threads" +comment "ltp-testsuite needs a non-musl toolchain w/ threads"
We usually use positive logic, like in samab4, libunwind or vlc:
comment "ltp-testsuite needs an (e)glibc or uClibc toolchain w/ threads"
Quoted 5 lines
package/ltp-testsuite/ltp-testsuite.mk +0
-0
package/ltp-testsuite/ltp-testsuite.mk endif · line 28
Quoted 10 lines
package/ltp-testsuite/ltp-testsuite.mk +7
-0@@ -19,8 +19,18 @@ endif # ltp-testsuite uses <fts.h>, which isn't compatible with largefile # support. +LTP_TESTSUITE_CFLAGS = $(filter-out -D_FILE_OFFSET_BITS=64,$(TARGET_CFLAGS)) +LTP_TESTSUITE_CPPFLAGS = $(filter-out -D_FILE_OFFSET_BITS=64,$(TARGET_CPPFLAGS)) + +ifeq ($(BR2_PACKAGE_LIBTIRPC),y) +LTP_TESTSUITE_DEPENDENCIES += libtirpc +LTP_TESTSUITE_CFLAGS += -I$(STAGING_DIR)/usr/include/tirpc/ +LTP_TESTSUITE_LDFLAGS += -ltirpc
libtirpc install a .pc file, so why not use it, as in:
LTP_TESTSUITE_DEPENDENCIES += libtirpc host-pkgconf
LTP_TESTSUITE_CFLAGS += `$(HOST_PKG_CONFIG_BINARY) --cflags libtirpc`
LTP_TESTSUITE_LDFLAGS += `$(HOST_PKG_COFNIG_BINARY) --libs libtirpc`Shoehorn a --static when needed, too, for good measure.
Regards,
Yann E. MORIN.
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH 1/1 ltp-testsuite: support building with toolchains without native RPC
Hi Yann,
Thanks for the review, see my feedback below...
Quoted 32 lines · Yann E. MORIN
Thomas, All,
On 2015-07-24 22:08 +0200, Thomas De Schampheleire spake thusly:
Quoted 19 lines
From: Thomas De Schampheleire <[email protected]>
ltp-testsuite needs RPC, but this could also be provided by libtirpc.
Since musl toolchains never have RPC support, this change would now allow building of ltp-testsuite on musl toolchains. Unfortunately, ltp-testsuite does not build yet with musl, so a specific check on musl is added.
Signed-off-by Thomas De Schampheleire <[email protected]>--- package/ltp-testsuite/Config.in | 7 ++++--- package/ltp-testsuite/ltp-testsuite.mk | 14 ++++++++++++-- 2 files changed, 16 insertions(+), 5 deletions(-)package/ltp-testsuite/Config.in +0
-0package/ltp-testsuite/Config.in config BR2_PACKAGE_LTP_TESTSUITE · line 10
Quoted 6 lines
package/ltp-testsuite/Config.in +2
-1@@ -6,7 +6,8 @@ config BR2_PACKAGE_LTP_TESTSUITE bool "ltp-testsuite" depends on BR2_USE_MMU # fork() depends on BR2_TOOLCHAIN_HAS_THREADS - depends on BR2_TOOLCHAIN_HAS_NATIVE_RPC + depends on !BR2_TOOLCHAIN_USES_MUSL + select BR2_PACKAGE_LIBTIRPC if !BR2_TOOLCHAIN_HAS_NATIVE_RPClibtirpc depends on !BR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX_2012R2 so I wonder why you did not propagate this dependency here.
Quoted 4 lines
However, that is not necessary, since that toolchain does provide native RPC, so we would not be selecting libtirpc with that toolchain.
Maybe worth a comment?
In fact there is another reason why this blackfin-specific dependency does not need propagation: ltp-testsuite depends on MMU support, which is not available for Blackfin anyway.
I used the other packages that have libtirpc support as example and used the same methods. All of them depend on MMU and none of them propagated the blackfin dependency. I did not see any comments about this so I did neither. I can clarify it in the commit message though.
Quoted 6 lines
Quoted 6 lines
package/ltp-testsuite/Config.in +0
-0# does not build, cachectl.h issue depends on !BR2_nios2 help@@ -21,7 +22,7 @@ config BR2_PACKAGE_LTP_TESTSUITE
Quoted 8 lines
package/ltp-testsuite/Config.in config BR2_PACKAGE_LTP_TESTSUITE · line 25
Quoted 4 lines
package/ltp-testsuite/Config.in +1
-1http://ltp.sourceforge.net/ -comment "ltp-testsuite needs a toolchain w/ RPC, threads" +comment "ltp-testsuite needs a non-musl toolchain w/ threads"We usually use positive logic, like in samab4, libunwind or vlc:
comment "ltp-testsuite needs an (e)glibc or uClibc toolchain w/ threads"
Here it depends on the viewpoint: the 'depends on' check is on !MUSL, so I find it logical to make the command the same. Alternatively, we can check on GLIBC || UCLIBC and make the comment correspond, but I feel it's not correct. Suppose tomorrow we add support for another C library: when checking on !MUSL, ltp-testsuite could be built against this C library, as expected. However, if we check on GLIBC || UCLIBC, ltp-testsuite would be automatically excluded from compilation against this C library, without a valid reason.
Quoted 19 lines
Quoted 6 lines
package/ltp-testsuite/ltp-testsuite.mk +0
-0package/ltp-testsuite/ltp-testsuite.mk endif · line 28
Quoted 10 lines
package/ltp-testsuite/ltp-testsuite.mk +7
-0@@ -19,8 +19,18 @@ endif # ltp-testsuite uses <fts.h>, which isn't compatible with largefile # support. +LTP_TESTSUITE_CFLAGS = $(filter-out -D_FILE_OFFSET_BITS=64,$(TARGET_CFLAGS)) +LTP_TESTSUITE_CPPFLAGS = $(filter-out -D_FILE_OFFSET_BITS=64,$(TARGET_CPPFLAGS)) + +ifeq ($(BR2_PACKAGE_LIBTIRPC),y) +LTP_TESTSUITE_DEPENDENCIES += libtirpc +LTP_TESTSUITE_CFLAGS += -I$(STAGING_DIR)/usr/include/tirpc/ +LTP_TESTSUITE_LDFLAGS += -ltirpclibtirpc install a .pc file, so why not use it, as in:
Quoted 3 lines
LTP_TESTSUITE_DEPENDENCIES += libtirpc host-pkgconf
LTP_TESTSUITE_CFLAGS += `$(HOST_PKG_CONFIG_BINARY) --cflags libtirpc`
LTP_TESTSUITE_LDFLAGS += `$(HOST_PKG_COFNIG_BINARY) --libs libtirpc`This is because I did the same as in other packages that use libtirpc, but you're absolutely right.
I will fix that and also line up the other packages to use the same approach.
Quoted 2 lines
Shoehorn a --static when needed, too, for good measure.
Yes, I will add that.
However, it does look like --static is not used consistently currently:
$ grep -rn '$(PKG_CONFIG_HOST_BINARY)' package/ | grep -v '\--static' | wc -l 37 $ grep -rn '$(PKG_CONFIG_HOST_BINARY)' package/ | grep '\--static' | wc -l 5
So this is another cleanup opportunity...
/Thomas