All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/iputils: patch ping to link against libm
@ 2016-02-15 13:00 Martin Bark
  2016-02-15 22:17 ` Thomas Petazzoni
  2016-02-20 14:51 ` Thomas Petazzoni
  0 siblings, 2 replies; 10+ messages in thread
From: Martin Bark @ 2016-02-15 13:00 UTC (permalink / raw)
  To: buildroot

ping fails to compile with uClibc based toolchains with the error

undefined reference to `__finite'

Add a patch to link ping against libm to resolve the math library function
finite().

Note, this error is not seen with glibc based toolchains because finite
seems to be resolved in both libm and libc.

Fixes:
http://autobuild.buildroot.net/results/08f7386f75c881bc582b338824f8ccd509b2921e/
http://autobuild.buildroot.net/results/5aeef61fbd399dd78dc72b9e7cce978e6f1f58b4/

A pull request has been sent to fix this issue upstream, see
https://github.com/iputils/iputils/pull/42

Signed-off-by: Martin Bark <martin@barkynet.com>
---
 package/iputils/0001-ping-link-against-libm.patch | 29 +++++++++++++++++++++++
 1 file changed, 29 insertions(+)
 create mode 100644 package/iputils/0001-ping-link-against-libm.patch

diff --git a/package/iputils/0001-ping-link-against-libm.patch b/package/iputils/0001-ping-link-against-libm.patch
new file mode 100644
index 0000000..d151c5b
--- /dev/null
+++ b/package/iputils/0001-ping-link-against-libm.patch
@@ -0,0 +1,29 @@
+From 8d189e73e660a637ae3f5a604448103ea42e397d Mon Sep 17 00:00:00 2001
+From: Martin Bark <martin@barkynet.com>
+Date: Fri, 12 Feb 2016 16:52:19 +0000
+Subject: [PATCH] ping: link against libm
+
+This commit links ping against libm because ping.c calls the math library
+function finite().
+
+Signed-off-by: Martin Bark <martin@barkynet.com>
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 8b37c42..fb80f6f 100644
+--- a/Makefile
++++ b/Makefile
+@@ -156,7 +156,7 @@ LIB_clockdiff = $(LIB_CAP)
+ DEF_ping_common = $(DEF_CAP) $(DEF_IDN)
+ DEF_ping6_common = $(DEF_CAP) $(DEF_IDN)
+ DEF_ping  = $(DEF_CAP) $(DEF_IDN) $(DEF_WITHOUT_IFADDRS)
+-LIB_ping  = $(LIB_CAP) $(LIB_IDN) $(LIB_RESOLV)
++LIB_ping  = $(LIB_CAP) $(LIB_IDN) $(LIB_RESOLV) -lm
+ 
+ ping: ping_common.o ping6_common.o
+ ping.o ping_common.o ping6_common.o: ping.h in6_flowlabel.h
+-- 
+2.7.0
+
-- 
2.7.0

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

* [Buildroot] [PATCH 1/1] package/iputils: patch ping to link against libm
  2016-02-15 13:00 [Buildroot] [PATCH 1/1] package/iputils: patch ping to link against libm Martin Bark
@ 2016-02-15 22:17 ` Thomas Petazzoni
  2016-02-16 10:13   ` Martin Bark
  2016-02-16 19:03   ` Waldemar Brodkorb
  2016-02-20 14:51 ` Thomas Petazzoni
  1 sibling, 2 replies; 10+ messages in thread
From: Thomas Petazzoni @ 2016-02-15 22:17 UTC (permalink / raw)
  To: buildroot

Martin,

On Mon, 15 Feb 2016 13:00:06 +0000, Martin Bark wrote:
> ping fails to compile with uClibc based toolchains with the error
> 
> undefined reference to `__finite'
> 
> Add a patch to link ping against libm to resolve the math library function
> finite().
> 
> Note, this error is not seen with glibc based toolchains because finite
> seems to be resolved in both libm and libc.
> 
> Fixes:
> http://autobuild.buildroot.net/results/08f7386f75c881bc582b338824f8ccd509b2921e/
> http://autobuild.buildroot.net/results/5aeef61fbd399dd78dc72b9e7cce978e6f1f58b4/
> 
> A pull request has been sent to fix this issue upstream, see
> https://github.com/iputils/iputils/pull/42
> 
> Signed-off-by: Martin Bark <martin@barkynet.com>

Thanks for working on this issue. However, I am not entirely happy with
the explanation.

Indeed, if you try to build iputils against uClibc, it builds just
fine. It is apparently only when the entire build is done with
BR2_ENABLE_DEBUG=y that the build failure occurs. And your commit log
doesn't explain at all why the problem only occurs when the build is
done with debugging symbols enabled.

I've tried building iputils against uClibc, it works fine. I've tried
building iputils against uClibc with BR2_ENABLE_DEBUG=y (using a
pre-built uClibc toolchain, which isn't built with debugging symbols),
and it works fine. So it seems that it only happens when the entire
build is done with debugging symbols, including uClibc itself.

While linking with -lm might be the correct fix, I am not convinced yet
due the lack of explanation for the root of the problem.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH 1/1] package/iputils: patch ping to link against libm
  2016-02-15 22:17 ` Thomas Petazzoni
@ 2016-02-16 10:13   ` Martin Bark
  2016-02-16 19:03   ` Waldemar Brodkorb
  1 sibling, 0 replies; 10+ messages in thread
From: Martin Bark @ 2016-02-16 10:13 UTC (permalink / raw)
  To: buildroot

Thomas,

On 15 February 2016 at 22:17, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Martin,
>
> On Mon, 15 Feb 2016 13:00:06 +0000, Martin Bark wrote:
>> ping fails to compile with uClibc based toolchains with the error
>>
>> undefined reference to `__finite'
>>
>> Add a patch to link ping against libm to resolve the math library function
>> finite().
>>
>> Note, this error is not seen with glibc based toolchains because finite
>> seems to be resolved in both libm and libc.
>>
>> Fixes:
>> http://autobuild.buildroot.net/results/08f7386f75c881bc582b338824f8ccd509b2921e/
>> http://autobuild.buildroot.net/results/5aeef61fbd399dd78dc72b9e7cce978e6f1f58b4/
>>
>> A pull request has been sent to fix this issue upstream, see
>> https://github.com/iputils/iputils/pull/42
>>
>> Signed-off-by: Martin Bark <martin@barkynet.com>
>
> Thanks for working on this issue. However, I am not entirely happy with
> the explanation.
>
> Indeed, if you try to build iputils against uClibc, it builds just
> fine. It is apparently only when the entire build is done with
> BR2_ENABLE_DEBUG=y that the build failure occurs. And your commit log
> doesn't explain at all why the problem only occurs when the build is
> done with debugging symbols enabled.
>
> I've tried building iputils against uClibc, it works fine. I've tried
> building iputils against uClibc with BR2_ENABLE_DEBUG=y (using a
> pre-built uClibc toolchain, which isn't built with debugging symbols),
> and it works fine. So it seems that it only happens when the entire
> build is done with debugging symbols, including uClibc itself.
>
> While linking with -lm might be the correct fix, I am not convinced yet
> due the lack of explanation for the root of the problem.
>
> Thanks!
>
> Thomas

I missed that BR2_ENABLE_DEBUG=y was part of this.  I still think you
need libm if you use finite but i agree it would be good to understand
further.  I'll do some more investigation.

Thanks

Martin


> --
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com

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

* [Buildroot] [PATCH 1/1] package/iputils: patch ping to link against libm
  2016-02-15 22:17 ` Thomas Petazzoni
  2016-02-16 10:13   ` Martin Bark
@ 2016-02-16 19:03   ` Waldemar Brodkorb
  2016-02-16 19:58     ` Martin Bark
  2016-02-16 20:28     ` Thomas Petazzoni
  1 sibling, 2 replies; 10+ messages in thread
From: Waldemar Brodkorb @ 2016-02-16 19:03 UTC (permalink / raw)
  To: buildroot

Hi,
Thomas Petazzoni wrote,

> Martin,
> 
> On Mon, 15 Feb 2016 13:00:06 +0000, Martin Bark wrote:
> > ping fails to compile with uClibc based toolchains with the error
> > 
> > undefined reference to `__finite'
> > 
> > Add a patch to link ping against libm to resolve the math library function
> > finite().
> > 
> > Note, this error is not seen with glibc based toolchains because finite
> > seems to be resolved in both libm and libc.
> > 
> > Fixes:
> > http://autobuild.buildroot.net/results/08f7386f75c881bc582b338824f8ccd509b2921e/
> > http://autobuild.buildroot.net/results/5aeef61fbd399dd78dc72b9e7cce978e6f1f58b4/
> > 
> > A pull request has been sent to fix this issue upstream, see
> > https://github.com/iputils/iputils/pull/42
> > 
> > Signed-off-by: Martin Bark <martin@barkynet.com>
> 
> Thanks for working on this issue. However, I am not entirely happy with
> the explanation.
> 
> Indeed, if you try to build iputils against uClibc, it builds just
> fine. It is apparently only when the entire build is done with
> BR2_ENABLE_DEBUG=y that the build failure occurs. And your commit log
> doesn't explain at all why the problem only occurs when the build is
> done with debugging symbols enabled.
> 
> I've tried building iputils against uClibc, it works fine. I've tried
> building iputils against uClibc with BR2_ENABLE_DEBUG=y (using a
> pre-built uClibc toolchain, which isn't built with debugging symbols),
> and it works fine. So it seems that it only happens when the entire
> build is done with debugging symbols, including uClibc itself.
> 
> While linking with -lm might be the correct fix, I am not convinced yet
> due the lack of explanation for the root of the problem.

The root of the problem is rather simple. When you use math library
functions you are required to link libm explicitely. I think for
historical reasons. For musl this is no issue as everything is
included in libc.so. In uClibc world you have the choice and could simply
build a system without any math library. 
GNU libc seems to have weak aliases for finitef even in libc.so:
nm output/build/glibc-2.22/build/libc.so|grep finitef                                                                                                      
0002ba9c W finitef
0002ba9c T __finitef
0002ba9c t __GI___finitef

So linking with GNU libc does not fail for iputils even without -lm.

Not sure, I cannot find every libm function, but some. tgamma or
exp10 is not referenced in libc.so.

May be Mike can explain the Glibc behaviour?

The finite macros where added here:
http://cgit.uclibc-ng.org/cgi/cgit/uclibc-ng.git/commit/include/math.h?id=21902b578e96fd6b85b9bcda8a0e929fc844ec51
So 1.0.10 is the first release containing this BSD specific
functions in a usable way.

I think BR2_*DEBUG* option is not related to this error.

best regards
 Waldemar

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

* [Buildroot] [PATCH 1/1] package/iputils: patch ping to link against libm
  2016-02-16 19:03   ` Waldemar Brodkorb
@ 2016-02-16 19:58     ` Martin Bark
  2016-02-16 20:30       ` Thomas Petazzoni
  2016-02-16 20:28     ` Thomas Petazzoni
  1 sibling, 1 reply; 10+ messages in thread
From: Martin Bark @ 2016-02-16 19:58 UTC (permalink / raw)
  To: buildroot

Waldemar,

Yes that is exactly what i found, the gnu libc includes some, but not
all, libm function.

Thomas,

I can't reproduce the issues you see.  I just ran some more tests and
for me iputils fails with undefined reference to `__finite' when built
against uClibc regardless of BR2_ENABLE_DEBUG=y.  I had a defconfig
with only BR2_PACKAGE_IPUTILS=y.

I looked at the autobuild fails for iputils from here
http://autobuild.buildroot.org/?reason=iputils-c8ff6feaf0442f8efd96ccb415770c54f9e84d47
and there are lots of fails without BR2_ENABLE_DEBUG=y

Thanks

Martin

On 16 February 2016 at 19:03, Waldemar Brodkorb <wbx@openadk.org> wrote:
> Hi,
> Thomas Petazzoni wrote,
>
>> Martin,
>>
>> On Mon, 15 Feb 2016 13:00:06 +0000, Martin Bark wrote:
>> > ping fails to compile with uClibc based toolchains with the error
>> >
>> > undefined reference to `__finite'
>> >
>> > Add a patch to link ping against libm to resolve the math library function
>> > finite().
>> >
>> > Note, this error is not seen with glibc based toolchains because finite
>> > seems to be resolved in both libm and libc.
>> >
>> > Fixes:
>> > http://autobuild.buildroot.net/results/08f7386f75c881bc582b338824f8ccd509b2921e/
>> > http://autobuild.buildroot.net/results/5aeef61fbd399dd78dc72b9e7cce978e6f1f58b4/
>> >
>> > A pull request has been sent to fix this issue upstream, see
>> > https://github.com/iputils/iputils/pull/42
>> >
>> > Signed-off-by: Martin Bark <martin@barkynet.com>
>>
>> Thanks for working on this issue. However, I am not entirely happy with
>> the explanation.
>>
>> Indeed, if you try to build iputils against uClibc, it builds just
>> fine. It is apparently only when the entire build is done with
>> BR2_ENABLE_DEBUG=y that the build failure occurs. And your commit log
>> doesn't explain at all why the problem only occurs when the build is
>> done with debugging symbols enabled.
>>
>> I've tried building iputils against uClibc, it works fine. I've tried
>> building iputils against uClibc with BR2_ENABLE_DEBUG=y (using a
>> pre-built uClibc toolchain, which isn't built with debugging symbols),
>> and it works fine. So it seems that it only happens when the entire
>> build is done with debugging symbols, including uClibc itself.
>>
>> While linking with -lm might be the correct fix, I am not convinced yet
>> due the lack of explanation for the root of the problem.
>
> The root of the problem is rather simple. When you use math library
> functions you are required to link libm explicitely. I think for
> historical reasons. For musl this is no issue as everything is
> included in libc.so. In uClibc world you have the choice and could simply
> build a system without any math library.
> GNU libc seems to have weak aliases for finitef even in libc.so:
> nm output/build/glibc-2.22/build/libc.so|grep finitef
> 0002ba9c W finitef
> 0002ba9c T __finitef
> 0002ba9c t __GI___finitef
>
> So linking with GNU libc does not fail for iputils even without -lm.
>
> Not sure, I cannot find every libm function, but some. tgamma or
> exp10 is not referenced in libc.so.
>
> May be Mike can explain the Glibc behaviour?
>
> The finite macros where added here:
> http://cgit.uclibc-ng.org/cgi/cgit/uclibc-ng.git/commit/include/math.h?id=21902b578e96fd6b85b9bcda8a0e929fc844ec51
> So 1.0.10 is the first release containing this BSD specific
> functions in a usable way.
>
> I think BR2_*DEBUG* option is not related to this error.
>
> best regards
>  Waldemar

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

* [Buildroot] [PATCH 1/1] package/iputils: patch ping to link against libm
  2016-02-16 19:03   ` Waldemar Brodkorb
  2016-02-16 19:58     ` Martin Bark
@ 2016-02-16 20:28     ` Thomas Petazzoni
  2016-02-17  0:17       ` Arnout Vandecappelle
  1 sibling, 1 reply; 10+ messages in thread
From: Thomas Petazzoni @ 2016-02-16 20:28 UTC (permalink / raw)
  To: buildroot

Hello,

On Tue, 16 Feb 2016 20:03:29 +0100, Waldemar Brodkorb wrote:

> The root of the problem is rather simple. When you use math library
> functions you are required to link libm explicitely. I think for
> historical reasons. For musl this is no issue as everything is
> included in libc.so. In uClibc world you have the choice and could simply
> build a system without any math library. 
> GNU libc seems to have weak aliases for finitef even in libc.so:
> nm output/build/glibc-2.22/build/libc.so|grep finitef                                                                                                      
> 0002ba9c W finitef
> 0002ba9c T __finitef
> 0002ba9c t __GI___finitef
> 
> So linking with GNU libc does not fail for iputils even without -lm.
> 
> Not sure, I cannot find every libm function, but some. tgamma or
> exp10 is not referenced in libc.so.
> 
> May be Mike can explain the Glibc behaviour?
> 
> The finite macros where added here:
> http://cgit.uclibc-ng.org/cgi/cgit/uclibc-ng.git/commit/include/math.h?id=21902b578e96fd6b85b9bcda8a0e929fc844ec51
> So 1.0.10 is the first release containing this BSD specific
> functions in a usable way.
> 
> I think BR2_*DEBUG* option is not related to this error.

OK, but how do you explain that:

BR2_arm=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/br-arm-full-2015.11-rc1-71-g90d1299.tar.bz2"
BR2_TOOLCHAIN_EXTERNAL_GCC_4_7=y
BR2_TOOLCHAIN_EXTERNAL_HEADERS_3_10=y
BR2_TOOLCHAIN_EXTERNAL_LOCALE=y
# BR2_TOOLCHAIN_EXTERNAL_HAS_THREADS_DEBUG is not set
BR2_TOOLCHAIN_EXTERNAL_INET_RPC=y
BR2_TOOLCHAIN_EXTERNAL_CXX=y
BR2_INIT_NONE=y
BR2_SYSTEM_BIN_SH_NONE=y
# BR2_PACKAGE_BUSYBOX is not set
BR2_PACKAGE_IPUTILS=y
# BR2_TARGET_ROOTFS_TAR is not set

Builds just fine (and uses uClibc 1.0.9) ?

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH 1/1] package/iputils: patch ping to link against libm
  2016-02-16 19:58     ` Martin Bark
@ 2016-02-16 20:30       ` Thomas Petazzoni
  0 siblings, 0 replies; 10+ messages in thread
From: Thomas Petazzoni @ 2016-02-16 20:30 UTC (permalink / raw)
  To: buildroot

Hello,

On Tue, 16 Feb 2016 19:58:13 +0000, Martin Bark wrote:

> I can't reproduce the issues you see.  I just ran some more tests and
> for me iputils fails with undefined reference to `__finite' when built
> against uClibc regardless of BR2_ENABLE_DEBUG=y.  I had a defconfig
> with only BR2_PACKAGE_IPUTILS=y.
> 
> I looked at the autobuild fails for iputils from here
> http://autobuild.buildroot.org/?reason=iputils-c8ff6feaf0442f8efd96ccb415770c54f9e84d47
> and there are lots of fails without BR2_ENABLE_DEBUG=y

All failures occur with the internal toolchain backend, i.e when using
the latest uClibc-ng version. So it seems to me that the failure
started to exist in a recent uClibc-ng version: the pre-built uClibc
toolchains that are based on uClibc-ng 1.0.9 do not exhibit the problem.

> > The finite macros where added here:
> > http://cgit.uclibc-ng.org/cgi/cgit/uclibc-ng.git/commit/include/math.h?id=21902b578e96fd6b85b9bcda8a0e929fc844ec51
> > So 1.0.10 is the first release containing this BSD specific
> > functions in a usable way.

Which would probably match with Waldemar's change in 1.0.10.

Waldemar, can you conrfirm? If those functions are only available
starting in 1.0.10, how can iputils build with 1.0.9 ?

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH 1/1] package/iputils: patch ping to link against libm
  2016-02-16 20:28     ` Thomas Petazzoni
@ 2016-02-17  0:17       ` Arnout Vandecappelle
  2016-02-17  7:56         ` Thomas Petazzoni
  0 siblings, 1 reply; 10+ messages in thread
From: Arnout Vandecappelle @ 2016-02-17  0:17 UTC (permalink / raw)
  To: buildroot

On 16-02-16 21:28, Thomas Petazzoni wrote:
> Hello,
> 
> On Tue, 16 Feb 2016 20:03:29 +0100, Waldemar Brodkorb wrote:
> 
>> The root of the problem is rather simple. When you use math library
>> functions you are required to link libm explicitely. I think for
>> historical reasons. For musl this is no issue as everything is
>> included in libc.so. In uClibc world you have the choice and could simply
>> build a system without any math library. 
>> GNU libc seems to have weak aliases for finitef even in libc.so:
>> nm output/build/glibc-2.22/build/libc.so|grep finitef                                                                                                      
>> 0002ba9c W finitef
>> 0002ba9c T __finitef
>> 0002ba9c t __GI___finitef
>>
>> So linking with GNU libc does not fail for iputils even without -lm.
>>
>> Not sure, I cannot find every libm function, but some. tgamma or
>> exp10 is not referenced in libc.so.
>>
>> May be Mike can explain the Glibc behaviour?
>>
>> The finite macros where added here:
>> http://cgit.uclibc-ng.org/cgi/cgit/uclibc-ng.git/commit/include/math.h?id=21902b578e96fd6b85b9bcda8a0e929fc844ec51
>> So 1.0.10 is the first release containing this BSD specific
>> functions in a usable way.
>>
>> I think BR2_*DEBUG* option is not related to this error.
> 
> OK, but how do you explain that:
> 
> BR2_arm=y
> BR2_TOOLCHAIN_EXTERNAL=y
> BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
> BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
> BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/br-arm-full-2015.11-rc1-71-g90d1299.tar.bz2"
> BR2_TOOLCHAIN_EXTERNAL_GCC_4_7=y
> BR2_TOOLCHAIN_EXTERNAL_HEADERS_3_10=y
> BR2_TOOLCHAIN_EXTERNAL_LOCALE=y
> # BR2_TOOLCHAIN_EXTERNAL_HAS_THREADS_DEBUG is not set
> BR2_TOOLCHAIN_EXTERNAL_INET_RPC=y
> BR2_TOOLCHAIN_EXTERNAL_CXX=y
> BR2_INIT_NONE=y
> BR2_SYSTEM_BIN_SH_NONE=y
> # BR2_PACKAGE_BUSYBOX is not set
> BR2_PACKAGE_IPUTILS=y
> # BR2_TARGET_ROOTFS_TAR is not set
> 
> Builds just fine (and uses uClibc 1.0.9) ?

 I think the difference is in gcc versions. It looks like gcc 4.7 in that
external toolchain uses a built-in inline version of __finite(), while gcc 4.9
just calls the external function. I don't think it has anything to do with the
uClibc version (though I didn't try all combinations). But for sure, it fails
with gcc 4.9 and uClibc 1.0.10 while it succeeds with the same config and gcc 4.7.

 I don't think BR2_ENABLE_DEBUG has anything to do with it, but I didn't test that.

 Anyway, it seems obvious to me that if you use finite(), then you should link
with -lm. There's bound to be some combination of libc and compiler that
requires -lm.

 So, maybe add 'and gcc 4.9' to the commit message, but even without it:

Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

 Regards,
 Arnout


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

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

* [Buildroot] [PATCH 1/1] package/iputils: patch ping to link against libm
  2016-02-17  0:17       ` Arnout Vandecappelle
@ 2016-02-17  7:56         ` Thomas Petazzoni
  0 siblings, 0 replies; 10+ messages in thread
From: Thomas Petazzoni @ 2016-02-17  7:56 UTC (permalink / raw)
  To: buildroot

Hello,

On Wed, 17 Feb 2016 01:17:34 +0100, Arnout Vandecappelle wrote:

>  I think the difference is in gcc versions. It looks like gcc 4.7 in that
> external toolchain uses a built-in inline version of __finite(), while gcc 4.9
> just calls the external function. I don't think it has anything to do with the
> uClibc version (though I didn't try all combinations). But for sure, it fails
> with gcc 4.9 and uClibc 1.0.10 while it succeeds with the same config and gcc 4.7.

Aaah, okay. Makes sense.

>  I don't think BR2_ENABLE_DEBUG has anything to do with it, but I didn't test that.
> 
>  Anyway, it seems obvious to me that if you use finite(), then you should link
> with -lm. There's bound to be some combination of libc and compiler that
> requires -lm.

I fully agree that from the beginning -lm is needed. However, I didn't
like the fact that the build failures were not fully understood.

> Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH 1/1] package/iputils: patch ping to link against libm
  2016-02-15 13:00 [Buildroot] [PATCH 1/1] package/iputils: patch ping to link against libm Martin Bark
  2016-02-15 22:17 ` Thomas Petazzoni
@ 2016-02-20 14:51 ` Thomas Petazzoni
  1 sibling, 0 replies; 10+ messages in thread
From: Thomas Petazzoni @ 2016-02-20 14:51 UTC (permalink / raw)
  To: buildroot

Dear Martin Bark,

On Mon, 15 Feb 2016 13:00:06 +0000, Martin Bark wrote:
> ping fails to compile with uClibc based toolchains with the error
> 
> undefined reference to `__finite'
> 
> Add a patch to link ping against libm to resolve the math library function
> finite().
> 
> Note, this error is not seen with glibc based toolchains because finite
> seems to be resolved in both libm and libc.
> 
> Fixes:
> http://autobuild.buildroot.net/results/08f7386f75c881bc582b338824f8ccd509b2921e/
> http://autobuild.buildroot.net/results/5aeef61fbd399dd78dc72b9e7cce978e6f1f58b4/
> 
> A pull request has been sent to fix this issue upstream, see
> https://github.com/iputils/iputils/pull/42
> 
> Signed-off-by: Martin Bark <martin@barkynet.com>
> ---
>  package/iputils/0001-ping-link-against-libm.patch | 29 +++++++++++++++++++++++
>  1 file changed, 29 insertions(+)
>  create mode 100644 package/iputils/0001-ping-link-against-libm.patch

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

end of thread, other threads:[~2016-02-20 14:51 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-15 13:00 [Buildroot] [PATCH 1/1] package/iputils: patch ping to link against libm Martin Bark
2016-02-15 22:17 ` Thomas Petazzoni
2016-02-16 10:13   ` Martin Bark
2016-02-16 19:03   ` Waldemar Brodkorb
2016-02-16 19:58     ` Martin Bark
2016-02-16 20:30       ` Thomas Petazzoni
2016-02-16 20:28     ` Thomas Petazzoni
2016-02-17  0:17       ` Arnout Vandecappelle
2016-02-17  7:56         ` Thomas Petazzoni
2016-02-20 14:51 ` Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.