https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121667
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- For me it is : /usr/bin/ld: /home/apinski/src/upstream-cross-aarch64/pr121667/libb.so: undefined reference to `std::ios_base_library_init()@GLIBCXX_3.4.32' Also it is not just with -W,--exclude-libs,ALL but in general.