This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Linux ppc64 - compatibility-ldbl.o can't find std::num_put
- From: Alan Modra <amodra at gmail dot com>
- To: Brian Groose <brian at groose dot com>
- Cc: binutils at sourceware dot org
- Date: Tue, 23 Apr 2019 20:19:08 +0930
- Subject: Re: Linux ppc64 - compatibility-ldbl.o can't find std::num_put
- References: <CAKMEP22bqYXsbDrViAmFdWJ4AQ26sSJbGOTC23-hXSpDA_Qjag@mail.gmail.com> <20190413025656.GL14424@bubble.grove.modra.org> <CAKMEP22QNtFk5wCR_vAhZ5ghn7gE_Yb_diW=TNmpSRzHSqBBFw@mail.gmail.com> <20190414231637.GP14424@bubble.grove.modra.org> <CAKMEP22H=T=uLccZ7GZw2e60T=WtqbR=fDQtvPg=CsMMELWS4w@mail.gmail.com> <20190416102257.GR14424@bubble.grove.modra.org> <CAKMEP22JpJ2kZudtYCX-zLkGwDcsNcDcLPQZSnSAW4LBzObc3Q@mail.gmail.com> <20190417003822.GZ14424@bubble.grove.modra.org> <CAKMEP22iLBSHNBYjhSQM7MubcjQQ0vaJo4cru0sP+3Y6y-ZOdA@mail.gmail.com> <CAKMEP22ci3Wu-OVhkMMb91fhxD23WX4rEEv9YohDHg6PxozurQ@mail.gmail.com>
On Mon, Apr 22, 2019 at 12:04:25PM -0400, Brian Groose wrote:
> Everything can be dropped into one directory and fails to link with this
> /PATH/TO/NEWER/G++/g++ -L. -Wl,-z,noexecstack -static-libgcc
> -static-libstdc++ -g *.o -lvirtualization -lagtframework
> -lvirtualization -ldas -loracle -lgeneric -lnas -lsystemstate
> -lstoragemgmt -lsmartcopy -lagtframework -lagentutils -ludplinuxutils
> -ludpzfsutils -lpthread -lrt -Wl,-Bstatic -lACE -lssl -lcrypto -lz
> -lxml2 -lboost_chrono -lboost_filesystem -lboost_locale
> -lboost_program_options -lboost_system -lboost_thread -Wl,-Bdynamic
> -ldl -lrt -lpam -o udsagent
OK, minus the -lpam I can link this and reproduce the problem here.
libboost_locale.a is the culprit.
The first complaint about an undefined symbol (linking with
-Wl,--no-demangle) is
_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE13_M_insert_intIlEES3_S3_RSt8ios_basecT_
This is actually defined in libstdc++.a(locale-inst.o) .opd section
(it's a function descriptor) an alias for
_ZNKSt17__gnu_cxx_ldbl1287num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE13_M_insert_intIlEES4_S4_RSt8ios_basecT_
with the corresponding code in section
.text._ZNKSt17__gnu_cxx_ldbl1287num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE13_M_insert_intIlEES4_S4_RSt8ios_basecT_
That section is a member of a comdat group
COMDAT group section [ 206] `.group' [_ZNKSt17__gnu_cxx_ldbl1287num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE13_M_insert_intIlEES4_S4_RSt8ios_basecT_] contains 2 sections:
[Index] Name
[ 837] .text._ZNKSt17__gnu_cxx_ldbl1287num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE13_M_insert_intIlEES4_S4_RSt8ios_basecT_
[ 838] .rela.text._ZNKSt17__gnu_cxx_ldbl1287num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE13_M_insert_intIlEES4_S4_RSt8ios_base
The trouble is, you have another copy of that group in
libboost_locale.a(numeric.o)
COMDAT group section [ 139] `.group' [_ZNKSt17__gnu_cxx_ldbl1287num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE13_M_insert_intIlEES4_S4_RSt8ios_basecT_] contains 2 sections:
[Index] Name
[ 535] .text._ZNKSt17__gnu_cxx_ldbl1287num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE13_M_insert_intIlEES4_S4_RSt8ios_basecT_
[ 536] .rela.text._ZNKSt17__gnu_cxx_ldbl1287num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE13_M_insert_intIlEES4_S4_RSt8ios_base
Only one of these groups gets linked in, the first. Since you link
libboost_locale.a before libstdc++.a you get the libboost_local.a
version, which doesn't have the alias symbols defined. I'll note that
object files with different sets of global symbols in comdat groups is
a worry, indicating that your libboost isn't properly compatible with
your libstdc++.
I found it was possible to link the static libstdc++ just before
-lboost_locale without linker complaint (libstdc++.a will be linked
afterwards too).
powerpc64-linux-g++ -L. -Wl,-z,noexecstack -static-libgcc -static-libstdc++ -g *.o -lvirtualization -lagtframework -lvirtualization -ldas -loracle -lgeneric -lnas -lsystemstate -lstoragemgmt -lsmartcopy -lagtframework -lagentutils -ludplinuxutils -ludpzfsutils -lpthread -lrt -Wl,-Bstatic -lACE -lssl -lcrypto -lz -lxml2 -lboost_chrono -lboost_filesystem -lstdc++ -lboost_locale -lboost_program_options -lboost_system -lboost_thread -Wl,-Bdynamic -ldl -lrt -o udsagent
--
Alan Modra
Australia Development Lab, IBM