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
cpu/Makefile.include.cortexm_common: don't use cortex-m0plus for clang if unsupported #3870
Conversation
A suggestion: Instead of checking the reported version number, could we check if the -mcpu=cortexm0plus option is supported by checking the exit code from a test call to clang? |
I did some messing around on the command line, the command
will return 0 if all options are valid and 1 when there is an invalid -mcpu option (try it with |
Ah okay, I came up with another solution. Which one do you like more? |
ifeq (llvm,$(TOOLCHAIN)) | ||
ifeq (cortex-m0plus,$(CPU_ARCH)) | ||
LLVM_CHECK = $(shell llvm-as < /dev/null | llc -march=$(CPU_MODEL) -mcpu=$(CPU_ARCH)) | ||
ifneq (,LLVM_CHECK) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing $()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed
addressed @gebart's comment |
# llvm/clang version 3.6.2 still does not support the cortex-m0plus mcpu type | ||
ifeq (llvm,$(TOOLCHAIN)) | ||
ifeq (cortex-m0plus,$(CPU_ARCH)) | ||
LLVM_UNSUP = $(shell clang -target arm-none-eabi -mcpu=$(CPU_ARCH) -c -x c /dev/null -o /dev/null \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also redirect stdout and stderr from clang (>/dev/null 2>&1
)
- addressed
addressed |
ACK, please squash. |
35f6576
to
81a4de0
Compare
squashed.
Frankly speaking, I don't know. |
Usually, I would say don't import something "new" into master this late in the release process, but on the other hand this shouldn't break anything for our "default toolchain", so I would be okay with merging. |
ifeq (cortex-m0plus,$(CPU_ARCH)) | ||
LLVM_UNSUP = $(shell clang -target arm-none-eabi -mcpu=$(CPU_ARCH) -c -x c /dev/null -o /dev/null \ | ||
> /dev/null 2>&1 || echo 1 ) | ||
ifneq (1,$(LLVM_UNSUP)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be ifeq
, I think..
81a4de0
to
32ff8e3
Compare
addressed @gebart's comment (amended) |
@gebart does your ACK still hold? (long time since last ACK) |
ACK holds |
travis is happy > GO |
cpu/Makefile.include.cortexm_common: don't use cortex-m0plus for clang if unsupported
@cgundogan Does clang know |
@sgso I checked briefly in their doxygen and searched in the github mirror of clang but couldn't find anything equivalent |
My clang version (3.6.2) does not support the
cortex-m0plus
mcpu type. I have no idea in which version they ~~will/~~have include/ed this, but building any application for thesamr21-xpro
with llvm/clang breaks for me:NOTE: I am currently building llvm/clang 3.8 from source and it appears that the m0plus is supported there. So I will just PR this and look what your opinion is on this matter. Close if necessary.