This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/21936] gcc build hangs with glibc 2.26 (conftest about static binaries dlopening themselves)


https://sourceware.org/bugzilla/show_bug.cgi?id=21936

--- Comment #7 from Felix von Leitner <felix-glibc at fefe dot de> ---
That is fascinating. How could that have happened?

  $ strace -fF -eexecve gcc -static -m32 -o t t.c
[...]
[pid 16587]
execve("/usr/lib64/gcc/x86_64-pc-linux-gnu/7.1.0/../../../../x86_64-pc-linux-gnu/bin/ld",
[...]

  $
/usr/lib64/gcc/x86_64-pc-linux-gnu/7.1.0/../../../../x86_64-pc-linux-gnu/bin/ld
--version
  GNU ld (GNU Binutils) 2.29
  Copyright (C) 2017 Free Software Foundation, Inc.
  This program is free software; you may redistribute it under the terms of
  the GNU General Public License version 3 or (at your option) a later version.
  This program has absolutely no warranty.

And that is the ld I used to build glibc itself:

-rwxr-xr-x    4 root     root      1011680 Jul 24 22:47
/usr/lib64/gcc/x86_64-pc-linux-gnu/7.1.0/../../../../x86_64-pc-linux-gnu/bin/ld

-rw-r--r--    1 root     root      3729394 Aug  5 13:51 /usr/lib/libc.a

  $ nm /usr/lib/libc.a 2>&1 | grep -w strchr
  strchr.o:
  00000000 T strchr
  $ ar x /usr/lib/libc.a strchr.o
  $ objdump -dr strchr.o


strchr.o:     file format elf32-i386

Disassembly of section .text:

00000000 <strchr>:
   0:   8d 05 00 00 00 00       lea    0x0,%eax
                        2: R_386_32     __strchr_ia32
   6:   f7 05 14 00 00 00 00    testl  $0x4000000,0x14
   d:   00 00 04 
                        8: R_386_32     _dl_x86_cpu_features
  10:   74 18                   je     2a <strchr+0x2a>
  12:   8d 05 00 00 00 00       lea    0x0,%eax
                        14: R_386_32    __strchr_sse2_bsf
  18:   f7 05 40 00 00 00 04    testl  $0x4,0x40
  1f:   00 00 00 
                        1a: R_386_32    _dl_x86_cpu_features
  22:   74 06                   je     2a <strchr+0x2a>
  24:   8d 05 00 00 00 00       lea    0x0,%eax
                        26: R_386_32    __strchr_sse2
  2a:   c3                      ret    
  2b:   90                      nop
  2c:   8d 74 26 00             lea    0x0(%esi,%eiz,1),%esi

00000030 <__GI_strchr>:
  30:   57                      push   %edi
  31:   56                      push   %esi
  32:   53                      push   %ebx
[...]

Why the hell would the IFUNC stuff be in the statically linked libc in the
first place? I thought that is just for runtime resolving during dynamic
linking?

What should I do next?

FWIW:

-rwxr-xr-x    3 root     root       989440 May  2 23:07 /usr/bin/gcc

My gcc 7.1 binary is even older than my binutils and glibc builds.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]