The llvm-wrapper scripts are broken when using them in symlinks. This is e.g. a problem in the ports tree when a port uses
BINARY_ALIAS=gcc=${CC} in combination with USES=compiler:c++14-lang on 10.3.
To reproduce the problem:
$ install -l rs /usr/local/bin/clang50 gcc $ ./gcc ./gcc: /usr/local/llvm50/bin/gcc: not found
My expectation is that /usr/local/llvm50/bin/clang would be called as intended.
I suggest we put in a call to realpath to resolve symlinks before using basename to get the wrapper script name.