Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ergrelet/llvm-ebc-lddump
Fake linker plugin compatible with lld and GNU ld, which dumps the linker's command-line in a file.
https://github.com/ergrelet/llvm-ebc-lddump
clang linker llvm llvm-bitcode plugin
Last synced: 3 days ago
JSON representation
Fake linker plugin compatible with lld and GNU ld, which dumps the linker's command-line in a file.
- Host: GitHub
- URL: https://github.com/ergrelet/llvm-ebc-lddump
- Owner: ergrelet
- License: mit
- Created: 2024-08-15T17:46:02.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-08-17T14:57:22.000Z (6 months ago)
- Last Synced: 2024-12-06T13:25:46.516Z (2 months ago)
- Topics: clang, linker, llvm, llvm-bitcode, plugin
- Language: C
- Homepage:
- Size: 3.91 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# llvm-ebc-lddump
Fake linker plugin compatible with lld and GNU ld, which dumps the linker's
command-line in a file. This is meant to be used with clang's `-fembed-bitcode`
on platforms where bitcode embedding doesn't include linker options.Disclaimer: the code works as is but isn't meant to be production-ready.
## Supported Platforms
- Linux (GNU ld, lld)
- Windows (lld)## How to Build
### Linux
```
cmake -B build -DCMAKE_BUILD_TYPE=Release && cmake --build build
```### Windows
```
cmake -B build && cmake --build build --config Release
```## How to Use
### Linux
#### lld
When using clang with lld, you can use the plugin like so:
```
clang -O2 -fuse-ld=lld -fembed-bitcode -Wl,-mllvm=-load=/path/to/libplugin.so file.c
```#### GNU ld
When using clang with GNU ld, you can use the plugin like so:
```
clang -O2 -fembed-bitcode -Wl,-plugin=/path/to/libplugin.so file.c
```### Windows
#### lld
When using clang with lld, you can use the plugin like so:
```
clang -O2 -fuse-ld=lld -fembed-bitcode -Wl,/mllvm:-load=C:\\path\\to\\plugin.dll file.c
```## Output
The linker options are dumped into a file located next to the output
executable, with the `.llvmldcmd` extension.Much like the `.llvmcmd` section generated by the linker, the output file
generated by the plugin contains each command-line argument separated by NUL
chars. However, please note that the first argument will be the linker's file
path.