Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GCC compilers version 8 or newer are highly recommended. #2155

Merged
merged 3 commits into from
Nov 23, 2020

Conversation

slaff
Copy link
Contributor

@slaff slaff commented Nov 22, 2020

Start warning when older compiler is used.
Middle of 2021 we should enforce the usage of newer compilers only.

@slaff slaff added this to the 4.2.0 milestone Nov 22, 2020
@slaff slaff requested a review from mikee47 November 22, 2020 10:51
@slaff slaff changed the title Preparation to move to newer compilers. GCC compilers version 8 or newer are highly recommended. Nov 22, 2020
Sming/build.mk Outdated
Comment on lines 192 to 200
GCC_MIN_MAJOR_VERSION = 8
GCC_VERSION_COMPATIBLE := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= $(GCC_MIN_MAJOR_VERSION))

ifeq ($(GCC_VERSION_COMPATIBLE),0)
$(warning ***** Please, upgrade your GCC compiler to version $(GCC_MIN_MAJOR_VERSION) or newer *************)
ifneq ($(GCC_UPGRADE_URL),)
$(info Instructions for upgrading your compiler can be found here: $(GCC_UPGRADE_URL))
endif
endif
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about:

GCC_MIN_VERSION := "8.0"
GCC_VERSION_COMPATIBLE := $(shell expr "$(GCC_VERSION)" ">=" "$(GCC_MIN_VERSION)")

ifeq ($(GCC_VERSION_COMPATIBLE),0)
$(warning ***** Please, upgrade your GCC compiler to version $(GCC_MIN_VERSION) or newer *************)
ifneq ($(GCC_UPGRADE_URL),)
$(info Instructions for upgrading your compiler can be found here: $(GCC_UPGRADE_URL))
endif 
endif

https://stackoverflow.com/questions/42419301/makefile-emit-warning-gcc-version-is-lower-than-4-8-0


- produce smaller and better code
- have features which improve code quality, easy of use, etc.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug fixes!

@@ -40,6 +40,8 @@ OBJCOPY := $(TOOLSPEC)objcopy
OBJDUMP := $(TOOLSPEC)objdump
GDB := $(TOOLSPEC)gdb

GCC_UPGRADE_URL := https://sming.readthedocs.io/en/latest/arch/esp8266/getting-started/eqt.html
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also update the 'pre-release' note on this page? I've yet to find any issues with it :-)

@slaff
Copy link
Contributor Author

slaff commented Nov 23, 2020

@mikee47 Recommended changes were applied. Something else to add to this PR?

Copy link
Contributor

@mikee47 mikee47 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks slaff. I know there have been further updates to the esp-quick-toolchain since we introduced it but seems pretty solid to me! At some point we should take a look at what's changed.

@slaff
Copy link
Contributor Author

slaff commented Nov 23, 2020

At some point we should take a look at what's changed.

Absolutely! Up to now there are only pre-release versions between 3.0.0-gnu5 and the latest 3.0.0-newlib330_gnu14.

@slaff slaff merged commit 08c9eb1 into SmingHub:develop Nov 23, 2020
@slaff slaff deleted the update/gcc-v-8-warning branch November 27, 2020 10:37
@frankdownunder
Copy link
Contributor

i have a version 10 compiler
it fails the comparison

this makefile;
GCC_VERSION := $(shell $(CC) -dumpversion)
GCC_MIN_VERSION := "8.0"
GCC_VERSION_COMPATIBLE := $(shell expr "$(GCC_VERSION)" ">=" "$(GCC_MIN_VERSION)")
all:
@echo "GCC_VERSION="$(GCC_VERSION)
@echo GCC_MIN_VERSION=$(GCC_MIN_VERSION)
@echo GCC_VERSION_COMPATIBLE=$(GCC_VERSION_COMPATIBLE)

prints:

GCC_VERSION=10
GCC_MIN_VERSION=8.0
GCC_VERSION_COMPATIBLE=0

@slaff
Copy link
Contributor Author

slaff commented Dec 4, 2020

@frankdownunder Go to the application that you are trying to compile and type

make list-config

Then paste here the whole output.

@mikee47
Copy link
Contributor

mikee47 commented Dec 4, 2020

It's because the comparison is lexical, "1" < "8". Need to strip out everything but the major part then compare numerically i.e. $(shell $$(($(GCC_VERSION_MAJOR) >= $(GCC_MIN_VERSION_MAJOR))))

@slaff
Copy link
Contributor Author

slaff commented Dec 4, 2020

@frankdownunder Can you test if this PR: #2172 is fixing the problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants