sdmitriev added a comment. In D64943#1666693 <https://reviews.llvm.org/D64943#1666693>, @JonChesterfield wrote:
> In D64943#1666679 <https://reviews.llvm.org/D64943#1666679>, @ABataev wrote: > > > In D64943#1666678 <https://reviews.llvm.org/D64943#1666678>, > > @JonChesterfield wrote: > > > > > In D64943#1666673 <https://reviews.llvm.org/D64943#1666673>, @ABataev > > > wrote: > > > > > > > In D64943#1666658 <https://reviews.llvm.org/D64943#1666658>, > > > > @JonChesterfield wrote: > > > > > > > > > > OpenMP linker script is known to cause problems for gold and lld > > > > > > linkers on Linux and it will also cause problems for Windows > > > > > > enabling in future > > > > > > > > > > What are the known problems with the linker script? I'm wondering if > > > > > they can be resolved without the overhead of introducing a new tool. > > > > > > > > > > > > They just do not support linker script. And, thus, cannot be used for > > > > offloading. Only `ld` supports it. > > > > > > > > > In what respect? I've used linker scripts with both gold and lld, and > > > both instances of --help text claim to support them. In the case of lld, > > > a very complicated script hit a few internal errors, but I believe > > > they've all been fixed since. > > > > > > Hmm, I tried it with gold some time ago and it just did not work for me. > > The linking failed with diagnostics that some of the commands in the script > > are unknown. > > > The problem turns out to be the 'insert before' statement. ld and lld support > it, gold does not. According to > https://bugzilla.redhat.com/show_bug.cgi?id=927573, the recommended > workaround is essentially that implemented in this differential. See also > https://sourceware.org/bugzilla/show_bug.cgi?id=15373. A small example that I presented on the OpenMP multi company meeting earlier: bash-4.2$ cat foo.c #include <stdio.h> int main() { int X = 0; #pragma omp target map(tofrom: X) X += 3; printf("X = %d\n", X); return 0; } bash-4.2$ clang -fopenmp -fopenmp-targets=x86_64-pc-linux-gnu -fuse-ld=gold foo.c /usr/bin/ld.gold: error: /tmp/a-c699cd.lk:25:8: syntax error, unexpected STRING /usr/bin/ld.gold: fatal error: unable to parse script file /tmp/a-c699cd.lk clang-10: error: linker command failed with exit code 1 (use -v to see invocation) bash-4.2$ clang -fopenmp -fopenmp-targets=x86_64-pc-linux-gnu -fuse-ld=lld foo.c ld.lld: error: unable to INSERT AFTER/BEFORE .data: section not defined clang-10: error: linker command failed with exit code 1 (use -v to see invocation) bash-4.2$ Also OpenMP linker script will obviously cause problems on Windows once we start enabling offload on Windows. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64943/new/ https://reviews.llvm.org/D64943 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits