[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Fix wrong rpath in poke/.libs/lt-poke
From: |
Bruno Haible |
Subject: |
Fix wrong rpath in poke/.libs/lt-poke |
Date: |
Sun, 10 May 2020 18:06:39 +0200 |
User-agent: |
KMail/5.1.3 (Linux/4.4.0-177-generic; KDE/5.18.0; x86_64; ; ) |
Hi,
The CI failed today, so tried to build from source locally, and encountered
a build failure. I always configure with the same -I and -L options; they
point to the place where libtextstyle is installed and where I want poke
to be installed as well.
$ make maintainer-clean
$ ./configure --prefix=/media/develdata/devel/inst-x86_64-64
CPPFLAGS="-I/media/develdata/devel/inst-x86_64-64/include -Wall"
LDFLAGS="-L/media/develdata/devel/inst-x86_64-64/lib" CFLAGS="-O0 -ggdb"
CXXFLAGS="-O0 -ggdb"
$ make
...
Making all in man
make[1]: Entering directory '/media/develdata/devel/POKE/poke/man'
make ./../poke/poke
make[2]: Entering directory '/media/develdata/devel/POKE/poke/man'
make[2]: Nothing to be done for '../poke/poke'.
make[2]: Leaving directory '/media/develdata/devel/POKE/poke/man'
../run \
/bin/bash /media/develdata/devel/POKE/poke/build-aux/missing
help2man -p poke --name="The GNU extensible binary editor" \
./../poke/poke -o poke.1
help2man: can't get `--help' info from ./../poke/poke
Try `--no-discard-stderr' if option outputs to stderr
make[1]: *** [Makefile:1886: poke.1] Error 139
make[1]: Leaving directory '/media/develdata/devel/POKE/poke/man'
Let's look why it can't get the --help output:
$ ../poke/poke --help
/media/develdata/devel/POKE/poke/poke/.libs/lt-poke: symbol lookup error:
/media/develdata/devel/inst-x86_64-64/lib/libpoke.so.0: undefined symbol:
rpl_asprintf
$ ../run ../poke/poke --help
/media/develdata/devel/POKE/poke/poke/.libs/lt-poke: symbol lookup error:
/media/develdata/devel/inst-x86_64-64/lib/libpoke.so.0: undefined symbol:
rpl_asprintf
$ nm --dynamic /media/develdata/devel/inst-x86_64-64/lib/libpoke.so.0 | grep
rpl_
U rpl_asprintf
U rpl_printf
U rpl_vasprintf
U rpl_vfprintf
$ nm --dynamic ../libpoke/.libs/libpoke.so.0.0.0 | grep rpl_
So, evidently the .libs/lt-poke executable uses the wrong version of
the libpoke library. Why does it do that?
$ readelf -d ../poke/.libs/lt-poke | grep RPATH
0x000000000000000f (RPATH) Library rpath:
[/media/develdata/devel/inst-x86_64-64/lib:/media/develdata/devel/POKE/poke/libpoke/.libs]
Because it has an RPATH that references the installation directory before
the build directory of libpoke. It should be the other way around.
The fix (which it took me a while to find) is attached.
The difference between LIBTEXTSTYLE and LTLIBTEXTSTYLE is that the former
is for linking without libtool and the latter with libtool. Since the
Makefile.am now defines poke_LDADD with some .la files, Automake uses
libtool for linking.
S["LIBTEXTSTYLE"]="/media/develdata/devel/inst-x86_64-64/lib/libtextstyle.so
-lm -lncurses -Wl,-rpath -Wl,/media/develdata/devel/inst-x86_64-64/lib"
S["LTLIBTEXTSTYLE"]="-L/media/develdata/devel/inst-x86_64-64/lib -ltextstyle
-lm -lncurses -R/media/develdata/devel/inst-x86_64-64/lib"
OK to push?
Bruno
0001-Fix-wrong-rpath-in-poke-.libs-lt-poke.patch
Description: Text Data
- Fix wrong rpath in poke/.libs/lt-poke,
Bruno Haible <=