On Aug 27 16:11:44, m...@mansr.com wrote: > >>> > > > > cc [...] -o .libs/sox sox.o -L./.libs -lsox -L/usr/local/lib > >>> > > > > -lpng [...] > >>> > > > > cc [...] -o .libs/sox sox.o -L/usr/local/lib -L./.libs -lsox > >>> > > > > -lpng [...] > >>> > > > > > >>> > > > > The first works, the second does not. > >>> > > > > The only difference between the two is the place > >>> > > > > where the extra -L/usr/local/lib gets added, > >>> > > > > as described in the previous emails. > >>> > > > >>> > > And it seems libtool itself is the one who breaks it. > >>> > > This is the failing line again: > >>> > > > >>> > > /bin/sh ../libtool --tag=CC --mode=link cc -g -O2 > >>> > > -fstack-protector-strong -Wall -Wmissing-prototypes > >>> > > -Wstrict-prototypes -avoid-version -module -L/usr/local/lib > >>> > > -Wl,--as-needed -o sox sox.o libsox.la -lm > >>> > > > >>> > > Notice the "-L/usr/local/lib -Wl,--as-needed". > >>> > > The "-L/usr/local/lib" part comes from the configure arg: > >>> > > > >>> > > ./configure CC=cc CPPFLAGS=-I/usr/local/include > >>> > > LDFLAGS=-L/usr/local/lib > >>> > > > >>> > > The "-Wl,--as-needed" comes from > >>> > > > >>> > > $ grep as-needed configure.ac > >>> > > AX_APPEND_LINK_FLAGS([-Wl,--as-needed]) > >>> > > > >>> > > That results in the following line in src/Makefile: > >>> > > > >>> > > LDFLAGS = -L/usr/local/lib -Wl,--as-needed > >>> > > > >>> > > and that's what is passed in the above command line. Now, libtool > >>> > > apparently preprocesses the line into something else; in particular, > >>> > > it reorders the options. The very next command is: > >>> > > > >>> > > libtool: link: cc -g -O2 -fstack-protector-strong -Wall > >>> > > -Wmissing-prototypes -Wstrict-prototypes -Wl,--as-needed -o .libs/sox > >>> > > sox.o -L/usr/local/lib -L./.libs -lsox -lpng -lltdl -lao -lgsm -lmad > >>> > > -lmp3lame -ltwolame -lid3tag -lz -lopusfile -lopus -lsndio > >>> > > -lvorbisfile -lwavpack -lcrypto -lsndfile -lFLAC -lvorbisenc -lvorbis > >>> > > -logg -lm -Wl,-rpath,/usr/local/lib > >>> > > > >>> > > Notice where the -L/usr/local/lib has been moved. > >>> > > As described previously, if it comes after -lsox > >>> > > instead of before it, it links just fine. > >>> > > >>> > That being said, the same problem is present in the master branch, > >>> > but it works in 14.4.2, where the libtool line is > >>> > > >>> > bin/sh ../libtool --silent --tag=CC --silent --mode=link cc > >>> > -Wtraditional-co > >>> > nversion -g -O2 -fstack-protector -Wall -W -Wmissing-prototypes > >>> > -Wstrict-protot > >>> > ypes -pedantic -avoid-version -module -L/usr/local/lib -o sox sox.o > >>> > libsox.la > >>> > -lm > >>> > > >>> > which becomes (without 'silent') > >>> > > >>> > libtool: link: cc -Wtraditional-conversion -g -O2 -fstack-protector > >>> > -Wall -W -Wmissing-prototypes -Wstrict-prototypes -pedantic -o > >>> > .libs/sox sox.o -L/usr/local/lib -L./.libs -lsox -lltdl -lpng -lao > >>> > -lgsm -lmad -lid3tag -lz -lmp3lame -ltwolame -lopusfile -lopus -lsndio > >>> > -lvorbisfile -lwavpack -lcrypto -lsndfile -lFLAC -lvorbisenc -lvorbis > >>> > -logg -lm -Wl,-rpath,/home/hans/lib -Wl,-rpath,/usr/local/lib > >> > >> With the current new-build, the ultimate linkage fails on OpenBSD > >> for plain ./configure (without any args or env variables): > >> > >> /bin/sh ../libtool --tag=CC --mode=link gcc -g -O2 > >> -fstack-protector-strong -Wall -Wmissing-prototypes -Wstrict-prototypes > >> -Wl,--as-needed -o sox sox.o libsox.la -lm > >> libtool: link: gcc -g -O2 -fstack-protector-strong -Wall > >> -Wmissing-prototypes -Wstrict-prototypes -Wl,--as-needed -o .libs/sox > >> sox.o -lsox -L/usr/local/lib -lFLAC -lopusfile -lopus -lsndio -lvorbisenc > >> -lvorbisfile -lvorbis -logg -lm -Wl,-rpath,/home/hans/lib > >> -Wl,-rpath,/usr/local/lib > >> ld: error: undefined symbol: lsx_realloc_array > >> > >> NB: -o .libs/sox sox.o -lsox ... > >> > >> Is it the literal '.' in "-L.*"? > >> It works with "-L\.*" > > > > Aargh, the OpenBSD package for GNU libtool is slightly (9 years) old. > > Now it works with both the old and current libtool versions.
I tested with libtool-2.4.2p0 as installed by the OpenBSD package, and it works, in that the resulting ./libtool issues a working link cmd. However, having a patch in a build system that is not even expected to apply cleanly is extremely fragile (beside being ugly). It depends on the precise GNU libtool version; that's the opposite of portability. The comment says Only one of hunks 3 and 4 is expected to apply. Which one depends on the libtool version. *The* libtool version? Meaning one of 2.4.2 or 2.4.6? What about all the other versions? Also, the failed patches accumulate with subsequent runs: ./libtool ./libtool.rej ./libtool.orig ./libtool.rej.orig Why not simply set LIBTOOL=/usr/bin/libtool once we figure this is OpenBSD? That works independently of the version, will not break after the libtool port is updated, and doesn't need to apply patches that do not apply. Jan _______________________________________________ SoX-devel mailing list SoX-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sox-devel