This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: libctf linking against different libbfd builds, but using the same soname
On 26 Nov 2019, Matthias Klose verbalised:
> On 26.11.19 15:56, Nick Alcock wrote:
>>>> Basically, BFD usage is a small part of libctf, and I was really hoping
>>>> that I wouldn't have to perturb the entire soname or do something else
>>>> massively disruptive just because of the library we're using to pull
>>>> sections out of executables. But really as long as users can just say
>>>> -lctf to link with it I guess it's not too problematical if the SONAME
>>>> they end up linking with is cross-specific. (It shouldn't be a
>>>> constantly-changing soname, though. Unlike libbfd, we have a stable
>>>> API/ABI in libctf, at least mostly, and I'd like to stick with that if
>>>> possible, with exceptions for newly-added and still evolving bits like
>>>> ctf_link_*().)
>>>
>>> Assume you had a configure option --with-system-libctf, linking the cross
>>> binutils against the libctf from the native binutils build ... would that work,
>>> or not, for any combination of the native and the cross architecture?
>>> Same question for --with-system-libctf-nobfd.
>>
>> Well, the question really is if libbfd's API or ABI or macro contents
>> etc changes if you change the target, and I fear it probably does. This
>> probably torpedoes your cross ld as well unless you change the soname
>> for libbfd as well.
>
> Yes, I'm using different sonames for the cross libbfd as well. Ok, in this case,
> I'll just use the same approach for both libctf libraries.
OK. I'd say it's the native library that shouldn't change: people doing
cross builds are already, alas, too used to doing local hacks.
(But in the longer term it would be nice if Debian had a more systematic
way to do this, i.e. some way to specify "native but targetting cross"
using multiarch: /usr/lib/$native/$cross perhaps:
/usr/lib/x86_64-pc-linux-gnu/aarch64-pc-linux-gnu/ or something.)