From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 7000AA00E6 for ; Thu, 18 Apr 2019 16:35:00 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 416E01BB2E; Thu, 18 Apr 2019 16:35:00 +0200 (CEST) Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by dpdk.org (Postfix) with ESMTP id 673A41BACE for ; Thu, 18 Apr 2019 16:34:58 +0200 (CEST) Received: from mail-oi1-f198.google.com ([209.85.167.198]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1hH87u-0001UE-0E for dev@dpdk.org; Thu, 18 Apr 2019 14:34:58 +0000 Received: by mail-oi1-f198.google.com with SMTP id n15so956320oig.11 for ; Thu, 18 Apr 2019 07:34:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=feSObTaY/u3QpNTmmF/xeu7kgIcngyLVOcagOYwkhzs=; b=oXBegX6uUrWlxfenNA8oRpzLDOmyQrEDMALGrCz6X1lxXGdtD8XjyAiEzuPK/TpYDu 1ADURFWrBF48KZnDWFFAqI99rsvNYbVGwqRPIfkShTq6ko58VRVFHmEaYKOG22Va4/ZA WZjgGSQX+M+ltyzwWO+aD7N3a16JcGQqsDz3MsYcZuYYrtwtdsbhTO4pH+pgoeEvVBZl TFJVmeBUV+x0ETuCB0go/QJ53F+Q/z9y3JtPhgyU6UsBMPUaw4jl3bBkmQi6PB+Y8Gbh RsM2myS8l33UDnFPuC8Dfn+oM1qjlz4GX4eaOfszwAI2c9sQo+GrXIzjgGB+PU0931Lj V66w== X-Gm-Message-State: APjAAAV0tALjB3rmo/SFREDK3wkBevNiTSOeLSZ16iRSGkVSkJ5MSrTw alZQkyLH4WAUFyG1M1rj2hYiUseP+HPqgpv54HHb7TzJSwJvEmQEM0UOsu8J4Xk2qgzLgBD9lbf SBc//Cmp6sg+5t9tm+aFNtltSogfU3bxOVAnT X-Received: by 2002:a9d:6c98:: with SMTP id c24mr26469049otr.324.1555598096651; Thu, 18 Apr 2019 07:34:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqwJZLfM/mGgh/6iXd6uac182LATmjlQSxHXBR+rQJUNy3ZMg1GjGhEksx0GXkgoNVzYW5AItI0eHBvJheck9gk= X-Received: by 2002:a9d:6c98:: with SMTP id c24mr26469024otr.324.1555598096257; Thu, 18 Apr 2019 07:34:56 -0700 (PDT) MIME-Version: 1.0 From: Christian Ehrhardt Date: Thu, 18 Apr 2019 16:34:30 +0200 Message-ID: To: dev Cc: Luca Boccassi , Bruce Richardson Content-Type: text/plain; charset="UTF-8" Subject: [dpdk-dev] Overlinking in PMDs X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Message-ID: <20190418143430.JTVtwCtHMY-Wtn-R9ae8xfzZpMKOR6jC5120Xc_nlso@z> Hi, on a recent 18.11.1 build I saw again that we are overlinking a lot still [1]. Some might be important and I'd not want to touch any *inner* links inside DPDK at this time. But it seems about everything is unconditionally linked to generic libs as well. Here one example from a (meson) build: # only start group and soname set are in as-needed -Wl,--as-needed -shared -fPIC -Wl,--start-group -Wl,-soname,librte_pmd_netvsc.so.18.11 -Wl,--no-as-needed # generic libs unconditionally link -pthread -lm -ldl -lnuma ... # internal libs -Wl,-z,relro -Wl,-z,now l ib/librte_ethdev.so.18.11 lib/librte_eal.so.18.11 lib/librte_kvargs.so.18.11 lib/librte_net.so.18.11 lib/librte_mbuf.so.18.11 lib/librte_mempool.so.18.11 lib/librte_ring.so.18.11 lib/l ibrte_cmdline.so.18.11 drivers/librte_bus_pci.so.18.11 lib/librte_pci.so.18.11 drivers/librte_bus_vdev.so.18.11 drivers/librte_bus_vmbus.so.18.11 -Wl,--version- ... # bsd is even more special it seems /usr/lib/x86_64-linux-gnu/libbsd.so # end group -Wl,--end-group ... I wonder if we really should not at least put "-pthread -lm -ldl -lnuma" into as-needed as well. Not sure why libbsd is so special at the end, but maybe if possible also there. I'd assume that about everything links into rte_eal and that will link out to the others as really needed then, that would look much cleaner than hard depends from all the libs right? I must admit I don't clearly see where the [no-]as-needed comes from in meson build and for example [2] doesn't really explain why no-as-needed was added. [1]: http://paste.ubuntu.com/p/yT4Phz7sg2/ [2]: https://git.dpdk.org/dpdk/diff/config/meson.build?id=57ae0ec6 -- Christian Ehrhardt Software Engineer, Ubuntu Server Canonical Ltd