From unknown Thu Sep 11 03:25:26 2025 X-Loop: help-debbugs@gnu.org Subject: bug#15646: Multiple bugs related to -no-undefined and -nostdlib Resent-From: Andy Lutomirski Original-Sender: "Debbugs-submit" Resent-CC: bug-libtool@gnu.org Resent-Date: Fri, 18 Oct 2013 17:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 15646 X-GNU-PR-Package: libtool X-GNU-PR-Keywords: To: 15646@debbugs.gnu.org X-Debbugs-Original-To: bug-libtool@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.138211718718098 (code B ref -1); Fri, 18 Oct 2013 17:27:01 +0000 Received: (at submit) by debbugs.gnu.org; 18 Oct 2013 17:26:27 +0000 Received: from localhost ([127.0.0.1]:57145 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VXDoe-0004hn-Bz for submit@debbugs.gnu.org; Fri, 18 Oct 2013 13:26:25 -0400 Received: from eggs.gnu.org ([208.118.235.92]:57685) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VXDRw-00047I-Pj for submit@debbugs.gnu.org; Fri, 18 Oct 2013 13:02:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VXDRm-0006xt-Fs for submit@debbugs.gnu.org; Fri, 18 Oct 2013 13:02:51 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:38171) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VXDRm-0006xp-Dg for submit@debbugs.gnu.org; Fri, 18 Oct 2013 13:02:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59375) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VXDRh-0007LH-S3 for bug-libtool@gnu.org; Fri, 18 Oct 2013 13:02:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VXDRd-0006xE-Fv for bug-libtool@gnu.org; Fri, 18 Oct 2013 13:02:41 -0400 Received: from mail-lb0-f177.google.com ([209.85.217.177]:63507) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VXDRd-0006xA-8f for bug-libtool@gnu.org; Fri, 18 Oct 2013 13:02:37 -0400 Received: by mail-lb0-f177.google.com with SMTP id u14so661299lbd.8 for ; Fri, 18 Oct 2013 10:02:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-type; bh=QcGj9u/giTGT1UrK5GcRvbu7fDamku14s1yR04e5yO4=; b=JLFt5DdxC5aasILF7xKWVA38HHLLZW0eDPqS6dnzC6neEFcVyOGert0dDs7vg4ZnE5 bRu5SykHp+Nm1V1SsEGXmT+gKgQtXTFPxGvyxX4SFAT45wH2fZXwSlizhP5vT2EGfTAp EHe1YmkyGpZrT5gbwQdbCK9Z5ifT0z+6vTTxDeApE5lCvAXxwLIN9U7/8DGDoqTNxaDH KxTL+osSoVMumJ1EzTDX6+eenP4mkpqk9Y5znKurNG7YpKvR74WOqGVgfKeRNmz/U8rh oc61pM4ig06CSa76t1DwNNQXi+Z7ngj2TSwj+62OyML5SVkD5tzVOaGfmKqosaoA5xkg S+wg== X-Gm-Message-State: ALoCoQmDIMyhJU0elwr24A86QM+IFrsQOH6Pn/SnAp5aFiBGPu/7uzSZAr2NjJTtNL2dDdfP0esc X-Received: by 10.112.138.164 with SMTP id qr4mr1917081lbb.49.1382115755520; Fri, 18 Oct 2013 10:02:35 -0700 (PDT) MIME-Version: 1.0 Received: by 10.112.189.166 with HTTP; Fri, 18 Oct 2013 10:02:15 -0700 (PDT) From: Andy Lutomirski Date: Fri, 18 Oct 2013 10:02:15 -0700 Message-ID: Content-Type: text/plain; charset=ISO-8859-1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Mailman-Approved-At: Fri, 18 Oct 2013 13:26:21 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) Hi- I recently played with the build system for capnproto (http://kentonv.github.io/capnproto/), and I think I found at least three bugs in libtool: 1. -no-undefined is completely broken on Linux (and probably almost every other non-Windows system). It should pass -Wl,--no-undefined to gcc for the link stage when building shared libraries. It doesn't. (This appears to be 100% consistent and reproducible.) When I sent in a patch to work around that (by adding -Wl,--no-undefined explicitly), other things broke. So far, I've discovered: 2. When building a c++ shared library with -pthread, g++ gets called with -nostdlib [1], and libtool forgets to add -lpthread. This can be reproduced on Fedora 19 if you build this and remove the -lpthread addition: https://github.com/kentonv/capnproto/commit/798ff87b1b7e0a2da96355a34fa6e0aa10aaae85 3. There are reports of -nostdlib getting used without -lc on Solaris. This also breaks if --no-undefined is fixed. [1] I cannot fathom why libtool thinks that -nostdlib is a good idea, but I have no intention of adding to that argument. This bug is about that fact that -nostdlib is used incorrectly. It could be fixed either by removing it or by adding the missing libraries that are supposed to be implied. --Andy -- Andy Lutomirski AMA Capital Management, LLC