This is the mail archive of the
mailing list for the binutils project.
Re: trunk gold not building unoptimized, powerpc.cc refs to invalid_address and pltresolve_size
- From: Ian Lance Taylor <iant at google dot com>
- To: Roland McGrath <mcgrathr at google dot com>
- Cc: binutils at sourceware dot org
- Date: Thu, 6 Dec 2012 15:45:22 -0800
- Subject: Re: trunk gold not building unoptimized, powerpc.cc refs to invalid_address and pltresolve_size
- References: <CAB=4xhrpn3ZC-i+d=mAmcw7d6tVGUtxZpNnCv9Yi2DVZ=U0LHA@mail.gmail.com>
On Thu, Dec 6, 2012 at 10:44 AM, Roland McGrath <email@example.com> wrote:
> I've been unable to compile the trunk version of gold for a while now.
> There are lots of these kinds of link errors:
> gold/powerpc.cc:3103: undefined reference to `(anonymous
> namespace)::Stub_table<32, false>::invalid_address'
> gold/powerpc.cc:3310: undefined reference to `(anonymous
> namespace)::Output_data_glink<64, true>::pltresolve_size'
> This is on the Google-modified version of Ubuntu 12.04.1,
> gcc -v says "gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)".
> This is with CXXFLAGS=-g in the configure line, so unoptimized.
> There is no link error with CXXFLAGS='-g -O2'.
> My guess is that optimized code folds these 'static const' class members as
> constants but unoptimized code doesn't, and that powerpc.cc ought to be
> doing something to explicitly instantiate its templates. But I don't know
> all the details of C++ template instantiation rules, so the fix is not
> obvious to me.
Alan needs to add a definition for the constant. In C++98, all
constants declared in classes, even those declared in template
classes, require an explicit definition.
template<int size, bool big_endian>
const Address Target_powerpc::invalid_address;