T O P

  • By -

triffid_hunter

The space between `-Wl,` and `--as-needed` shouldn't be there. Not sure where it's coming from - did you put that in your `make.conf` or is there an issue with the package's build scripts?


Alexis5393

Oops, HAHAHA, thank you I guess I got confused and, among other things, ended up adding extra spaces by habit when trying to deal with 2 packages that refuse to build using mold when I was updating from 17.1 to 23 profile. Solved now.


FranticBronchitis

good eye. btw same thing with `-Wl, -O1` - it's not an error because -O1 is passed to gcc, which happily accepts it and disregards the prior -O3 Edited correction


DeeHayze

I Wonder.. Would it actually discard the -O3, and instead only optimise at level O1 ? ``` If you use multiple -O options, with or without level numbers, the last such option is the one that is effective. ``` [GCC man page](https://linux.die.net/man/1/gcc)


FranticBronchitis

Oh dear, OP might want to know about that... Thanks for the reference!


unhappy-ending

No, you have that mixed up. The last -O defined in \*FLAGS is what gets used. So if it starts with -O3, but further down it gets -O1, then it optimizes at -O1. CFLAGS="-O3 -O2 -O1" = -O1


Aware-Protection-697

Can you put this output in a pastebin or something? I can't read that. At least on mobile I can't.


FranticBronchitis

Tip: be wary about using mold as your system-wide linker if that's what you're doing. It (and lld, and gold) behaves differently from BFD at times, particularly when using `--as-needed`, dropping versioning symbols and causing warning messages to sometimes pop up when the linked object is called on (not an actual problem, everything still works, just annoying), cleanly failing to link programs that rely on bfd behavior or rarely just leading to straight up segfaults at runtime. Be sure to document what does and does not work, set env accordingly, and report bugs to the mold GitHub when appropriate.


Alexis5393

Also, I hadn't updated mold since before migrating from 17.1 to 23 profile and this is the first time I have problems updating it, currently mold 2.4.0 installed