From: Thomas Petazzoni Date: Sun, 28 May 2017 15:33:23 +0200 Subject: [Buildroot] [PATCH] package/openpowerlink: use pcap-config to fix static linking with libpcap In-Reply-To: <20170527225119.26015-1-romain.naour@gmail.com> References: <20170527225119.26015-1-romain.naour@gmail.com> Message-ID: <20170528153323.6e7f716b@free-electrons.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: buildroot@busybox.net Hello, On Sun, 28 May 2017 00:51:19 +0200, Romain Naour wrote: > When linking demo_mn_console statically with pcap, the CMake build > system forget to link with other libraries linked with libpcap > (-lnl-genl-3 -lnl-3 -ldbus-1 -pthread). > > [100%] Linking C executable demo_mn_console > lib64/libpcap.a(pcap-linux.o): In function nl80211_init': pcap-linux.c:(.text+0x41e): undefined reference tonl_socket_alloc' > > To fix this, the build system could use pcap-config: > pcap-config --libs --static > -L/path/to/sysroot/usr/lib -lpcap -L/path/to/sysroot/usr/lib/.libs > -lnl-genl-3 -lnl-3 -L/path/to/sysroot/usr/lib -ldbus-1 -pthread > > Also don't use getopt() from contrib directory to avoid a clash with > libc definition. > > Fixes: > http://autobuild.buildroot.net/results/f43/f437d09ac6c689c911e1885b95da33b692f2cb3c > http://autobuild.buildroot.net/results/385/3859dc0f4de7e3284a96d5841f040f69f71842df > https://github.com/OpenAutomationTechnologies/openPOWERLINK_V2/issues/187 > > Signed-off-by: Romain Naour > --- > ...04-FIX-use-contrib-getopt-only-on-Windows.patch | 102 +++++++++++++ > ...p-config-to-fix-static-linking-with-libpc.patch | 166 +++++++++++++++++++++ > package/openpowerlink/openpowerlink.mk | 6 +- > 3 files changed, 272 insertions(+), 2 deletions(-) > create mode 100644 package/openpowerlink/0004-FIX-use-contrib-getopt-only-on-Windows.patch > create mode 100644 package/openpowerlink/0005-FIX-use-pcap-config-to-fix-static-linking-with-libpc.patch Applied to master, thanks. Thomas -- Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com