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

--- Comment #28 from Greg Chandler <chandleg at wizardsworks dot org> ---
Everywhere I look at this problem, something doesn't look right, so I took the
drastic step of rebuilding everything.  Beause nothing was matching up.  Some
things had tls, some didn't, some had ld as gold some as gnu-ld, some had
multilib support (not used) and some didn't....  etc...

So I rebuilt my entire tool-chain, and then I rebuilt all the resultant native
stuff: (I even moved up to gcc 14.3.0 just in case)

Glibc:
../glibc-2.41/configure --prefix=/usr --disable-werror --libdir=/usr/lib
--enable-kernel=6.12 --with-headers=/opt/usr/include --enable-add-ons
--enable-profile libc_cv_slibdir=/usr/lib --infodir=/usr/info --mandir=/usr/man
--with-tls --without-cvs --host=alpha-linux-gnu --target=alpha-linux-gnu
--disable-multilib --di
sable-nls

Binutils:
../binutils-gdb/configure --prefix=/usr --libdir=/usr/lib --sysconfdir=/etc
--mandir=/usr/man --infodir=/usr/info --docdir=/usr/doc/binutils-2.44
--disable-compressed-debug-sections --enable-64-bit-bfd --enable-plugins
--enable-threads=posix --enable-install-libiberty --host=alpha-linux-gnu
--target=alpha-linux-gnu

GCC:
../gcc-14.3.0/configure --build=x86_64-slackware-linux --host=alpha-linux-gnu
--target=alpha-linux-gnu --prefix=/usr --libdir=/usr/lib --mandir=/usr/man
--infodir=/usr/info --enable-default-pie --enable-default-ssp
--enable-languages=c,c++ --enable-libatomic --enable-libgomp
--enable-libquadmath --enable-libssp --enab
le-libstdcxx --enable-libvtv --enable-threads=posix --enable-tls
--disable-gtktest --disable-install-libiberty --disable-libsanitizer
--disable-libstdcxx-pch --disable-libunwind-exceptions --enable-lto
--disable-multilib --disable-nls --enable-plugin --disable-werror --with-gnu-ld
--with-isl --with-zlib --enable-share
d


So now everything native is built without multilib, with tls, with gnu-ld, with
shared (static gcc would only yielded shared regardless of what I tried), and
most of the trimmings for gcc.


I swapped out the old glibc 2.41 with the freshly rebuilt one, and the system
seems happy with that. (all links and cache updated as well)
I removed all traces of gcc, libstdc++, and the binutils (links, libs, man
pages, everything), and dropped the new native sets on the machine.


The gcc driver is now back to waiting as if it needs input or is waiting for a
thread that doesn't exist.




The individual components seem to be working:

root@bigbang:/tmp# /usr/libexec/gcc/alpha-linux-gnu/14.3.0/cc1 1.c
 __bswap_16 __bswap_32 __bswap_64 __uint16_identity __uint32_identity
__uint64_identity main
Analyzing compilation unit
Performing interprocedural optimizations
 <*free_lang_data> {heap 928k} <visibility> {heap 928k} <build_ssa_passes>
{heap 928k} <opt_local_passes> {heap 1120k} <remove_symbols> {heap 1120k}
<targetclone> {heap 1120k} <free-fnsummary> {heap 1120k}Streaming LTO
 <whole-program> {heap 1120k} <fnsummary> {heap 1120k} <inline> {heap 1120k}
<modref> {heap 1120k} <free-fnsummary> {heap 1120k} <single-use> {heap 1120k}
<comdats> {heap 1120k}Assembling functions:
 main
Time variable                                   usr           sys          wall
          GGC
 phase setup                        :   0.03 ( 13%)   0.01 ( 10%)   0.05 ( 14%)
 1255k ( 54%)
 phase parsing                      :   0.18 ( 79%)   0.07 ( 82%)   0.27 ( 72%)
 1029k ( 44%)
 phase opt and generate             :   0.02 (  8%)   0.01 (  8%)   0.05 ( 13%)
   46k (  2%)
 callgraph optimization             :   0.00 (  0%)   0.00 (  1%)   0.01 (  2%)
    0  (  0%)
 callgraph ipa passes               :   0.00 (  0%)   0.00 (  2%)   0.01 (  3%)
 3936  (  0%)
 preprocessing                      :   0.11 ( 48%)   0.04 ( 44%)   0.16 ( 41%)
  449k ( 19%)
 lexical analysis                   :   0.01 (  3%)   0.02 ( 19%)   0.03 (  7%)
    0  (  0%)
 parser (global)                    :   0.06 ( 25%)   0.01 ( 16%)   0.08 ( 20%)
  535k ( 23%)
 parser struct body                 :   0.01 (  3%)   0.00 (  1%)   0.01 (  2%)
   35k (  2%)
 parser inl. func. body             :   0.00 (  0%)   0.00 (  2%)   0.01 (  2%)
 7408  (  0%)
 initialize rtl                     :   0.01 (  3%)   0.00 (  1%)   0.01 (  3%)
   15k (  1%)
 TOTAL                              :   0.23          0.09          0.38       
 2330k



Yielding:

root@bigbang:/tmp# cat 1.s
        .set noreorder
        .set volatile
        .set noat
        .set nomacro
        .arch ev4
        .text
        .align 2
        .globl main
        .ent main
$main..ng:
main:
        .frame $15,16,$26,0
        .mask 0x4008000,-16
$LFB6:
        .cfi_startproc
        lda $30,-16($30)
        .cfi_def_cfa_offset 16
        stq $26,0($30)
        stq $15,8($30)
        .cfi_offset 26, -16
        .cfi_offset 15, -8
        mov $30,$15
        .cfi_def_cfa_register 15
        .prologue 0
        mov $31,$1
        mov $1,$0
        mov $15,$30
        ldq $26,0($30)
        ldq $15,8($30)
        lda $30,16($30)
        .cfi_restore 15
        .cfi_restore 26
        .cfi_def_cfa 30, 0
        ret $31,($26),1
        .cfi_endproc
$LFE6:
        .end main
        .ident  "GCC: (GNU) 14.3.0"
        .section        .note.GNU-stack,"",@progbits




root@bigbang:/tmp# gdb gcc
GNU gdb (GDB) 17.0.50.20250609-git
Copyright (C) 2024 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "alpha-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from gcc...
(gdb) set follow-fork-mode child
(gdb) run -o test.out 1.c
Starting program: /usr/bin/gcc -o test.out 1.c
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
[Attaching after Thread 0x2000003b460 (LWP 810) vfork to child process 813]
[New inferior 2 (process 813)]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
[Detaching vfork parent process 810 after child exec]
[Inferior 1 (process 810) detached]
process 813 is executing new program:
/usr/libexec/gcc/alpha-linux-gnu/14.3.0/cc1

(Hangs here)






root@bigbang:~# ps -aux |grep 810
root       810  0.0  0.1   6032  2744 ttyS0    S+   04:06   0:00 /usr/bin/gcc
-o test.out 1.c
root       819 11.4  0.0   3240  1752 ttyS1    S+   04:07   0:00 grep 810

root@bigbang:~# ps -aux |grep 813
root       813  0.0  0.7  45656 15448 ttyS0    S+   04:06   0:00
/usr/libexec/gcc/alpha-linux-gnu/14.3.0/cc1
root       823 20.0  0.0   3240  1752 ttyS1    S+   04:08   0:00 grep 813


root@bigbang:~# file /usr/libexec/gcc/alpha-linux-gnu/14.3.0/cc1
/usr/libexec/gcc/alpha-linux-gnu/14.3.0/cc1: ELF 64-bit LSB executable, Alpha
(unofficial), version 1 (GNU/Linux), dynamically linked, interpreter
/lib/ld-linux.so.2, with debug_info, not stripped

root@bigbang:~# ldd /usr/libexec/gcc/alpha-linux-gnu/14.3.0/cc1
        libisl.so.23 => /usr/lib/libisl.so.23 (0x0000020000050000)
        libmpc.so.3 => /usr/lib/libmpc.so.3 (0x0000020000350000)
        libmpfr.so.6 => /usr/lib/libmpfr.so.6 (0x00000200003a0000)
        libgmp.so.10 => /usr/lib/libgmp.so.10 (0x0000020000460000)
        libzstd.so.1 => /lib/libzstd.so.1 (0x0000020000510000)
        libm.so.6.1 => /lib/libm.so.6.1 (0x00000200006b0000)
        libc.so.6.1 => /lib/libc.so.6.1 (0x00000200007a0000)
        /lib/ld-linux.so.2 => /usr/lib/ld-linux.so.2 (0x0000020000000000)


root@bigbang:~# file /usr/bin/gcc
/usr/bin/gcc: symbolic link to gcc-14.3.0

root@bigbang:~# file /usr/bin/gcc-14.3.0
/usr/bin/gcc-14.3.0: ELF 64-bit LSB executable, Alpha (unofficial), version 1
(GNU/Linux), dynamically linked, interpreter /lib/ld-linux.so.2, with
debug_info, not stripped

root@bigbang:~# ldd /usr/bin/gcc-14.3.0
        libm.so.6.1 => /lib/libm.so.6.1 (0x0000020000050000)
        libc.so.6.1 => /lib/libc.so.6.1 (0x0000020000140000)
        /lib/ld-linux.so.2 => /usr/lib/ld-linux.so.2 (0x0000020000000000)

Reply via email to