llvmbox icon indicating copy to clipboard operation
llvmbox copied to clipboard

Improve dynamic linker interpreter on Linux

Open rsms opened this issue 3 years ago • 0 comments

Currently if you just build a program with vanilla clang foo.c -o foo on Linux, foo will have a linker interpreter entry of e.g. /lib/ld-musl-x86_64.so.1 which isn't correct on most systems. This stems from the fact that llvmbox bundles musl libc.

Ideas:

  1. Make builds -static by default. This would limit llvmbox, not making it possible to link with shared libs, so this is a bad idea.
  2. Build libc.so in addition to libc.a and have the default interpreter be an absolute path to the llvmbox installation's libc.so (libc.so contains the dynamic linker.) The problem with this approach is of course that the resulting program won't work if the llvmbox dir isn't in the same place.
  3. Do our best to detect the host system's dynamic linker and use that for the interpreter entry

rsms avatar Jan 31 '23 23:01 rsms