https://github.com/thilinarmtb/spack_ld_parse_error
https://github.com/thilinarmtb/spack_ld_parse_error
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/thilinarmtb/spack_ld_parse_error
- Owner: thilinarmtb
- Created: 2025-06-24T02:12:39.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2025-06-24T02:22:52.000Z (3 months ago)
- Last Synced: 2025-06-24T03:27:31.418Z (3 months ago)
- Language: Makefile
- Size: 1000 Bytes
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Introduction
I am running into an issue where spack `ld` wrappers on Darwin fails to parse
command-line arguments of the form `-Wl,-rpath ` (note the space instead
of `,` between `-rpath` and ``). This happens with the latest spack
release `v0.23.1`. If the space is changed to a comma, it works as expected
with the spack `ld` wrappers.# Steps to reproduce
First of all, `-Wl,-rpath ` works as expected with the regular clang:
```sh
tratnayaka@hapana3 spack_ld_parse_error % which clang
/usr/bin/clang
tratnayaka@hapana3 spack_ld_parse_error % CC=clang make
clang -c hello.c -o hello.o
clang -Wl,-rpath /Users/tratnayaka/workspace/anl/thapi/spack_ld_parse_error/libs -o hello hello.o
```
To reproduce the error with `spack`, first get to a spack build-env so we can
use the spack compiler wrappers:
```sh
spack build-env sowing%apple-clang bash
```Try to build the `hello` executable:
```
bash-3.2$ which clang
/Users/tratnayaka/workspace/anl/thapi/spack/lib/spack/env/clang/clang
bash-3.2$ CC=clang make
clang -c hello.c -o hello.o
clang -Wl,-rpath /Users/tratnayaka/workspace/anl/thapi/spack_ld_parse_error/libs -o hello hello.o
ld: warning: -rpath missing
ld: file cannot be mmap()ed, errno=22 path=/Users/tratnayaka/workspace/anl/thapi/spack_ld_parse_error/libs in '/Users/tratnayaka/workspace/anl/thapi/spack_ld_parse_error/libs'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Makefile:7: hello] Error 1
```