patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH 0/7] Do not change build/link behavior on stable release
@ 2021-03-22 11:21 Christian Ehrhardt
  2021-03-22 11:21 ` [dpdk-stable] [PATCH 1/7] Revert "Revert "Revert "build/pkg-config: prevent overlinking""" Christian Ehrhardt
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Christian Ehrhardt @ 2021-03-22 11:21 UTC (permalink / raw)
  To: stable, Thomas Monjalon, Luca Boccassi, Bruce Richardson
  Cc: Pai Sunil, Ilya Maximets, Stokes Ian, Govindharajan Hariprasad,
	James Page, Christian Ehrhardt

Hi,
most of you have been on CC on the discussion around this already.
Background:
http://mails.dpdk.org/archives/stable/2021-March/029418.html

Summary:
- changes to DPDK linking were proposed to stable @19.11.4 and
  identified to be bad
- in the 19.11.6 time-frame the responses were ok so they were
  accepted in there
- but the old issue still exists and e.g. OVS is non-buildable vs
  DPDK >=19.11.6
- IMHO an upgrade of 19.11.x should not break how linking is done
- But, OTOH one can now say "upgrading from 19.11.6 -> 19.11.8 this
  changes"

I'm unsure if this is worth an early 19.11.8 or maybe just
pushing it to git and an entry in the known-issues for 19.11.7?
But before we bike-shed over that let us discuss and agree if
taking those changes out of the 19.11.x release is the right
approach.


Christian Ehrhardt (7):
  Revert "Revert "Revert "build/pkg-config: prevent overlinking"""
  Revert "Revert "Revert "build/pkg-config: improve static linking
    flags"""
  Revert "Revert "Revert "build/pkg-config: output drivers first for
    static build"""
  Revert "Revert "Revert "build/pkg-config: move pkg-config file
    creation"""
  Revert "Revert "Revert "build: always link whole DPDK static
    libraries"""
  Revert "Revert "Revert "devtools: test static linkage with
    pkg-config"""
  Regenerate meson.build changes required due to reverts

 MAINTAINERS                                   |  2 -
 app/test/meson.build                          |  2 +-
 buildtools/pkg-config/meson.build             | 59 -------------------
 .../pkg-config/set-static-linker-flags.py     | 38 ------------
 devtools/test-meson-builds.sh                 |  2 +-
 doc/build-sdk-meson.txt                       |  2 +-
 drivers/meson.build                           |  2 +-
 examples/bbdev_app/Makefile                   |  2 +-
 examples/bond/Makefile                        |  2 +-
 examples/cmdline/Makefile                     |  2 +-
 examples/distributor/Makefile                 |  2 +-
 examples/eventdev_pipeline/Makefile           |  2 +-
 examples/fips_validation/Makefile             |  2 +-
 examples/flow_classify/Makefile               |  2 +-
 examples/flow_filtering/Makefile              |  2 +-
 examples/helloworld/Makefile                  |  2 +-
 examples/ioat/Makefile                        |  2 +-
 examples/ip_fragmentation/Makefile            |  2 +-
 examples/ip_pipeline/Makefile                 |  2 +-
 examples/ip_reassembly/Makefile               |  2 +-
 examples/ipsec-secgw/Makefile                 |  2 +-
 examples/ipv4_multicast/Makefile              |  2 +-
 examples/kni/Makefile                         |  2 +-
 examples/l2fwd-cat/Makefile                   |  2 +-
 examples/l2fwd-crypto/Makefile                |  2 +-
 examples/l2fwd-event/Makefile                 |  2 +-
 examples/l2fwd-jobstats/Makefile              |  2 +-
 examples/l2fwd-keepalive/Makefile             |  2 +-
 examples/l2fwd/Makefile                       |  2 +-
 examples/l3fwd-acl/Makefile                   |  2 +-
 examples/l3fwd-power/Makefile                 |  2 +-
 examples/l3fwd/Makefile                       |  2 +-
 examples/link_status_interrupt/Makefile       |  2 +-
 examples/meson.build                          |  6 +-
 examples/ntb/Makefile                         |  2 +-
 examples/packet_ordering/Makefile             |  2 +-
 examples/ptpclient/Makefile                   |  2 +-
 examples/qos_meter/Makefile                   |  2 +-
 examples/qos_sched/Makefile                   |  2 +-
 examples/rxtx_callbacks/Makefile              |  2 +-
 examples/service_cores/Makefile               |  2 +-
 examples/skeleton/Makefile                    |  2 +-
 examples/tep_termination/Makefile             |  2 +-
 examples/timer/Makefile                       |  2 +-
 examples/vdpa/Makefile                        |  2 +-
 examples/vhost/Makefile                       |  2 +-
 examples/vhost_blk/Makefile                   |  2 +-
 examples/vhost_crypto/Makefile                |  2 +-
 examples/vmdq/Makefile                        |  2 +-
 examples/vmdq_dcb/Makefile                    |  2 +-
 lib/meson.build                               |  2 +-
 meson.build                                   | 30 +++++++++-
 52 files changed, 78 insertions(+), 151 deletions(-)
 delete mode 100644 buildtools/pkg-config/meson.build
 delete mode 100644 buildtools/pkg-config/set-static-linker-flags.py

-- 
2.30.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [dpdk-stable] [PATCH 1/7] Revert "Revert "Revert "build/pkg-config: prevent overlinking"""
  2021-03-22 11:21 [dpdk-stable] [PATCH 0/7] Do not change build/link behavior on stable release Christian Ehrhardt
@ 2021-03-22 11:21 ` Christian Ehrhardt
  2021-03-22 11:21 ` [dpdk-stable] [PATCH 2/7] Revert "Revert "Revert "build/pkg-config: improve static linking flags""" Christian Ehrhardt
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Christian Ehrhardt @ 2021-03-22 11:21 UTC (permalink / raw)
  To: stable, Thomas Monjalon, Luca Boccassi, Bruce Richardson
  Cc: Pai Sunil, Ilya Maximets, Stokes Ian, Govindharajan Hariprasad,
	James Page, Christian Ehrhardt

This reverts commit f49248a990b5c34938c5246e013bc82f1296959f.
This series changes linking behavior in 19.11.x and thereby should stay
out. It breaks - for example - a rebuild of OVS 2.13 or builds
of later OVS 2.13.x stable releases.
---
 buildtools/pkg-config/meson.build | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/buildtools/pkg-config/meson.build b/buildtools/pkg-config/meson.build
index 39a8fd1c8e..63a76b56d3 100644
--- a/buildtools/pkg-config/meson.build
+++ b/buildtools/pkg-config/meson.build
@@ -21,11 +21,6 @@ endif
 # Another requirement is to allow linking dependencies as shared libraries,
 # while linking static DPDK libraries and drivers. It is satisfied by
 # listing the static files in Libs.private with the explicit syntax -l:libfoo.a.
-# As a consequence, the regular DPDK libraries are already listed as static
-# in the field Libs.private. The second occurences of DPDK libraries,
-# included from Requires and used for shared library linkage case,
-# are skipped in the case of static linkage thanks to the flag --as-needed.
-
 
 pkg.generate(name: 'dpdk-libs',
 	filebase: 'libdpdk-libs',
@@ -34,7 +29,7 @@ Use libdpdk.pc instead of this file to query DPDK compile/link arguments''',
 	version: meson.project_version(),
 	subdirs: [get_option('include_subdir_arch'), '.'],
 	extra_cflags: pkg_extra_cflags,
-	libraries: ['-Wl,--as-needed'] + dpdk_libraries,
+	libraries: dpdk_libraries,
 	libraries_private: dpdk_extra_ldflags)
 
 platform_flags = []
-- 
2.30.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [dpdk-stable] [PATCH 2/7] Revert "Revert "Revert "build/pkg-config: improve static linking flags"""
  2021-03-22 11:21 [dpdk-stable] [PATCH 0/7] Do not change build/link behavior on stable release Christian Ehrhardt
  2021-03-22 11:21 ` [dpdk-stable] [PATCH 1/7] Revert "Revert "Revert "build/pkg-config: prevent overlinking""" Christian Ehrhardt
@ 2021-03-22 11:21 ` Christian Ehrhardt
  2021-03-22 11:21 ` [dpdk-stable] [PATCH 3/7] Revert "Revert "Revert "build/pkg-config: output drivers first for static build""" Christian Ehrhardt
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Christian Ehrhardt @ 2021-03-22 11:21 UTC (permalink / raw)
  To: stable, Thomas Monjalon, Luca Boccassi, Bruce Richardson
  Cc: Pai Sunil, Ilya Maximets, Stokes Ian, Govindharajan Hariprasad,
	James Page, Christian Ehrhardt

This reverts commit 39586a4cf0e320a15392342411532e398e0c5c8d.
This series changes linking behavior in 19.11.x and thereby should stay
out. It breaks - for example - a rebuild of OVS 2.13 or builds
of later OVS 2.13.x stable releases.
---
 buildtools/pkg-config/meson.build             | 16 +++-----
 .../pkg-config/set-static-linker-flags.py     | 38 -------------------
 doc/build-sdk-meson.txt                       |  2 +-
 examples/bbdev_app/Makefile                   |  2 +-
 examples/bond/Makefile                        |  2 +-
 examples/cmdline/Makefile                     |  2 +-
 examples/distributor/Makefile                 |  2 +-
 examples/eventdev_pipeline/Makefile           |  2 +-
 examples/fips_validation/Makefile             |  2 +-
 examples/flow_classify/Makefile               |  2 +-
 examples/flow_filtering/Makefile              |  2 +-
 examples/helloworld/Makefile                  |  2 +-
 examples/ioat/Makefile                        |  2 +-
 examples/ip_fragmentation/Makefile            |  2 +-
 examples/ip_pipeline/Makefile                 |  2 +-
 examples/ip_reassembly/Makefile               |  2 +-
 examples/ipsec-secgw/Makefile                 |  2 +-
 examples/ipv4_multicast/Makefile              |  2 +-
 examples/kni/Makefile                         |  2 +-
 examples/l2fwd-cat/Makefile                   |  2 +-
 examples/l2fwd-crypto/Makefile                |  2 +-
 examples/l2fwd-event/Makefile                 |  2 +-
 examples/l2fwd-jobstats/Makefile              |  2 +-
 examples/l2fwd-keepalive/Makefile             |  2 +-
 examples/l2fwd/Makefile                       |  2 +-
 examples/l3fwd-acl/Makefile                   |  2 +-
 examples/l3fwd-power/Makefile                 |  2 +-
 examples/l3fwd/Makefile                       |  2 +-
 examples/link_status_interrupt/Makefile       |  2 +-
 examples/ntb/Makefile                         |  2 +-
 examples/packet_ordering/Makefile             |  2 +-
 examples/ptpclient/Makefile                   |  2 +-
 examples/qos_meter/Makefile                   |  2 +-
 examples/qos_sched/Makefile                   |  2 +-
 examples/rxtx_callbacks/Makefile              |  2 +-
 examples/service_cores/Makefile               |  2 +-
 examples/skeleton/Makefile                    |  2 +-
 examples/tep_termination/Makefile             |  2 +-
 examples/timer/Makefile                       |  2 +-
 examples/vdpa/Makefile                        |  2 +-
 examples/vhost/Makefile                       |  2 +-
 examples/vhost_blk/Makefile                   |  2 +-
 examples/vhost_crypto/Makefile                |  2 +-
 examples/vmdq/Makefile                        |  2 +-
 examples/vmdq_dcb/Makefile                    |  2 +-
 45 files changed, 49 insertions(+), 91 deletions(-)
 delete mode 100644 buildtools/pkg-config/set-static-linker-flags.py

diff --git a/buildtools/pkg-config/meson.build b/buildtools/pkg-config/meson.build
index 63a76b56d3..ccb34dcab3 100644
--- a/buildtools/pkg-config/meson.build
+++ b/buildtools/pkg-config/meson.build
@@ -1,6 +1,10 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2020 Intel Corporation
 
+# for static builds, include the drivers as libs and we need to "whole-archive"
+# them.
+dpdk_drivers = ['-Wl,--whole-archive'] + dpdk_drivers + ['-Wl,--no-whole-archive']
+
 pkg = import('pkgconfig')
 pkg_extra_cflags = ['-include', 'rte_config.h'] + machine_args
 if is_freebsd
@@ -18,9 +22,6 @@ endif
 # and those need to come *before* the regular libraries (Libs field).
 # This requirement is satisfied by moving the regular libs in a separate file
 # included in the field Requires (after Libs.private).
-# Another requirement is to allow linking dependencies as shared libraries,
-# while linking static DPDK libraries and drivers. It is satisfied by
-# listing the static files in Libs.private with the explicit syntax -l:libfoo.a.
 
 pkg.generate(name: 'dpdk-libs',
 	filebase: 'libdpdk-libs',
@@ -44,11 +45,6 @@ Note that CFLAGS might contain an -march flag higher than typical baseline.
 This is required for a number of static inline functions in the public headers.''',
 	requires: ['libdpdk-libs', libbsd], # may need libbsd for string funcs
 	                  # if libbsd is not enabled, then this is blank
-	libraries_private: ['-Wl,--whole-archive'] +
-			dpdk_drivers + dpdk_static_libraries +
-			['-Wl,--no-whole-archive'] + platform_flags
+	libraries_private: dpdk_drivers + dpdk_static_libraries +
+			['-Wl,-Bdynamic'] + platform_flags
 )
-
-# For static linking with dependencies as shared libraries,
-# the internal static libraries must be flagged explicitly.
-run_command(py3, 'set-static-linker-flags.py', check: true)
diff --git a/buildtools/pkg-config/set-static-linker-flags.py b/buildtools/pkg-config/set-static-linker-flags.py
deleted file mode 100644
index 2745db34c2..0000000000
--- a/buildtools/pkg-config/set-static-linker-flags.py
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/usr/bin/env python3
-# SPDX-License-Identifier: BSD-3-Clause
-# Copyright(c) 2020 Intel Corporation
-
-# Script to fix flags for static linking in pkgconfig files from meson
-# Should be called from meson build itself
-import os
-import sys
-
-
-def fix_ldflag(f):
-    if not f.startswith('-lrte_'):
-        return f
-    return '-l:lib' + f[2:] + '.a'
-
-
-def fix_libs_private(line):
-    if not line.startswith('Libs.private'):
-        return line
-    ldflags = [fix_ldflag(flag) for flag in line.split()]
-    return ' '.join(ldflags) + '\n'
-
-
-def process_pc_file(filepath):
-    print('Processing', filepath)
-    with open(filepath) as src:
-        lines = src.readlines()
-    with open(filepath, 'w') as dst:
-        dst.writelines([fix_libs_private(line) for line in lines])
-
-
-if 'MESON_BUILD_ROOT' not in os.environ:
-    print('This script must be called from a meson build environment')
-    sys.exit(1)
-for root, dirs, files in os.walk(os.environ['MESON_BUILD_ROOT']):
-    pc_files = [f for f in files if f.endswith('.pc')]
-    for f in pc_files:
-        process_pc_file(os.path.join(root, f))
diff --git a/doc/build-sdk-meson.txt b/doc/build-sdk-meson.txt
index 8fb60a7c11..61c8e3515c 100644
--- a/doc/build-sdk-meson.txt
+++ b/doc/build-sdk-meson.txt
@@ -190,7 +190,7 @@ From examples/helloworld/Makefile::
 	PC_FILE := $(shell pkg-config --path libdpdk)
 	CFLAGS += -O3 $(shell pkg-config --cflags libdpdk)
 	LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk)
-	LDFLAGS_STATIC = $(shell pkg-config --static --libs libdpdk)
+	LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk)
 
 	build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
 		$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
diff --git a/examples/bbdev_app/Makefile b/examples/bbdev_app/Makefile
index 3c8eb75a4e..ead3f016b8 100644
--- a/examples/bbdev_app/Makefile
+++ b/examples/bbdev_app/Makefile
@@ -22,7 +22,7 @@ PKGCONF ?= pkg-config
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
-LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk)
+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk)
 
 CFLAGS += -DALLOW_EXPERIMENTAL_API
 
diff --git a/examples/bond/Makefile b/examples/bond/Makefile
index 4e4289e151..2030ca410a 100644
--- a/examples/bond/Makefile
+++ b/examples/bond/Makefile
@@ -24,7 +24,7 @@ PKGCONF ?= pkg-config
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
-LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk)
+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk)
 
 CFLAGS += -DALLOW_EXPERIMENTAL_API
 
diff --git a/examples/cmdline/Makefile b/examples/cmdline/Makefile
index 9418b50b87..0b6b54540a 100644
--- a/examples/cmdline/Makefile
+++ b/examples/cmdline/Makefile
@@ -22,7 +22,7 @@ PKGCONF ?= pkg-config
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
-LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk)
+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk)
 
 build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
 	$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
diff --git a/examples/distributor/Makefile b/examples/distributor/Makefile
index 5253780793a..4192d8a4ae 100644
--- a/examples/distributor/Makefile
+++ b/examples/distributor/Makefile
@@ -22,7 +22,7 @@ PKGCONF ?= pkg-config
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
-LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk)
+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk)
 
 build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
 	$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
diff --git a/examples/eventdev_pipeline/Makefile b/examples/eventdev_pipeline/Makefile
index 95a8d0884a..96cd244378 100644
--- a/examples/eventdev_pipeline/Makefile
+++ b/examples/eventdev_pipeline/Makefile
@@ -24,7 +24,7 @@ PKGCONF ?= pkg-config
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
-LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk)
+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk)
 
 build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
 	$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
diff --git a/examples/fips_validation/Makefile b/examples/fips_validation/Makefile
index 5bcf1872c4..e5ae22b521 100644
--- a/examples/fips_validation/Makefile
+++ b/examples/fips_validation/Makefile
@@ -31,7 +31,7 @@ PKGCONF ?= pkg-config
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
-LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk)
+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk)
 
 CFLAGS += -DALLOW_EXPERIMENTAL_API
 
diff --git a/examples/flow_classify/Makefile b/examples/flow_classify/Makefile
index 161d576b60..6864941b3e 100644
--- a/examples/flow_classify/Makefile
+++ b/examples/flow_classify/Makefile
@@ -22,7 +22,7 @@ PKGCONF ?= pkg-config
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
-LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk)
+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk)
 
 CFLAGS += -DALLOW_EXPERIMENTAL_API
 
diff --git a/examples/flow_filtering/Makefile b/examples/flow_filtering/Makefile
index 0ce20d3485..6c51c0b7a0 100644
--- a/examples/flow_filtering/Makefile
+++ b/examples/flow_filtering/Makefile
@@ -20,7 +20,7 @@ PKGCONF ?= pkg-config
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
-LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk)
+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk)
 
 build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
 	$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
diff --git a/examples/helloworld/Makefile b/examples/helloworld/Makefile
index 9a07f89efc..16d82b02f0 100644
--- a/examples/helloworld/Makefile
+++ b/examples/helloworld/Makefile
@@ -22,7 +22,7 @@ PKGCONF ?= pkg-config
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
-LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk)
+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk)
 
 build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
 	$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
diff --git a/examples/ioat/Makefile b/examples/ioat/Makefile
index dd4930136e..ef63f5d689 100644
--- a/examples/ioat/Makefile
+++ b/examples/ioat/Makefile
@@ -22,7 +22,7 @@ PKGCONF ?= pkg-config
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
-LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk)
+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk)
 
 build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
 	$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
diff --git a/examples/ip_fragmentation/Makefile b/examples/ip_fragmentation/Makefile
index d200cc627d..ede0c4f02b 100644
--- a/examples/ip_fragmentation/Makefile
+++ b/examples/ip_fragmentation/Makefile
@@ -23,7 +23,7 @@ PKGCONF ?= pkg-config
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
-LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk)
+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk)
 
 build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
 	$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
diff --git a/examples/ip_pipeline/Makefile b/examples/ip_pipeline/Makefile
index b8e086267b..1e404ff5d0 100644
--- a/examples/ip_pipeline/Makefile
+++ b/examples/ip_pipeline/Makefile
@@ -35,7 +35,7 @@ PKGCONF ?= pkg-config
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
-LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk)
+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk)
 
 CFLAGS += -I. -DALLOW_EXPERIMENTAL_API -D_GNU_SOURCE
 
diff --git a/examples/ip_reassembly/Makefile b/examples/ip_reassembly/Makefile
index c7424da2b7..3f2888b338 100644
--- a/examples/ip_reassembly/Makefile
+++ b/examples/ip_reassembly/Makefile
@@ -23,7 +23,7 @@ PKGCONF ?= pkg-config
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
-LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk)
+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk)
 
 build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
 	$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
diff --git a/examples/ipsec-secgw/Makefile b/examples/ipsec-secgw/Makefile
index 38c456daa2..a4977f61f8 100644
--- a/examples/ipsec-secgw/Makefile
+++ b/examples/ipsec-secgw/Makefile
@@ -33,7 +33,7 @@ PKGCONF ?= pkg-config
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
-LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk)
+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk)
 
 CFLAGS += -DALLOW_EXPERIMENTAL_API
 
diff --git a/examples/ipv4_multicast/Makefile b/examples/ipv4_multicast/Makefile
index 5e34bbba00..92d3db0f4d 100644
--- a/examples/ipv4_multicast/Makefile
+++ b/examples/ipv4_multicast/Makefile
@@ -23,7 +23,7 @@ PKGCONF ?= pkg-config
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
-LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk)
+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk)
 
 build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
 	$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
diff --git a/examples/kni/Makefile b/examples/kni/Makefile
index 10b42891da..f687765510 100644
--- a/examples/kni/Makefile
+++ b/examples/kni/Makefile
@@ -23,7 +23,7 @@ PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 CFLAGS += -DALLOW_EXPERIMENTAL_API
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
-LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk)
+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk)
 
 LDFLAGS += -pthread
 
diff --git a/examples/l2fwd-cat/Makefile b/examples/l2fwd-cat/Makefile
index e8fdc46d74..b0e53c37e8 100644
--- a/examples/l2fwd-cat/Makefile
+++ b/examples/l2fwd-cat/Makefile
@@ -22,7 +22,7 @@ PKGCONF ?= pkg-config
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
-LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk)
+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk)
 
 LDFLAGS += -lpqos
 
diff --git a/examples/l2fwd-crypto/Makefile b/examples/l2fwd-crypto/Makefile
index cafe778fc6..7c170cfb53 100644
--- a/examples/l2fwd-crypto/Makefile
+++ b/examples/l2fwd-crypto/Makefile
@@ -22,7 +22,7 @@ PKGCONF ?= pkg-config
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
-LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk)
+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk)
 
 CFLAGS += -DALLOW_EXPERIMENTAL_API
 CONFIG_DEFINES = $(shell $(CC) $(CFLAGS) -dM -E - < /dev/null)
diff --git a/examples/l2fwd-event/Makefile b/examples/l2fwd-event/Makefile
index bf0ee890d5..4cdae36f17 100644
--- a/examples/l2fwd-event/Makefile
+++ b/examples/l2fwd-event/Makefile
@@ -28,7 +28,7 @@ PKGCONF ?= pkg-config
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
-LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk)
+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk)
 
 build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
 	$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
diff --git a/examples/l2fwd-jobstats/Makefile b/examples/l2fwd-jobstats/Makefile
index c26803909f..73c91faa8d 100644
--- a/examples/l2fwd-jobstats/Makefile
+++ b/examples/l2fwd-jobstats/Makefile
@@ -22,7 +22,7 @@ PKGCONF ?= pkg-config
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
-LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk)
+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk)
 
 build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
 	$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
diff --git a/examples/l2fwd-keepalive/Makefile b/examples/l2fwd-keepalive/Makefile
index ea3a9cbbf3..94d1e58bb5 100644
--- a/examples/l2fwd-keepalive/Makefile
+++ b/examples/l2fwd-keepalive/Makefile
@@ -24,7 +24,7 @@ PKGCONF ?= pkg-config
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
-LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk)
+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk)
 
 build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
 	$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
diff --git a/examples/l2fwd/Makefile b/examples/l2fwd/Makefile
index 15105ac57e..8b7b26cb90 100644
--- a/examples/l2fwd/Makefile
+++ b/examples/l2fwd/Makefile
@@ -24,7 +24,7 @@ CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 # Add flag to allow experimental API as l2fwd uses rte_ethdev_set_ptype API
 CFLAGS += -DALLOW_EXPERIMENTAL_API
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
-LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk)
+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk)
 
 build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
 	$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
diff --git a/examples/l3fwd-acl/Makefile b/examples/l3fwd-acl/Makefile
index 156dc19606..d9909584b1 100644
--- a/examples/l3fwd-acl/Makefile
+++ b/examples/l3fwd-acl/Makefile
@@ -22,7 +22,7 @@ PKGCONF ?= pkg-config
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
-LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk)
+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk)
 
 build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
 	$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
diff --git a/examples/l3fwd-power/Makefile b/examples/l3fwd-power/Makefile
index 74441f98cf..729d49639b 100644
--- a/examples/l3fwd-power/Makefile
+++ b/examples/l3fwd-power/Makefile
@@ -22,7 +22,7 @@ PKGCONF ?= pkg-config
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
-LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk)
+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk)
 
 CFLAGS += -DALLOW_EXPERIMENTAL_API
 
diff --git a/examples/l3fwd/Makefile b/examples/l3fwd/Makefile
index 38a370c2cf..b2dbf26075 100644
--- a/examples/l3fwd/Makefile
+++ b/examples/l3fwd/Makefile
@@ -22,7 +22,7 @@ PKGCONF ?= pkg-config
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
-LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk)
+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk)
 
 build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
 	$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
diff --git a/examples/link_status_interrupt/Makefile b/examples/link_status_interrupt/Makefile
index 879ee7384d..4f02a89013 100644
--- a/examples/link_status_interrupt/Makefile
+++ b/examples/link_status_interrupt/Makefile
@@ -22,7 +22,7 @@ PKGCONF ?= pkg-config
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
-LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk)
+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk)
 
 build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
 	$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
diff --git a/examples/ntb/Makefile b/examples/ntb/Makefile
index f41ccfac27..bdc0d6e80f 100644
--- a/examples/ntb/Makefile
+++ b/examples/ntb/Makefile
@@ -26,7 +26,7 @@ LDFLAGS += -pthread
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
-LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk)
+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk)
 
 build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
 	$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
diff --git a/examples/packet_ordering/Makefile b/examples/packet_ordering/Makefile
index 1e50389421..261b7f06a8 100644
--- a/examples/packet_ordering/Makefile
+++ b/examples/packet_ordering/Makefile
@@ -22,7 +22,7 @@ PKGCONF ?= pkg-config
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
-LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk)
+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk)
 
 build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
 	$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
diff --git a/examples/ptpclient/Makefile b/examples/ptpclient/Makefile
index 9e47a60117..82d72b3e31 100644
--- a/examples/ptpclient/Makefile
+++ b/examples/ptpclient/Makefile
@@ -22,7 +22,7 @@ PKGCONF ?= pkg-config
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
-LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk)
+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk)
 
 build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
 	$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
diff --git a/examples/qos_meter/Makefile b/examples/qos_meter/Makefile
index f733facaeb..7c2bf88a90 100644
--- a/examples/qos_meter/Makefile
+++ b/examples/qos_meter/Makefile
@@ -22,7 +22,7 @@ PKGCONF ?= pkg-config
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
-LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk)
+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk)
 
 CFLAGS += -DALLOW_EXPERIMENTAL_API
 
diff --git a/examples/qos_sched/Makefile b/examples/qos_sched/Makefile
index 736ac00a36..525061ca07 100644
--- a/examples/qos_sched/Makefile
+++ b/examples/qos_sched/Makefile
@@ -22,7 +22,7 @@ PKGCONF ?= pkg-config
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
-LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk)
+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk)
 
 build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
 	$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
diff --git a/examples/rxtx_callbacks/Makefile b/examples/rxtx_callbacks/Makefile
index eecdcada3e..418f47c4d7 100644
--- a/examples/rxtx_callbacks/Makefile
+++ b/examples/rxtx_callbacks/Makefile
@@ -22,7 +22,7 @@ PKGCONF ?= pkg-config
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
-LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk)
+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk)
 
 CFLAGS += -DALLOW_EXPERIMENTAL_API
 
diff --git a/examples/service_cores/Makefile b/examples/service_cores/Makefile
index b8669fdf7e..c47055813e 100644
--- a/examples/service_cores/Makefile
+++ b/examples/service_cores/Makefile
@@ -22,7 +22,7 @@ PKGCONF ?= pkg-config
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
-LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk)
+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk)
 
 build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
 	$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
diff --git a/examples/skeleton/Makefile b/examples/skeleton/Makefile
index 5059f3123f..2c29004d79 100644
--- a/examples/skeleton/Makefile
+++ b/examples/skeleton/Makefile
@@ -22,7 +22,7 @@ PKGCONF ?= pkg-config
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
-LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk)
+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk)
 
 build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
 	$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
diff --git a/examples/tep_termination/Makefile b/examples/tep_termination/Makefile
index 548ca3cee3..645112498d 100644
--- a/examples/tep_termination/Makefile
+++ b/examples/tep_termination/Makefile
@@ -24,7 +24,7 @@ PKGCONF ?= pkg-config
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
-LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk)
+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk)
 
 CFLAGS += -Wno-deprecated-declarations
 
diff --git a/examples/timer/Makefile b/examples/timer/Makefile
index b34c8baa6b..bf86339ab7 100644
--- a/examples/timer/Makefile
+++ b/examples/timer/Makefile
@@ -22,7 +22,7 @@ PKGCONF ?= pkg-config
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
-LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk)
+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk)
 
 build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
 	$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
diff --git a/examples/vdpa/Makefile b/examples/vdpa/Makefile
index bc0b6793e6..6a25497cd8 100644
--- a/examples/vdpa/Makefile
+++ b/examples/vdpa/Makefile
@@ -23,7 +23,7 @@ PKGCONF ?= pkg-config
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
-LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk)
+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk)
 
 build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
 	$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
diff --git a/examples/vhost/Makefile b/examples/vhost/Makefile
index ef6f3550f3..f2b1615418 100644
--- a/examples/vhost/Makefile
+++ b/examples/vhost/Makefile
@@ -24,7 +24,7 @@ PKGCONF ?= pkg-config
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
-LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk)
+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk)
 
 CFLAGS += -DALLOW_EXPERIMENTAL_API
 
diff --git a/examples/vhost_blk/Makefile b/examples/vhost_blk/Makefile
index 3952791784..39244320d8 100644
--- a/examples/vhost_blk/Makefile
+++ b/examples/vhost_blk/Makefile
@@ -25,7 +25,7 @@ LDFLAGS += -pthread
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
-LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk)
+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk)
 
 CFLAGS += -DALLOW_EXPERIMENTAL_API
 
diff --git a/examples/vhost_crypto/Makefile b/examples/vhost_crypto/Makefile
index 28e3e4de74..ae8cb81f87 100644
--- a/examples/vhost_crypto/Makefile
+++ b/examples/vhost_crypto/Makefile
@@ -23,7 +23,7 @@ PKGCONF ?= pkg-config
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
-LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk)
+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk)
 
 build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
 	$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
diff --git a/examples/vmdq/Makefile b/examples/vmdq/Makefile
index 7e59e4d658..0767c715a1 100644
--- a/examples/vmdq/Makefile
+++ b/examples/vmdq/Makefile
@@ -22,7 +22,7 @@ PKGCONF ?= pkg-config
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
-LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk)
+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk)
 
 build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
 	$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
diff --git a/examples/vmdq_dcb/Makefile b/examples/vmdq_dcb/Makefile
index 2302577d00..2a9b04143f 100644
--- a/examples/vmdq_dcb/Makefile
+++ b/examples/vmdq_dcb/Makefile
@@ -22,7 +22,7 @@ PKGCONF ?= pkg-config
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
-LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk)
+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk)
 
 build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
 	$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
-- 
2.30.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [dpdk-stable] [PATCH 3/7] Revert "Revert "Revert "build/pkg-config: output drivers first for static build"""
  2021-03-22 11:21 [dpdk-stable] [PATCH 0/7] Do not change build/link behavior on stable release Christian Ehrhardt
  2021-03-22 11:21 ` [dpdk-stable] [PATCH 1/7] Revert "Revert "Revert "build/pkg-config: prevent overlinking""" Christian Ehrhardt
  2021-03-22 11:21 ` [dpdk-stable] [PATCH 2/7] Revert "Revert "Revert "build/pkg-config: improve static linking flags""" Christian Ehrhardt
@ 2021-03-22 11:21 ` Christian Ehrhardt
  2021-03-22 11:21 ` [dpdk-stable] [PATCH 4/7] Revert "Revert "Revert "build/pkg-config: move pkg-config file creation""" Christian Ehrhardt
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Christian Ehrhardt @ 2021-03-22 11:21 UTC (permalink / raw)
  To: stable, Thomas Monjalon, Luca Boccassi, Bruce Richardson
  Cc: Pai Sunil, Ilya Maximets, Stokes Ian, Govindharajan Hariprasad,
	James Page, Christian Ehrhardt

This reverts commit 906e935a1fd1f6cf01ff12d70c2f040aa91984c6.
This series changes linking behavior in 19.11.x and thereby should stay
out. It breaks - for example - a rebuild of OVS 2.13 or builds
of later OVS 2.13.x stable releases.

Reverting this drops the two following 19.11.7 changes which need to be
re-created in the new (old) place of meson.build
---
 buildtools/pkg-config/meson.build | 36 ++++---------------------------
 1 file changed, 4 insertions(+), 32 deletions(-)

diff --git a/buildtools/pkg-config/meson.build b/buildtools/pkg-config/meson.build
index ccb34dcab3..c93711b5e8 100644
--- a/buildtools/pkg-config/meson.build
+++ b/buildtools/pkg-config/meson.build
@@ -10,41 +10,13 @@ pkg_extra_cflags = ['-include', 'rte_config.h'] + machine_args
 if is_freebsd
 	pkg_extra_cflags += ['-D__BSD_VISIBLE']
 endif
-
-# When calling pkg-config --static --libs, pkg-config will always output the
-# regular libs first, and then the extra libs from Libs.private field,
-# since the assumption is that those are additional dependencies for building
-# statically that the .a files depend upon. The output order of .pc fields is:
-#   Libs   Libs.private   Requires   Requires.private
-# The fields Requires* are for package names.
-# The flags of the DPDK libraries must be defined in Libs* fields.
-# However, the DPDK drivers are linked only in static builds (Libs.private),
-# and those need to come *before* the regular libraries (Libs field).
-# This requirement is satisfied by moving the regular libs in a separate file
-# included in the field Requires (after Libs.private).
-
-pkg.generate(name: 'dpdk-libs',
-	filebase: 'libdpdk-libs',
-	description: '''Internal-only DPDK pkgconfig file. Not for direct use.
-Use libdpdk.pc instead of this file to query DPDK compile/link arguments''',
+pkg.generate(name: meson.project_name(),
+	filebase: 'lib' + meson.project_name().to_lower(),
 	version: meson.project_version(),
-	subdirs: [get_option('include_subdir_arch'), '.'],
-	extra_cflags: pkg_extra_cflags,
 	libraries: dpdk_libraries,
-	libraries_private: dpdk_extra_ldflags)
-
-platform_flags = []
-if not is_windows
-	platform_flags += ['-Wl,--export-dynamic'] # ELF only
-endif
-pkg.generate(name: 'DPDK', # main DPDK pkgconfig file
-	filebase: 'libdpdk',
-	version: meson.project_version(),
 	description: '''The Data Plane Development Kit (DPDK).
 Note that CFLAGS might contain an -march flag higher than typical baseline.
 This is required for a number of static inline functions in the public headers.''',
-	requires: ['libdpdk-libs', libbsd], # may need libbsd for string funcs
-	                  # if libbsd is not enabled, then this is blank
-	libraries_private: dpdk_drivers + dpdk_static_libraries +
-			['-Wl,-Bdynamic'] + platform_flags
+	subdirs: [get_option('include_subdir_arch'), '.'],
+	extra_cflags: pkg_extra_cflag
 )
-- 
2.30.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [dpdk-stable] [PATCH 4/7] Revert "Revert "Revert "build/pkg-config: move pkg-config file creation"""
  2021-03-22 11:21 [dpdk-stable] [PATCH 0/7] Do not change build/link behavior on stable release Christian Ehrhardt
                   ` (2 preceding siblings ...)
  2021-03-22 11:21 ` [dpdk-stable] [PATCH 3/7] Revert "Revert "Revert "build/pkg-config: output drivers first for static build""" Christian Ehrhardt
@ 2021-03-22 11:21 ` Christian Ehrhardt
  2021-03-22 11:21 ` [dpdk-stable] [PATCH 5/7] Revert "Revert "Revert "build: always link whole DPDK static libraries""" Christian Ehrhardt
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Christian Ehrhardt @ 2021-03-22 11:21 UTC (permalink / raw)
  To: stable, Thomas Monjalon, Luca Boccassi, Bruce Richardson
  Cc: Pai Sunil, Ilya Maximets, Stokes Ian, Govindharajan Hariprasad,
	James Page, Christian Ehrhardt

This reverts commit deebf952394cef1d14912f3dc2fc5121431c16a5.
This series changes linking behavior in 19.11.x and thereby should stay
out. It breaks - for example - a rebuild of OVS 2.13 or builds
of later OVS 2.13.x stable releases.
---
 MAINTAINERS                       |  2 --
 buildtools/pkg-config/meson.build | 22 ----------------------
 meson.build                       | 25 +++++++++++++++++++++++--
 3 files changed, 23 insertions(+), 26 deletions(-)
 delete mode 100644 buildtools/pkg-config/meson.build

diff --git a/MAINTAINERS b/MAINTAINERS
index 952ded7b00..75431e333b 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -131,8 +131,6 @@ F: config/rte_config.h
 F: buildtools/call-sphinx-build.py
 F: buildtools/gen-pmdinfo-cfile.sh
 F: buildtools/map_to_def.py
-F: buildtools/list-dir-globs.py
-F: buildtools/pkg-config/
 F: buildtools/symlink-drivers-solibs.sh
 
 Public CI
diff --git a/buildtools/pkg-config/meson.build b/buildtools/pkg-config/meson.build
deleted file mode 100644
index c93711b5e8..0000000000
--- a/buildtools/pkg-config/meson.build
+++ /dev/null
@@ -1,22 +0,0 @@
-# SPDX-License-Identifier: BSD-3-Clause
-# Copyright(c) 2020 Intel Corporation
-
-# for static builds, include the drivers as libs and we need to "whole-archive"
-# them.
-dpdk_drivers = ['-Wl,--whole-archive'] + dpdk_drivers + ['-Wl,--no-whole-archive']
-
-pkg = import('pkgconfig')
-pkg_extra_cflags = ['-include', 'rte_config.h'] + machine_args
-if is_freebsd
-	pkg_extra_cflags += ['-D__BSD_VISIBLE']
-endif
-pkg.generate(name: meson.project_name(),
-	filebase: 'lib' + meson.project_name().to_lower(),
-	version: meson.project_version(),
-	libraries: dpdk_libraries,
-	description: '''The Data Plane Development Kit (DPDK).
-Note that CFLAGS might contain an -march flag higher than typical baseline.
-This is required for a number of static inline functions in the public headers.''',
-	subdirs: [get_option('include_subdir_arch'), '.'],
-	extra_cflags: pkg_extra_cflag
-)
diff --git a/meson.build b/meson.build
index 00949de995..58995252bd 100644
--- a/meson.build
+++ b/meson.build
@@ -64,8 +64,29 @@ configure_file(output: build_cfg,
 		install_dir: join_paths(get_option('includedir'),
 				get_option('include_subdir_arch')))
 
-# build pkg-config files for dpdk
-subdir('buildtools/pkg-config')
+# for static builds, include the drivers as libs and we need to "whole-archive"
+# them.
+dpdk_drivers = ['-Wl,--whole-archive'] + dpdk_drivers + ['-Wl,--no-whole-archive']
+
+pkg = import('pkgconfig')
+pkg_extra_cflags = ['-include', 'rte_config.h'] + machine_args
+if is_freebsd
+	pkg_extra_cflags += ['-D__BSD_VISIBLE']
+endif
+pkg.generate(name: meson.project_name(),
+	filebase: 'lib' + meson.project_name().to_lower(),
+	version: meson.project_version(),
+	libraries: dpdk_libraries,
+	libraries_private: dpdk_drivers + dpdk_static_libraries +
+			['-Wl,-Bdynamic'] + dpdk_extra_ldflags,
+	requires: libbsd, # apps using rte_string_fns.h may need this if enabled
+	                  # if libbsd is not enabled, then this is blank
+	description: '''The Data Plane Development Kit (DPDK).
+Note that CFLAGS might contain an -march flag higher than typical baseline.
+This is required for a number of static inline functions in the public headers.''',
+	subdirs: [get_option('include_subdir_arch'), '.'],
+	extra_cflags: pkg_extra_cflags
+)
 
 # final output, list all the libs and drivers to be built
 # this does not affect any part of the build, for information only.
-- 
2.30.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [dpdk-stable] [PATCH 5/7] Revert "Revert "Revert "build: always link whole DPDK static libraries"""
  2021-03-22 11:21 [dpdk-stable] [PATCH 0/7] Do not change build/link behavior on stable release Christian Ehrhardt
                   ` (3 preceding siblings ...)
  2021-03-22 11:21 ` [dpdk-stable] [PATCH 4/7] Revert "Revert "Revert "build/pkg-config: move pkg-config file creation""" Christian Ehrhardt
@ 2021-03-22 11:21 ` Christian Ehrhardt
  2021-03-22 11:21 ` [dpdk-stable] [PATCH 6/7] Revert "Revert "Revert "devtools: test static linkage with pkg-config""" Christian Ehrhardt
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Christian Ehrhardt @ 2021-03-22 11:21 UTC (permalink / raw)
  To: stable, Thomas Monjalon, Luca Boccassi, Bruce Richardson
  Cc: Pai Sunil, Ilya Maximets, Stokes Ian, Govindharajan Hariprasad,
	James Page, Christian Ehrhardt

This reverts commit a3bd9a34bf9988de641b6e78b825fafb69d2d13f.
This series changes linking behavior in 19.11.x and thereby should stay
out. It breaks - for example - a rebuild of OVS 2.13 or builds
of later OVS 2.13.x stable releases.
---
 app/test/meson.build | 2 +-
 drivers/meson.build  | 2 +-
 examples/meson.build | 6 +++---
 lib/meson.build      | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/app/test/meson.build b/app/test/meson.build
index 24fb59f74f..860728bb07 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -391,7 +391,7 @@ test_dep_objs += cc.find_library('execinfo', required: false)
 
 link_libs = []
 if get_option('default_library') == 'static'
-	link_libs = dpdk_static_libraries + dpdk_drivers
+	link_libs = dpdk_drivers
 endif
 
 dpdk_test = executable('dpdk-test',
diff --git a/drivers/meson.build b/drivers/meson.build
index 696079680b..0400d84675 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -198,7 +198,7 @@ foreach class:dpdk_driver_classes
 			shared_dep = declare_dependency(link_with: shared_lib,
 					include_directories: includes,
 					dependencies: shared_deps)
-			static_dep = declare_dependency(
+			static_dep = declare_dependency(link_with: static_lib,
 					include_directories: includes,
 					dependencies: static_deps)
 
diff --git a/examples/meson.build b/examples/meson.build
index 9e081f3fb7..4dc292fbd1 100644
--- a/examples/meson.build
+++ b/examples/meson.build
@@ -1,9 +1,9 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017-2019 Intel Corporation
 
-link_whole_libs = []
+driver_libs = []
 if get_option('default_library') == 'static'
-	link_whole_libs = dpdk_static_libraries + dpdk_drivers
+	driver_libs = dpdk_drivers
 endif
 
 execinfo = cc.find_library('execinfo', required: false)
@@ -97,7 +97,7 @@ foreach example: examples
 		endif
 		executable('dpdk-' + name, sources,
 			include_directories: includes,
-			link_whole: link_whole_libs,
+			link_whole: driver_libs,
 			link_args: ldflags,
 			c_args: cflags,
 			dependencies: dep_objs)
diff --git a/lib/meson.build b/lib/meson.build
index b60396428c..f8da4f3168 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -127,7 +127,7 @@ foreach l:libraries
 					dependencies: static_deps,
 					include_directories: includes,
 					install: true)
-			static_dep = declare_dependency(
+			static_dep = declare_dependency(link_with: static_lib,
 					include_directories: includes,
 					dependencies: static_deps)
 
-- 
2.30.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [dpdk-stable] [PATCH 6/7] Revert "Revert "Revert "devtools: test static linkage with pkg-config"""
  2021-03-22 11:21 [dpdk-stable] [PATCH 0/7] Do not change build/link behavior on stable release Christian Ehrhardt
                   ` (4 preceding siblings ...)
  2021-03-22 11:21 ` [dpdk-stable] [PATCH 5/7] Revert "Revert "Revert "build: always link whole DPDK static libraries""" Christian Ehrhardt
@ 2021-03-22 11:21 ` Christian Ehrhardt
  2021-03-22 11:21 ` [dpdk-stable] [PATCH 7/7] Regenerate meson.build changes required due to reverts Christian Ehrhardt
  2021-03-22 12:00 ` [dpdk-stable] [PATCH 0/7] Do not change build/link behavior on stable release Luca Boccassi
  7 siblings, 0 replies; 9+ messages in thread
From: Christian Ehrhardt @ 2021-03-22 11:21 UTC (permalink / raw)
  To: stable, Thomas Monjalon, Luca Boccassi, Bruce Richardson
  Cc: Pai Sunil, Ilya Maximets, Stokes Ian, Govindharajan Hariprasad,
	James Page, Christian Ehrhardt

This reverts commit d4bc12443836ccb8a5032b34f1d412b33a1d2384.
This series changes linking behavior in 19.11.x and thereby should stay
out. It breaks - for example - a rebuild of OVS 2.13 or builds
of later OVS 2.13.x stable releases.
---
 devtools/test-meson-builds.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh
index 8678a3d824..47fdb9dfb5 100755
--- a/devtools/test-meson-builds.sh
+++ b/devtools/test-meson-builds.sh
@@ -146,6 +146,6 @@ if pkg-config --define-prefix libdpdk >/dev/null 2>&1; then
 	export PKGCONF="pkg-config --define-prefix"
 	for example in cmdline helloworld l2fwd l3fwd skeleton timer; do
 		echo "## Building $example"
-		$MAKE -C $DESTDIR/usr/local/share/dpdk/examples/$example clean shared static
+		$MAKE -C $DESTDIR/usr/local/share/dpdk/examples/$example clean all
 	done
 fi
-- 
2.30.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [dpdk-stable] [PATCH 7/7] Regenerate meson.build changes required due to reverts
  2021-03-22 11:21 [dpdk-stable] [PATCH 0/7] Do not change build/link behavior on stable release Christian Ehrhardt
                   ` (5 preceding siblings ...)
  2021-03-22 11:21 ` [dpdk-stable] [PATCH 6/7] Revert "Revert "Revert "devtools: test static linkage with pkg-config""" Christian Ehrhardt
@ 2021-03-22 11:21 ` Christian Ehrhardt
  2021-03-22 12:00 ` [dpdk-stable] [PATCH 0/7] Do not change build/link behavior on stable release Luca Boccassi
  7 siblings, 0 replies; 9+ messages in thread
From: Christian Ehrhardt @ 2021-03-22 11:21 UTC (permalink / raw)
  To: stable, Thomas Monjalon, Luca Boccassi, Bruce Richardson
  Cc: Pai Sunil, Ilya Maximets, Stokes Ian, Govindharajan Hariprasad,
	James Page, Christian Ehrhardt

Due to a series of re-re-reverts by this case:
http://mails.dpdk.org/archives/stable/2021-March/029418.html
http://mails.dpdk.org/archives/stable/2020-September/024796.html
The two changes of:
  3f33f5056 build: fix plugin load on static build
  4a2baf099 build: fix linker flags on Windows
would have been lost.
Re-apply them here to have the reverts only remove what was added by them.

Fixes: 16ade738fd0d ("app/testpmd: build with meson")
Fixes: 89f0711f9ddf ("examples: build some samples with meson")
Fixes: b031e13d7f0d ("build: fix plugin load on static build")

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
---
 meson.build | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/meson.build b/meson.build
index 58995252bd..01bbb556ec 100644
--- a/meson.build
+++ b/meson.build
@@ -64,9 +64,14 @@ configure_file(output: build_cfg,
 		install_dir: join_paths(get_option('includedir'),
 				get_option('include_subdir_arch')))
 
+platform_flags = []
+if not is_windows
+       platform_flags += ['-Wl,--export-dynamic'] # ELF only
+endif
+
 # for static builds, include the drivers as libs and we need to "whole-archive"
 # them.
-dpdk_drivers = ['-Wl,--whole-archive'] + dpdk_drivers + ['-Wl,--no-whole-archive']
+dpdk_drivers = ['-Wl,--whole-archive'] + dpdk_drivers + ['-Wl,--no-whole-archive'] + platform_flags
 
 pkg = import('pkgconfig')
 pkg_extra_cflags = ['-include', 'rte_config.h'] + machine_args
-- 
2.30.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [dpdk-stable] [PATCH 0/7] Do not change build/link behavior on stable release
  2021-03-22 11:21 [dpdk-stable] [PATCH 0/7] Do not change build/link behavior on stable release Christian Ehrhardt
                   ` (6 preceding siblings ...)
  2021-03-22 11:21 ` [dpdk-stable] [PATCH 7/7] Regenerate meson.build changes required due to reverts Christian Ehrhardt
@ 2021-03-22 12:00 ` Luca Boccassi
  7 siblings, 0 replies; 9+ messages in thread
From: Luca Boccassi @ 2021-03-22 12:00 UTC (permalink / raw)
  To: Christian Ehrhardt, stable, Thomas Monjalon, Bruce Richardson
  Cc: Pai Sunil, Ilya Maximets, Stokes Ian, Govindharajan Hariprasad,
	James Page

On Mon, 2021-03-22 at 12:21 +0100, Christian Ehrhardt wrote:
> Hi,
> most of you have been on CC on the discussion around this already.
> Background:
> http://mails.dpdk.org/archives/stable/2021-March/029418.html
> 
> Summary:
> - changes to DPDK linking were proposed to stable @19.11.4 and
>   identified to be bad
> - in the 19.11.6 time-frame the responses were ok so they were
>   accepted in there
> - but the old issue still exists and e.g. OVS is non-buildable vs
>   DPDK >=19.11.6
> - IMHO an upgrade of 19.11.x should not break how linking is done
> - But, OTOH one can now say "upgrading from 19.11.6 -> 19.11.8 this
>   changes"
> 
> I'm unsure if this is worth an early 19.11.8 or maybe just
> pushing it to git and an entry in the known-issues for 19.11.7?
> But before we bike-shed over that let us discuss and agree if
> taking those changes out of the 19.11.x release is the right
> approach.
> 
> 
> Christian Ehrhardt (7):
>   Revert "Revert "Revert "build/pkg-config: prevent overlinking"""
>   Revert "Revert "Revert "build/pkg-config: improve static linking
>     flags"""
>   Revert "Revert "Revert "build/pkg-config: output drivers first for
>     static build"""
>   Revert "Revert "Revert "build/pkg-config: move pkg-config file
>     creation"""
>   Revert "Revert "Revert "build: always link whole DPDK static
>     libraries"""
>   Revert "Revert "Revert "devtools: test static linkage with
>     pkg-config"""
>   Regenerate meson.build changes required due to reverts
> 
>  MAINTAINERS                                   |  2 -
>  app/test/meson.build                          |  2 +-
>  buildtools/pkg-config/meson.build             | 59 -------------------
>  .../pkg-config/set-static-linker-flags.py     | 38 ------------
>  devtools/test-meson-builds.sh                 |  2 +-
>  doc/build-sdk-meson.txt                       |  2 +-
>  drivers/meson.build                           |  2 +-
>  examples/bbdev_app/Makefile                   |  2 +-
>  examples/bond/Makefile                        |  2 +-
>  examples/cmdline/Makefile                     |  2 +-
>  examples/distributor/Makefile                 |  2 +-
>  examples/eventdev_pipeline/Makefile           |  2 +-
>  examples/fips_validation/Makefile             |  2 +-
>  examples/flow_classify/Makefile               |  2 +-
>  examples/flow_filtering/Makefile              |  2 +-
>  examples/helloworld/Makefile                  |  2 +-
>  examples/ioat/Makefile                        |  2 +-
>  examples/ip_fragmentation/Makefile            |  2 +-
>  examples/ip_pipeline/Makefile                 |  2 +-
>  examples/ip_reassembly/Makefile               |  2 +-
>  examples/ipsec-secgw/Makefile                 |  2 +-
>  examples/ipv4_multicast/Makefile              |  2 +-
>  examples/kni/Makefile                         |  2 +-
>  examples/l2fwd-cat/Makefile                   |  2 +-
>  examples/l2fwd-crypto/Makefile                |  2 +-
>  examples/l2fwd-event/Makefile                 |  2 +-
>  examples/l2fwd-jobstats/Makefile              |  2 +-
>  examples/l2fwd-keepalive/Makefile             |  2 +-
>  examples/l2fwd/Makefile                       |  2 +-
>  examples/l3fwd-acl/Makefile                   |  2 +-
>  examples/l3fwd-power/Makefile                 |  2 +-
>  examples/l3fwd/Makefile                       |  2 +-
>  examples/link_status_interrupt/Makefile       |  2 +-
>  examples/meson.build                          |  6 +-
>  examples/ntb/Makefile                         |  2 +-
>  examples/packet_ordering/Makefile             |  2 +-
>  examples/ptpclient/Makefile                   |  2 +-
>  examples/qos_meter/Makefile                   |  2 +-
>  examples/qos_sched/Makefile                   |  2 +-
>  examples/rxtx_callbacks/Makefile              |  2 +-
>  examples/service_cores/Makefile               |  2 +-
>  examples/skeleton/Makefile                    |  2 +-
>  examples/tep_termination/Makefile             |  2 +-
>  examples/timer/Makefile                       |  2 +-
>  examples/vdpa/Makefile                        |  2 +-
>  examples/vhost/Makefile                       |  2 +-
>  examples/vhost_blk/Makefile                   |  2 +-
>  examples/vhost_crypto/Makefile                |  2 +-
>  examples/vmdq/Makefile                        |  2 +-
>  examples/vmdq_dcb/Makefile                    |  2 +-
>  lib/meson.build                               |  2 +-
>  meson.build                                   | 30 +++++++++-
>  52 files changed, 78 insertions(+), 151 deletions(-)
>  delete mode 100644 buildtools/pkg-config/meson.build
>  delete mode 100644 buildtools/pkg-config/set-static-linker-flags.py

Series-acked-by: Luca Boccassi <bluca@debian.org>

-- 
Kind regards,
Luca Boccassi

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-03-22 12:00 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-22 11:21 [dpdk-stable] [PATCH 0/7] Do not change build/link behavior on stable release Christian Ehrhardt
2021-03-22 11:21 ` [dpdk-stable] [PATCH 1/7] Revert "Revert "Revert "build/pkg-config: prevent overlinking""" Christian Ehrhardt
2021-03-22 11:21 ` [dpdk-stable] [PATCH 2/7] Revert "Revert "Revert "build/pkg-config: improve static linking flags""" Christian Ehrhardt
2021-03-22 11:21 ` [dpdk-stable] [PATCH 3/7] Revert "Revert "Revert "build/pkg-config: output drivers first for static build""" Christian Ehrhardt
2021-03-22 11:21 ` [dpdk-stable] [PATCH 4/7] Revert "Revert "Revert "build/pkg-config: move pkg-config file creation""" Christian Ehrhardt
2021-03-22 11:21 ` [dpdk-stable] [PATCH 5/7] Revert "Revert "Revert "build: always link whole DPDK static libraries""" Christian Ehrhardt
2021-03-22 11:21 ` [dpdk-stable] [PATCH 6/7] Revert "Revert "Revert "devtools: test static linkage with pkg-config""" Christian Ehrhardt
2021-03-22 11:21 ` [dpdk-stable] [PATCH 7/7] Regenerate meson.build changes required due to reverts Christian Ehrhardt
2021-03-22 12:00 ` [dpdk-stable] [PATCH 0/7] Do not change build/link behavior on stable release Luca Boccassi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).