Skip to content

eng/common/cross/toolchain.cmake incorrect default compiler options. #7607

@michaelgsharp

Description

@michaelgsharp
  • This issue is blocking
  • This issue is causing unreasonable pain

When cross-targeting for arm eng/common/cross/toolchain.cmake adds the -mthumb flag. If the -mthumb flag is added but the -fPIC -march=armv7-a flags are not added then it compiles for armv6 or v5 and uses thumb instead of thumb2, which is quite different. One of the differences with thumb is that its 16 bits, which causes interop with floating point numbers to not work correctly. Since -mthumb is added automatically, but -fPIC and -march=armv7-a are not, this makes the default compilation work incorrectly.

I synced with @janvorli and he suggested that:

The toolchain file is used only in the crosscompilation case, so it actually seemed to me that it should not contain any compiler options and they should all come from the eng/native/configurecompiler.cmake in the runtime build case or from some other file specific to your component build.

We could remove the all compilation flags as suggested by Jan, just remove the -mthumb flag from the cross/toolchain.cmake` file, or add in the missing flags, but whatever approach we take we should make sure that the default case works correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions