Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] More libtool fun
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
watersb
Apprentice
Apprentice


Joined: 04 Sep 2002
Posts: 297
Location: where the hell is Tesuque, New Mexico?

PostPosted: Sun May 06, 2018 10:27 pm    Post subject: [SOLVED] More libtool fun Reply with quote

TL;DR --- Don't use LTO (link-time optimization) with libtool, libltdl, libffi ( at least, until I can figure out this one autoconf test that is failing )

If NM is set to something fun -- I had it set to gcc-nm, the GCC wrapper that does LTO -- then libtool will not build correctly, BUT it will say that it is fine.

That is to say, libtool will cheerfully build and install a broken libtool for you.

This also affects libltdl, which is a separate package on Gentoo, but is just a distinct subset, a subdirectory of the libtool source tree.

I consider this a bug with upstream libtool, and perhaps whatever it is using for autoconf macros to check this.

Was really messing with me, until I stumbled upon this thread from GNU libtool lists:

Quote:

You have this line in there:
Code:

checking command to parse /usr/ccs/bin/nm output from
/opt/solarisstudio12.3/bin/cc object... failed

which...
...is the direct cause of this diagnostic:
Code:

> Undefined                       first referenced
>  symbol                             in file
> lt_libltdl_LTX_preloaded_symbols    libltdl/.libs/libltdl_libltdl_la-ltdl.o
> ld: fatal: symbol referencing errors. No output written to
> libltdl/.libs/libltdl.so.7.3.0


The lt_libltdl_LTX_preloaded_symbols symbol is supposed to be in an automatically generated file, which isn't generated because configure does not recognize the $NM output. Libtool wants BSD style output.

<hex address> <symbol type> <symbol name>

e.g.
00000118 T _foobar

Try to set NM to something that outputs lines as above when given object files from your compiler.


The signal I was getting was

Code:

checking command to parse /usr/powerpc-unknown-linux-gnu/gcc-bin/7.3.0/gcc-nm output from powerpc-unknown-linux-gnu-gcc object... failed


This does not kill the build! The result for me was a library with an unresolved symbol:

Code:

libtool:   error: not configured to extract global symbols from dlpreopened files
.
.
.
done
echo stamp > 'libltdl/stamp-mk'
cd './libltdl' && /bin/bash /var/tmp/portage/sys-devel/libtool-2.4.6-r5/work/libtool-2.4.6/build-aux/missing autoheader
touch 'libltdl/config-h.in'
make[2]: Leaving directory '/var/tmp/portage/sys-devel/libtool-2.4.6-r5/work/libtool-2.4.6'
make[1]: Leaving directory '/var/tmp/portage/sys-devel/libtool-2.4.6-r5/work/libtool-2.4.6'
>>> Source compiled.


Code:

# objdump -T libltdl.so | grep LTX
00000000      D  *UND*  00000000              lt_libltdl_LTX_preloaded_symbols



I am building this on an obsolete platform, because I tend to learn things by grabbing sharp, pointy objects. Be careful out there.
Back to top
View user's profile Send private message
sunova
n00b
n00b


Joined: 07 Feb 2020
Posts: 15

PostPosted: Fri Feb 07, 2020 6:11 pm    Post subject: Reply with quote

Nah, it's not related to lto. It's some sort of mismatch between libtool and/or gcc and/or binutils.

It causes the
Code:
lt_cv_sys_global_symbol_pipe=
which messes up with your final configuration results.

I added this line at the end of my make.conf:
Code:

lt_cv_sys_global_symbol_pipe='sed -n -e '\''s/^.*[      ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[         ][      ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p'\'' | sed '\''/ __gnu_lto/d'\'''

I know it's not a best practice but I can't miss gcc-10 or new binutils at the time. + I learn new things best in these situations.
Back to top
View user's profile Send private message
sunova
n00b
n00b


Joined: 07 Feb 2020
Posts: 15

PostPosted: Thu Aug 20, 2020 2:58 am    Post subject: Reply with quote

Gentoo Bugtracker Issue:
https://bugs.gentoo.org/708340
Upstream issue:
https://sourceware.org/bugzilla/show_bug.cgi?id=25355

binutils 2.35 worked perfectly for me.

And sorry by saying it's not related to LTO I meant to blame libtool, not contradicting you. Crude of me, I apologize.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum