This is an archive of the discontinued LLVM Phabricator instance.

[Builtin] [ARM] Update CMake to support the build of armv6m
ClosedPublic

Authored by weimingz on Jan 8 2017, 10:45 PM.

Details

Summary

Setting -DCOMPILER_RT_TEST_TARGET_TRIPLE=armv6m-none-eabi will enable the build of builtin functions ARMv6m.
Currently, only those asms that support armv6m are added.

TODO:All asm sin ARM_EABI_Sources are ported for thumb1 so Thumb1_EABI_Sources will be deprecated.

Diff Detail

Repository
rL LLVM

Event Timeline

weimingz updated this revision to Diff 83586.Jan 8 2017, 10:45 PM
weimingz retitled this revision from to [Builtin] [ARM] Update CMake to support the build of armv6m.
weimingz updated this object.
weimingz added reviewers: rengolin, compnerd.
weimingz added a subscriber: llvm-commits.
rengolin added inline comments.Jan 11 2017, 3:16 AM
cmake/base-config-ix.cmake
169 ↗(On Diff #83586)

Why not just add a test_target_arch inside the MATCHES "arm" below?

weimingz updated this revision to Diff 84044.Jan 11 2017, 3:27 PM
compnerd added inline comments.Jan 11 2017, 6:43 PM
cmake/base-config-ix.cmake
175 ↗(On Diff #84044)

How are you planning on dealing with arm and armv6m builds stomping each other? IIRC, the output file name is the same for both builds.

weimingz added inline comments.Jan 11 2017, 11:42 PM
cmake/base-config-ix.cmake
175 ↗(On Diff #84044)

They have different build directories:
ls lib/builtins/CMakeFiles \

clang_rt.builtins-arm.dir  clang_rt.builtins-armv6m.dir

and separate output files:
ls lib/linux/libclang_rt.builtins-arm*.a

lib/linux/libclang_rt.builtins-arm.a  lib/linux/libclang_rt.builtins-armv6m.a
weimingz added inline comments.Jan 18 2017, 10:08 AM
cmake/base-config-ix.cmake
175 ↗(On Diff #84044)

Hi Saleem, does it answer your question?

compnerd accepted this revision.Jan 18 2017, 6:57 PM

Ah, sorry, missed that response. Yes, that answers the question, I didnt realize that the file got named differently. SG

This revision is now accepted and ready to land.Jan 18 2017, 6:57 PM
This revision was automatically updated to reflect the committed changes.

Hi, this causes build failures one of our internal Darwin machines when building the lib/builtins/arm/comparesf2.S file with -ffreestanding -arch armv6m -static -mfloat-abi=soft:

./lib/builtins/arm/comparesf2.S:72:5: error: instruction requires: arm-mode
    orrs r6, r2, r6
./lib/builtins/arm/comparesf2.S:197:5: error: instruction requires: arm-mode
    orrs r6, r2, r6

Any ideas why?

rengolin edited edge metadata.Jan 20 2017, 4:56 AM

Hum, I believe the three-reg encoding is for Thumb2/ARM only, but apparently present in v6M. Since those sources are named "thumb1_sources" we can't have v6M-specific encodings in there. I missed that one, apparently.

@weimingz, can you have a look and use a Thumb1-specific encoding instead? Also, for all the other instructions, please check the ARM ARM to make sure they're allowed pre-v6 and are strictly 16-bit encodings.