From unknown Fri Aug 15 04:04:37 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#9595 <9595@debbugs.gnu.org> To: bug#9595 <9595@debbugs.gnu.org> Subject: Status: -module is not enough to get an .so Reply-To: bug#9595 <9595@debbugs.gnu.org> Date: Fri, 15 Aug 2025 11:04:37 +0000 retitle 9595 -module is not enough to get an .so reassign 9595 libtool submitter 9595 Reuben Thomas severity 9595 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 24 18:00:24 2011 Received: (at submit) by debbugs.gnu.org; 24 Sep 2011 22:00:24 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R7aGl-0004Na-H2 for submit@debbugs.gnu.org; Sat, 24 Sep 2011 18:00:23 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R7aGi-0004NS-4a for submit@debbugs.gnu.org; Sat, 24 Sep 2011 18:00:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R7aG8-0001Qv-SE for submit@debbugs.gnu.org; Sat, 24 Sep 2011 17:59:46 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([140.186.70.17]:42740) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R7aG8-0001Qr-Qm for submit@debbugs.gnu.org; Sat, 24 Sep 2011 17:59:44 -0400 Received: from eggs.gnu.org ([140.186.70.92]:48855) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R7aG7-0006II-M9 for bug-libtool@gnu.org; Sat, 24 Sep 2011 17:59:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R7aG6-0001QV-6J for bug-libtool@gnu.org; Sat, 24 Sep 2011 17:59:43 -0400 Received: from exprod7og107.obsmtp.com ([64.18.2.167]:41152) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1R7aG5-0001QL-Of for bug-libtool@gnu.org; Sat, 24 Sep 2011 17:59:42 -0400 Received: from mail-wy0-f172.google.com ([74.125.82.172]) (using TLSv1) by exprod7ob107.postini.com ([64.18.6.12]) with SMTP ID DSNKTn5Syb3GLNWAz5DCSO2GWnnPfuemOokM@postini.com; Sat, 24 Sep 2011 14:59:41 PDT Received: by wyh21 with SMTP id 21so2515908wyh.3 for ; Sat, 24 Sep 2011 14:59:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.172.198 with SMTP id t48mr6817404wel.79.1316901575636; Sat, 24 Sep 2011 14:59:35 -0700 (PDT) Received: by 10.180.100.164 with HTTP; Sat, 24 Sep 2011 14:59:35 -0700 (PDT) Date: Sat, 24 Sep 2011 22:59:35 +0100 Message-ID: Subject: -module is not enough to get an .so From: Reuben Thomas To: bug-libtool@gnu.org Content-Type: text/plain; charset=ISO-8859-1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -6.2 (------) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.2 (------) I want to build a test plugin in an automake project. For installed plugins, I add them to pkglib_LTLIBRARIES, and the relevant .so files are built in foo/.libs, whence I can extract them for testing. However, libraries in check_LTLIBRARIES (or noinst_LTLIBRARIES) do not have their .so files built, so my tests can't find them. I can't just use the .la files, as I'm not linking against the plugin files, but dlopening them (of course, using the appropriate variables to get the .so suffix and .libs directory name). I notice that in the .la file, dlname is empty for libraries in check_LTLIBRARIES, yet the relevant library has -module in its foo_la_LDFLAGS. The library is built, just not the .so file. From looking at the output of make V=1, the difference appears to be that the installed libraries are built with -rpath: /bin/bash ../../libtool --tag=CC --mode=link gcc -g -O2 -module -avoid-version -o struct.la -rpath /home/rrt/local/x86_64/lib/lua/5.1/alien struct.lo libtool: link: gcc -shared .libs/struct.o -Wl,-soname -Wl,struct.so -o .libs/struct.so libtool: link: gcc -shared .libs/core.o -lffi -Wl,-soname -Wl,core.so -o .libs/core.so libtool: link: ( cd ".libs" && rm -f "struct.la" && ln -s "../struct.la" "struct.la" ) libtool: link: ( cd ".libs" && rm -f "core.la" && ln -s "../core.la" "core.la" ) whereas the noinst/check libraries aren't: /bin/bash ../libtool --tag=CC --mode=link gcc -g -O2 -module -avoid-version -o alientest.la alientest.lo libtool: link: ar cru .libs/alientest.a .libs/alientest.o libtool: link: ranlib .libs/alientest.a libtool: link: ( cd ".libs" && rm -f "alientest.la" && ln -s "../alientest.la" "alientest.la" ) I'm using libtool 2.2.6b (and automake 1.11.1). I can't see anything in NEWS in git since 2.2.6b which bears on this issue. However, I can see that the omission of -rpath is intentional, from this commit message: commit f15fa67ff2df0c7c147b7f61062fe6594d75be99 Author: Tom Tromey Date: Sat Jan 13 18:56:19 2001 +0000 2001-01-13 Kevin Ryde * automake.in (handle_ltlibraries): Omit -rpath from check_LTLIBRARIES, as per noinst_LTLIBRARIES. -- http://rrt.sc3d.org