All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCHv2] core: support host gcc of the future
@ 2018-10-23  9:08 Yann E. MORIN
  2018-10-23  9:45 ` Peter Korsgaard
  2018-10-24 15:56 ` Peter Korsgaard
  0 siblings, 2 replies; 3+ messages in thread
From: Yann E. MORIN @ 2018-10-23  9:08 UTC (permalink / raw)
  To: buildroot

When we do a release, we know only of a set of gcc versions that the
host may have. But in the future, distributions with newer gcc versions
may show up.

Currently, we do not recognise those versions, and thus we do as if they
were older than the oldest we know of. This means that a set of packages
become unselectable, when they should be.

We fix that be capping the detected version to the highest we know of.

Reported-by: gargar_ on IRC
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Peter Korsgaard <peter@korsgaard.com>
Cc: Arnout Vandecappelle <arnout@mind.be>

---
Changes v1 -> v2:
  - use a variable to store the highest version we know of  (Arnout)
---
 Config.in |  3 +++
 Makefile  | 10 ++++++++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/Config.in b/Config.in
index 6b5b2b043c..42cdf7a3eb 100644
--- a/Config.in
+++ b/Config.in
@@ -67,6 +67,9 @@ config BR2_HOST_GCC_AT_LEAST_8
 	default y if BR2_HOST_GCC_VERSION = "8"
 	select BR2_HOST_GCC_AT_LEAST_7
 
+# When adding new entries above, be sure to update
+# the HOSTCC_MAX_VERSION variable in the Makefile.
+
 # Hidden boolean selected by packages in need of Java in order to build
 # (example: kodi)
 config BR2_NEEDS_HOST_JAVA
diff --git a/Makefile b/Makefile
index d39a94e832..a69af3b645 100644
--- a/Makefile
+++ b/Makefile
@@ -351,8 +351,14 @@ export HOSTARCH := $(shell LC_ALL=C $(HOSTCC_NOCCACHE) -v 2>&1 | \
 	    -e 's/macppc/powerpc/' \
 	    -e 's/sh.*/sh/' )
 
-HOSTCC_VERSION := $(shell $(HOSTCC_NOCCACHE) --version | \
-	sed -n -r 's/^.* ([0-9]*)\.([0-9]*)\.([0-9]*)[ ]*.*/\1 \2/p')
+# When adding a new host gcc version in Config.in,
+# update the HOSTCC_MAX_VERSION variable:
+HOSTCC_MAX_VERSION := 8
+
+HOSTCC_VERSION := $(shell V=$$($(HOSTCC_NOCCACHE) --version | \
+	sed -n -r 's/^.* ([0-9]*)\.([0-9]*)\.([0-9]*)[ ]*.*/\1 \2/p'); \
+	[ "$${V%% *}" -le $(HOSTCC_MAX_VERSION) ] || V=$(HOSTCC_MAX_VERSION); \
+	printf "%s" "$${V}")
 
 # For gcc >= 5.x, we only need the major version.
 ifneq ($(firstword $(HOSTCC_VERSION)),4)
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCHv2] core: support host gcc of the future
  2018-10-23  9:08 [Buildroot] [PATCHv2] core: support host gcc of the future Yann E. MORIN
@ 2018-10-23  9:45 ` Peter Korsgaard
  2018-10-24 15:56 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2018-10-23  9:45 UTC (permalink / raw)
  To: buildroot

>>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:

 > When we do a release, we know only of a set of gcc versions that the
 > host may have. But in the future, distributions with newer gcc versions
 > may show up.

 > Currently, we do not recognise those versions, and thus we do as if they
 > were older than the oldest we know of. This means that a set of packages
 > become unselectable, when they should be.

 > We fix that be capping the detected version to the highest we know of.

 > Reported-by: gargar_ on IRC
 > Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
 > Cc: Peter Korsgaard <peter@korsgaard.com>
 > Cc: Arnout Vandecappelle <arnout@mind.be>

 > ---
 > Changes v1 -> v2:
 >   - use a variable to store the highest version we know of  (Arnout)

Committed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCHv2] core: support host gcc of the future
  2018-10-23  9:08 [Buildroot] [PATCHv2] core: support host gcc of the future Yann E. MORIN
  2018-10-23  9:45 ` Peter Korsgaard
@ 2018-10-24 15:56 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2018-10-24 15:56 UTC (permalink / raw)
  To: buildroot

>>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:

 > When we do a release, we know only of a set of gcc versions that the
 > host may have. But in the future, distributions with newer gcc versions
 > may show up.

 > Currently, we do not recognise those versions, and thus we do as if they
 > were older than the oldest we know of. This means that a set of packages
 > become unselectable, when they should be.

 > We fix that be capping the detected version to the highest we know of.

 > Reported-by: gargar_ on IRC
 > Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
 > Cc: Peter Korsgaard <peter@korsgaard.com>
 > Cc: Arnout Vandecappelle <arnout@mind.be>

 > ---
 > Changes v1 -> v2:
 >   - use a variable to store the highest version we know of  (Arnout)

Committed to 2018.02.x and 2018.08.x, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-10-24 15:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-23  9:08 [Buildroot] [PATCHv2] core: support host gcc of the future Yann E. MORIN
2018-10-23  9:45 ` Peter Korsgaard
2018-10-24 15:56 ` Peter Korsgaard

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.