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
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,15 @@ Please note Version 4 documentation is at [sming.readthedocs.io](https://sming.r

## Compatibility


### GCC compiler >= 8

Your GCC compiler should be version 8 or newer! See the different architectures for details.
Newer compilers

- 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!

### Architecture: ESP8266

OS/SDK | Linux | Mac OS X | Windows | FreeBSD-current |
Expand Down
2 changes: 2 additions & 0 deletions Sming/Arch/Esp8266/build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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 :-)


CPPFLAGS += \
-nostdlib \
-mlongcalls \
Expand Down
2 changes: 2 additions & 0 deletions Sming/Arch/Host/build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ OBJCOPY := $(TOOLSPEC)objcopy
OBJDUMP := $(TOOLSPEC)objdump
GDB := $(TOOLSPEC)gdb

GCC_UPGRADE_URL := https://sming.readthedocs.io/en/latest/arch/host/host-emulator.html\#c-c-32-bit-compiler-and-libraries

CPPFLAGS += \
-m32 \
-Wno-deprecated-declarations
Expand Down
10 changes: 9 additions & 1 deletion Sming/build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,15 @@ SMING_CXX_STD ?= c++17
endif
CXXFLAGS += -std=$(SMING_CXX_STD)


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


# Component (user) libraries have a special prefix so linker script can identify them
CLIB_PREFIX := clib-
Expand Down
12 changes: 4 additions & 8 deletions docs/source/arch/host/host-emulator.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,21 @@ develop only with Ubuntu 16.04 and 18.04.
C/C++ 32 bit compiler and libraries
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The latest versions of Sming require GCC version 8 or newer.
If your OS is 64 bit then you should install also 32 bit C/C++ compiler and libraries.
For Ubuntu, install like this::

sudo apt-get install gcc-multilib g++-multilib

You may wish to install the latest compilers for testing alongside the recent
:doc:`/arch/esp8266/getting-started/eqt` updates. Here's a summary of how to do this::
Here's a summary of how to do this::

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install gcc-9 g++-9

# For 64-bit systems
sudo apt install gcc-9-multilib g++-9-multilib

# Set GCC 9 as default
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-9

The current version is `GCC 9.2.1 <https://www.gnu.org/software/gcc/gcc-9>`__.
The current version is `GCC 9.3.0 <https://www.gnu.org/software/gcc/gcc-9>`__.

CMake 3.8 or newer
~~~~~~~~~~~~~~~~~~
Expand Down