package/make: add host variant
PATCH v2 1/3 package/make: add host variant
Add host variant for make package since glibc 2.28 now require GNU Make >= 4.0 [1].
We have to ceate gnumake and gmake symlinks to GNU make generated by Buildroot for the host. Otherwise the one provided by the host system can be used instead.
For example, the glibc build system is looking for gnumake and gmake before make. See [2].
[1] https://www.sourceware.org/ml/libc-alpha/2018-08/msg00003.html
[2] http://lists.busybox.net/pipermail/buildroot/2018-September/229654.html
--- package/make/make.mk | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
package/make/make.mk +14 -0
@@ -20,4 +20,18 @@ ifeq ($(BR2_STATIC_LIBS),y) MAKE_CONF_OPTS += --disable-load endif +HOST_MAKE_DEPENDENCIES = host-pkgconf +HOST_MAKE_CONF_OPTS = --without-guile + +# Some packages, like glibc, are looking for gnumake or gmake before +# make program. +# Create these symlink to use make binary generated by Buildroot for +# the host. +define HOST_MAKE_INSTALL_GNUMAKE + ln -fs make $(HOST_DIR)/bin/gnumake + ln -fs make $(HOST_DIR)/bin/gmake +endef +HOST_MAKE_POST_INSTALL_HOOKS += HOST_MAKE_INSTALL_GNUMAKE + $(eval $(autotools-package)) +$(eval $(host-autotools-package))
Signature · 1 line
2.14.4
PATCH v2 2/3 dependencies: host-make version check
The host make program is already checked by dependencies.sh but we want to check the version number even if Buildroot is able to use GNU make >= 3.81 but some packages may require a more recent version.
For example, since version 2.28 [1], glibc requires GNU Make >= 4.0.
For packages requiring make >= 4.0, the package makefile must use:
<PKG>_DEPENDENCIES = $(BR2_MAKE_HOST_DEPENDENCY) ... <PKG>_MAKE = $(BR2_MAKE)
BR2_MAKE1 is also available if needed.
[1] https://www.sourceware.org/ml/libc-alpha/2018-08/msg00003.html
--- support/dependencies/check-host-make.mk | 21 +++++++++++++++++ support/dependencies/check-host-make.sh | 42 +++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 support/dependencies/check-host-make.mk create mode 100755 support/dependencies/check-host-make.sh
support/dependencies/check-host-make.mk new file +21 -0
@@ -0,0 +1,21 @@ +# Since version 2.28, glibc requires GNU Make >= 4.0 +# https://www.sourceware.org/ml/libc-alpha/2018-08/msg00003.html +# +# Set this to either 4.0 or higher, depending on the highest minimum +# version required by any of the packages bundled in Buildroot. If a +# package is bumped or a new one added, and it requires a higher +# version, our package infra will catch it and whine. +# +BR2_MAKE_VERSION_MIN = 4.0 + +BR2_MAKE ?= $(call suitable-host-package,make,\ + $(BR2_MAKE_VERSION_MIN) $(MAKE)) + +ifeq ($(BR2_MAKE),) +BR2_MAKE = $(HOST_DIR)/bin/make -j$(PARALLEL_JOBS) +BR2_MAKE1 = $(HOST_DIR)/bin/make -j1 +BR2_MAKE_HOST_DEPENDENCY = host-make +else +BR2_MAKE = $(MAKE) +BR2_MAKE1 = $(MAKE1) +endif
support/dependencies/check-host-make.sh new file +42 -0
42 lines not on this page · raw message
Signature · 1 line
2.14.4
PATCH v2 2/3 dependencies: host-make version check
On 4 September 2018 at 05:19, Romain Naour <[email protected]> wrote:
[snip]
Quoted 35 lines
support/dependencies/check-host-make.sh new file +29
-0@@ -0,0 +1,42 @@ +#!/bin/sh + +# prevent shift error +[ $# -lt 2 ] && exit 1 + +major_min="${1%.*}" +minor_min="${1#*.}" + +shift + +# The host make program is already checked by dependencies.sh but we +# want to check the version number even if Buildroot is able to use +# GNU make >= 3.81 but some packages may require a more recent version. +make="$1" + +# Output of 'make --version' examples: +# GNU Make 4.2.1 +# GNU Make 4.0 +# GNU Make 3.81 +version=`$make --version 2>&1 | sed -e 's/^.* \([0-9\.]\)/\1/g' -e 's/[-\ +].*//g' -e '1q'` + +major=`echo "$version" | cut -d. -f1` +minor=`echo "$version" | cut -d. -f2` +bugfix=`echo "$version" | cut -d. -f3` + +if [ -z "${bugfix}" ] ; then + bugfix=0 +fi
support/dependencies/check-host-make.sh line 39
Quoted 10 lines
support/dependencies/check-host-make.sh new file +10
-0+ +if [ $major -lt $major_min ]; then + # echo nothing: no suitable make found + exit 1 +fi + +if [ $major -eq $major_min -a $minor -lt $minor_min ]; then + # echo nothing: no suitable make found + exit 1 +fi
Rather than parsing version strings, I've had good success with using sort -V:
if [ "$(printf '%s\n' "${minver}" "${makever}" | sort -V | head -n 1)" != "${minver}" ]; then
exit 1
fi
sort -V was added to GNU sort in coreutils 7.0 released 2008-10-05
Quoted 10 lines
support/dependencies/check-host-make.sh new file +3
-1+ +# valid +echo $make --2.14.4
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
PATCH v2 2/3 dependencies: host-make version check
In reply to Romain NaourRomain,
Quoted 11 lines · Romain Naour
The host make program is already checked by
dependencies.shbut we want to check the version number even if Buildroot is able to use GNU make >= 3.81 but some packages may require a more recent version.For example, since version 2.28 [1], glibc requires GNU Make >= 4.0.
For packages requiring make >= 4.0, the package makefile must use:
<PKG>_DEPENDENCIES = $(BR2_MAKE_HOST_DEPENDENCY) ... <PKG>_MAKE = $(BR2_MAKE)
Quoted 7 lines
BR2_MAKE1is also available if needed.[1] https://www.sourceware.org/ml/libc-alpha/2018-08/msg00003.html
Signed-off-by Romain Naour <[email protected]>Cc Baruch Siach <[email protected]>Cc Thomas Petazzoni <[email protected]>
Quoted 89 lines
--- support/dependencies/check-host-make.mk | 21 +++++++++++++++++ support/dependencies/check-host-make.sh | 42 +++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 support/dependencies/check-host-make.mk create mode 100755 support/dependencies/check-host-make.shsupport/dependencies/check-host-make.mk new file +21
-0@@ -0,0 +1,21 @@ +# Since version 2.28, glibc requires GNU Make >= 4.0 +# https://www.sourceware.org/ml/libc-alpha/2018-08/msg00003.html +# +# Set this to either 4.0 or higher, depending on the highest minimum +# version required by any of the packages bundled in Buildroot. If a +# package is bumped or a new one added, and it requires a higher +# version, our package infra will catch it and whine. +# +BR2_MAKE_VERSION_MIN = 4.0 + +BR2_MAKE ?= $(call suitable-host-package,make,\ + $(BR2_MAKE_VERSION_MIN) $(MAKE)) + +ifeq ($(BR2_MAKE),) +BR2_MAKE = $(HOST_DIR)/bin/make -j$(PARALLEL_JOBS) +BR2_MAKE1 = $(HOST_DIR)/bin/make -j1 +BR2_MAKE_HOST_DEPENDENCY = host-make +else +BR2_MAKE = $(MAKE) +BR2_MAKE1 = $(MAKE1) +endifsupport/dependencies/check-host-make.sh new file +42
-1@@ -0,0 +1,42 @@ +#!/bin/sh + +# prevent shift error +[ $# -lt 2 ] && exit 1 + +major_min="${1%.*}" +minor_min="${1#*.}" + +shift + +# The host make program is already checked by dependencies.sh but we +# want to check the version number even if Buildroot is able to use +# GNU make >= 3.81 but some packages may require a more recent version. +make="$1" + +# Output of 'make --version' examples: +# GNU Make 4.2.1 +# GNU Make 4.0 +# GNU Make 3.81 +version=`$make --version 2>&1 | sed -e 's/^.* \([0-9\.]\)/\1/g' -e 's/[-\ +].*//g' -e '1q'` + +major=`echo "$version" | cut -d. -f1` +minor=`echo "$version" | cut -d. -f2` +bugfix=`echo "$version" | cut -d. -f3` + +if [ -z "${bugfix}" ] ; then + bugfix=0 +fi + +if [ $major -lt $major_min ]; then + # echo nothing: no suitable make found + exit 1 +fi + +if [ $major -eq $major_min -a $minor -lt $minor_min ]; then + # echo nothing: no suitable make found + exit 1 +fi + +# valid +echo $make --2.14.4
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 8 lines
Matthew L Weber / Pr Software Engineer Airborne Information Systems / RC Linux Secure Platforms MS 131-100, C Ave NE, Cedar Rapids, IA, 52498, USA www.rockwellcollins.com Note: Any Export License Required Information and License Restricted Third Party Intellectual Property (TPIP) content must be encrypted and sent to matthew.weber at corp.rockwellcollins.com.
PATCH v2 2/3 dependencies: host-make version check
In reply to Romain NaourHello,
support/dependencies/check-host-make.sh line 29
Quoted 7 lines · Romain Naour
support/dependencies/check-host-make.sh new file +7
-0+major=`echo "$version" | cut -d. -f1` +minor=`echo "$version" | cut -d. -f2` +bugfix=`echo "$version" | cut -d. -f3` + +if [ -z "${bugfix}" ] ; then + bugfix=0 +fi
bugfix is not used anywhere, so I dropped this variable, and applied the patch to master. Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH v2 3/3 package/glibc: allow to specify host-make
In reply to Romain NaourUse host-make package if GNU make from the host machine is too old.
Use the newly introduced BR2_MAKE_HOST_DEPENDENCY and BR2_MAKE to provide respectively, host-make dependency and the path to the GNU make binary to use for building glibc.
Fixes:
http://autobuild.buildroot.net/results/576/5760ea2635d9aecc9c789494a8b2cc73a1af1ceb
http://autobuild.buildroot.net/results/583/58347b94884eee2db28740486eda280e8c08e22f
http://autobuild.buildroot.net/results/dc7/dc7c8cd548409864ab0055e196c0280457a5fb5f
--- package/glibc/glibc.mk | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
package/glibc/glibc.mk +6 -1
@@ -28,7 +28,12 @@ GLIBC_ADD_TOOLCHAIN_DEPENDENCY = NO # Before glibc is configured, we must have the first stage # cross-compiler and the kernel headers -GLIBC_DEPENDENCIES = host-gcc-initial linux-headers host-bison host-gawk +GLIBC_DEPENDENCIES = host-gcc-initial linux-headers host-bison host-gawk \ + $(BR2_MAKE_HOST_DEPENDENCY) + +# glibc requires make >= 4.0 since 2.28 release. +# https://www.sourceware.org/ml/libc-alpha/2018-08/msg00003.html +GLIBC_MAKE = $(BR2_MAKE) GLIBC_SUBDIR = build
Signature · 1 line
2.14.4
PATCH v2 3/3 package/glibc: allow to specify host-make
Romain,
Quoted 7 lines · Romain Naour
Use host-make package if GNU make from the host machine is too old.
Use the newly introduced
BR2_MAKE_HOST_DEPENDENCYandBR2_MAKEto provide respectively, host-make dependency and the path to the GNU make binary to use for building glibc.
Quoted 8 lines
Fixes:
http://autobuild.buildroot.net/results/576/5760ea2635d9aecc9c789494a8b2cc73a1af1ceb
http://autobuild.buildroot.net/results/583/58347b94884eee2db28740486eda280e8c08e22f
http://autobuild.buildroot.net/results/dc7/dc7c8cd548409864ab0055e196c0280457a5fb5fSigned-off-by Romain Naour <[email protected]>Cc Baruch Siach <[email protected]>Cc Thomas Petazzoni <[email protected]>
Quoted 29 lines
--- package/glibc/glibc.mk | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)package/glibc/glibc.mk +6
-2@@ -28,7 +28,12 @@ GLIBC_ADD_TOOLCHAIN_DEPENDENCY = NO # Before glibc is configured, we must have the first stage # cross-compiler and the kernel headers -GLIBC_DEPENDENCIES = host-gcc-initial linux-headers host-bison host-gawk +GLIBC_DEPENDENCIES = host-gcc-initial linux-headers host-bison host-gawk \ + $(BR2_MAKE_HOST_DEPENDENCY) + +# glibc requires make >= 4.0 since 2.28 release. +# https://www.sourceware.org/ml/libc-alpha/2018-08/msg00003.html +GLIBC_MAKE = $(BR2_MAKE) GLIBC_SUBDIR = build --2.14.4
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 8 lines
Matthew L Weber / Pr Software Engineer Airborne Information Systems / RC Linux Secure Platforms MS 131-100, C Ave NE, Cedar Rapids, IA, 52498, USA www.rockwellcollins.com Note: Any Export License Required Information and License Restricted Third Party Intellectual Property (TPIP) content must be encrypted and sent to matthew.weber at corp.rockwellcollins.com.
Thomas Petazzoni
AppliedPATCH v2 3/3 package/glibc: allow to specify host-make
In reply to Romain NaourHello,
Quoted 11 lines · Romain Naour
Use host-make package if GNU make from the host machine is too old.
Use the newly introduced
BR2_MAKE_HOST_DEPENDENCYandBR2_MAKEto provide respectively, host-make dependency and the path to the GNU make binary to use for building glibc.Fixes:
http://autobuild.buildroot.net/results/576/5760ea2635d9aecc9c789494a8b2cc73a1af1ceb
http://autobuild.buildroot.net/results/583/58347b94884eee2db28740486eda280e8c08e22f
http://autobuild.buildroot.net/results/dc7/dc7c8cd548409864ab0055e196c0280457a5fb5f
Quoted 6 lines
Signed-off-by Romain Naour <[email protected]>Cc Baruch Siach <[email protected]>Cc Thomas Petazzoni <[email protected]>--- package/glibc/glibc.mk | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
Applied to master, thanks.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com
PATCH v2 1/3 package/make: add host variant
In reply to Romain NaourRomain,
Quoted 35 lines · Romain Naour
Add host variant for make package since glibc 2.28 now require GNU Make >= 4.0 [1].
We have to ceate gnumake and gmake symlinks to GNU make generated by Buildroot for the host. Otherwise the one provided by the host system can be used instead.
For example, the glibc build system is looking for gnumake and gmake before make. See [2].
[1] https://www.sourceware.org/ml/libc-alpha/2018-08/msg00003.html
[2] http://lists.busybox.net/pipermail/buildroot/2018-September/229654.htmlSigned-off-by Romain Naour <[email protected]>Cc Baruch Siach <[email protected]>Cc Thomas Petazzoni <[email protected]>--- package/make/make.mk | 14 ++++++++++++++ 1 file changed, 14 insertions(+)package/make/make.mk +6
-0@@ -20,4 +20,18 @@ ifeq ($(BR2_STATIC_LIBS),y) MAKE_CONF_OPTS += --disable-load endif +HOST_MAKE_DEPENDENCIES = host-pkgconf +HOST_MAKE_CONF_OPTS = --without-guile + +# Some packages, like glibc, are looking for gnumake or gmake before +# make program. +# Create these symlink to use make binary generated by Buildroot for
package/make/make.mk ifeq ($(BR2_STATIC_LIBS),y)
Quoted 10 lines
package/make/make.mk +8
-1+# the host. +define HOST_MAKE_INSTALL_GNUMAKE + ln -fs make $(HOST_DIR)/bin/gnumake + ln -fs make $(HOST_DIR)/bin/gmake +endef +HOST_MAKE_POST_INSTALL_HOOKS += HOST_MAKE_INSTALL_GNUMAKE + $(eval $(autotools-package)) +$(eval $(host-autotools-package)) --
I plan to give this a test tomorrow. We have been close to sending something similar because of a Make 3 vs 4 issue across vintages of builds we've been supporting. I wonder if there is any interest picking this one back into the LTS?
Matt
PATCH v2 1/3 package/make: add host variant
Quoted 19 lines · Matthew Weber
Romain,
Quoted 17 lines · Romain Naour
Add host variant for make package since glibc 2.28 now require GNU Make >= 4.0 [1].
We have to ceate gnumake and gmake symlinks to GNU make generated by Buildroot for the host. Otherwise the one provided by the host system can be used instead.
For example, the glibc build system is looking for gnumake and gmake before make. See [2].
[1] https://www.sourceware.org/ml/libc-alpha/2018-08/msg00003.html
[2] http://lists.busybox.net/pipermail/buildroot/2018-September/229654.htmlSigned-off-by Romain Naour <[email protected]>Cc Baruch Siach <[email protected]>Cc Thomas Petazzoni <[email protected]>
[snip]
Quoted 5 lines
I plan to give this a test tomorrow. We have been close to sending something similar because of a Make 3 vs 4 issue across vintages of builds we've been supporting. I wonder if there is any interest picking this one back into the LTS?
Is it needed for anything else than glibc 2.28 then?
Regards,
Arnout
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
PATCH v2 1/3 package/make: add host variant
In reply to Matthew WeberHello,
Quoted 4 lines · Matthew Weber
I plan to give this a test tomorrow. We have been close to sending something similar because of a Make 3 vs 4 issue across vintages of builds we've been supporting. I wonder if there is any interest picking this one back into the LTS?
If you're talking about the issue that Sam Voss was discussing on IRC, then it's different. Your issue was that your host machine is using make >= 4.0, but some of your funky packages don't like that and would need make < 4.0 to build.
This is not handled by Romain's series@all, which handles the opposite situation: packages that need make >= 4.0, but the host has make < 4.0.
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH v2 1/3 package/make: add host variant
Thomas,
Quoted 10 lines · Thomas Petazzoni
Hello,
Quoted 4 lines · Matthew Weber
I plan to give this a test tomorrow. We have been close to sending something similar because of a Make 3 vs 4 issue across vintages of builds we've been supporting. I wonder if there is any interest picking this one back into the LTS?
Quoted 9 lines
If you're talking about the issue that Sam Voss was discussing on IRC, then it's different. Your issue was that your host machine is using make >= 4.0, but some of your funky packages don't like that and would need make < 4.0 to build.
This is not handled by Romain's series at all, which handles the opposite situation: packages that need make >= 4.0, but the host has make < 4.0.
Yep, Sam was discussing handling older kernel / buildroot versions vs versions of Make.
Romain's series covers compatibility on some of our older build machines until we get them refreshed.
Matt
PATCH v2 1/3 package/make: add host variant
In reply to Romain NaourRomain,
Quoted 11 lines · Romain Naour
Add host variant for make package since glibc 2.28 now require GNU Make >= 4.0 [1].
We have to ceate gnumake and gmake symlinks to GNU make generated by Buildroot for the host. Otherwise the one provided by the host system can be used instead.
For example, the glibc build system is looking for gnumake and gmake before make. See [2].
Quoted 6 lines
[1] https://www.sourceware.org/ml/libc-alpha/2018-08/msg00003.html
[2] http://lists.busybox.net/pipermail/buildroot/2018-September/229654.htmlSigned-off-by Romain Naour <[email protected]>Cc Baruch Siach <[email protected]>Cc Thomas Petazzoni <[email protected]>
Quoted 34 lines
--- package/make/make.mk | 14 ++++++++++++++ 1 file changed, 14 insertions(+)package/make/make.mk +14
-1@@ -20,4 +20,18 @@ ifeq ($(BR2_STATIC_LIBS),y) MAKE_CONF_OPTS += --disable-load endif +HOST_MAKE_DEPENDENCIES = host-pkgconf +HOST_MAKE_CONF_OPTS = --without-guile + +# Some packages, like glibc, are looking for gnumake or gmake before +# make program. +# Create these symlink to use make binary generated by Buildroot for +# the host. +define HOST_MAKE_INSTALL_GNUMAKE + ln -fs make $(HOST_DIR)/bin/gnumake + ln -fs make $(HOST_DIR)/bin/gmake +endef +HOST_MAKE_POST_INSTALL_HOOKS += HOST_MAKE_INSTALL_GNUMAKE + $(eval $(autotools-package)) +$(eval $(host-autotools-package)) --2.14.4
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 8 lines
Matthew L Weber / Pr Software Engineer Airborne Information Systems / RC Linux Secure Platforms MS 131-100, C Ave NE, Cedar Rapids, IA, 52498, USA www.rockwellcollins.com Note: Any Export License Required Information and License Restricted Third Party Intellectual Property (TPIP) content must be encrypted and sent to matthew.weber at corp.rockwellcollins.com.
Thomas Petazzoni
AppliedPATCH v2 1/3 package/make: add host variant
In reply to Romain NaourHello,
Quoted 13 lines · Romain Naour
Add host variant for make package since glibc 2.28 now require GNU Make >= 4.0 [1].
We have to ceate gnumake and gmake symlinks to GNU make generated by Buildroot for the host. Otherwise the one provided by the host system can be used instead.
For example, the glibc build system is looking for gnumake and gmake before make. See [2].
[1] https://www.sourceware.org/ml/libc-alpha/2018-08/msg00003.html
[2] http://lists.busybox.net/pipermail/buildroot/2018-September/229654.html
Quoted 6 lines
Signed-off-by Romain Naour <[email protected]>Cc Baruch Siach <[email protected]>Cc Thomas Petazzoni <[email protected]>--- package/make/make.mk | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
Applied to master, thanks.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com