This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Is it possible disassemble an object compiled by armclang and re-compile it with arm-none-eabi-gcc

I have a libray compiled with armclang,  and I wan't to link the library to my project which

compiled with arm-none-eabi-gcc.

But when link it, following error happens:

"Object has vendor-specific contents that must be processed by the 'ARM' toolchain"

It come from some object files, which maybe use some assembler instructions specific

for armclang. 

So if it is possible that disassemble the object files with fromelf tool or arm-none-eabi-objdump tools,

generate .S files, and then use the arm-none-eabi-gcc(as) tools to compile them again,

at last link them all.

Parents
  • Hi sword_i

    It should be possible, within certain limitations, to link an armclang-built library with gcc-compiled code, if both toolchains conform to the same Application Binary Interface (ABI) and Arm C Language Extensions (ACLE).

    See developer.arm.com/.../application-binary-interface-for-the-arm-architecture-the-base-standard-abi-2018q4-documentation
    and developer.arm.com/.../acle

    Which version of arm-none-eabi-gcc, exactly, are you using.
    With which Arm Compiler 6 was the library generated?
    For which processor/architecture is your codebase built for?

    The same error message is reported in
    community.arm.com/.../compatibility-between-gcc-arm-and-ds-5-compiler
    which explains:
    "There are other potential incompatibilities between the complication defaults between the compilers - it is sometimes useful to figure this out using the "fromelf" tool, specifically the options --dump_build_attributes and --decode_build_attributes. Any attributes specified which are not the same, or specified in one but not the other, cannot be merged and this is what causes the error you're seeing.

    Finding out why those attributes are specified is usually a big clue as to which option you need to pass to each compiler to ensure they build using the same ABI and CPU features."

    Hope this helps

Reply
  • Hi sword_i

    It should be possible, within certain limitations, to link an armclang-built library with gcc-compiled code, if both toolchains conform to the same Application Binary Interface (ABI) and Arm C Language Extensions (ACLE).

    See developer.arm.com/.../application-binary-interface-for-the-arm-architecture-the-base-standard-abi-2018q4-documentation
    and developer.arm.com/.../acle

    Which version of arm-none-eabi-gcc, exactly, are you using.
    With which Arm Compiler 6 was the library generated?
    For which processor/architecture is your codebase built for?

    The same error message is reported in
    community.arm.com/.../compatibility-between-gcc-arm-and-ds-5-compiler
    which explains:
    "There are other potential incompatibilities between the complication defaults between the compilers - it is sometimes useful to figure this out using the "fromelf" tool, specifically the options --dump_build_attributes and --decode_build_attributes. Any attributes specified which are not the same, or specified in one but not the other, cannot be merged and this is what causes the error you're seeing.

    Finding out why those attributes are specified is usually a big clue as to which option you need to pass to each compiler to ensure they build using the same ABI and CPU features."

    Hope this helps

Children