Skip to contentSkip to conversation

iproute2: fix no-thread build

PATCH New Thomas Petazzoni 2 participants 5 messages Aug 5, 2016 – Aug 7, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 iproute2: fix no-thread build

iproute2 believes that it needs to link with libpthread for its arpd binary, because "some db implementations require thread". Therefore, our iproute2.mk explicitly disables the build of arpd when thread support is not available.

However, the sed expression it uses no longer works. The Makefile used to look like:

TARGETS = foo baz baz arpd foobar

so replacing " arpd " with a space was working fine. However, the Makefile got changed in iproute2 to:

ifeq (... berkeleydb available ...)

     TARGETS += arpd

endif

i.e, with no space at the end of the line. This made our sed expression ineffective, causing build issues with no-thread configurations since arpd was no longer disabled.

To address this, instead of sed-ing the Makefile, we overwrite the berkeleydb detection of iproute2, by writing to the "Config" file, like we're doing for other aspects of the package.

Fixes:

http://autobuild.buildroot.net/results/03a37a2372a4c2e438a073e015c49d9e554b86b7/

---
 package/iproute2/iproute2.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/iproute2/iproute2.mk +1 -1
index 91d5033..edc17ad 100644
@@ -42,7 +42,7 @@ ifeq ($(BR2_PACKAGE_BERKELEYDB_COMPAT185)$(BR2_TOOLCHAIN_HAS_THREADS),yy)
 IPROUTE2_DEPENDENCIES += berkeleydb
 else
 define IPROUTE2_DISABLE_ARPD
-	$(SED) "/^TARGETS=/s: arpd : :" $(IPROUTE2_DIR)/misc/Makefile
+	echo "HAVE_BERKELEY_DB:=n" >> $(IPROUTE2_DIR)/Config
 endef
 endif
 
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/2 iproute2: fix no-thread build

Hello,

Quoted 25 lines · Thomas Petazzoni

iproute2 believes that it needs to link with libpthread for its arpd binary, because "some db implementations require thread". Therefore, our iproute2.mk explicitly disables the build of arpd when thread support is not available.

However, the sed expression it uses no longer works. The Makefile used to look like:

TARGETS = foo baz baz arpd foobar

so replacing " arpd " with a space was working fine. However, the Makefile got changed in iproute2 to:

ifeq (... berkeleydb available ...)

     TARGETS += arpd

endif

i.e, with no space at the end of the line. This made our sed expression ineffective, causing build issues with no-thread configurations since arpd was no longer disabled.

To address this, instead of sed-ing the Makefile, we overwrite the berkeleydb detection of iproute2, by writing to the "Config" file, like we're doing for other aspects of the package.

Quoted 8 lines

Fixes:

http://autobuild.buildroot.net/results/03a37a2372a4c2e438a073e015c49d9e554b86b7/

---
 package/iproute2/iproute2.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Both patches applied.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#2 lore raw

PATCH 1/2 iproute2: fix no-thread build

In reply to Thomas Petazzoni

Thomas, All,

On 2016-08-05 19:07 +0200, Thomas Petazzoni spake thusly:

Quoted 25 lines

iproute2 believes that it needs to link with libpthread for its arpd binary, because "some db implementations require thread". Therefore, our iproute2.mk explicitly disables the build of arpd when thread support is not available.

However, the sed expression it uses no longer works. The Makefile used to look like:

TARGETS = foo baz baz arpd foobar

so replacing " arpd " with a space was working fine. However, the Makefile got changed in iproute2 to:

ifeq (... berkeleydb available ...)

     TARGETS += arpd

endif

i.e, with no space at the end of the line. This made our sed expression ineffective, causing build issues with no-thread configurations since arpd was no longer disabled.

To address this, instead of sed-ing the Makefile, we overwrite the berkeleydb detection of iproute2, by writing to the "Config" file, like we're doing for other aspects of the package.

Quoted 5 lines

Fixes:

http://autobuild.buildroot.net/results/03a37a2372a4c2e438a073e015c49d9e554b86b7/

Regards,
Yann E. MORIN.

Quoted 24 lines
---
 package/iproute2/iproute2.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/iproute2/iproute2.mk +1 -1
index 91d5033..edc17ad 100644
@@ -42,7 +42,7 @@ ifeq ($(BR2_PACKAGE_BERKELEYDB_COMPAT185)$(BR2_TOOLCHAIN_HAS_THREADS),yy)
 IPROUTE2_DEPENDENCIES += berkeleydb
 else
 define IPROUTE2_DISABLE_ARPD
-	$(SED) "/^TARGETS=/s: arpd : :" $(IPROUTE2_DIR)/misc/Makefile
+	echo "HAVE_BERKELEY_DB:=n" >> $(IPROUTE2_DIR)/Config
 endef
 endif
 
Signature · 6 lines
2.7.4

_______________________________________________
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.  |
'------------------------------^-------^------------------^--------------------'
#3 lore raw

PATCH 2/2 iproute2: use @D instead of IPROUTE2_DIR

In reply to Thomas Petazzoni

We more generally use $(@D) instead of $(pkg_DIR) to refer to the package source directory, so this commit updates iproute2 to also use $(@D) everywhere.

---
 package/iproute2/iproute2.mk | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
package/iproute2/iproute2.mk +4 -4
index edc17ad..09e68c5 100644
@@ -27,13 +27,13 @@ ifeq ($(BR2_PACKAGE_IPTABLES)x$(BR2_STATIC_LIBS),yx)
 IPROUTE2_DEPENDENCIES += iptables
 define IPROUTE2_WITH_IPTABLES
 	# Makefile is busted so it never passes IPT_LIB_DIR properly
-	$(SED) "s/-DIPT/-DXT/" $(IPROUTE2_DIR)/tc/Makefile
+	$(SED) "s/-DIPT/-DXT/" $(@D)/tc/Makefile
 endef
 else
 define IPROUTE2_WITH_IPTABLES
 	# em_ipset needs xtables, but configure misdetects it
-	echo "TC_CONFIG_IPSET:=n" >>$(IPROUTE2_DIR)/Config
-	echo "TC_CONFIG_XT:=n" >>$(IPROUTE2_DIR)/Config
+	echo "TC_CONFIG_IPSET:=n" >>$(@D)/Config
+	echo "TC_CONFIG_XT:=n" >>$(@D)/Config
 endef
 endif
 
@@ -42,7 +42,7 @@ ifeq ($(BR2_PACKAGE_BERKELEYDB_COMPAT185)$(BR2_TOOLCHAIN_HAS_THREADS),yy)
 IPROUTE2_DEPENDENCIES += berkeleydb
 else
 define IPROUTE2_DISABLE_ARPD
-	echo "HAVE_BERKELEY_DB:=n" >> $(IPROUTE2_DIR)/Config
+	echo "HAVE_BERKELEY_DB:=n" >> $(@D)/Config
 endef
 endif
 
Signature · 1 line
2.7.4
#4 lore raw

PATCH 2/2 iproute2: use @D instead of IPROUTE2_DIR

Thomas, All,

On 2016-08-05 19:08 +0200, Thomas Petazzoni spake thusly:

Quoted 5 lines

We more generally use $(@D) instead of $(pkg_DIR) to refer to the package source directory, so this commit updates iproute2 to also use $(@D) everywhere.

Regards,
Yann E. MORIN.

Quoted 41 lines
---
 package/iproute2/iproute2.mk | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
package/iproute2/iproute2.mk +4 -4
index edc17ad..09e68c5 100644
@@ -27,13 +27,13 @@ ifeq ($(BR2_PACKAGE_IPTABLES)x$(BR2_STATIC_LIBS),yx)
 IPROUTE2_DEPENDENCIES += iptables
 define IPROUTE2_WITH_IPTABLES
 	# Makefile is busted so it never passes IPT_LIB_DIR properly
-	$(SED) "s/-DIPT/-DXT/" $(IPROUTE2_DIR)/tc/Makefile
+	$(SED) "s/-DIPT/-DXT/" $(@D)/tc/Makefile
 endef
 else
 define IPROUTE2_WITH_IPTABLES
 	# em_ipset needs xtables, but configure misdetects it
-	echo "TC_CONFIG_IPSET:=n" >>$(IPROUTE2_DIR)/Config
-	echo "TC_CONFIG_XT:=n" >>$(IPROUTE2_DIR)/Config
+	echo "TC_CONFIG_IPSET:=n" >>$(@D)/Config
+	echo "TC_CONFIG_XT:=n" >>$(@D)/Config
 endef
 endif
 
@@ -42,7 +42,7 @@ ifeq ($(BR2_PACKAGE_BERKELEYDB_COMPAT185)$(BR2_TOOLCHAIN_HAS_THREADS),yy)
 IPROUTE2_DEPENDENCIES += berkeleydb
 else
 define IPROUTE2_DISABLE_ARPD
-	echo "HAVE_BERKELEY_DB:=n" >> $(IPROUTE2_DIR)/Config
+	echo "HAVE_BERKELEY_DB:=n" >> $(@D)/Config
 endef
 endif
 
Signature · 6 lines
2.7.4

_______________________________________________
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.  |
'------------------------------^-------^------------------^--------------------'