public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/64237] New: [5 Regression] glibc build failure
@ 2014-12-09 12:25 trippels at gcc dot gnu.org
  2014-12-09 12:33 ` [Bug target/64237] " rguenth at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: trippels at gcc dot gnu.org @ 2014-12-09 12:25 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 64237
           Summary: [5 Regression] glibc build failure
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: trippels at gcc dot gnu.org

trippels@gcc20 nscd % cat nscd.i
extern int program_invocation_name;
extern void fn2(int, int);
void
fn1() { fn2(0, program_invocation_name); }

trippels@gcc20 nscd % gcc -shared nscd.i -fpie
/home/trippels/bin/ld: /home/trippels/tmp/ccoI5Lbg.o: relocation R_X86_64_PC32
against undefined symbol `program_invocation_name@@GLIBC_2.2.5' can not be used
when making a shared object; recompile with -fPIC
/home/trippels/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status


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

* [Bug target/64237] [5 Regression] glibc build failure
  2014-12-09 12:25 [Bug c/64237] New: [5 Regression] glibc build failure trippels at gcc dot gnu.org
@ 2014-12-09 12:33 ` rguenth at gcc dot gnu.org
  2014-12-09 12:36 ` trippels at gcc dot gnu.org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-12-09 12:33 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|                            |x86_64-*-*, i?86-*-*
           Priority|P3                          |P1
                 CC|                            |hjl at gcc dot gnu.org
          Component|c                           |target
   Target Milestone|---                         |5.0

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
I'd say

2014-12-04  Sriraman Tallam  <tmsriram@google.com>
            H.J. Lu  <hongjiu.lu@intel.com>

        * configure.ac (HAVE_LD_PIE_COPYRELOC): Defined to 1 if
        Linux/x86-64 linker supports PIE with copy reloc.
        * config.in: Regenerated.
        * configure: Likewise.

        * config/i386/i386.c (legitimate_pic_address_disp_p): Allow
        pc-relative address for undefined, non-weak, non-function
        symbol reference in 64-bit PIE if linker supports PIE with
        copy reloc.

        * doc/sourcebuild.texi: Document pie_copyreloc target.
?


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

* [Bug target/64237] [5 Regression] glibc build failure
  2014-12-09 12:25 [Bug c/64237] New: [5 Regression] glibc build failure trippels at gcc dot gnu.org
  2014-12-09 12:33 ` [Bug target/64237] " rguenth at gcc dot gnu.org
@ 2014-12-09 12:36 ` trippels at gcc dot gnu.org
  2014-12-09 14:28 ` hjl.tools at gmail dot com
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: trippels at gcc dot gnu.org @ 2014-12-09 12:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
Started with r218397. 
HJ, it looks like this is now the intended behavior.

Original error:
/home/trippels/gcc_test/usr/local/bin/gcc -pie -Wl,-O1 -nostdlib -nostartfiles
-o /home/trippels/glibc_build/nscd/nscd   -Wl,-z,now -Wl,-z,combreloc
-Wl,-z,relro -Wl,--hash-s
tyle=both /home/trippels/glibc_build/csu/Scrt1.o
/home/trippels/glibc_build/csu/crti.o
`/home/trippels/gcc_test/usr/local/bin/gcc  --print-file-name=crtbeginS.o`
/home/trippe
ls/glibc_build/nscd/nscd.o /home/trippels/glibc_build/nscd/connections.o
/home/trippels/glibc_build/nscd/pwdcache.o
/home/trippels/glibc_build/nscd/getpwnam_r.o /home/trippel
s/glibc_build/nscd/getpwuid_r.o /home/trippels/glibc_build/nscd/grpcache.o
/home/trippels/glibc_build/nscd/getgrnam_r.o
/home/trippels/glibc_build/nscd/getgrgid_r.o /home/tri
ppels/glibc_build/nscd/hstcache.o
/home/trippels/glibc_build/nscd/gethstbyad_r.o
/home/trippels/glibc_build/nscd/gethstbynm3_r.o
/home/trippels/glibc_build/nscd/getsrvbynm_r.
o /home/trippels/glibc_build/nscd/getsrvbypt_r.o
/home/trippels/glibc_build/nscd/servicescache.o
/home/trippels/glibc_build/nscd/dbg_log.o /home/trippels/glibc_build/nscd/nsc
d_conf.o /home/trippels/glibc_build/nscd/nscd_stat.o
/home/trippels/glibc_build/nscd/cache.o /home/trippels/glibc_build/nscd/mem.o
/home/trippels/glibc_build/nscd/nscd_setup_
thread.o /home/trippels/glibc_build/nscd/xmalloc.o
/home/trippels/glibc_build/nscd/xstrdup.o
/home/trippels/glibc_build/nscd/aicache.o
/home/trippels/glibc_build/nscd/initgrc
ache.o /home/trippels/glibc_build/nscd/gai.o
/home/trippels/glibc_build/nscd/res_hconf.o
/home/trippels/glibc_build/nscd/netgroupcache.o
/home/trippels/glibc_build/nptl/libpt
hread_nonshared.a /home/trippels/glibc_build/nptl/libpthread.so
/home/trippels/glibc_build/nis/libnsl.so 
-Wl,-dynamic-linker=/lib64/ld-linux-x86-64.so.2 -Wl,-rpath-link=/hom
e/trippels/glibc_build:/home/trippels/glibc_build/math:/home/trippels/glibc_build/elf:/home/trippels/glibc_build/dlfcn:/home/trippels/glibc_build/nss:/home/trippels/glibc_bui
ld/nis:/home/trippels/glibc_build/rt:/home/trippels/glibc_build/resolv:/home/trippels/glibc_build/crypt:/home/trippels/glibc_build/nptl
/home/trippels/glibc_build/libc.so.6 /
home/trippels/glibc_build/libc_nonshared.a -Wl,--as-needed
/home/trippels/glibc_build/elf/ld.so -Wl,--no-as-needed -lgcc 
`/home/trippels/gcc_test/usr/local/bin/gcc  --print-
file-name=crtendS.o` /home/trippels/glibc_build/csu/crtn.o
/home/trippels/bin/ld: /home/trippels/glibc_build/nscd/nscd.o: relocation
R_X86_64_PC32 against undefined symbol `program_invocation_name@@GLIBC_2.2.5'
can not be used when m
aking a shared object; recompile with -fPIC
/home/trippels/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [/home/trippels/glibc_build/nscd/nscd] Error 1
make[2]: Leaving directory `/home/trippels/glibc/nscd'
make[1]: *** [nscd/others] Error 2
make[1]: Leaving directory `/home/trippels/glibc'

 % ld -v
GNU ld (GNU Binutils) 2.25.51.20141204

 % CC=~/gcc_test/usr/local/bin/gcc CXX=~/gcc_test/usr/local/bin/g++
CFLAGS="-march=native -O2 -pipe" CXXFLAGS="-march=native -O2 -pipe"
../glibc/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib
--with-headers=/usr/include --enable-add-ons --with-tls --with-__thread
--enable-bind-now --without-gd --without-cvs --disable-profile
--disable-multi-arch


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

* [Bug target/64237] [5 Regression] glibc build failure
  2014-12-09 12:25 [Bug c/64237] New: [5 Regression] glibc build failure trippels at gcc dot gnu.org
  2014-12-09 12:33 ` [Bug target/64237] " rguenth at gcc dot gnu.org
  2014-12-09 12:36 ` trippels at gcc dot gnu.org
@ 2014-12-09 14:28 ` hjl.tools at gmail dot com
  2014-12-09 14:36 ` trippels at gcc dot gnu.org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: hjl.tools at gmail dot com @ 2014-12-09 14:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Markus Trippelsdorf from comment #0)
> trippels@gcc20 nscd % cat nscd.i
> extern int program_invocation_name;
> extern void fn2(int, int);
> void
> fn1() { fn2(0, program_invocation_name); }
> 
> trippels@gcc20 nscd % gcc -shared nscd.i -fpie
> /home/trippels/bin/ld: /home/trippels/tmp/ccoI5Lbg.o: relocation
> R_X86_64_PC32 against undefined symbol
> `program_invocation_name@@GLIBC_2.2.5' can not be used when making a shared
> object; recompile with -fPIC
> /home/trippels/bin/ld: final link failed: Bad value
> collect2: error: ld returned 1 exit status

If you use -fpie, you should use -pie.
If you use -shared, you should use -fpic.


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

* [Bug target/64237] [5 Regression] glibc build failure
  2014-12-09 12:25 [Bug c/64237] New: [5 Regression] glibc build failure trippels at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2014-12-09 14:28 ` hjl.tools at gmail dot com
@ 2014-12-09 14:36 ` trippels at gcc dot gnu.org
  2014-12-09 14:41 ` hjl.tools at gmail dot com
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: trippels at gcc dot gnu.org @ 2014-12-09 14:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
(In reply to H.J. Lu from comment #3)
> (In reply to Markus Trippelsdorf from comment #0)
> > trippels@gcc20 nscd % cat nscd.i
> > extern int program_invocation_name;
> > extern void fn2(int, int);
> > void
> > fn1() { fn2(0, program_invocation_name); }
> > 
> > trippels@gcc20 nscd % gcc -shared nscd.i -fpie
> > /home/trippels/bin/ld: /home/trippels/tmp/ccoI5Lbg.o: relocation
> > R_X86_64_PC32 against undefined symbol
> > `program_invocation_name@@GLIBC_2.2.5' can not be used when making a shared
> > object; recompile with -fPIC
> > /home/trippels/bin/ld: final link failed: Bad value
> > collect2: error: ld returned 1 exit status
> 
> If you use -fpie, you should use -pie.
> If you use -shared, you should use -fpic.

-shared was used for demonstration purpose only.
Same issue with -pie:

 % gcc -O2 -pie nscd.i -fPIE
/usr/lib/x86_64-linux-gnu/Scrt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
/home/trippels/bin/ld: /home/trippels/tmp/ccZF5sOU.o: relocation R_X86_64_PC32
against undefined symbol `program_invocation_name@@GLIBC_2.2.5' can not be used
when making a shared object; recompile with -fPIC


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

* [Bug target/64237] [5 Regression] glibc build failure
  2014-12-09 12:25 [Bug c/64237] New: [5 Regression] glibc build failure trippels at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2014-12-09 14:36 ` trippels at gcc dot gnu.org
@ 2014-12-09 14:41 ` hjl.tools at gmail dot com
  2014-12-09 15:01 ` hjl.tools at gmail dot com
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: hjl.tools at gmail dot com @ 2014-12-09 14:41 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Markus Trippelsdorf from comment #4)
> (In reply to H.J. Lu from comment #3)
> > (In reply to Markus Trippelsdorf from comment #0)
> > > trippels@gcc20 nscd % cat nscd.i
> > > extern int program_invocation_name;
> > > extern void fn2(int, int);
> > > void
> > > fn1() { fn2(0, program_invocation_name); }
> > > 
> > > trippels@gcc20 nscd % gcc -shared nscd.i -fpie
> > > /home/trippels/bin/ld: /home/trippels/tmp/ccoI5Lbg.o: relocation
> > > R_X86_64_PC32 against undefined symbol
> > > `program_invocation_name@@GLIBC_2.2.5' can not be used when making a shared
> > > object; recompile with -fPIC
> > > /home/trippels/bin/ld: final link failed: Bad value
> > > collect2: error: ld returned 1 exit status
> > 
> > If you use -fpie, you should use -pie.
> > If you use -shared, you should use -fpic.
> 
> -shared was used for demonstration purpose only.
> Same issue with -pie:
> 
>  % gcc -O2 -pie nscd.i -fPIE
> /usr/lib/x86_64-linux-gnu/Scrt1.o: In function `_start':
> (.text+0x20): undefined reference to `main'
> /home/trippels/bin/ld: /home/trippels/tmp/ccZF5sOU.o: relocation
> R_X86_64_PC32 against undefined symbol
> `program_invocation_name@@GLIBC_2.2.5' can not be used when making a shared
> object; recompile with -fPIC

Does -fuse-ld=gold work?


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

* [Bug target/64237] [5 Regression] glibc build failure
  2014-12-09 12:25 [Bug c/64237] New: [5 Regression] glibc build failure trippels at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2014-12-09 14:41 ` hjl.tools at gmail dot com
@ 2014-12-09 15:01 ` hjl.tools at gmail dot com
  2014-12-09 15:06 ` trippels at gcc dot gnu.org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: hjl.tools at gmail dot com @ 2014-12-09 15:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Markus Trippelsdorf from comment #7)
> > Adding -fuse-ld=gold to the crtn.o link command posted above, also fixes the
> > issue.
> 
> It should read: "nscd link command"

Do you use the same ld to build GCC and glic?
If yes, please open a binutils bug and I
will fix it next week.


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

* [Bug target/64237] [5 Regression] glibc build failure
  2014-12-09 12:25 [Bug c/64237] New: [5 Regression] glibc build failure trippels at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2014-12-09 15:01 ` hjl.tools at gmail dot com
@ 2014-12-09 15:06 ` trippels at gcc dot gnu.org
  2014-12-09 15:12 ` hjl.tools at gmail dot com
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: trippels at gcc dot gnu.org @ 2014-12-09 15:06 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
(In reply to H.J. Lu from comment #8)
> (In reply to Markus Trippelsdorf from comment #7)
> > > Adding -fuse-ld=gold to the crtn.o link command posted above, also fixes the
> > > issue.
> > 
> > It should read: "nscd link command"
> 
> Do you use the same ld to build GCC and glic?
> If yes, please open a binutils bug and I
> will fix it next week.

See comment 6.


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

* [Bug target/64237] [5 Regression] glibc build failure
  2014-12-09 12:25 [Bug c/64237] New: [5 Regression] glibc build failure trippels at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2014-12-09 15:06 ` trippels at gcc dot gnu.org
@ 2014-12-09 15:12 ` hjl.tools at gmail dot com
  2014-12-09 15:23 ` trippels at gcc dot gnu.org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: hjl.tools at gmail dot com @ 2014-12-09 15:12 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Markus Trippelsdorf from comment #9)
> (In reply to H.J. Lu from comment #8)
> > (In reply to Markus Trippelsdorf from comment #7)
> > > > Adding -fuse-ld=gold to the crtn.o link command posted above, also fixes the
> > > > issue.
> > > 
> > > It should read: "nscd link command"
> > 
> > Do you use the same ld to build GCC and glic?
> > If yes, please open a binutils bug and I
> > will fix it next week.
> 
> See comment 6.

Please open a binutils bug and assign it
to me. I will fix it next week.


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

* [Bug target/64237] [5 Regression] glibc build failure
  2014-12-09 12:25 [Bug c/64237] New: [5 Regression] glibc build failure trippels at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2014-12-09 15:12 ` hjl.tools at gmail dot com
@ 2014-12-09 15:23 ` trippels at gcc dot gnu.org
  2014-12-09 15:28 ` trippels at gcc dot gnu.org
  2014-12-09 15:29 ` trippels at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: trippels at gcc dot gnu.org @ 2014-12-09 15:23 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
(In reply to H.J. Lu from comment #10)
> (In reply to Markus Trippelsdorf from comment #9)
> > (In reply to H.J. Lu from comment #8)
> > > (In reply to Markus Trippelsdorf from comment #7)
> > > > > Adding -fuse-ld=gold to the crtn.o link command posted above, also fixes the
> > > > > issue.
> > > > 
> > > > It should read: "nscd link command"
> > > 
> > > Do you use the same ld to build GCC and glic?
> > > If yes, please open a binutils bug and I
> > > will fix it next week.
> > 
> > See comment 6.
> 
> Please open a binutils bug and assign it
> to me. I will fix it next week.

OK. Thanks.
https://sourceware.org/bugzilla/show_bug.cgi?id=17689


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

* [Bug target/64237] [5 Regression] glibc build failure
  2014-12-09 12:25 [Bug c/64237] New: [5 Regression] glibc build failure trippels at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2014-12-09 15:23 ` trippels at gcc dot gnu.org
@ 2014-12-09 15:28 ` trippels at gcc dot gnu.org
  2014-12-09 15:29 ` trippels at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: trippels at gcc dot gnu.org @ 2014-12-09 15:28 UTC (permalink / raw)
  To: gcc-bugs

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

Markus Trippelsdorf <trippels at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                URL|                            |https://sourceware.org/bugz
                   |                            |illa/show_bug.cgi?id=17689
         Resolution|---                         |FIXED

--- Comment #12 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
Moved to sourceware bugzilla.


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

* [Bug target/64237] [5 Regression] glibc build failure
  2014-12-09 12:25 [Bug c/64237] New: [5 Regression] glibc build failure trippels at gcc dot gnu.org
                   ` (9 preceding siblings ...)
  2014-12-09 15:28 ` trippels at gcc dot gnu.org
@ 2014-12-09 15:29 ` trippels at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: trippels at gcc dot gnu.org @ 2014-12-09 15:29 UTC (permalink / raw)
  To: gcc-bugs

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

Markus Trippelsdorf <trippels at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|FIXED                       |MOVED

--- Comment #13 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
moved.


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

end of thread, other threads:[~2014-12-09 15:29 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-09 12:25 [Bug c/64237] New: [5 Regression] glibc build failure trippels at gcc dot gnu.org
2014-12-09 12:33 ` [Bug target/64237] " rguenth at gcc dot gnu.org
2014-12-09 12:36 ` trippels at gcc dot gnu.org
2014-12-09 14:28 ` hjl.tools at gmail dot com
2014-12-09 14:36 ` trippels at gcc dot gnu.org
2014-12-09 14:41 ` hjl.tools at gmail dot com
2014-12-09 15:01 ` hjl.tools at gmail dot com
2014-12-09 15:06 ` trippels at gcc dot gnu.org
2014-12-09 15:12 ` hjl.tools at gmail dot com
2014-12-09 15:23 ` trippels at gcc dot gnu.org
2014-12-09 15:28 ` trippels at gcc dot gnu.org
2014-12-09 15:29 ` trippels 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).