From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14356 invoked by alias); 14 Sep 2016 19:03:24 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 39328 Received: (qmail 1776 invoked from network); 14 Sep 2016 19:03:24 -0000 X-Qmail-Scanner-Diagnostics: from mail-qk0-f177.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.220.177):SA:0(0.0/5.0):. Processed in 0.596344 secs); 14 Sep 2016 19:03:24 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM,SPF_PASS, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: mikachu@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.220.177 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=kgn0VX0XW5kyL6uEOrWO93+KZ9SJqwNlktBs2pitwyg=; b=PpFF/h0/51d1Ru9FH/3gGgF3g1Rzk3EazOr4rQpbJYrgRxz5YzTcoWmryaq5ojh2k1 k+ov9yFrfYWy92hGzmg4n+gXnIp3dSGg0lGnJg9u1quVpbvWLbOl1Bf9eSNcn/egtpO8 9ae5Y77bs4VUP14QFZvcu3mR0fTpwfyV0VTY7414rBC+7bHaa5c0bjis0vkajHzm+gzr ZXXe9pONpDRcTRBY7G7qxDu/193LCAe5A7dZ135EFKpUKb+5HHZLkBj8YdHi4HlssCuM vAOAC9XcIP4vO1CpIV1miZzaSD0gi2LfcQbozuYVtHxvTi9jjDdnyQMcpemEX4gcCVJU I9oQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=kgn0VX0XW5kyL6uEOrWO93+KZ9SJqwNlktBs2pitwyg=; b=GBFhz+1yX73IcPhfpCBpn3ljvMoEtpAB4k7atwZ4AXaFNf9cufIlf0IpR/sUv21K2x XTlQdU0+iexYHdahFmCXdN2+MGyPXrO2Ie3cG3mdCJbUF4RviRjy2oKfITUbCFzAZP8e yeeEf0Yf5zaoIsp+dilAyib0JK5XYD4uDD8RUsd7CUqDXjC4SXw5yKDKHx0AMJwgkemg u0uE0hCtgKa3LOZt2Uq2AVAnQ9FcyrOJThLSWZQ9AvDdWHoy3DnTJaXfFnRO8Mpon+Uw gElM5wyefGK+hzGVOgvvmXGgLbSPi3y77avtkjxOmw4qrVecUPLXG2z/2o+wW/yEl7hM 7wWg== X-Gm-Message-State: AE9vXwOz07XaY9zp5ZuIpNvI4me7bYph+sTSraF7ywTvql7+MWh6pypMibrVs93pWyooOGcvzeaJQTfSCWDW2g== X-Received: by 10.55.127.1 with SMTP id a1mr5481381qkd.49.1473879797107; Wed, 14 Sep 2016 12:03:17 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <45670.1473843287@hydra.kiddle.eu> References: <160912103839.ZM25202@torch.brasslantern.com> <45670.1473843287@hydra.kiddle.eu> From: Mikael Magnusson Date: Wed, 14 Sep 2016 21:03:16 +0200 Message-ID: Subject: Re: Adding (compiling) a module to already build Zsh To: Oliver Kiddle Cc: Sebastian Gniazdowski , Zsh hackers list Content-Type: text/plain; charset=UTF-8 On Wed, Sep 14, 2016 at 10:54 AM, Oliver Kiddle wrote: > Sebastian Gniazdowski wrote: >> > On Sep 12, 8:12am, Sebastian Gniazdowski wrote: > >> > } I think gdbm and pcre add linkage to additional libraries to >> > } the Zsh binary itself. > > You can usually prevent that with something like > LDFLAGS='-Wl,--as-needed' > Depending on you linker, the option might be -zignore. > > Or you can retrospectively remove the library from the NEEDED list with > a tool like patchelf. > > The limitation is really with autoconf or at least our use of it. > We add checks for libraries such as pcre and it adds -lpcre to the > global list of linker options. I don't know whether anything has changed > in autoconf to make it easier to limit that so it would only be used > when linking the pcre module - anyone? http://cgit.mika.l3ib.org/cgit/zsh-cvs/commit/?h=a095c720fff0893b9f1ca3f96bb28de125aa155f I did this at least 5 years ago so I didn't know as much then as I do know about autoconf, but I think AC_CHECK_LIB is a convenience macro for something that first checks if a lib is linkable, and then adds it to the list of things to link to globally. We could just expand those to the full thing that only does the check without adding, and since the lib is always the same, the part of the patch that has the unconditional lib names in the .mdd files should be fine? https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Libraries.html ah, actually we can just provide the action-if-found action and it won't add the name to LIBS for us, even better. -- Mikael Magnusson