This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Compile SDK11 with ARM Compiler Version 6

I would like to use the latest ARM Compiler Version 6 (armclang) because I need some features of the C++11 language.

Is it possible to use the latest ARM Compiler Version 6 to compile the SDK 11 ? Which flags should we use to be compatible with all macros currently available for GCC and armcc ?

In future SDK releases, will this compiler be officially supported ?

Parents
  • is armclang related to clang, as in the LLVM compiler? If so, it's very likely not going to work at all. clang/llvm fails to generate proper softdevice calls in release mode for reasons I and others have gone into at length on other threads. You can't currently use clang to compile so if armclang is based on LLVM, give up.

  • It's a bit of both. the gcc optimiser doesn't require the definitions of naked ASM functions to say they do actually use the values of all parameters, it always sets the stack up and it always takes the return value and doesn't try to optimise. That's arguably wrong because you can specify which arguments are really used and probably should. If they changed that however, it would break so much code I can't imagine they ever will. So the ASM code for the SVC calls is kind of technically wrong, but it works with GCC and is unlikely to break.

    clang works rather differently, so unless you specify exactly that all the arguments to an sd_ function are used, it can, and does, optimise away the ones which it believes aren't.

    It's quite easy to write an sd_ function which works perfectly well in clang, under all cases of optimisation. However what's NOT easy, is writing ..

Reply
  • It's a bit of both. the gcc optimiser doesn't require the definitions of naked ASM functions to say they do actually use the values of all parameters, it always sets the stack up and it always takes the return value and doesn't try to optimise. That's arguably wrong because you can specify which arguments are really used and probably should. If they changed that however, it would break so much code I can't imagine they ever will. So the ASM code for the SVC calls is kind of technically wrong, but it works with GCC and is unlikely to break.

    clang works rather differently, so unless you specify exactly that all the arguments to an sd_ function are used, it can, and does, optimise away the ones which it believes aren't.

    It's quite easy to write an sd_ function which works perfectly well in clang, under all cases of optimisation. However what's NOT easy, is writing ..

Children
No Data
Related