[Bug ld/20675] [metag] internal error cross-compiling static programs

2016-11-18 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=20675

Nick Clifton  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #8 from Nick Clifton  ---
Patch applied.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/20675] [metag] internal error cross-compiling static programs

2016-11-18 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=20675

--- Comment #7 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by Nick Clifton :

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=6ec49e7c0aeb6d98e379319b565aee2c89388615

commit 6ec49e7c0aeb6d98e379319b565aee2c89388615
Author: Nick Clifton 
Date:   Fri Nov 18 09:27:41 2016 +

Help diagnose problems with the metag target when mixing static and shared
binaries.

PR ld/20675
* elf32-metag.c (elf_metag_relocate_section): Replace abort with
an informative error message.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/20675] [metag] internal error cross-compiling static programs

2016-11-17 Thread wbx at openadk dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=20675

--- Comment #6 from wbx at openadk dot org ---
Thanks Nick for looking into this.
I think the patch is the best we can do for now.
It seems more likely a gcc bug then a uClibc-ng problem.
I can do the static toolchain test builds for all other uClibc-ng supported
architectures without a problem. Unfortunately gcc support never made it into
upstream for META, so I will just disable static testing for META on my site.

Patch is fine for me and way more useful then an abort.

Thanks
 Waldemar

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/20675] [metag] internal error cross-compiling static programs

2016-11-14 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=20675

--- Comment #5 from Nick Clifton  ---
Created attachment 9629
  --> https://sourceware.org/bugzilla/attachment.cgi?id=9629&action=edit
Proposed patch

Hi Wbx,

  Thanks very much.  I can now reproduce the problem, although I am not sure
now it should be resolved.  At issue is the fact that the libc.a library
contains relocations that set up entries in the PLT, but the PLT is only used
when creating a dynamic executable, not a static one.  You are linking with
"-static" specified on the command line, so clearly the intent is to create a
static executable.

  There is a bug in the linker, in that it should have produced an informative
error message and then exited with a non-zero return code, rather than calling
abort.  But I do not think that the linker is doing anything fundamentally
wrong.  You are asking it to create a static executable, but giving it shared
libraries to link.  The real bug, IMHO, is the creation of what appears to be a
static library - libc.a - but which actually contains shared library code.

  The uploaded patch will fix the linker, so that an error message like this is
displayed:

  ld:./libc.a(herrno.os)(.text): shared library symbol _h_errno encountered
whilst performing a static link
  ld: final link failed: Nonrepresentable section on output

If you are happy with this change then I will check it in.  I am not sure
however what should be done about libc.a.  I think that you need to investigate
how it was created in the first place.

Cheers
  Nick

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/20675] [metag] internal error cross-compiling static programs

2016-11-13 Thread wbx at openadk dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=20675

--- Comment #4 from wbx at openadk dot org ---
Files uploaded.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/20675] [metag] internal error cross-compiling static programs

2016-11-11 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=20675

--- Comment #3 from Nick Clifton  ---
Hi wbx,

  Thanks.  Please could you upload the following files as well ?

  crtbegin.o
  crtend.o
  libgcc.a
  libc.a

Cheers
  Nick

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/20675] [metag] internal error cross-compiling static programs

2016-10-15 Thread wbx at openadk dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=20675

--- Comment #2 from wbx at openadk dot org ---
See http://debug.openadk.org/metag for the c file and the object file produced.
In lib is the static uClibc-ng library files.

The Link command I use:
/home/wbx/metag/toolchain_qemu-metag_uclibc-ng/usr/bin/metag-openadk-linux-uclibc-gcc
-Wl,-EL -Wl,-z,now -Wl,-static -static-libgcc
-Wl,-rpath,/home/wbx/metag/toolchain_build_qemu-metag_uclibc-ng/w-uClibc-ng-1.0.18-1/uClibc-ng-1.0.18/test/termios
-L/home/wbx/metag/target_qemu-metag_uclibc-ng/lib
-L/home/wbx/metag/target_qemu-metag_uclibc-ng/usr/lib -Wl,-O1 -Wl,-rpath
-Wl,/usr/lib -Wl,-rpath-link
-Wl,/home/wbx/metag/target_qemu-metag_uclibc-ng/usr/lib -static termios.o -o
terms -Wl,-v

Output:
collect2 version 4.2.4 (IMG-1.4.0.300) (Metag Linux GNU)
/home/wbx/metag/toolchain_qemu-metag_uclibc-ng/usr/lib/gcc/metag-openadk-linux-uclibc/4.2.4/../../../../metag-openadk-linux-uclibc/bin/ld
-m elf32metag -init=__init -fini=__fini -static -o termios
/home/wbx/metag/toolchain_qemu-metag_uclibc-ng/usr/lib/gcc/metag-openadk-linux-uclibc/4.2.4/../../../../metag-openadk-linux-uclibc/lib/crt1.o
/home/wbx/metag/toolchain_qemu-metag_uclibc-ng/usr/lib/gcc/metag-openadk-linux-uclibc/4.2.4/../../../../metag-openadk-linux-uclibc/lib/crti.o
/home/wbx/metag/toolchain_qemu-metag_uclibc-ng/usr/lib/gcc/metag-openadk-linux-uclibc/4.2.4/crtbegin.o
-L/home/wbx/metag/target_qemu-metag_uclibc-ng/lib
-L/home/wbx/metag/target_qemu-metag_uclibc-ng/usr/lib
-L/home/wbx/metag/toolchain_qemu-metag_uclibc-ng/usr/lib/gcc/metag-openadk-linux-uclibc/4.2.4
-L/home/wbx/metag/toolchain_qemu-metag_uclibc-ng/usr/lib/gcc/metag-openadk-linux-uclibc/4.2.4/../../../../metag-openadk-linux-uclibc/lib
-EL -z now -static -rpath
/home/wbx/metag/toolchain_build_qemu-metag_uclibc-ng/w-uClibc-ng-1.0.18-1/uClibc-ng-1.0.18/test/termios
-O1 -rpath /usr/lib -rpath-link
/home/wbx/metag/target_qemu-metag_uclibc-ng/usr/lib termios.o -v --start-group
-lgcc -lc --end-group
/home/wbx/metag/toolchain_qemu-metag_uclibc-ng/usr/lib/gcc/metag-openadk-linux-uclibc/4.2.4/crtend.o
/home/wbx/metag/toolchain_qemu-metag_uclibc-ng/usr/lib/gcc/metag-openadk-linux-uclibc/4.2.4/../../../../metag-openadk-linux-uclibc/lib/crtn.o
GNU ld (GNU Binutils) 2.27.51.20161015
/home/wbx/metag/toolchain_qemu-metag_uclibc-ng/usr/lib/gcc/metag-openadk-linux-uclibc/4.2.4/../../../../metag-openadk-linux-uclibc/bin/ld:
BFD (GNU Binutils) 2.27.51.20161015 internal error, aborting at
elf32-metag.c:1881 in elf_metag_relocate_section

/home/wbx/metag/toolchain_qemu-metag_uclibc-ng/usr/lib/gcc/metag-openadk-linux-uclibc/4.2.4/../../../../metag-openadk-linux-uclibc/bin/ld:
Please report this bug.

collect2: ld returned 1 exit status

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/20675] [metag] internal error cross-compiling static programs

2016-10-14 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=20675

Nick Clifton  changed:

   What|Removed |Added

 CC||nickc at redhat dot com

--- Comment #1 from Nick Clifton  ---
Hi wbx,

  Would it be possible for you to upload the testcase here so that we can
attempt to reproduce it ?  Preferably including the termios.o object file, so
that we do not need a compiler, and the full linker command line.  If target
libraries are needed as well, then including them would be really helpful too.

Cheers
  Nick

PS.  The abort that is triggering this failure is accompanied by this comment:

/* We don't support changing the TLS model.  */

So it might be that the test case is attempting to do something that is just
not supported by the linker.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/20675] [metag] internal error cross-compiling static programs

2016-10-09 Thread wbx at openadk dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=20675

wbx at openadk dot org changed:

   What|Removed |Added

 Target||metag-openadk-linux-uclibc
   Host||x86_64-linux-gnu
  Build||x86_64-linux-gnu

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils