[flang][AArch64] Always link compiler-rt to flang after libgcc (#144710)
This patch fixes an issue where the __trampoline_setup symbol is missing with some programs compiled with flang. This symbol is present only in compiler-rt and not in libgcc. This patch adds compiler-rt to the link line after libgcc if libgcc is being used, so that only this symbol will be picked from compiler-rt. Fixes #141147
This commit is contained in:
9
flang/test/Driver/flang-ld-aarch64.f90
Normal file
9
flang/test/Driver/flang-ld-aarch64.f90
Normal file
@@ -0,0 +1,9 @@
|
||||
! Check linker flags for AArch64 linux, since it needs both libgcc and
|
||||
! compiler-rt, with compiler-rt second when -rtlib=libgcc.
|
||||
|
||||
! RUN: %flang -### -rtlib=libgcc --target=aarch64-linux-gnu %S/Inputs/hello.f90 2>&1 | FileCheck %s
|
||||
|
||||
! CHECK-LABEL: "{{.*}}ld{{(\.exe)?}}"
|
||||
! CHECK-SAME: "-lflang_rt.runtime" "-lm"
|
||||
! CHECK-SAME: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
|
||||
! CHECK-SAME: "--as-needed" "{{.*}}{{\\|/}}libclang_rt.builtins.a" "--no-as-needed"
|
||||
Reference in New Issue
Block a user