| View previous topic :: View next topic |
| Author |
Message |
watersb Apprentice


Joined: 04 Sep 2002 Posts: 297 Location: where the hell is Tesuque, New Mexico?
|
Posted: Sun May 06, 2018 10:27 pm Post subject: [SOLVED] More libtool fun |
|
|
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 |
|
 |
sunova n00b

Joined: 07 Feb 2020 Posts: 15
|
Posted: Fri Feb 07, 2020 6:11 pm Post subject: |
|
|
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 |
|
 |
sunova n00b

Joined: 07 Feb 2020 Posts: 15
|
|
| Back to top |
|
 |
|
|
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
|
|