lambdaclass / concrete

Concrete is a simple programming language specifically crafted for creating highly scalable systems that are reliable, efficient, and easy to maintain.
Apache License 2.0
123 stars 11 forks source link

Make linker more consistent across systems #118

Open edg-l opened 4 months ago

edg-l commented 4 months ago

On linux use ld.so --list-diagnostics and parse the results to find the system dirs to pass to the linker. The output looks like this on my gentoo:

...
path.prefix="/usr"
path.rtld="/lib64/ld-linux-x86-64.so.2"
path.sysconfdir="/etc"
path.system_dirs[0x0]="/lib64/"
path.system_dirs[0x1]="/usr/lib64/"
version.release="stable"
version.version="2.38"
...

and like this on debian

...
path.prefix="/usr"
path.rtld="/lib64/ld-linux-x86-64.so.2"
path.sysconfdir="/etc"
path.system_dirs[0x0]="/lib/x86_64-linux-gnu/"
path.system_dirs[0x1]="/usr/lib/x86_64-linux-gnu/"
path.system_dirs[0x2]="/lib/"
path.system_dirs[0x3]="/usr/lib/"
version.release="stable"
version.version="2.36"
...