Re: mips64[el] for gcc 4.8 (unfinished)

2014-05-09 Thread Pascal Stumpf
On Fri, 09 May 2014 01:22:45 -0400, Brian Callahan wrote:
 
 On 05/08/14 19:39, Tobias Ulmer wrote:
  I've invested some time into adding the mips64(el) backend. It gets
  quite far (xgcc seems to be fine), but then our ld takes a dump:
 
  /usr/bin/ld: not enough GOT space for local GOT entries
  /usr/bin/ld: BFD 2.15 internal error, aborting at 
  /usr/src/gnu/usr.bin/binutils
/bfd/elfxx-mips.c line 6483 in _bfd_mips_elf_relocate_section
 
  /usr/bin/ld: Please report this bug.
 
  Log: http://www.tmux.org/~tobiasu/tmp/gcc48-mips64-build.txt
 
  Others have run into this, and it's possibly fixed in newer binutils,
  but I have not been able to make sense of the BFD guts enough to fix ld.
 
 
  Question is, should I commit this in its current form so others can try
  their luck? I'm pretty sure this patch is 95% there.
 
 Yes, please.
 
 

Seconded.  It's a known bug that's fixed in 2.17, iirc.



Re: mips64[el] for gcc 4.8 (unfinished)

2014-05-09 Thread Brian Callahan


On 05/09/14 14:41, Pascal Stumpf wrote:

On Fri, 09 May 2014 01:22:45 -0400, Brian Callahan wrote:

On 05/08/14 19:39, Tobias Ulmer wrote:

I've invested some time into adding the mips64(el) backend. It gets
quite far (xgcc seems to be fine), but then our ld takes a dump:

/usr/bin/ld: not enough GOT space for local GOT entries
/usr/bin/ld: BFD 2.15 internal error, aborting at /usr/src/gnu/usr.bin/binutils
   /bfd/elfxx-mips.c line 6483 in _bfd_mips_elf_relocate_section

/usr/bin/ld: Please report this bug.

Log: http://www.tmux.org/~tobiasu/tmp/gcc48-mips64-build.txt

Others have run into this, and it's possibly fixed in newer binutils,
but I have not been able to make sense of the BFD guts enough to fix ld.


Question is, should I commit this in its current form so others can try
their luck? I'm pretty sure this patch is 95% there.

Yes, please.



Seconded.  It's a known bug that's fixed in 2.17, iirc.


Yup. I can confirm that.



Re: mips64[el] for gcc 4.8 (unfinished)

2014-05-09 Thread Tobias Ulmer
On Fri, May 09, 2014 at 03:39:50PM -0400, Brian Callahan wrote:
 
 On 05/09/14 14:41, Pascal Stumpf wrote:
 On Fri, 09 May 2014 01:22:45 -0400, Brian Callahan wrote:
 On 05/08/14 19:39, Tobias Ulmer wrote:
 I've invested some time into adding the mips64(el) backend. It gets
 quite far (xgcc seems to be fine), but then our ld takes a dump:
 
 /usr/bin/ld: not enough GOT space for local GOT entries
 /usr/bin/ld: BFD 2.15 internal error, aborting at 
 /usr/src/gnu/usr.bin/binutils
/bfd/elfxx-mips.c line 6483 in _bfd_mips_elf_relocate_section
 
 /usr/bin/ld: Please report this bug.
 
 Log: http://www.tmux.org/~tobiasu/tmp/gcc48-mips64-build.txt
 
 Others have run into this, and it's possibly fixed in newer binutils,
 but I have not been able to make sense of the BFD guts enough to fix ld.
 
 
 Question is, should I commit this in its current form so others can try
 their luck? I'm pretty sure this patch is 95% there.
 Yes, please.
 
 
 Seconded.  It's a known bug that's fixed in 2.17, iirc.
 
 Yup. I can confirm that.

Wait, so did you try this patch? Does it build? mips64 or mips64el?



Re: mips64[el] for gcc 4.8 (unfinished)

2014-05-09 Thread Brian Callahan


On 05/09/14 23:20, Tobias Ulmer wrote:

On Fri, May 09, 2014 at 03:39:50PM -0400, Brian Callahan wrote:

On 05/09/14 14:41, Pascal Stumpf wrote:

On Fri, 09 May 2014 01:22:45 -0400, Brian Callahan wrote:

On 05/08/14 19:39, Tobias Ulmer wrote:

I've invested some time into adding the mips64(el) backend. It gets
quite far (xgcc seems to be fine), but then our ld takes a dump:

/usr/bin/ld: not enough GOT space for local GOT entries
/usr/bin/ld: BFD 2.15 internal error, aborting at /usr/src/gnu/usr.bin/binutils
   /bfd/elfxx-mips.c line 6483 in _bfd_mips_elf_relocate_section

/usr/bin/ld: Please report this bug.

Log: http://www.tmux.org/~tobiasu/tmp/gcc48-mips64-build.txt

Others have run into this, and it's possibly fixed in newer binutils,
but I have not been able to make sense of the BFD guts enough to fix ld.


Question is, should I commit this in its current form so others can try
their luck? I'm pretty sure this patch is 95% there.

Yes, please.



Seconded.  It's a known bug that's fixed in 2.17, iirc.

Yup. I can confirm that.

Wait, so did you try this patch? Does it build? mips64 or mips64el?



I'm just confirming that the ld error is fixed with binutils-2.17: it's 
the exact same error as gcc-4.6 and I did have a built 
gcc-4.6/binutils-2.17 combo on loongson. No reason to suspect that 
gcc-4.8 won't build with binutils-2.17 as well. I don't have the time to 
test gcc-4.8/binutils-2.17 right now but I will if people really want.




Re: mips64[el] for gcc 4.8 (unfinished)

2014-05-09 Thread Tobias Ulmer
On Fri, May 09, 2014 at 11:24:34PM -0400, Brian Callahan wrote:
 
 On 05/09/14 23:20, Tobias Ulmer wrote:
 On Fri, May 09, 2014 at 03:39:50PM -0400, Brian Callahan wrote:
 On 05/09/14 14:41, Pascal Stumpf wrote:
 On Fri, 09 May 2014 01:22:45 -0400, Brian Callahan wrote:
 On 05/08/14 19:39, Tobias Ulmer wrote:
 I've invested some time into adding the mips64(el) backend. It gets
 quite far (xgcc seems to be fine), but then our ld takes a dump:
 
 /usr/bin/ld: not enough GOT space for local GOT entries
 /usr/bin/ld: BFD 2.15 internal error, aborting at 
 /usr/src/gnu/usr.bin/binutils
/bfd/elfxx-mips.c line 6483 in _bfd_mips_elf_relocate_section
 
 /usr/bin/ld: Please report this bug.
 
 Log: http://www.tmux.org/~tobiasu/tmp/gcc48-mips64-build.txt
 
 Others have run into this, and it's possibly fixed in newer binutils,
 but I have not been able to make sense of the BFD guts enough to fix ld.
 
 
 Question is, should I commit this in its current form so others can try
 their luck? I'm pretty sure this patch is 95% there.
 Yes, please.
 
 
 Seconded.  It's a known bug that's fixed in 2.17, iirc.
 Yup. I can confirm that.
 Wait, so did you try this patch? Does it build? mips64 or mips64el?
 
 
 I'm just confirming that the ld error is fixed with binutils-2.17:
 it's the exact same error as gcc-4.6 and I did have a built
 gcc-4.6/binutils-2.17 combo on loongson. No reason to suspect that
 gcc-4.8 won't build with binutils-2.17 as well. I don't have the
 time to test gcc-4.8/binutils-2.17 right now but I will if people
 really want.

Thanks, I'll try that myself for now :)



mips64[el] for gcc 4.8 (unfinished)

2014-05-08 Thread Tobias Ulmer
I've invested some time into adding the mips64(el) backend. It gets
quite far (xgcc seems to be fine), but then our ld takes a dump:

/usr/bin/ld: not enough GOT space for local GOT entries
/usr/bin/ld: BFD 2.15 internal error, aborting at /usr/src/gnu/usr.bin/binutils
 /bfd/elfxx-mips.c line 6483 in _bfd_mips_elf_relocate_section

/usr/bin/ld: Please report this bug.

Log: http://www.tmux.org/~tobiasu/tmp/gcc48-mips64-build.txt

Others have run into this, and it's possibly fixed in newer binutils,
but I have not been able to make sense of the BFD guts enough to fix ld.


Question is, should I commit this in its current form so others can try
their luck? I'm pretty sure this patch is 95% there.


Untested on mips64el, but I don't expect wonders...

diff --git a/lang/gcc/4.8/Makefile b/lang/gcc/4.8/Makefile
index b528088..2b6fb4a 100644
--- a/lang/gcc/4.8/Makefile
+++ b/lang/gcc/4.8/Makefile
@@ -1,6 +1,9 @@
 # $OpenBSD: Makefile,v 1.33 2014/03/30 19:30:28 naddy Exp $
 
-ONLY_FOR_ARCHS = alpha amd64 i386 powerpc sparc64
+BROKEN-mips64 = ld: not enough GOT space for local GOT entries
+BROKEN-mips64el = ld: not enough GOT space for local GOT entries
+
+ONLY_FOR_ARCHS = alpha amd64 i386 powerpc sparc64 mips64 mips64el
 DPB_PROPERTIES = parallel
 
 V = 4.8.2
diff --git a/lang/gcc/4.8/patches/patch-gcc_config_gcc 
b/lang/gcc/4.8/patches/patch-gcc_config_gcc
index 310e4a4..50ad33a 100644
--- a/lang/gcc/4.8/patches/patch-gcc_config_gcc
+++ b/lang/gcc/4.8/patches/patch-gcc_config_gcc
@@ -1,6 +1,6 @@
 $OpenBSD: patch-gcc_config_gcc,v 1.5 2014/03/23 17:30:19 pascal Exp $
 --- gcc/config.gcc.origThu Oct  3 02:47:24 2013
-+++ gcc/config.gcc Sun Mar 23 18:03:05 2014
 gcc/config.gcc Mon May  5 18:39:28 2014
 @@ -712,6 +712,14 @@ case ${target} in
default_use_cxa_atexit=yes
;;
@@ -49,7 +49,26 @@ $OpenBSD: patch-gcc_config_gcc,v 1.5 2014/03/23 17:30:19 
pascal Exp $
tm_file=${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h
tm_file=${tm_file} openbsd.h openbsd-stdint.h openbsd-libpthread.h 
i386/x86-64.h i386/openbsdelf.h
extra_options=${extra_options} openbsd.opt
-@@ -1973,11 +1984,12 @@ picochip-*)
+@@ -1787,6 +1798,18 @@ mips*-*-netbsd*)# NetBSD/mips, 
either endian.
+   tm_file=elfos.h ${tm_file} mips/elf.h netbsd.h netbsd-elf.h 
mips/netbsd.h
+   extra_options=${extra_options} netbsd.opt netbsd-elf.opt
+   ;;
++mips64-*-openbsd*)
++  set
++  tm_file=dbxelf.h elfos.h openbsd.h mips/mips.h mips/openbsd.h 
openbsd-libpthread.h
++  tm_defines=MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_64
++  extra_options=${extra_options} openbsd.opt
++  ;;
++mips64el-*-openbsd*)
++  set
++  tm_file=dbxelf.h elfos.h openbsd.h mips/mips.h mips/openbsd.h 
openbsd-libpthread.h
++  tm_defines=MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_64 
TARGET_ENDIAN_DEFAULT=0
++  extra_options=${extra_options} openbsd.opt
++  ;;
+ mips*-mti-linux*)
+   tm_file=dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ${tm_file} 
mips/gnu-user.h mips/gnu-user64.h mips/linux64.h mips/linux-common.h 
mips/mti-linux.h
+   tmake_file=${tmake_file} mips/t-mti-linux
+@@ -1973,11 +1996,12 @@ picochip-*)
use_gcc_stdint=wrap
tmake_file=picochip/t-picochip t-pnt16-warn
  ;;
@@ -67,7 +86,7 @@ $OpenBSD: patch-gcc_config_gcc,v 1.5 2014/03/23 17:30:19 
pascal Exp $
  powerpc-*-darwin*)
extra_options=${extra_options} rs6000/darwin.opt
case ${target} in
-@@ -2524,6 +2536,7 @@ sparc64-*-netbsd*)
+@@ -2524,6 +2548,7 @@ sparc64-*-netbsd*)
tmake_file=${tmake_file} sparc/t-sparc sparc/t-netbsd64
;;
  sparc64-*-openbsd*)
@@ -75,7 +94,7 @@ $OpenBSD: patch-gcc_config_gcc,v 1.5 2014/03/23 17:30:19 
pascal Exp $
tm_file=sparc/openbsd1-64.h ${tm_file} dbxelf.h elfos.h sparc/sysv4.h 
sparc/sp64-elf.h
tm_file=${tm_file} openbsd.h openbsd-stdint.h openbsd-libpthread.h 
sparc/openbsd64.h
extra_options=${extra_options} openbsd.opt
-@@ -2710,6 +2723,12 @@ case ${target} in
+@@ -2710,6 +2735,12 @@ case ${target} in
  else
arch=i386
  fi
diff --git a/lang/gcc/4.8/patches/patch-gcc_config_mips_mips_h 
b/lang/gcc/4.8/patches/patch-gcc_config_mips_mips_h
new file mode 100644
index 000..2a0c7d7
--- /dev/null
+++ b/lang/gcc/4.8/patches/patch-gcc_config_mips_mips_h
@@ -0,0 +1,13 @@
+$OpenBSD$
+--- gcc/config/mips/mips.h.origFri May  2 13:26:58 2014
 gcc/config/mips/mips.h Fri May  2 13:27:20 2014
+@@ -1175,7 +1175,9 @@ struct mips_cpu_info {
+ #define SUBTARGET_CPP_SPEC 
+ #endif
+ 
++#ifndef CPP_SPEC
+ #define CPP_SPEC %(subtarget_cpp_spec)
++#endif
+ 
+ /* This macro defines names of additional specifications to put in the specs
+that can be used in various specifications like CC1_SPEC.  Its definition
diff --git a/lang/gcc/4.8/patches/patch-gcc_config_mips_openbsd_h 
b/lang/gcc/4.8/patches/patch-gcc_config_mips_openbsd_h
new file mode 100644
index 

Re: mips64[el] for gcc 4.8 (unfinished)

2014-05-08 Thread Stuart Henderson
On 2014/05/09 01:39, Tobias Ulmer wrote:
 I've invested some time into adding the mips64(el) backend. It gets
 quite far (xgcc seems to be fine), but then our ld takes a dump:
 
 /usr/bin/ld: not enough GOT space for local GOT entries
 /usr/bin/ld: BFD 2.15 internal error, aborting at 
 /usr/src/gnu/usr.bin/binutils
  /bfd/elfxx-mips.c line 6483 in _bfd_mips_elf_relocate_section
 
 /usr/bin/ld: Please report this bug.
 
 Log: http://www.tmux.org/~tobiasu/tmp/gcc48-mips64-build.txt
 
 Others have run into this, and it's possibly fixed in newer binutils,
 but I have not been able to make sense of the BFD guts enough to fix ld.
 
 
 Question is, should I commit this in its current form so others can try
 their luck? I'm pretty sure this patch is 95% there.

Yes, I think so.



Re: mips64[el] for gcc 4.8 (unfinished)

2014-05-08 Thread Brad Smith

On 08/05/14 7:39 PM, Tobias Ulmer wrote:

I've invested some time into adding the mips64(el) backend. It gets
quite far (xgcc seems to be fine), but then our ld takes a dump:

/usr/bin/ld: not enough GOT space for local GOT entries
/usr/bin/ld: BFD 2.15 internal error, aborting at /usr/src/gnu/usr.bin/binutils
  /bfd/elfxx-mips.c line 6483 in _bfd_mips_elf_relocate_section

/usr/bin/ld: Please report this bug.

Log: http://www.tmux.org/~tobiasu/tmp/gcc48-mips64-build.txt

Others have run into this, and it's possibly fixed in newer binutils,
but I have not been able to make sense of the BFD guts enough to fix ld.


Question is, should I commit this in its current form so others can try
their luck? I'm pretty sure this patch is 95% there.


IMO better than nothing and its a good start. Anyone else that might
want to help out I'm sure would find it useful. Fine with me.


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



Re: mips64[el] for gcc 4.8 (unfinished)

2014-05-08 Thread Brian Callahan


On 05/08/14 19:39, Tobias Ulmer wrote:

I've invested some time into adding the mips64(el) backend. It gets
quite far (xgcc seems to be fine), but then our ld takes a dump:

/usr/bin/ld: not enough GOT space for local GOT entries
/usr/bin/ld: BFD 2.15 internal error, aborting at /usr/src/gnu/usr.bin/binutils
  /bfd/elfxx-mips.c line 6483 in _bfd_mips_elf_relocate_section

/usr/bin/ld: Please report this bug.

Log: http://www.tmux.org/~tobiasu/tmp/gcc48-mips64-build.txt

Others have run into this, and it's possibly fixed in newer binutils,
but I have not been able to make sense of the BFD guts enough to fix ld.


Question is, should I commit this in its current form so others can try
their luck? I'm pretty sure this patch is 95% there.


Yes, please.