sox-devel@lists.sourceforge.net unofficial mirror
 help / color / mirror / code / Atom feed
From: Jan Stary <hans@stare.cz>
To: "Måns Rullgård" <mans@mansr.com>
Cc: sox-devel@lists.sourceforge.net
Subject: Re: Build system cleanup
Date: Thu, 27 Aug 2020 16:38:22 +0200	[thread overview]
Message-ID: <20200827143822.GA98176@www.stare.cz> (raw)
In-Reply-To: <20200827141012.GA28669@www.stare.cz>

On Aug 27 16:10:12, hans@stare.cz wrote:
> On Aug 27 14:31:51, mans@mansr.com wrote:
> > Jan Stary <hans@stare.cz> writes:
> > 
> > > On Aug 27 11:40:48, hans@stare.cz wrote:
> > >> On Aug 24 08:56:43, hans@stare.cz wrote:
> > >> > On Aug 23 23:55:51, hans@stare.cz 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.
> 
> Yes. That would be around 2011; the OpenBSD libtool is from 2012
> - since then, the GNU libtool is only kept for ports that require it
> (unlike the audio/sox port).
> 
> Do you run a newer version of GNU libtool on your OpenBSD machine
> that behaves differently with respect to the "." pattern
> and makes the current new-build link?

Maybe that's not it -
the patch in configure.ac doesn't apply cleanly.


$ doas pkg_add -i libtool
$ env AUTOCONF_VERSION=2.69 AUTOMAKE_VERSION=1.16 autoreconf -i
$ find . -name libtool\*
./m4/libtool.m4
$ ./configure --disable-silent-rules --prefix=$HOME
[...]
config.status: executing libtool commands
No such line 10787 in input file, ignoring
1 out of 3 hunks failed--saving rejects to libtool.rej
[...]

(Should the while build fail here?)

$ find . -name libtool\*
./m4/libtool.m4
./libtool
./libtool.rej
./libtool.orig

$ cat libtool.rej
@@ -9144,7 +9146,7 @@
	*) func_append new_libs " $deplib" ;;
	esac
       done
-      compile_deplibs=$new_libs
+      compile_deplibs="$pri_libs $new_libs"


       func_append compile_command " $compile_deplibs"

$ diff libtool.orig libtool
--- libtool.orig	Thu Aug 27 16:21:12 2020
+++ libtool	Thu Aug 27 16:21:12 2020
@@ -9122,6 +9122,7 @@ EOF
       # move library search paths that coincide with paths to not yet
       # installed libraries to the beginning of the library search list
       new_libs=
+      pri_libs=
       for path in $notinst_path; do
	case " $new_libs " in
	*" -L$path/$objdir "*) ;;
@@ -9135,6 +9136,7 @@ EOF
       done
       for deplib in $compile_deplibs; do
	case $deplib in
+	-L.*) func_append pri_libs " $deplib" ;;
	-L*)
	  case " $new_libs " in
	  *" $deplib "*) ;;

(In case you would like a user account on an actual OpenBSD system,
send me you public key.)

Instead of trying to patch the broken libtool,
can ./configure jus use /usr/bin/libtool on OpenBSD?
While

/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 -lsndio -lvorbisenc -lvorbisfile -lvorbis -logg -lopus -lm -Wl,-rpath,/usr/local/lib
ld: error: undefined symbol: lsx_realloc_array

fails, "make LIBTOOL=/usr/bin/libtool" works just fine:

/usr/bin/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 -o .libs/sox -g -O2 -fstack-protector-strong -Wall -Wmissing-prototypes -Wstrict-prototypes -Wl,--as-needed sox.o -L.libs -lsox -lFLAC -logg -lm -lopusfile -lopus -lsndio -lvorbis -lvorbisenc -lvorbisfile -Wl,-rpath-link,/usr/local/lib

Note the "/usr/bin/libtool" instead of "/bin/sh ../libtool".

Also, patching with a diff between libtool~ and libtool
(as configure.ac currently does) apparently requires
a specific version of GNU libtool; and is doomed to fail
on every subsequent run anyway.

	Jan



_______________________________________________
SoX-devel mailing list
SoX-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-devel

  reply	other threads:[~2020-08-27 14:38 UTC|newest]

Thread overview: 89+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-19 20:40 Build system cleanup Måns Rullgård
2020-08-20 20:40 ` Wolfgang Stoeggl via SoX-devel
2020-08-20 21:22   ` Måns Rullgård
2020-08-20 22:15     ` Wolfgang Stoeggl via SoX-devel
2020-08-21  8:24     ` Jan Stary
2020-08-21  8:16 ` Jan Stary
2020-08-21  8:31   ` Jan Stary
2020-08-21 10:28     ` Måns Rullgård
2020-08-21 12:24       ` Jan Stary
2020-08-21 12:46         ` Måns Rullgård
2020-08-21  8:49   ` Jan Stary
2020-08-21 10:33     ` Måns Rullgård
2020-08-21 12:49       ` Jan Stary
2020-08-21 12:50         ` Jan Stary
2020-08-21 13:32         ` Måns Rullgård
2020-08-21 14:09         ` Jan Stary
2020-08-21 11:15   ` Måns Rullgård
2020-08-21 14:04     ` Jan Stary
2020-08-21 14:47       ` Måns Rullgård
2020-08-21 19:26       ` Wolfgang Stoeggl
2020-08-21 20:20       ` Jan Stary
2020-08-21 15:16   ` Jan Stary
2020-08-21 15:21     ` Jan Stary
2020-08-21 17:08       ` Måns Rullgård
2020-08-21 17:43         ` Jan Stary
2020-08-21 17:52           ` Måns Rullgård
2020-08-21 17:57             ` Jan Stary
2020-08-21 20:17             ` Jan Stary
2020-08-21 20:45               ` Jan Stary
2020-08-21 21:43                 ` Måns Rullgård
2020-08-22  8:17                   ` Jan Stary
2020-08-22 10:10                     ` Måns Rullgård
2020-08-22 15:35                       ` Jan Stary
2020-08-22 15:44                         ` Jan Stary
2020-08-22 20:54                         ` Måns Rullgård
2020-08-23 14:07                           ` Jan Stary
2020-08-23 17:13                             ` Måns Rullgård
2020-08-23 19:46                               ` Jan Stary
2020-08-24 11:04                                 ` Måns Rullgård
2020-08-24 11:19                                   ` Jan Stary
2020-08-27  9:38                                     ` Jan Stary
2020-08-27 10:53                                       ` Måns Rullgård
2020-08-23 21:55                               ` Jan Stary
2020-08-24  6:56                                 ` Jan Stary
2020-08-27  9:40                                   ` Jan Stary
2020-08-27 11:08                                     ` Måns Rullgård
2020-08-27 11:37                                       ` Jan Stary
2020-08-27 11:53                                         ` Måns Rullgård
2020-08-27 13:05                                     ` Jan Stary
2020-08-27 13:31                                       ` Måns Rullgård
2020-08-27 14:10                                         ` Jan Stary
2020-08-27 14:38                                           ` Jan Stary [this message]
2020-08-27 15:11                                         ` Måns Rullgård
2020-08-27 17:41                                           ` Jan Stary
2020-08-27 18:50                                             ` Måns Rullgård
2020-08-27 19:18                                               ` Jan Stary
2020-08-28  4:54                                                 ` Jan Stary
2020-08-28  9:13                                                 ` Måns Rullgård
2020-08-24 12:19                                 ` Måns Rullgård
2020-08-24 14:43                                   ` Jan Stary
2020-08-24 14:59                                     ` Måns Rullgård
2020-08-27  9:44                                       ` Jan Stary
2020-08-27 11:08                                         ` Måns Rullgård
2020-08-24 17:22                                     ` Måns Rullgård
2020-08-22 15:43                     ` Jan Stary
2020-08-22 15:48                       ` Jan Stary
2020-08-24 12:18                   ` Jan Stary
2020-08-24 12:27                     ` Måns Rullgård
2020-08-24 13:16                       ` Jan Stary
2020-08-24 14:15                         ` Måns Rullgård
2020-08-27  9:52                           ` Jan Stary
2020-08-27 11:10                             ` Måns Rullgård
  -- strict thread matches above, loose matches on Subject: below --
2020-08-21  8:52 Jan Stary
2020-08-21 10:36 ` Måns Rullgård
2020-08-21 12:22   ` Jan Stary
2020-08-21 12:27     ` Måns Rullgård
2020-08-27  9:21 Jan Stary
2020-08-27 10:54 ` Jan Stary
2020-08-27 11:52 ` Måns Rullgård
2020-08-27 12:40   ` Jan Stary
2020-08-27 12:44     ` Jan Stary
2020-08-27 12:45     ` Måns Rullgård
2020-08-27 17:45 ` Jan Stary
2020-08-27 18:59   ` Måns Rullgård
2020-08-27 19:51     ` Jan Stary
2020-08-27 20:01 ` Jan Stary
2020-08-28  9:21   ` Måns Rullgård
2020-08-28  9:35     ` Jan Stary
2020-08-28  9:43       ` Måns Rullgård

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.sourceforge.net/lists/listinfo/sox-devel

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200827143822.GA98176@www.stare.cz \
    --to=sox-devel@lists.sourceforge.net \
    --cc=mans@mansr.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/sox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).