make: provide support for listing supported and blacklisting toolchains#9730
Conversation
cladmi
left a comment
There was a problem hiding this comment.
Some review before testing remarks:
I like the idea and implementation.
I would like to also have a short documentation in https://github.com/RIOT-OS/RIOT/blob/master/makefiles/vars.inc.mk
As they do not need to be exported they can be explained in a comment like BUILDDEPS.
Some nitpicks inline.
Comparing to FEATURES, there is currently no need for a TOOLCHAINS_REQUIRED but it could be added later when/if necessary.
I did not tested the test and changes yet but will do it now.
pkg/micro-ecc/Makefile.include
Outdated
| INCLUDES += -I$(PKGDIRBASE)/micro-ecc | ||
|
|
||
| # LLVM/clang can't handle the inline assembler instructions in this package | ||
| TOOLCHAINS_BLACKLIST := llvm |
cpu/cortexm_common/Makefile.include
Outdated
| LINKFLAGS += $(LINKFLAGPREFIX)--defsym=_ram_length=$(RAM_LEN) | ||
| endif | ||
|
|
||
| TOOLCHAINS_SUPPORTED := gnu llvm |
There was a problem hiding this comment.
You can just use = here there is no reason to do :=.
cpu/native/Makefile.include
Outdated
| # include common peripheral initialization | ||
| USEMODULE += periph_common | ||
|
|
||
| TOOLCHAINS_SUPPORTED := gnu llvm |
There was a problem hiding this comment.
You can just use = here there is no reason to do :=.
| INCLUDES += -I$(RIOTCPU)/$(CPU)/include | ||
| include $(RIOTCPU)/$(CPU)/Makefile.include | ||
|
|
||
| TOOLCHAINS_SUPPORTED ?= gnu |
There was a problem hiding this comment.
Maybe a small comment on top.
|
Addressed comments |
pkg/libcose/Makefile.include
Outdated
|
|
||
| # There is a problem with the LLVM assembler and the assembly part of this | ||
| # package | ||
| TOOLCHAINS_BLACKLIST += llvm |
There was a problem hiding this comment.
I do not get errors for BOARD=iotlab-m3 or BOARD=native using TOOLCHAIN=llvm for unittests…
There was a problem hiding this comment.
Mhhh.... I do get it. Are you in the right branch ;-)?
There was a problem hiding this comment.
I of course get the warning for the BLACKLISTED toolchain.
pkg/openthread/Makefile.include
Outdated
| DIRS += $(OPENTHREAD_DIR)/contrib/netdev | ||
| endif | ||
|
|
||
| # There is a problem with ranlib and LLVM/clang in this package |
There was a problem hiding this comment.
Maybe also add problem with unused '-mcpu' arguments and ranlib
There was a problem hiding this comment.
But those are only warnings.
There was a problem hiding this comment.
Which I think may be the root cause of the ranlib error.
pkg/micro-ecc/Makefile.include
Outdated
| INCLUDES += -I$(PKGDIRBASE)/micro-ecc | ||
|
|
||
| # LLVM/clang can't handle the inline assembler instructions in this package | ||
| TOOLCHAINS_BLACKLIST += llvm |
There was a problem hiding this comment.
Same here, I do not get any errors.
make -C tests/pkg_micro-ecc --no-print-directory BOARD=iotlab-m3 clean all TOOLCHAIN=llvm
Do you have a failing murdock output maybe ?
There was a problem hiding this comment.
There was a problem hiding this comment.
Ok it fails with samr21-xpro but not iotlab-m3 in docker and on my computer.
There was a problem hiding this comment.
Ok... I'll take the blacklisting out of this PR for now.
|
Addressed more comments |
e43d9be to
6a598b2
Compare
Done |
|
Removed the milestone. This isn't part of the release (it just popped up during the testing procedures). |
See #9734 for the usage of the blacklisting. |
| @echo $($*) | ||
|
|
||
| info-toolchains-supported: | ||
| @echo $(filter-out $(TOOLCHAINS_BLACKLIST),$(TOOLCHAINS_SUPPORTED)) |
There was a problem hiding this comment.
I would also like to have something like info-toolchain-is-supported that produces an error if not
info-toolchain-is-supported:
@exit $(if $(filter $(TOOLCHAIN), $(filter-out $(TOOLCHAINS_BLACKLIST),$(TOOLCHAINS_SUPPORTED))),1,0)
Or maybe not info- but more on assert/test/check.
So it can be used in https://github.com/RIOT-OS/RIOT/blob/master/makefiles/buildtests.inc.mk to skip the compilation in buildtest.
makefiles/buildtests.inc.mk
Outdated
| RESULT=false ; \ | ||
| fi ; \ | ||
| $(MAKE) clean-intermediates >/dev/null 2>&1 || true; \ | ||
| if $(MAKE) check-toolchain-supported; then |
There was a problem hiding this comment.
Needs a terminating \ and also silencing stdout and stderr. Missing BOARD=$${board}.
Suggestion, it could be replace by an ! condition and using continue to remove one indentation.
makefiles/buildtests.inc.mk
Outdated
| RESULT=false ; \ | ||
| fi ; \ | ||
| $(MAKE) clean-intermediates >/dev/null 2>&1 || true; \ | ||
| fi |
makefiles/info.inc.mk
Outdated
| @echo $(filter-out $(TOOLCHAINS_BLACKLIST),$(TOOLCHAINS_SUPPORTED)) | ||
|
|
||
| check-toolchain-supported: | ||
| @exit $(if $(filter $(TOOLCHAIN), $(filter-out $(TOOLCHAINS_BLACKLIST),$(TOOLCHAINS_SUPPORTED))),1,0) |
There was a problem hiding this comment.
This is not failing:
make -C examples/hello-world/ check-toolchain-supported TOOLCHAIN=llvm QUIET=0 BOARD=hifive1
make: Entering directory '/home/harter/work/git/RIOT/examples/hello-world'
make: Leaving directory '/home/harter/work/git/RIOT/examples/hello-world'
I reversed the 1 and the 0 while writing the code… my bad
It should also be added to the .PHONY targets.
|
Addressed comments (was already working on it, while testing it with #9734 ;-)) |
|
The normal When using #9734 I also correctly get the |
cladmi
left a comment
There was a problem hiding this comment.
Only missing a short documentation in https://github.com/RIOT-OS/RIOT/blob/master/makefiles/vars.inc.mk
As they do not need to be exported they can be explained in a comment like BUILDDEPS.
I could propose something if it can help, but feel free to adapt/change it:
# TOOLCHAINS_SUPPORTED List of supported toolchains by a cpu (gnu/llvm/…).
# TOOLCHAINS_BLACKLISTED List of unspported toolchains for a module or an example.
|
Mh, |
|
( |
e2434ef to
2f27f11
Compare
|
Rebased (please check if I didn't mess up the change from bfbc9c1) and addressed comments. |
2f27f11 to
7943cb0
Compare
|
And another rebase due to #9351 being merged ;-) |
|
This looks good to me, please rebase/squash, I will retest and review the commits individually after. |
Assuming `TOOLCHAIN_SUPPORTED` is provided by the board and `TOOLCHAIN_BLACKLIST` by a module or `pkg`, this outputs the fact that a toolchain is not supported or blacklisted in a similar manner as (un-)supported features and boards are.
7943cb0 to
6309df6
Compare
|
Squashed |
cladmi
left a comment
There was a problem hiding this comment.
ACK Test from #9730 (comment) work.
Note, this is not doing any murdock handling as it does not compile with llvm and that everything is currently compatible with gnu. (Tested in murdock integration #9398)
|
I was adding |
Contribution description
This PR introduces two things:
TOOLCHAINS_SUPPORTEDmacropkgthat does not support that particular toolchain via theTOOLCHAINS_BLACKLIST(similar toBOARD_BLACKLIST)As a consequence of those to introductions this PR also contains:
Blacklisting of(moved to pkg: blacklist selectedllvmforpkgs we encountered hard to fix problems with in combination with LLVM/clang in murdock: also compile with LLVM/clang #9398pkgs for LLVM/clang #9734)Things that might be worth an inclusion into this:
info-%-supportingor something)Issues/PRs references
Errors for packages that caused blacklisting were detected in #9398.
#9734 applies the concept of blacklisting toolchains for several packets that have problems with LLVM/clang.