[PATCH] D126192: [Driver] Support linking with lld for target AVR

Ben Shi via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 24 17:47:49 PDT 2022


benshi001 added inline comments.


================
Comment at: clang/lib/Driver/ToolChains/AVR.cpp:441
+    if (!llvm::sys::fs::can_execute(FullPath))
+      D.Diag(diag::err_drv_invalid_linker_name) << Linker;
+    else
----------------
We report an error if the linker specified via `-fuse-ld` is not executable.


================
Comment at: clang/lib/Driver/ToolChains/AVR.cpp:526
+      CmdArgs.push_back(Args.MakeArgString("__vectors"));
+      // We must explicitly spefify the linker script (for lld), which has
+      // already been integrated into avr-libc, and whose full path is
----------------
benshi001 wrote:
> I am not familiar with avr-ld internal, but it will implicitly:
> 
> 1. Use `__vectors` as the entry;
> 2. Use `$AVR-LIBC/lib/ldscripts/$FamilyName.xn` as the linker script;
>  
Use `$AVR-LIBC/lib/ldscripts/$FamilyName.x` as the default linker script.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D126192/new/

https://reviews.llvm.org/D126192



More information about the cfe-commits mailing list