[clang] [Driver] Link Flang runtime on Solaris (PR #65644)

Rainer Orth via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 22 02:39:57 PDT 2023


rorth wrote:

The different behaviour can easily be seen since Solaris `clang` supports linker selection at compile time:
```
$ clang -r -o hello-r.o hello.o -fuse-ld=gld
/usr/gnu/bin/ld: warning: cannot find entry symbol _start; not setting start address
$ clang -r -o hello-r.o hello.o
ld: fatal: option '-Bdynamic' is incompatible with building a relocatable object
ld: fatal: option '-e _start' is incompatible with building a relocatable object
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```
I'll either fix the Solaris driver code not to pass `-Bdynamic -e _start` with `-r` or do a full comparison of `Gnu.cpp` and `Solaris.cpp` to check for undesirable differences.

However, for the patch at hand this is moot while
```
$ flang-new -r -o hello-r.o hello.o
flang-new: error: unknown argument: '-r'
```

I wonder how to proceed with the patch at hand.

https://github.com/llvm/llvm-project/pull/65644


More information about the cfe-commits mailing list