diff mbox series

[oe,meta-networking] networkmanager: Fix build with clang

Message ID 20190406184223.28699-1-raj.khem@gmail.com
State Accepted
Commit 82b8ae6bd2167748ca3ffb4cd5d251f20ed30af1
Headers show
Series [oe,meta-networking] networkmanager: Fix build with clang | expand

Commit Message

Khem Raj April 6, 2019, 6:42 p.m. UTC
Detecting libdl for dlopen when failed returns
"none required", which then gets added to linker commandline
and inturn fails to link with errors obviously because "-lnone required"
is no such library.

This patch is not musl dependent, earlier patches clubbed it into musl
patch however this is needed with clang too regardless of the C library
the reason is clang automatically brings in libdl in OE and hence this
test is failing.

This is noop with gcc since the first check will pass thats why it works
in first place

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Andreas Müller <schnitzeltony@gmail.com>
---
 .../networkmanager/0003-dlopen-failure.patch  | 34 +++++++++++++++++++
 .../musl/0001-Fix-build-with-musl.patch       | 13 -------
 .../networkmanager/networkmanager_1.16.0.bb   |  1 +
 3 files changed, 35 insertions(+), 13 deletions(-)
 create mode 100644 meta-networking/recipes-connectivity/networkmanager/networkmanager/0003-dlopen-failure.patch

Comments

Andreas Müller April 6, 2019, 6:53 p.m. UTC | #1
On Sat, Apr 6, 2019 at 8:42 PM Khem Raj <raj.khem@gmail.com> wrote:
>

> Detecting libdl for dlopen when failed returns

> "none required", which then gets added to linker commandline

> and inturn fails to link with errors obviously because "-lnone required"

> is no such library.

>

> This patch is not musl dependent, earlier patches clubbed it into musl

> patch however this is needed with clang too regardless of the C library

> the reason is clang automatically brings in libdl in OE and hence this

> test is failing.

>

Seems I was a bit over enthusiastic - thanks

Out of curiosity: If I remember correct similar is in musl patch.
Doesn't this cause conflict with musl patch?

Andreas
-- 
_______________________________________________
Openembedded-devel mailing list
Openembedded-devel@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
Khem Raj April 6, 2019, 7:03 p.m. UTC | #2
On Sat, Apr 6, 2019 at 11:53 AM Andreas Müller <schnitzeltony@gmail.com> wrote:
>
> On Sat, Apr 6, 2019 at 8:42 PM Khem Raj <raj.khem@gmail.com> wrote:
> >
> > Detecting libdl for dlopen when failed returns
> > "none required", which then gets added to linker commandline
> > and inturn fails to link with errors obviously because "-lnone required"
> > is no such library.
> >
> > This patch is not musl dependent, earlier patches clubbed it into musl
> > patch however this is needed with clang too regardless of the C library
> > the reason is clang automatically brings in libdl in OE and hence this
> > test is failing.
> >
> Seems I was a bit over enthusiastic - thanks
>
> Out of curiosity: If I remember correct similar is in musl patch.
> Doesn't this cause conflict with musl patch?
>

I have deleted that portion from cumulative musl patch

> Andreas
Andreas Müller April 6, 2019, 7:25 p.m. UTC | #3
On Sat, Apr 6, 2019 at 9:04 PM Khem Raj <raj.khem@gmail.com> wrote:
>
> On Sat, Apr 6, 2019 at 11:53 AM Andreas Müller <schnitzeltony@gmail.com> wrote:
> >
> > On Sat, Apr 6, 2019 at 8:42 PM Khem Raj <raj.khem@gmail.com> wrote:
> > >
> > > Detecting libdl for dlopen when failed returns
> > > "none required", which then gets added to linker commandline
> > > and inturn fails to link with errors obviously because "-lnone required"
> > > is no such library.
> > >
> > > This patch is not musl dependent, earlier patches clubbed it into musl
> > > patch however this is needed with clang too regardless of the C library
> > > the reason is clang automatically brings in libdl in OE and hence this
> > > test is failing.
> > >
> > Seems I was a bit over enthusiastic - thanks
> >
> > Out of curiosity: If I remember correct similar is in musl patch.
> > Doesn't this cause conflict with musl patch?
> >
>
> I have deleted that portion from cumulative musl patch
>
Ahh OK missed that

Andreas
diff mbox series

Patch

diff --git a/meta-networking/recipes-connectivity/networkmanager/networkmanager/0003-dlopen-failure.patch b/meta-networking/recipes-connectivity/networkmanager/networkmanager/0003-dlopen-failure.patch
new file mode 100644
index 0000000000..e99c22710c
--- /dev/null
+++ b/meta-networking/recipes-connectivity/networkmanager/networkmanager/0003-dlopen-failure.patch
@@ -0,0 +1,34 @@ 
+From 57239fda56b68a8f3e413f7b6af5290ba0d86636 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com>
+Date: Thu, 22 Mar 2018 18:18:06 +0100
+Subject: [PATCH] musl: dlopen is included so LD_LIBS="" instead of
+ LD_LIBS="none required"
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Upstream-Status: Pending
+
+Stolen from [1] and prettyfied slightly
+
+[1] https://github.com/voidlinux/void-packages/tree/master/srcpkgs/NetworkManager/patches
+
+Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
+---
+ configure.ac | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/configure.ac b/configure.ac
+index 487a266..96ae4f7 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -235,6 +235,7 @@ dnl
+ dnl Checks for libdl - on certain platforms its part of libc
+ dnl
+ AC_SEARCH_LIBS([dlopen], [dl dld], [], [ac_cv_search_dlopen=])
++AS_IF([test "$ac_cv_search_dlopen" = "none required"],[ac_cv_search_dlopen=""])
+ AC_SUBST([DL_LIBS], "$ac_cv_search_dlopen")
+ 
+ PKG_CHECK_MODULES(GLIB, [gio-unix-2.0 >= 2.37.6 gmodule-2.0],
+-- 
+2.14.3
diff --git a/meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0001-Fix-build-with-musl.patch b/meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0001-Fix-build-with-musl.patch
index 21e9a16d6d..b3f93ff92b 100644
--- a/meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0001-Fix-build-with-musl.patch
+++ b/meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0001-Fix-build-with-musl.patch
@@ -11,7 +11,6 @@  Upstream-Status: Pending
 Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
 ---
  clients/cli/connections.c                    |  1 -
- configure.ac                                 |  1 +
  libnm-core/nm-utils.c                        |  2 +-
  shared/n-acd/src/n-acd.c                     |  1 -
  shared/systemd/src/basic/in-addr-util.c      |  1 +
@@ -43,18 +42,6 @@  index 6db44f8..36e51cc 100644
  #include <readline/readline.h>
  #include <readline/history.h>
  #include <fcntl.h>
-diff --git a/configure.ac b/configure.ac
-index 872c292..b1d7a68 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -241,6 +241,7 @@ dnl
- dnl Checks for libdl - on certain platforms its part of libc
- dnl
- AC_SEARCH_LIBS([dlopen], [dl dld], [], [ac_cv_search_dlopen=])
-+AS_IF([test "$ac_cv_search_dlopen" = "none required"],[ac_cv_search_dlopen=""])
- AC_SUBST([DL_LIBS], "$ac_cv_search_dlopen")
- 
- PKG_CHECK_MODULES(GLIB, [gio-unix-2.0 >= 2.37.6 gmodule-2.0],
 diff --git a/libnm-core/nm-utils.c b/libnm-core/nm-utils.c
 index d276cfe..2aec785 100644
 --- a/libnm-core/nm-utils.c
diff --git a/meta-networking/recipes-connectivity/networkmanager/networkmanager_1.16.0.bb b/meta-networking/recipes-connectivity/networkmanager/networkmanager_1.16.0.bb
index 90792ff4ee..9f57908e96 100644
--- a/meta-networking/recipes-connectivity/networkmanager/networkmanager_1.16.0.bb
+++ b/meta-networking/recipes-connectivity/networkmanager/networkmanager_1.16.0.bb
@@ -26,6 +26,7 @@  SRC_URI = " \
     ${GNOME_MIRROR}/NetworkManager/${@gnome_verdir("${PV}")}/NetworkManager-${PV}.tar.xz \
     file://0001-Fixed-configure.ac-Fix-pkgconfig-sysroot-locations.patch \
     file://0002-Do-not-create-settings-settings-property-documentati.patch \
+    file://0003-dlopen-failure.patch \
 "
 SRC_URI_append_libc-musl = " file://musl/0001-Fix-build-with-musl.patch"