This is an archive of the discontinued LLVM Phabricator instance.

[Driver] Support linking to compiler-rt for target AVR
AbandonedPublic

Authored by benshi001 on Jun 7 2022, 12:18 AM.

Details

Diff Detail

Event Timeline

benshi001 created this revision.Jun 7 2022, 12:18 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 7 2022, 12:18 AM
Herald added subscribers: Jim, dberris. · View Herald Transcript
benshi001 requested review of this revision.Jun 7 2022, 12:18 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 7 2022, 12:18 AM
benshi001 updated this revision to Diff 434706.Jun 7 2022, 12:21 AM
benshi001 updated this revision to Diff 434709.Jun 7 2022, 12:38 AM
benshi001 updated this revision to Diff 435036.Jun 7 2022, 7:58 PM
benshi001 added a reviewer: MaskRay.
benshi001 added inline comments.Jun 7 2022, 8:05 PM
clang/lib/Driver/ToolChains/AVR.cpp
428
  1. Though I expect each device family has its own optimized build of compiler-rt binary, I found most targets such as arm/x86 use unique libclang-rt.builtins.a. So I will follow this tradition for avr, a compitable avr binary built with the minimal instruction set is used.
  1. I have to explicitly inherit getCompilerRTPath, since AVR can never be a host environment, the default path $resource_dir/lib is not suitable for AVR.
benshi001 abandoned this revision.Jun 18 2022, 11:01 PM
MaskRay added inline comments.Jun 18 2022, 11:03 PM
clang/test/Driver/avr-toolchain.c
83

libclang_rt.builtins-avr.a is the non-longer-recommended LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=off path. Use the LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=on path.

-fuse-ld=abs/path is deprecated. Use --ld-path or carefully use -fuse-ld=lld to select lld.

benshi001 added inline comments.Jun 18 2022, 11:43 PM
clang/test/Driver/avr-toolchain.c
83

Thanks. I will fix that in another review request https://reviews.llvm.org/D128133.

benshi001 updated this revision to Diff 438181.Jun 19 2022, 1:12 AM
benshi001 abandoned this revision.Jun 19 2022, 6:53 AM