libm uses copysign() and copysignf() internally, but fails to declare
the amd64 assembly versions that way. When built with clang, this
results in undefined references to _libm_copysign etc.
Presumably gcc replaces those calls to copysign with a builtin, but
clang doesn't.
Index: arch/amd64/s_copysign.S
===================================================================
RCS file: /cvs/src/lib/libm/arch/amd64/s_copysign.S,v
retrieving revision 1.5
diff -u -p -r1.5 s_copysign.S
--- arch/amd64/s_copysign.S 12 Sep 2016 19:47:01 -0000 1.5
+++ arch/amd64/s_copysign.S 21 Dec 2016 11:46:53 -0000
@@ -6,6 +6,8 @@
#include <machine/asm.h>
+#include "abi.h"
+
.Lpos:
.quad 0x8000000000000000
.Lneg:
@@ -18,4 +20,4 @@ ENTRY(copysign)
pand %xmm3,%xmm0
por %xmm1,%xmm0
ret
-END(copysign)
+END_STD(copysign)
Index: arch/amd64/s_copysignf.S
===================================================================
RCS file: /cvs/src/lib/libm/arch/amd64/s_copysignf.S,v
retrieving revision 1.5
diff -u -p -r1.5 s_copysignf.S
--- arch/amd64/s_copysignf.S 12 Sep 2016 19:47:01 -0000 1.5
+++ arch/amd64/s_copysignf.S 21 Dec 2016 11:48:56 -0000
@@ -6,6 +6,8 @@
#include <machine/asm.h>
+#include "abi.h"
+
.Lneg:
.long 0x7fffffff
.Lpos:
@@ -18,4 +20,4 @@ ENTRY(copysignf)
pand %xmm3,%xmm0
por %xmm1,%xmm0
ret
-END(copysignf)
+END_STD(copysignf)
--
Christian "naddy" Weisgerber [email protected]