public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/63691] New: GCC 4.9.x fails to build GLIBC 2.20 on HPPA
@ 2014-10-30 21:19 aaro.koskinen at iki dot fi
  2014-10-30 21:27 ` [Bug target/63691] " aaro.koskinen at iki dot fi
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: aaro.koskinen at iki dot fi @ 2014-10-30 21:19 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63691

            Bug ID: 63691
           Summary: GCC 4.9.x fails to build GLIBC 2.20 on HPPA
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: aaro.koskinen at iki dot fi

GCC 4.8.3 builds GLIBC 2.20 (w/Gentoo patches) fine, but with GCC 4.9 it fails:

hppa-linux-gnu-gcc   -nostdlib -nostartfiles -r -o
/home/aaro/los/work/parisc/glibc-2.20-build/default/elf/librtld.map.o '-Wl,-('
/home/aaro/los/work/parisc/glibc-2.20-build/default/elf/dl-allobjs.os
/home/aaro/los/work/parisc/glibc-2.20-build/default/libc_pic.a -lgcc '-Wl,-)'
-Wl,-Map,/home/aaro/los/work/parisc/glibc-2.20-build/default/elf/librtld.mapT
/home/aaro/los/work/parisc/glibc-2.20-build/default/libc_pic.a(dl-addr.os): In
function `_dl_addr_inside_object':
/home/aaro/los/work/shared/glibc-2.20/elf/dl-addr.c:152: multiple definition of
`_dl_addr_inside_object'
/home/aaro/los/work/parisc/glibc-2.20-build/default/elf/dl-allobjs.os:(.text+0x8b8):
first defined here
/home/aaro/los/work/parisc/glibc-2.20-build/default/libc_pic.a(init-first.os):(.data+0x0):
multiple definition of `__libc_multiple_libcs'
/home/aaro/los/work/parisc/glibc-2.20-build/default/elf/dl-allobjs.os:(.bss+0x7c):
first defined here
/home/aaro/los/work/parisc/glibc-2.20-build/default/libc_pic.a(_itoa.os): In
function `_itoa':
/home/aaro/los/work/shared/glibc-2.20/stdio-common/_itoa.c:199: multiple
definition of `_itoa'
/home/aaro/los/work/parisc/glibc-2.20-build/default/elf/dl-allobjs.os:(.text+0x5b8):
first defined here
collect2: error: ld returned 1 exit status


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

* [Bug target/63691] GCC 4.9.x fails to build GLIBC 2.20 on HPPA
  2014-10-30 21:19 [Bug target/63691] New: GCC 4.9.x fails to build GLIBC 2.20 on HPPA aaro.koskinen at iki dot fi
@ 2014-10-30 21:27 ` aaro.koskinen at iki dot fi
  2014-10-31  0:29 ` dave.anglin at bell dot net
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: aaro.koskinen at iki dot fi @ 2014-10-30 21:27 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63691

Aaro Koskinen <aaro.koskinen at iki dot fi> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |carlos at systemhalted dot org,
                   |                            |dave.anglin at bell dot net,
                   |                            |law at redhat dot com

--- Comment #1 from Aaro Koskinen <aaro.koskinen at iki dot fi> ---
Bisected on gcc git gcc-4_9-branch to:

db242b6d0eba96a468a2cea2c0e175aeb210644a is the first bad commit
commit db242b6d0eba96a468a2cea2c0e175aeb210644a
Author: law <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Tue Nov 5 19:47:44 2013 +0000

        * Makefile.in (OBJS): Add gimple-ssa-isolate-paths.o

Unfortunately this does not revert cleanly so I cannot verify the result of
bisection by reverting the commit.


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

* [Bug target/63691] GCC 4.9.x fails to build GLIBC 2.20 on HPPA
  2014-10-30 21:19 [Bug target/63691] New: GCC 4.9.x fails to build GLIBC 2.20 on HPPA aaro.koskinen at iki dot fi
  2014-10-30 21:27 ` [Bug target/63691] " aaro.koskinen at iki dot fi
@ 2014-10-31  0:29 ` dave.anglin at bell dot net
  2014-10-31  0:49 ` pinskia at gcc dot gnu.org
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: dave.anglin at bell dot net @ 2014-10-31  0:29 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63691

--- Comment #3 from dave.anglin at bell dot net ---
On 30-Oct-14, at 5:19 PM, aaro.koskinen at iki dot fi wrote:

> Bisected on gcc git gcc-4_9-branch to:

Would you please attach .i and .s files generated from dl-addr.c?

Dave
--
John David Anglin    dave.anglin@bell.net


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

* [Bug target/63691] GCC 4.9.x fails to build GLIBC 2.20 on HPPA
  2014-10-30 21:19 [Bug target/63691] New: GCC 4.9.x fails to build GLIBC 2.20 on HPPA aaro.koskinen at iki dot fi
  2014-10-30 21:27 ` [Bug target/63691] " aaro.koskinen at iki dot fi
  2014-10-31  0:29 ` dave.anglin at bell dot net
@ 2014-10-31  0:49 ` pinskia at gcc dot gnu.org
  2014-10-31  1:18 ` pinskia at gcc dot gnu.org
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu.org @ 2014-10-31  0:49 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63691

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
this was a bug in glibc iirc. it showed up on aarch64 too.  there is two ways
of solving it, backport the patch to glibc or define trap pattern in the pa
backend.


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

* [Bug target/63691] GCC 4.9.x fails to build GLIBC 2.20 on HPPA
  2014-10-30 21:19 [Bug target/63691] New: GCC 4.9.x fails to build GLIBC 2.20 on HPPA aaro.koskinen at iki dot fi
                   ` (2 preceding siblings ...)
  2014-10-31  0:49 ` pinskia at gcc dot gnu.org
@ 2014-10-31  1:18 ` pinskia at gcc dot gnu.org
  2014-10-31 18:43 ` aaro.koskinen at iki dot fi
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu.org @ 2014-10-31  1:18 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63691

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
See https://sourceware.org/ml/libc-alpha/2013-11/msg00291.html .


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

* [Bug target/63691] GCC 4.9.x fails to build GLIBC 2.20 on HPPA
  2014-10-30 21:19 [Bug target/63691] New: GCC 4.9.x fails to build GLIBC 2.20 on HPPA aaro.koskinen at iki dot fi
                   ` (3 preceding siblings ...)
  2014-10-31  1:18 ` pinskia at gcc dot gnu.org
@ 2014-10-31 18:43 ` aaro.koskinen at iki dot fi
  2014-10-31 19:43 ` dave.anglin at bell dot net
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: aaro.koskinen at iki dot fi @ 2014-10-31 18:43 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63691

--- Comment #6 from Aaro Koskinen <aaro.koskinen at iki dot fi> ---
(In reply to Andrew Pinski from comment #5)
> See https://sourceware.org/ml/libc-alpha/2013-11/msg00291.html .

This patch is already included in GLIBC 2.20...


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

* [Bug target/63691] GCC 4.9.x fails to build GLIBC 2.20 on HPPA
  2014-10-30 21:19 [Bug target/63691] New: GCC 4.9.x fails to build GLIBC 2.20 on HPPA aaro.koskinen at iki dot fi
                   ` (4 preceding siblings ...)
  2014-10-31 18:43 ` aaro.koskinen at iki dot fi
@ 2014-10-31 19:43 ` dave.anglin at bell dot net
  2014-10-31 21:52 ` aaro.koskinen at iki dot fi
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: dave.anglin at bell dot net @ 2014-10-31 19:43 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63691

--- Comment #7 from dave.anglin at bell dot net ---
On 10/31/2014 2:39 PM, aaro.koskinen at iki dot fi wrote:
> This patch is already included in GLIBC 2.20...
I can add support for __builtin_trap() but we need preprocessed source
and full compile command.  You can add "-save-temps -v" to glibc command
to generate these files.


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

* [Bug target/63691] GCC 4.9.x fails to build GLIBC 2.20 on HPPA
  2014-10-30 21:19 [Bug target/63691] New: GCC 4.9.x fails to build GLIBC 2.20 on HPPA aaro.koskinen at iki dot fi
                   ` (5 preceding siblings ...)
  2014-10-31 19:43 ` dave.anglin at bell dot net
@ 2014-10-31 21:52 ` aaro.koskinen at iki dot fi
  2014-11-01  8:17 ` schwab@linux-m68k.org
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: aaro.koskinen at iki dot fi @ 2014-10-31 21:52 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63691

--- Comment #8 from Aaro Koskinen <aaro.koskinen at iki dot fi> ---
(In reply to dave.anglin from comment #7)
> On 10/31/2014 2:39 PM, aaro.koskinen at iki dot fi wrote:
> > This patch is already included in GLIBC 2.20...
> I can add support for __builtin_trap() but we need preprocessed source
> and full compile command.  You can add "-save-temps -v" to glibc command
> to generate these files.

I was able to isolate the problem to GLIBC elf/dl-conflict.c and specifically
hppa specific elf_machine_rela function called from there. The problem occurs
at link time, so crafting a standalone preprocessed source file triggering the
error might be difficult, but I'll see what can I do.


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

* [Bug target/63691] GCC 4.9.x fails to build GLIBC 2.20 on HPPA
  2014-10-30 21:19 [Bug target/63691] New: GCC 4.9.x fails to build GLIBC 2.20 on HPPA aaro.koskinen at iki dot fi
                   ` (6 preceding siblings ...)
  2014-10-31 21:52 ` aaro.koskinen at iki dot fi
@ 2014-11-01  8:17 ` schwab@linux-m68k.org
  2014-11-01 11:32 ` aaro.koskinen at iki dot fi
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: schwab@linux-m68k.org @ 2014-11-01  8:17 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63691

--- Comment #9 from Andreas Schwab <schwab@linux-m68k.org> ---
You don't need a link test, you only need to check whether there is a reference
to abort.


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

* [Bug target/63691] GCC 4.9.x fails to build GLIBC 2.20 on HPPA
  2014-10-30 21:19 [Bug target/63691] New: GCC 4.9.x fails to build GLIBC 2.20 on HPPA aaro.koskinen at iki dot fi
                   ` (7 preceding siblings ...)
  2014-11-01  8:17 ` schwab@linux-m68k.org
@ 2014-11-01 11:32 ` aaro.koskinen at iki dot fi
  2014-11-01 14:34 ` danglin at gcc dot gnu.org
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: aaro.koskinen at iki dot fi @ 2014-11-01 11:32 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63691

--- Comment #10 from Aaro Koskinen <aaro.koskinen at iki dot fi> ---
(In reply to Andreas Schwab from comment #9)
> You don't need a link test, you only need to check whether there is a
> reference to abort.

A simple test:

$ cat pr63691.c
void foo (int a, char *p)
{
        if (a == 0)
                return;
        *p = 1;
}
int main (int argc, char **argv)
{
        foo(argc, 0);
        return 0;
}
$ hppa-linux-gnu-gcc -nostdlib -O2 pr63691.c
/home/aaro/los/work/parisc/toolchain/lib/gcc/hppa-linux-gnu/4.9.2/../../../../hppa-linux-gnu/bin/ld:
warning: cannot find entry symbol _start; defaulting to 0000000000010054
/tmp/ccWAW31H.o: In function `main':
(.text.startup+0x14): undefined reference to `abort'
collect2: error: ld returned 1 exit status

abort() reference is gone if you compile GCC with the patch
Dave posted here:

https://www.sourceware.org/ml/libc-alpha/2014-10/msg00823.html

BTW, I think this optimization also breaks PALO (PA-RISC bootloader). There the
program actually wants to access page zero.


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

* [Bug target/63691] GCC 4.9.x fails to build GLIBC 2.20 on HPPA
  2014-10-30 21:19 [Bug target/63691] New: GCC 4.9.x fails to build GLIBC 2.20 on HPPA aaro.koskinen at iki dot fi
                   ` (8 preceding siblings ...)
  2014-11-01 11:32 ` aaro.koskinen at iki dot fi
@ 2014-11-01 14:34 ` danglin at gcc dot gnu.org
  2014-11-04 19:36 ` aaro.koskinen at iki dot fi
  2021-11-28 14:43 ` danglin at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: danglin at gcc dot gnu.org @ 2014-11-01 14:34 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63691

John David Anglin <danglin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
   Last reconfirmed|                            |2014-11-01
                 CC|                            |danglin at gcc dot gnu.org
         Resolution|INVALID                     |---
     Ever confirmed|0                           |1

--- Comment #11 from John David Anglin <danglin at gcc dot gnu.org> ---
There is a reference to abort and abort is part of stdlib.


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

* [Bug target/63691] GCC 4.9.x fails to build GLIBC 2.20 on HPPA
  2014-10-30 21:19 [Bug target/63691] New: GCC 4.9.x fails to build GLIBC 2.20 on HPPA aaro.koskinen at iki dot fi
                   ` (9 preceding siblings ...)
  2014-11-01 14:34 ` danglin at gcc dot gnu.org
@ 2014-11-04 19:36 ` aaro.koskinen at iki dot fi
  2021-11-28 14:43 ` danglin at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: aaro.koskinen at iki dot fi @ 2014-11-04 19:36 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63691

--- Comment #13 from Aaro Koskinen <aaro.koskinen at iki dot fi> ---
Created attachment 33884
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33884&action=edit
Preprocessed dl-conflict

Here's the preprocessed dl-conflict.c. In elf_machine_rela(), the sym_map gets
always assigned to 0, and in the following switch cases it's dereferenced
without any checks. Those are where the compiler will add abort refs.

When compiled with -fno-delete-null-pointer-checks GCC won't do that, but it's
not really related to any null pointer checks, instead the switch has also
other meanings, i.e. it's also telling the compiler that NULL deref is not
erroneous so it cannot make program fail on those. Or at least that's how I
understand it.


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

* [Bug target/63691] GCC 4.9.x fails to build GLIBC 2.20 on HPPA
  2014-10-30 21:19 [Bug target/63691] New: GCC 4.9.x fails to build GLIBC 2.20 on HPPA aaro.koskinen at iki dot fi
                   ` (10 preceding siblings ...)
  2014-11-04 19:36 ` aaro.koskinen at iki dot fi
@ 2021-11-28 14:43 ` danglin at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: danglin at gcc dot gnu.org @ 2021-11-28 14:43 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63691

John David Anglin <danglin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #15 from John David Anglin <danglin at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2021-11-28 14:43 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-30 21:19 [Bug target/63691] New: GCC 4.9.x fails to build GLIBC 2.20 on HPPA aaro.koskinen at iki dot fi
2014-10-30 21:27 ` [Bug target/63691] " aaro.koskinen at iki dot fi
2014-10-31  0:29 ` dave.anglin at bell dot net
2014-10-31  0:49 ` pinskia at gcc dot gnu.org
2014-10-31  1:18 ` pinskia at gcc dot gnu.org
2014-10-31 18:43 ` aaro.koskinen at iki dot fi
2014-10-31 19:43 ` dave.anglin at bell dot net
2014-10-31 21:52 ` aaro.koskinen at iki dot fi
2014-11-01  8:17 ` schwab@linux-m68k.org
2014-11-01 11:32 ` aaro.koskinen at iki dot fi
2014-11-01 14:34 ` danglin at gcc dot gnu.org
2014-11-04 19:36 ` aaro.koskinen at iki dot fi
2021-11-28 14:43 ` danglin at gcc dot gnu.org

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 read-only IMAP folder(s) and NNTP newsgroup(s).