If the sysroot parameter is passed to the clang frontend, clang already uses it to find libraries and adds -L options for it, but also passes it on to the linker. Therefore we can get pretty far by just ignoring it altogether.
Details
Details
Diff Detail
Diff Detail
Sort asciibetically.