Wednesday, March 03, 2021

Re: GCC only on OpenBSD adds -L/usr/lib as prefix, why? Re: OpenBSD: Failing to link custom libpng to custom libz, any thoughts how fix?

Do you have some actual reason to use gcc for that project instead of
clang ?...

as far as -L goes you've got a lot of choices, between linking directly to
the .so, linking with --nostdlib and putting back the pieces manually.

it's been a long time since I've last looked at gcc, we've moved to clang
a few years ago for the most part. gcc is mostly there for the legacy
architectures that do not have clang support.

Oh, I remember now, it's because of ld.ldd, the linker from clang.
see, that one does not link with /usr/lib by default, which tends to break
everything.


Note that you don't have to recompile gcc to change that: the specs file
is where the magic happens, and hey, you can specify a new one on the command
line, so you just need to copy and change.

But again: why gcc ?

No comments:

Post a Comment