Hi all,
Very happy to see this go in.
In the new build Prathamesh has noticed that since the Makefile declares
dependencies on libatomic for nearly everything, libatomic gets added to
the link lines for many target libraries.
Taking libstdc++ as an example, Prathamesh noticed that the build system
ended up with a new DT_NEEDED entry requiring libatomic.so.1. We
suspect this is not desirable. I guess it could lead to loading
libatomic in some C++ programs where it wouldn't have been necessary?
Questions for others:
1) We'd like to double-check that this sounds like a problem before
trying to change it.
2) Does this trigger thoughts of anything else to look out for?
3) Would the best solution be to add some `--as-needed` push/pop state
arguments into the link line?
4) Honestly, I'm surprised this didn't automatically happen, since the
link line Prathamesh saw seemed to use `xgcc` and the `gcc` driver on my
local machine seems to add `--as-needed` when linking a shared object.
Does this sound like something to look into?
Regards,
Matthew
On 10/9/25 08:37, Prathamesh Kulkarni wrote:
Prathamesh, could you check it in? Joseph approved it on the 2nd.
Thanks!
Hi,
Sorry for late response, I slacked a bit due to other tasks.
I have posted comment on PR requesting for wider testing.
I plan to commit the patch by end of this week, if there are no
reports of build/test failures.
I have now committed the patch to trunk in:
https://gcc.gnu.org/cgit/gcc/commit/?id=e63cf4b130b86dd7dde1bf499d3d40faca10ea2e
After following validation:
1] Bootstrap+test on aarch64-linux-gnu and ppc64le-redhat-linux with
--enable-languages=c,c++,fortran,d
2] Bootstrap+test on x86_64-pc-linux-gnu with --enable-languages=all and
multilib enabled.
3] Verified GCC builds with patch on arm-eabi toolchain.
4] Verified there are no change in RPATHS for target libraries (libstdc++ in
particular).
5] Verified the patch doesn't introduce new build failures compared to trunk
for config-list.mk builds.
6] Linaro's CI reported (previous iteration of) patch built OK for aarch32:
https://patchwork.sourceware.org/project/gcc/patch/ia1pr12mb903102844c7379bf41277763ce...@ia1pr12mb9031.namprd12.prod.outlook.com/
7] Sam reported the patch built OK on their system.