From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0DC1DA0524 for ; Fri, 5 Feb 2021 12:19:52 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 087414067B; Fri, 5 Feb 2021 12:19:52 +0100 (CET) Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) by mails.dpdk.org (Postfix) with ESMTP id 538231606C3 for ; Fri, 5 Feb 2021 12:19:50 +0100 (CET) Received: by mail-wr1-f44.google.com with SMTP id b3so7264106wrj.5 for ; Fri, 05 Feb 2021 03:19:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=43ks9Fx1KDzRSdyebsPq+luWZ2LzVtLOIy8SFTdg3HY=; b=QAw8K86fjHP14qrsAklY4A1Jg6c+jXI4FOs0IPv1KKQZA+mUXbJD17OVtMldl8BwH3 0uACcEQrYEqqrKGNNjsqvR+sEeLhniZLMtyRz3QAhOPwcX77AyGGmBLdudDe4s1+taHT 7jyhMjypGUk1u+KbVqtczu6oloyjf/074w1Aed/2dWH6jchNcm3kNenbUil/Juyt97dP OdCmVdBUc2r8JcpIWQuBo1uttAlrGGmqzItKYuViJ2qoDXpraqlS6zHRKCZh848QkZVq GWe7Ogf8LTgm9pBz1mhM2VjPXdCTipVxn12P0wxf/sd/fn0VI4LtgMQLPySVn57c/bbd XcPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=43ks9Fx1KDzRSdyebsPq+luWZ2LzVtLOIy8SFTdg3HY=; b=mgjo6YxMxl+h6izYRn0tU7qFexuEjuCouh7EAGiwy686yFOgjJ/6pKrTz6KzDvYDWW D7YcqScOOyXqsjaUz3um87OSLYmxHLkCvEX0ljevQI0rg0MfWyiVLPSUb3CbVlffyfJu uETxPOO1/MkVOjuIosCRqVyW1JlBSkBFK63Nhd3cAGeEKd0sBDb+ZXEh9SGozGNnng7c TQwmDxNu4P8HTzALsVSA+ylsMbw9+rnzy7VUFQSJYX9E5ox3g0r4pZMmGKxKeETHbJOv DlW5R/7RgoLUAkNVJQL+CI9pnd+1f7T77Sk5n6lAh3/Uhuoeuo+alSRO9b2jpNgms8DY z9LQ== X-Gm-Message-State: AOAM533fFhtyf2L3pXrtKquYYPvwskEjfh8XIqQW8oVaHzsepBlDwEPy SSKB0SWYL2oIEIiDpM3gG7A= X-Google-Smtp-Source: ABdhPJxcE92YjEpE0OZ7N6lNXKLaPTIJvmAiLnmLNImk0cYJE5EvT9TvnnqkDnDdMngaCQerpbHs9Q== X-Received: by 2002:adf:f28b:: with SMTP id k11mr4415251wro.418.1612523990127; Fri, 05 Feb 2021 03:19:50 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id c3sm6731574wrr.6.2021.02.05.03.19.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 03:19:49 -0800 (PST) From: luca.boccassi@gmail.com To: Olivier Matz Cc: Bruce Richardson , dpdk stable Date: Fri, 5 Feb 2021 11:14:55 +0000 Message-Id: <20210205111920.1272063-9-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210205111920.1272063-1-luca.boccassi@gmail.com> References: <20210205111920.1272063-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'build: fix plugin load on static build' has been queued to stable release 20.11.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/07/21. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/937675ee69fe1051bca6e3cb31ec5319e453b328 Thanks. Luca Boccassi --- >From 937675ee69fe1051bca6e3cb31ec5319e453b328 Mon Sep 17 00:00:00 2001 From: Olivier Matz Date: Fri, 18 Dec 2020 14:14:22 +0100 Subject: [PATCH] build: fix plugin load on static build [ upstream commit b031e13d7f0dc7cba9bc5befe968b67832021a59 ] When dpdk is compiled as static libraries, it is not possible to load a plugin from an application. We get the following error: EAL: librte_pmd_xxxx.so: undefined symbol: per_lcore__rte_errno This happens because the dpdk symbols are not exported. Add them to the dynamic symbol table by using '-Wl,--export-dynamic'. This option was previously present when compiled with Makefiles, it was introduced in commit f9a08f650211 ("eal: add support for shared object drivers") Also add it to the pkg-config file. Fixes: 16ade738fd0d ("app/testpmd: build with meson") Fixes: 89f0711f9ddf ("examples: build some samples with meson") Signed-off-by: Olivier Matz Reviewed-by: Bruce Richardson --- app/meson.build | 6 ++++++ buildtools/pkg-config/meson.build | 2 +- examples/meson.build | 7 ++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/app/meson.build b/app/meson.build index eb74f215a3..fd72d7da68 100644 --- a/app/meson.build +++ b/app/meson.build @@ -25,6 +25,10 @@ apps = [ lib_execinfo = cc.find_library('execinfo', required: false) default_cflags = machine_args + ['-DALLOW_EXPERIMENTAL_API'] +default_ldflags = [] +if get_option('default_library') == 'static' + default_ldflags += ['-Wl,--export-dynamic'] +endif foreach app:apps build = true @@ -32,6 +36,7 @@ foreach app:apps sources = [] includes = [] cflags = default_cflags + ldflags = default_ldflags objs = [] # other object files to link against, used e.g. for # instruction-set optimized versions of code @@ -58,6 +63,7 @@ foreach app:apps executable('dpdk-' + name, sources, c_args: cflags, + link_args: ldflags, link_whole: link_libs, dependencies: dep_objs, install_rpath: join_paths(get_option('prefix'), diff --git a/buildtools/pkg-config/meson.build b/buildtools/pkg-config/meson.build index 5f19304289..168ee08e58 100644 --- a/buildtools/pkg-config/meson.build +++ b/buildtools/pkg-config/meson.build @@ -47,7 +47,7 @@ This is required for a number of static inline functions in the public headers.' # if libbsd is not enabled, then this is blank libraries_private: ['-Wl,--whole-archive'] + dpdk_drivers + dpdk_static_libraries + - ['-Wl,--no-whole-archive'] + ['-Wl,--no-whole-archive', '-Wl,--export-dynamic'] ) # For static linking with dependencies as shared libraries, diff --git a/examples/meson.build b/examples/meson.build index 46ec80919e..f643ec1bad 100644 --- a/examples/meson.build +++ b/examples/meson.build @@ -63,6 +63,10 @@ default_cflags = machine_args if cc.has_argument('-Wno-format-truncation') default_cflags += '-Wno-format-truncation' endif +default_ldflags = dpdk_extra_ldflags +if get_option('default_library') == 'static' + default_ldflags += ['-Wl,--export-dynamic'] +endif foreach example: examples name = example.split('/')[-1] @@ -70,6 +74,7 @@ foreach example: examples sources = [] allow_experimental_apis = false cflags = default_cflags + ldflags = default_ldflags ext_deps = [execinfo] includes = [include_directories(example)] @@ -91,7 +96,7 @@ foreach example: examples executable('dpdk-' + name, sources, include_directories: includes, link_whole: link_whole_libs, - link_args: dpdk_extra_ldflags, + link_args: ldflags, c_args: cflags, dependencies: dep_objs) elif not allow_skips -- 2.29.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-02-05 11:18:29.736566413 +0000 +++ 0009-build-fix-plugin-load-on-static-build.patch 2021-02-05 11:18:28.586686923 +0000 @@ -1 +1 @@ -From b031e13d7f0dc7cba9bc5befe968b67832021a59 Mon Sep 17 00:00:00 2001 +From 937675ee69fe1051bca6e3cb31ec5319e453b328 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit b031e13d7f0dc7cba9bc5befe968b67832021a59 ] + @@ -20 +21,0 @@ -Cc: stable@dpdk.org