Is --as-needed the default these days?

2024-03-24 Thread Yuri Kanivetsky via Gcc
Hi, It looks like somewhere between gcc-5.3.0 and gcc-6.2.1 --as-needed became the default: https://gist.github.com/x-yuri/1b4c19891be50b2b8801689de1487009 In other words it looks like on Alpine Linux 3.4 -lintl always adds libintl, on >= 3.5 only if some of its symbols are really needed. Can y

Re: Is --as-needed the default these days?

2024-03-24 Thread Yuri Kanivetsky via Gcc
> That's a linker option, and the linker is not part of GCC. Any change in > linker behaviour is not because of a change in GCC. Have you noticed what gcc does? 3.4: /usr/libexec/gcc/x86_64-alpine-linux-musl/5.3.0/collect2 ... -lintl 3.5: /usr/libexec/gcc/x86_64-alpine-linux-musl/6.2.1/collect2

Re: Is --as-needed the default these days?

2024-03-24 Thread Yuri Kanivetsky via Gcc
> Upstream GCC does (still) not default to adding `--as-needed` to the > command line (except around libgcc). Some distros add patches which > add `--as-needed` by default though. It looks like alpine is one of > those distros. Maybe you should ask them instead of asking us. It > looks like they ma