mailing list of musl libc
 help / color / mirror / code / Atom feed
* musl 1.1.16 build failure on armhf
@ 2017-01-04 20:51 Reiner Herrmann
  2017-01-04 21:06 ` Rich Felker
  2017-02-04 14:19 ` [PATCH] use .object_arch to declare the architecture of the object file Reiner Herrmann
  0 siblings, 2 replies; 10+ messages in thread
From: Reiner Herrmann @ 2017-01-04 20:51 UTC (permalink / raw)
  To: musl

[-- Attachment #1: Type: text/plain, Size: 1190 bytes --]

Hi,

when trying to build musl on armhf, the build fails with the following
error (gcc 6.3.0), which is also seen on the Debian build servers [0]:

> gcc -std=c99 -nostdinc -ffreestanding -fexcess-precision=standard -frounding-math -Wa,--noexecstack -D_XOPEN_SOURCE=700 -I./arch/arm -I./arch/generic -Iobj/src/internal -I./src/internal -Iobj/include -I./include  -Os -pipe -fomit-frame-pointer -fno-unwind-tables -fno-asynchronous-unwind-tables -ffunction-sections -fdata-sections -Werror=implicit-function-declaration -Werror=implicit-int -Werror=pointer-sign -Werror=pointer-arith -include vis.h -Wa,-mimplicit-it=always -Wa,-mthumb  -fPIC -c -o obj/src/thread/arm/atomics.lo src/thread/arm/atomics.s
> src/thread/arm/atomics.s: Assembler messages:
> src/thread/arm/atomics.s:59: Error: invalid constant (1) after fixup
> src/thread/arm/atomics.s:74: Error: invalid constant (1) after fixup
> Makefile:158: recipe for target 'obj/src/thread/arm/atomics.lo' failed

On other architectures it builds fine.
Does someone know what the issue is?

Kind regards,
  Reiner

(Please keep me in CC)

[0]: https://buildd.debian.org/status/fetch.php?pkg=musl&arch=armhf&ver=1.1.16-1&stamp=1483481970

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

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

* Re: musl 1.1.16 build failure on armhf
  2017-01-04 20:51 musl 1.1.16 build failure on armhf Reiner Herrmann
@ 2017-01-04 21:06 ` Rich Felker
  2017-01-04 21:13   ` Reiner Herrmann
  2017-01-04 21:27   ` Reiner Herrmann
  2017-02-04 14:19 ` [PATCH] use .object_arch to declare the architecture of the object file Reiner Herrmann
  1 sibling, 2 replies; 10+ messages in thread
From: Rich Felker @ 2017-01-04 21:06 UTC (permalink / raw)
  To: Reiner Herrmann; +Cc: musl

On Wed, Jan 04, 2017 at 09:51:24PM +0100, Reiner Herrmann wrote:
> Hi,
> 
> when trying to build musl on armhf, the build fails with the following
> error (gcc 6.3.0), which is also seen on the Debian build servers [0]:

The error is from gas; do you know the binutils version? Also, what
-march is gcc configured for?

> > gcc -std=c99 -nostdinc -ffreestanding -fexcess-precision=standard -frounding-math -Wa,--noexecstack -D_XOPEN_SOURCE=700 -I./arch/arm -I./arch/generic -Iobj/src/internal -I./src/internal -Iobj/include -I./include  -Os -pipe -fomit-frame-pointer -fno-unwind-tables -fno-asynchronous-unwind-tables -ffunction-sections -fdata-sections -Werror=implicit-function-declaration -Werror=implicit-int -Werror=pointer-sign -Werror=pointer-arith -include vis.h -Wa,-mimplicit-it=always -Wa,-mthumb  -fPIC -c -o obj/src/thread/arm/atomics.lo src/thread/arm/atomics.s
> > src/thread/arm/atomics.s: Assembler messages:
> > src/thread/arm/atomics.s:59: Error: invalid constant (1) after fixup
> > src/thread/arm/atomics.s:74: Error: invalid constant (1) after fixup
> > Makefile:158: recipe for target 'obj/src/thread/arm/atomics.lo' failed
> 
> On other architectures it builds fine.
> Does someone know what the issue is?

I don't see why there would be fixups in those lines; they only
contain the immediate constant 1, and I don't see why it would be
invalid.

Rich


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

* Re: musl 1.1.16 build failure on armhf
  2017-01-04 21:06 ` Rich Felker
@ 2017-01-04 21:13   ` Reiner Herrmann
  2017-01-04 21:27   ` Reiner Herrmann
  1 sibling, 0 replies; 10+ messages in thread
From: Reiner Herrmann @ 2017-01-04 21:13 UTC (permalink / raw)
  To: Rich Felker; +Cc: musl

[-- Attachment #1: Type: text/plain, Size: 1716 bytes --]

On Wed, Jan 04, 2017 at 04:06:09PM -0500, Rich Felker wrote:
> The error is from gas; do you know the binutils version? Also, what
> -march is gcc configured for?

binutils is version 2.27.90.20161231, and here are the gcc details:

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/6/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: ../src/configure -v --with-pkgversion='Debian 6.3.0-2' --with-bugurl=file:///usr/share/doc/gcc-6/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-6 --program-prefix=arm-linux-gnueabihf- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libitm --disable-libquadmath --enable-plugin --enable-default-pie --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-6-armhf/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-6-armhf --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-6-armhf --with-arch-directory=arm --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-sjlj-exceptions --with-arch=armv7-a --with-fpu=vfpv3-d16 --with-float=hard --with-mode=thumb --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf
Thread model: posix
gcc version 6.3.0 20161229 (Debian 6.3.0-2) 

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

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

* Re: musl 1.1.16 build failure on armhf
  2017-01-04 21:06 ` Rich Felker
  2017-01-04 21:13   ` Reiner Herrmann
@ 2017-01-04 21:27   ` Reiner Herrmann
  2017-01-04 21:36     ` Rich Felker
  1 sibling, 1 reply; 10+ messages in thread
From: Reiner Herrmann @ 2017-01-04 21:27 UTC (permalink / raw)
  To: Rich Felker; +Cc: musl

[-- Attachment #1: Type: text/plain, Size: 335 bytes --]

On Wed, Jan 04, 2017 at 04:06:09PM -0500, Rich Felker wrote:
> The error is from gas; do you know the binutils version? Also, what
> -march is gcc configured for?

Thanks for the binutils hint. I just tried some older versions, and
found out that it builds fine with binutils 2.27.51.20161102-1, but
no longer with 2.27.51.20161105-1.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

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

* Re: musl 1.1.16 build failure on armhf
  2017-01-04 21:27   ` Reiner Herrmann
@ 2017-01-04 21:36     ` Rich Felker
  2017-01-07 15:19       ` Reiner Herrmann
  0 siblings, 1 reply; 10+ messages in thread
From: Rich Felker @ 2017-01-04 21:36 UTC (permalink / raw)
  To: musl

On Wed, Jan 04, 2017 at 10:27:49PM +0100, Reiner Herrmann wrote:
> On Wed, Jan 04, 2017 at 04:06:09PM -0500, Rich Felker wrote:
> > The error is from gas; do you know the binutils version? Also, what
> > -march is gcc configured for?
> 
> Thanks for the binutils hint. I just tried some older versions, and
> found out that it builds fine with binutils 2.27.51.20161102-1, but
> no longer with 2.27.51.20161105-1.

Can you find the commit that broke it and figure out if it's a
binutils bug or an intentional change we need to find a way to work
with?

Rich


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

* Re: musl 1.1.16 build failure on armhf
  2017-01-04 21:36     ` Rich Felker
@ 2017-01-07 15:19       ` Reiner Herrmann
  2017-01-09 13:02         ` Szabolcs Nagy
  0 siblings, 1 reply; 10+ messages in thread
From: Reiner Herrmann @ 2017-01-07 15:19 UTC (permalink / raw)
  To: Rich Felker; +Cc: musl

[-- Attachment #1: Type: text/plain, Size: 1031 bytes --]

On Wed, Jan 04, 2017 at 04:36:46PM -0500, Rich Felker wrote:
> On Wed, Jan 04, 2017 at 10:27:49PM +0100, Reiner Herrmann wrote:
> > On Wed, Jan 04, 2017 at 04:06:09PM -0500, Rich Felker wrote:
> > > The error is from gas; do you know the binutils version? Also, what
> > > -march is gcc configured for?
> > 
> > Thanks for the binutils hint. I just tried some older versions, and
> > found out that it builds fine with binutils 2.27.51.20161102-1, but
> > no longer with 2.27.51.20161105-1.
> 
> Can you find the commit that broke it and figure out if it's a
> binutils bug or an intentional change we need to find a way to work
> with?

Someone posted the bug also on the binutils mailinglist [0], and found
the commit which broke it [1].
I now built binutils 2.27.51.20161105-1 with this commit reverted, and
was able to build musl.

[0] https://sourceware.org/ml/binutils/2017-01/msg00081.html
[1] https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=bada43421274615d0d5f629a61a60b7daa71bc15

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

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

* Re: musl 1.1.16 build failure on armhf
  2017-01-07 15:19       ` Reiner Herrmann
@ 2017-01-09 13:02         ` Szabolcs Nagy
  0 siblings, 0 replies; 10+ messages in thread
From: Szabolcs Nagy @ 2017-01-09 13:02 UTC (permalink / raw)
  To: musl; +Cc: Rich Felker

* Reiner Herrmann <reiner@reiner-h.de> [2017-01-07 16:19:27 +0100]:
> On Wed, Jan 04, 2017 at 04:36:46PM -0500, Rich Felker wrote:
> > Can you find the commit that broke it and figure out if it's a
> > binutils bug or an intentional change we need to find a way to work
> > with?
> 
> Someone posted the bug also on the binutils mailinglist [0], and found
> the commit which broke it [1].
> I now built binutils 2.27.51.20161105-1 with this commit reverted, and
> was able to build musl.
> 
> [0] https://sourceware.org/ml/binutils/2017-01/msg00081.html
> [1] https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=bada43421274615d0d5f629a61a60b7daa71bc15

the regression was not intentional i think, but that
change fixes a real issue.

.arch foo
	x
.arch bar
	y

assembles x according to arch foo, and y according to
arch bar and the final arch attribute of the object is
bar.

however there is a second fixup pass in arm gas and
that fixes both x and y according to the final object
attribute and that can fail on x (the patch happens to
tighten some checks there)

this may be fixed in gas by considering .arch settings
during the second pass, but it is probably non-trivial
code change (second pass does not have the context of
the original code now)

on the musl side a possible workaround is to use the
.object_arch directive which only affects the final
arch attribute, but not the second pass.
(but it has to be evaluated on all the different
toolchains and assemblers to do the right thing..)



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

* [PATCH] use .object_arch to declare the architecture of the object file
  2017-01-04 20:51 musl 1.1.16 build failure on armhf Reiner Herrmann
  2017-01-04 21:06 ` Rich Felker
@ 2017-02-04 14:19 ` Reiner Herrmann
  2017-02-05 23:40   ` Rich Felker
  1 sibling, 1 reply; 10+ messages in thread
From: Reiner Herrmann @ 2017-02-04 14:19 UTC (permalink / raw)
  To: musl

musl fails to build for arm with current binutils (since commit bada434).
Szabolcs Nagy suggested to use .object_arch for declaring the architecture
of the object file, instead of .arch.

See also: https://sourceware.org/ml/binutils/2006-09/msg00054.html
---
 src/thread/arm/atomics.s | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/thread/arm/atomics.s b/src/thread/arm/atomics.s
index 202faa4a..101ad391 100644
--- a/src/thread/arm/atomics.s
+++ b/src/thread/arm/atomics.s
@@ -84,7 +84,7 @@ __a_gettp_cp15:
 	bx lr
 
 /* Tag this file with minimum ISA level so as not to affect linking. */
-.arch armv4t
+.object_arch armv4t
 .eabi_attribute 6,2
 
 .data
-- 
2.11.0



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

* Re: [PATCH] use .object_arch to declare the architecture of the object file
  2017-02-04 14:19 ` [PATCH] use .object_arch to declare the architecture of the object file Reiner Herrmann
@ 2017-02-05 23:40   ` Rich Felker
  2017-02-06 10:21     ` Szabolcs Nagy
  0 siblings, 1 reply; 10+ messages in thread
From: Rich Felker @ 2017-02-05 23:40 UTC (permalink / raw)
  To: musl

On Sat, Feb 04, 2017 at 03:19:47PM +0100, Reiner Herrmann wrote:
> musl fails to build for arm with current binutils (since commit bada434).
> Szabolcs Nagy suggested to use .object_arch for declaring the architecture
> of the object file, instead of .arch.
> 
> See also: https://sourceware.org/ml/binutils/2006-09/msg00054.html
> ---
>  src/thread/arm/atomics.s | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/thread/arm/atomics.s b/src/thread/arm/atomics.s
> index 202faa4a..101ad391 100644
> --- a/src/thread/arm/atomics.s
> +++ b/src/thread/arm/atomics.s
> @@ -84,7 +84,7 @@ __a_gettp_cp15:
>  	bx lr
>  
>  /* Tag this file with minimum ISA level so as not to affect linking. */
> -.arch armv4t
> +.object_arch armv4t
>  .eabi_attribute 6,2

What's the earliest version of binutils that supports this? If it's a
newish feature we can't just unconditionally switch... (ARM is
infamous for that kind of breakage...) But if it's been around for a
really long time (long enough that older binutils versions are
seriously broken) it doesn't matter.

Rich


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

* Re: [PATCH] use .object_arch to declare the architecture of the object file
  2017-02-05 23:40   ` Rich Felker
@ 2017-02-06 10:21     ` Szabolcs Nagy
  0 siblings, 0 replies; 10+ messages in thread
From: Szabolcs Nagy @ 2017-02-06 10:21 UTC (permalink / raw)
  To: musl

* Rich Felker <dalias@libc.org> [2017-02-05 18:40:47 -0500]:
> On Sat, Feb 04, 2017 at 03:19:47PM +0100, Reiner Herrmann wrote:
> > musl fails to build for arm with current binutils (since commit bada434).
> > Szabolcs Nagy suggested to use .object_arch for declaring the architecture
> > of the object file, instead of .arch.
> > 
> > See also: https://sourceware.org/ml/binutils/2006-09/msg00054.html
> > ---
> >  src/thread/arm/atomics.s | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/src/thread/arm/atomics.s b/src/thread/arm/atomics.s
> > index 202faa4a..101ad391 100644
> > --- a/src/thread/arm/atomics.s
> > +++ b/src/thread/arm/atomics.s
> > @@ -84,7 +84,7 @@ __a_gettp_cp15:
> >  	bx lr
> >  
> >  /* Tag this file with minimum ISA level so as not to affect linking. */
> > -.arch armv4t
> > +.object_arch armv4t
> >  .eabi_attribute 6,2
> 
> What's the earliest version of binutils that supports this? If it's a
> newish feature we can't just unconditionally switch... (ARM is
> infamous for that kind of breakage...) But if it's been around for a
> really long time (long enough that older binutils versions are
> seriously broken) it doesn't matter.

binutils supports it since
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7a1d4c38938b172a8f3fdb38b01551306bd51d8d
and it is present in the last gplv2 binutils source

llvm seems to support it too since
https://github.com/llvm-mirror/llvm/commit/09f38a0ef13bf542f7b3f1862d718e33e7de587b
i think it's in llvm >=3.5


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

end of thread, other threads:[~2017-02-06 10:21 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-04 20:51 musl 1.1.16 build failure on armhf Reiner Herrmann
2017-01-04 21:06 ` Rich Felker
2017-01-04 21:13   ` Reiner Herrmann
2017-01-04 21:27   ` Reiner Herrmann
2017-01-04 21:36     ` Rich Felker
2017-01-07 15:19       ` Reiner Herrmann
2017-01-09 13:02         ` Szabolcs Nagy
2017-02-04 14:19 ` [PATCH] use .object_arch to declare the architecture of the object file Reiner Herrmann
2017-02-05 23:40   ` Rich Felker
2017-02-06 10:21     ` Szabolcs Nagy

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).