* [Buildroot] [PATCH] libnspr: fix link error with musl toolchains
@ 2016-01-05 23:48 Sergio Prado
2016-01-24 15:46 ` Bernd Kuhls
2016-01-27 22:59 ` Thomas Petazzoni
0 siblings, 2 replies; 3+ messages in thread
From: Sergio Prado @ 2016-01-05 23:48 UTC (permalink / raw)
To: buildroot
When linking against libnspr with musl toolchains we get undefined
references to `getprotobyname_r' and `getprotobynumber_r', for example
when compiling libnss:
/home/test/autobuild/instance-1/output/host/usr/arm-buildroot-linux-musleabihf/sysroot/usr/lib/libnspr4.so:
undefined reference to `getprotobyname_r'
/home/test/autobuild/instance-1/output/host/usr/arm-buildroot-linux-musleabihf/sysroot/usr/lib/libnspr4.so:
undefined reference to `getprotobynumber_r'
That's because musl does not have an implementation of these functions,
so we need to enable their internal implementation from libnspr.
This patch was backported from Alpine Linux commit
a162da839db0d3f8be94a5c1ad2e2e54e691c38a.
Fixes:
http://autobuild.buildroot.net/results/6052538d10779a21ac242d61bb43a371497ec684/
http://autobuild.buildroot.net/results/d62ea7dbe68188d073b4f176e6a354e95a8bab97/
http://autobuild.buildroot.net/results/ae50521c485371cd59bc4ee7e8f323169c7d513d/
...
Signed-off-by: Sergio Prado <sergio.prado@e-labworks.com>
---
...able-internal-getproto-functions-for-musl.patch | 35 ++++++++++++++++++++++
1 file changed, 35 insertions(+)
create mode 100644 package/libnspr/0003-enable-internal-getproto-functions-for-musl.patch
diff --git a/package/libnspr/0003-enable-internal-getproto-functions-for-musl.patch b/package/libnspr/0003-enable-internal-getproto-functions-for-musl.patch
new file mode 100644
index 000000000000..860ca2ad282d
--- /dev/null
+++ b/package/libnspr/0003-enable-internal-getproto-functions-for-musl.patch
@@ -0,0 +1,35 @@
+From c950bcf9cc7bdc68ed9751a1b7d04f4b4c2a9fb0 Mon Sep 17 00:00:00 2001
+From: Sergio Prado <sergio.prado@e-labworks.com>
+Date: Tue, 5 Jan 2016 21:15:34 -0200
+Subject: [PATCH] enable internal getproto functions for musl
+
+Musl toolchains does not have getprotobyname_r and getprotobynumber_r
+functions and need its internal implementation.
+
+Patch backported from Alpine Linux commit
+a162da839db0d3f8be94a5c1ad2e2e54e691c38a.
+
+Signed-off-by: Sergio Prado <sergio.prado@e-labworks.com>
+---
+ nspr/pr/src/misc/prnetdb.c | 5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/nspr/pr/src/misc/prnetdb.c b/nspr/pr/src/misc/prnetdb.c
+index b86248f863f0..dc83a5615f45 100644
+--- a/nspr/pr/src/misc/prnetdb.c
++++ b/nspr/pr/src/misc/prnetdb.c
+@@ -61,10 +61,7 @@ PRLock *_pr_dnsLock = NULL;
+ #define _PR_HAVE_GETPROTO_R_POINTER
+ #endif
+
+-#if defined(SOLARIS) || (defined(BSDI) && defined(_REENTRANT)) \
+- || (defined(LINUX) && defined(_REENTRANT) \
+- && !(defined(__GLIBC__) && __GLIBC__ >= 2) \
+- && !defined(ANDROID))
++#if defined(SOLARIS) || (defined(BSDI) && defined(_REENTRANT))
+ #define _PR_HAVE_GETPROTO_R
+ #define _PR_HAVE_GETPROTO_R_POINTER
+ #endif
+--
+1.9.1
+
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH] libnspr: fix link error with musl toolchains
2016-01-05 23:48 [Buildroot] [PATCH] libnspr: fix link error with musl toolchains Sergio Prado
@ 2016-01-24 15:46 ` Bernd Kuhls
2016-01-27 22:59 ` Thomas Petazzoni
1 sibling, 0 replies; 3+ messages in thread
From: Bernd Kuhls @ 2016-01-24 15:46 UTC (permalink / raw)
To: buildroot
Am Tue, 05 Jan 2016 21:48:36 -0200 schrieb Sergio Prado:
> +Patch backported from Alpine Linux commit
> +a162da839db0d3f8be94a5c1ad2e2e54e691c38a.
> +
> +Signed-off-by: Sergio Prado
> <sergio.prado@e-labworks.com>
> +---
> + nspr/pr/src/misc/prnetdb.c | 5 +----
> + 1 file changed, 1 insertion(+), 4 deletions(-)
Hi,
Tested-by: Bernd Kuhls <bernd.kuhls@t-online.de>
(compile-tested only using http://autobuild.buildroot.net/
results/6fb/6fbe96af007803acfe9deacf26399cb19e5f2b47/defconfig )
Regards, Bernd
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH] libnspr: fix link error with musl toolchains
2016-01-05 23:48 [Buildroot] [PATCH] libnspr: fix link error with musl toolchains Sergio Prado
2016-01-24 15:46 ` Bernd Kuhls
@ 2016-01-27 22:59 ` Thomas Petazzoni
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2016-01-27 22:59 UTC (permalink / raw)
To: buildroot
Dear Sergio Prado,
On Tue, 5 Jan 2016 21:48:36 -0200, Sergio Prado wrote:
> When linking against libnspr with musl toolchains we get undefined
> references to `getprotobyname_r' and `getprotobynumber_r', for example
> when compiling libnss:
>
> /home/test/autobuild/instance-1/output/host/usr/arm-buildroot-linux-musleabihf/sysroot/usr/lib/libnspr4.so:
> undefined reference to `getprotobyname_r'
> /home/test/autobuild/instance-1/output/host/usr/arm-buildroot-linux-musleabihf/sysroot/usr/lib/libnspr4.so:
> undefined reference to `getprotobynumber_r'
>
> That's because musl does not have an implementation of these functions,
> so we need to enable their internal implementation from libnspr.
>
> This patch was backported from Alpine Linux commit
> a162da839db0d3f8be94a5c1ad2e2e54e691c38a.
>
> Fixes:
> http://autobuild.buildroot.net/results/6052538d10779a21ac242d61bb43a371497ec684/
> http://autobuild.buildroot.net/results/d62ea7dbe68188d073b4f176e6a354e95a8bab97/
> http://autobuild.buildroot.net/results/ae50521c485371cd59bc4ee7e8f323169c7d513d/
> ...
>
> Signed-off-by: Sergio Prado <sergio.prado@e-labworks.com>
> ---
> ...able-internal-getproto-functions-for-musl.patch | 35 ++++++++++++++++++++++
> 1 file changed, 35 insertions(+)
> create mode 100644 package/libnspr/0003-enable-internal-getproto-functions-for-musl.patch
Applied, thanks.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-01-27 22:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-05 23:48 [Buildroot] [PATCH] libnspr: fix link error with musl toolchains Sergio Prado
2016-01-24 15:46 ` Bernd Kuhls
2016-01-27 22:59 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox