-
Notifications
You must be signed in to change notification settings - Fork 90
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
[Clang compatibility] Added Clang CMake definitions. #76
base: master
Are you sure you want to change the base?
[Clang compatibility] Added Clang CMake definitions. #76
Conversation
Can you please update this with a note in the toolchain files to say this is currently unsupported. I'm generally happy to merge this in, but I don't want to end up maintaining two 'official' toolchains :) |
Explained how to get a Clang build running (This depends on other pull requests) in compiler-flags.cmake which wasn't documented anywhere. Also made sure users are aware this isn't the preferred or official compiler. Mileage may vary.
|
||
# This file is a copy from ../ARM_GCC, building with Clang/LLVM however will not immediatly work, | ||
# some flags are not accepted by both compilers (e.g -Wl,--no-wchar-size-warning, defined in target.json), handle conflicts, | ||
# and Clang will require the --target=arm-none-eabi flag. We also need Clang to include extra header files: |
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.
Can the --target=arm-none-eabi
flag be added to this file?
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.
Other flags added to lancaster-university/codal-microbit-v2@master...Johnn333:codal-microbit-v2-clang:master could also be include in this file instead?
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.
Can the
--target=arm-none-eabi
flag be added to this file?
Possibly, although I'm not sure where it would be added. "cpu_opts" in target.json feels like a more correct spot for it? Although we can't easily have a separate target.json.
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.
Other flags added to lancaster-university/[email protected]:codal-microbit-v2-clang:master could also be include in this file instead?
The main flags added here is for include paths which annoyingly have a version number in their name. Probably not the best thing to push as depending on arm-none-eabi version they may not have the directory? As for the others flags it was mostly to suppress warnings.
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.
There is more -W
flags added to the target-lock.json file. I assume those might not be required and could be removed to reduce the diff?
What was the reason they were added? To help catch issues with the toolchain porting?
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.
From memory it was all just to reduce warnings aswell. Clang would give a warning about unused linker inputs so I got rid of them. It still builds but now I think about it may have something to do with the hex size diff? Might be worth looking into.
Able to change the compiler used in target.json to CLANG now, this will build using clang (atleast up to the libraries) given some other changes, such as setting the flag--target=arm-none-eabi.