[Bug binutils/19311] arm-linux-as build on Mac OS X with Xcode7 fails to assemble code from FreePascal cross-compiler

2016-01-26 Thread Loria at phantasia dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=19311

--- Comment #8 from Loria  ---
I found a LLVM Bug, which seems to be at least correlated with the problem I a
encountered:
https://llvm.org/bugs/show_bug.cgi?id=24688
I will do some more checks, if it really is.

since it is unknown how many times this bug hits the compiler generated, I
would actually like to disable that type of optimization instead of changing
the correct code to circumwent such compiler issue :/ you never know where it
hits again :/

If the following change would help (will test):
encode_arm_immediate (unsigned int val)
{
  unsigned int a, i;

  for (i = 0; i < 32; i += 2)
if ((a = rotate_left (val, i)) <= 0xff)
  return a | (i << 7); /* 12-bit pack: [shift-cnt,const].  */

  return FAIL;
}
changed to:
encode_arm_immediate (unsigned int val)
{
  unsigned int a, i;

  for (i = 0; i < 16; i++)
if ((a = rotate_left (val, i*2)) <= 0xff)
  return a | (i << 8); /* 12-bit pack: [shift-cnt,const].  */

  return FAIL;
}
or using the inline funktion instead of a macro ...
Will test those.

-- 
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 binutils/19311] arm-linux-as build on Mac OS X with Xcode7 fails to assemble code from FreePascal cross-compiler

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

--- Comment #7 from Nick Clifton  ---
Hi Loria,

> Investigation so far shows evidence of some problem with loop optimization
> of the construct used in "encode_arm_immediate"

So this *is* a host compiler bug.  Phew!

> #define rotate_left(v, n) (v << n | v >> (32 - n))
>   for (i = 0; i < 32; i += 2)
> if ((a = rotate_left (val, i)) <= 0xff)
>   return a | (i << 7); /* 12-bit pack: [shift-cnt,const].  */
>   return FAIL;

> I am looking for a way to either add a workaround or set some optimzerflag
> to stop the broken code from beeing submitted.

You could try turning rotate_left into an inline function.

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 gas/19520] New: [2.26 regression] R_386_GOT32X relocation breaks gcc bootstrap with non-gld/gold linker

2016-01-26 Thread ro at TechFak dot Uni-Bielefeld.DE
https://sourceware.org/bugzilla/show_bug.cgi?id=19520

Bug ID: 19520
   Summary: [2.26 regression] R_386_GOT32X relocation breaks gcc
bootstrap with non-gld/gold linker
   Product: binutils
   Version: 2.26
Status: NEW
  Severity: normal
  Priority: P2
 Component: gas
  Assignee: unassigned at sourceware dot org
  Reporter: ro at TechFak dot Uni-Bielefeld.DE
CC: hjl.tools at gmail dot com
  Target Milestone: ---
  Host: i386-pc-solaris2.*
Target: i386-pc-solaris2.*
 Build: i386-pc-solaris2.*

The new R_386_GOT32X reloc introduced in binutils 2.26 break gcc mainline
bootstrap
with gas 2.26 and Solaris ld, which doesn't handle it:

ld: fatal: relocation error: file cpuinfo_s.o: section [5].rel.text.startup:
invalid relocation type: 0x2b

Even if support were introduced, there's guaranteed a large number of older
linkers in the field that continue not to support it, so there needs to be a
way
to disable its generation.

  Rainer

-- 
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 gas/19520] [2.26 regression] R_386_GOT32X relocation breaks gcc bootstrap with non-gld/gold linker

2016-01-26 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=19520

H.J. Lu  changed:

   What|Removed |Added

 Status|NEW |WAITING

--- Comment #1 from H.J. Lu  ---
Please open a Solaris linker request to support R_386_GOT32X,
R_X86_64_GOTPCRELX and R_X86_64_REX_GOTPCRELX.  Then we discuss
how to address it, depending on the response.

-- 
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 gas/19520] [2.26 regression] R_386_GOT32X relocation breaks gcc bootstrap with non-gld/gold linker

2016-01-26 Thread ro at CeBiTec dot Uni-Bielefeld.DE
https://sourceware.org/bugzilla/show_bug.cgi?id=19520

--- Comment #2 from Rainer Orth  ---
> --- Comment #1 from H.J. Lu  ---
> Please open a Solaris linker request to support R_386_GOT32X,
> R_X86_64_GOTPCRELX and R_X86_64_REX_GOTPCRELX.  Then we discuss
> how to address it, depending on the response.

I've started just that (at least for R_386_GOT32X for now), but even if
this were implemented for Solaris 12, this won't help older
installations in the field.  This also needs to be addressed on the
binutils side.

Rainer

-- 
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 gas/19520] [2.26 regression] R_386_GOT32X relocation breaks gcc bootstrap with non-gld/gold linker

2016-01-26 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=19520

--- Comment #3 from H.J. Lu  ---
(In reply to Rainer Orth from comment #2)
> > --- Comment #1 from H.J. Lu  ---
> > Please open a Solaris linker request to support R_386_GOT32X,
> > R_X86_64_GOTPCRELX and R_X86_64_REX_GOTPCRELX.  Then we discuss
> > how to address it, depending on the response.
> 
> I've started just that (at least for R_386_GOT32X for now), but even if
> this were implemented for Solaris 12, this won't help older
> installations in the field.  This also needs to be addressed on the
> binutils side.

Understood.  I still need a response from Solaris.

-- 
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 gas/19520] [2.26 regression] R_386_GOT32X relocation breaks gcc bootstrap with non-gld/gold linker

2016-01-26 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=19520

H.J. Lu  changed:

   What|Removed |Added

 Status|WAITING |NEW

--- Comment #4 from H.J. Lu  ---
Please checkout users/hjl/pr19520/master branch.  I added a
configure-time option, --enable-new-x86-relocations, and a
run-time option, -mnew-relocations=.

-- 
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 binutils/19311] arm-linux-as build on Mac OS X with Xcode7 fails to assemble code from FreePascal cross-compiler

2016-01-26 Thread Loria at phantasia dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=19311

--- Comment #9 from Loria  ---
Well, how related it is with the named bug is unclear, but it seems the unroll
loops just does not work ...
on x86_64 I get the following disassemble:
_encode_arm_immediate:  ## @encode_arm_immediate
.cfi_startproc
## BB#0:
pushq   %rbp
Ltmp4:
.cfi_def_cfa_offset 16
Ltmp5:
.cfi_offset %rbp, -16
movq%rsp, %rbp
Ltmp6:
.cfi_def_cfa_register %rbp
movl%edi, %ecx
roll$2, %ecx
movl$256, %edx  ## imm = 0x100
cmpl$255, %ecx
jbe LBB1_1
## BB#3:
movl%edi, %ecx
roll$4, %ecx
movl$512, %edx  ## imm = 0x200
cmpl$256, %ecx  ## imm = 0x100
jb  LBB1_1
.
## BB#16:
roll$30, %edi
movl$-1, %eax
movl$3840, %edx ## imm = 0xF00
cmpl$256, %edi  ## imm = 0x100
movl%edi, %ecx
jae LBB1_2
LBB1_1:
orl %edx, %ecx
movl%ecx, %eax
LBB1_2: ## %.loopexit5
popq%rbp
retq

well it looks like its definitly not a bug of binutils ... its caused by bad
unroll-loops of Apple LLVM version 7.0.2 (clang-700.1.81). 
I think the save workaround would be to add -fno-unroll-loops to the flags for
building a toolchain .. with Apple Xcode 7.2 

How do you think ?

(hopefully they fixed it with the upcoming Xcode 7.3 which unfortunatly wont
build for 10.10 anymore.

-- 
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