From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.3 required=3.0 tests=AWL,BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 030551F66E for ; Mon, 24 Aug 2020 15:00:17 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1kADx5-0008Ps-Es; Mon, 24 Aug 2020 15:00:03 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kADx3-0008Pk-Vt for sox-devel@lists.sourceforge.net; Mon, 24 Aug 2020 15:00:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:Content-Type:MIME-Version :Message-ID:In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=JdGAlx8urJjkS8H8++rucw3xXKDiaQ7V/SWpob/kSio=; b=Fqibxw+8DdPUSqZdJh8wJV6ZaE PlnHCeKFX8qn4O/9RIwDx7ZM3OJSRv3NqTlPA+sDFZ1ZLsHxWg6/5uawi2Nwe6CIg+mDiR42BOhch B3gg3RfRIzLsRAp8zWNk7o4gNUEVnc5W2QXVwWX7QgVLeAPhTTfG+zY4J2ULQFuLF/sM=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID: In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=JdGAlx8urJjkS8H8++rucw3xXKDiaQ7V/SWpob/kSio=; b=lithPic4eWPxRPFJbfScN0dNIa zf+z9Vc8f7Xl2fjlwLjL3YhBm7rDxQw8pPCAwdW9OzDJ3mUAX2rejFEf4O2/vBDZi33nUJd2UP+Av HlhLG4GuWekCaLgA+w90pi2l/nBo+mXMHtcMe3xzFNIO4jrKKp9Mi8gIiCmIjRMNYXs4=; Received: from [81.2.72.234] (helo=unicorn.mansr.com) by sfi-mx-4.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1kADx0-005NPZ-B0 for sox-devel@lists.sourceforge.net; Mon, 24 Aug 2020 15:00:01 +0000 Received: from raven.mansr.com (raven.mansr.com [81.2.72.235]) by unicorn.mansr.com (Postfix) with ESMTPS id A22E715360; Mon, 24 Aug 2020 15:59:41 +0100 (BST) Received: by raven.mansr.com (Postfix, from userid 51770) id 2AE2021A6F2; Mon, 24 Aug 2020 15:59:40 +0100 (BST) From: =?iso-8859-1?Q?M=E5ns_Rullg=E5rd?= To: Jan Stary References: <20200821204550.GA67586@www.stare.cz> <20200822081738.GA14321@www.stare.cz> <20200822153545.GA61858@www.stare.cz> <20200823140733.GA9403@www.stare.cz> <20200823215551.GA83582@www.stare.cz> <20200824144314.GA45261@www.stare.cz> Date: Mon, 24 Aug 2020 15:59:40 +0100 In-Reply-To: <20200824144314.GA45261@www.stare.cz> (Jan Stary's message of "Mon, 24 Aug 2020 16:43:14 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 X-Headers-End: 1kADx0-005NPZ-B0 Subject: Re: Build system cleanup X-BeenThere: sox-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sox-devel@lists.sourceforge.net Cc: sox-devel@lists.sourceforge.net Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Errors-To: sox-devel-bounces@lists.sourceforge.net Jan Stary writes: > On Aug 24 13:19:36, mans@mansr.com wrote: >> Jan Stary writes: >> = >> >> > 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=3DCC --mode=3Dlink cc -g -O2 -fstack-pro= tector-strong -Wall -Wmissing-prototypes -Wstrict-prototypes -avoid-versi= on -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=3Dcc CPPFLAGS=3D-I/usr/local/include LDFLAGS=3D-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 =3D -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-prot= otypes -Wstrict-prototypes -Wl,--as-needed -o .libs/sox sox.o -L/usr/local= /lib -L./.libs -lsox -lpng -lltdl -lao -lgsm -lmad -lmp3lame -ltwolame -lid= 3tag -lz -lopusfile -lopus -lsndio -lvorbisfile -lwavpack -lcrypto -lsndfil= e -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. >> = >> None of this has changed. The problem is that you have an old libsox in >> /usr/local/lib, and with that -L flag early in the command, it takes >> precedence over the just-built libsox, causing the link to fail. > > This seems to be the case - together with GNU libtool > putting that -L/usr/local/lib _before_ the -L./.libs > which would link with the "new" libsox. > > (And, indeed, > $ nm /usr/local/lib/libsox.so.4.0 | grep lsx_malloc > $ nm src/.libs/libsox.so.3.0 | grep lsx_malloc > 00042f60 T lsx_malloc > which was the actual unresolved symbol, among others). > > I can confirm that deleting the previous version of sox > (installed in /usr/local/ via the OpenBSD sox-14.4.2p5 port) > makes that problem go away; or, better put, masks the bug > by removing the condition under which is shows. Good, we're finally in agreement. >> This whole issue is unique to OpenBSD. > > Having a previous version installed while a new one > is being built is to be expected, right? Yes, and it works everywhere I've tested it except OpenBSD. > Searching for -lsox in the -L path is also perfectly normal. > As we now know, it is the order of the -L options > introduced by GNU libtool that breaks it. > > Your "clean" VM is a special case in that it does not > have a previous version installed (as opposed to my screwed up, > misconfigured machine). When you install the previous sox 14.4.2 > (pkg_add sox), does the > > ./configure CC=3Dcc CFLAGS=3D-I/usr/local/include LDFLAGS=3D-L/usr/loca= l/lib > make V=3D1 > > build still work? I assume it will break. >> On Linux and FreeBSD the link command uses the full filename of libsox, >> so it isn't searched for in the -L locations. > > I didn't get to FreeBSD testing yet, but on NetBSD > (where the build fails in other interesting ways), it's > > libtool: link: gcc -g -O2 -fstack-protector-strong -Wall -Wmissing-protot= ypes -Wstrict-prototypes -fopenmp -Wl,--as-needed -o .libs/sox sox.o ./.li= bs/libsox.so -L/usr/pkg/lib -lmagic /usr/pkg/lib/libFLAC.so /usr/pkg/lib/li= bopusfile.so /usr/pkg/lib/libopus.so /usr/pkg/lib/libvorbisenc.so /usr/pkg/= lib/libvorbisfile.so /usr/pkg/lib/libvorbis.so /usr/pkg/lib/libogg.so -lm -= fopenmp -Wl,-rpath -Wl,/usr/local/lib -Wl,-rpath -Wl,/usr/pkg/lib > > So even some of the external libraries are linked via absolute paths - > seems to be precisely those detected by pkg-config > (not sure what the point of pkg-config --libs is then); > the others (-lm -lmagic) are found in the -L path. > > The linking commands are not invented by Linux or FreeBSD or OpenBSD > - they are what libtool or ./configure (or whatever it is inside the > auto* maze) put into the actual Makefile(s). If I understand the idea > of autotools at all, the supposed position of libtool is > > "Yo, I know how any given system/linker links; > so I can issue the right linking commands > for this system/linker right here, man". > > What *is* unique about OpenBSD, then, is that GNU libtool > does in fact not know how to link here. Does that make sense? Yes, libtool should put the -L.libs before any other -L flags to avoid such problems. Why don't you report the bug to them? -- = M=E5ns Rullg=E5rd _______________________________________________ SoX-devel mailing list SoX-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sox-devel