[Bug libgcc/111322] non-canonical reference to canonical protected function `__pthread_key_create'

2023-09-07 Thread wbx at openadk dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111322

Waldemar Brodkorb  changed:

   What|Removed |Added

 CC||wbx at openadk dot org

--- Comment #3 from Waldemar Brodkorb  ---
uClibc is doing this nearly since the beginning (commit
f91e94f6c5a1f1d6dfd3e5a535df303b805bf321 in 2001). I think normally this is
okay, because uClibc tries to be compatible to glibc. There are cornercases
like this issue. I think the patch is useful and should be applied.

[Bug target/111001] SH: ICE during RTL pass: sh_treg_combine2

2023-08-12 Thread wbx at openadk dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111001

--- Comment #1 from Waldemar Brodkorb  ---
/home/browa22-ext/e2fsprogs/output/host/bin/sh4-buildroot-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/home/browa22-ext/e2fsprogs/output/host/bin/sh4-buildroot-linux-gnu-gcc.br_real
COLLECT_LTO_WRAPPER=/home/browa22-ext/e2fsprogs/output/host/libexec/gcc/sh4-buildroot-linux-gnu/13.2.0/lto-wrapper
Target: sh4-buildroot-linux-gnu
Configured with: ./configure --prefix=/home/browa22-ext/e2fsprogs/output/host
--sysconfdir=/home/browa22-ext/e2fsprogs/output/host/etc --enable-static
--target=sh4-buildroot-linux-gnu
--with-sysroot=/home/browa22-ext/e2fsprogs/output/host/sh4-buildroot-linux-gnu/sysroot
--enable-__cxa_atexit --with-gnu-ld --disable-libssp --disable-multilib
--disable-decimal-float --enable-plugins --enable-lto
--with-gmp=/home/browa22-ext/e2fsprogs/output/host
--with-mpc=/home/browa22-ext/e2fsprogs/output/host
--with-mpfr=/home/browa22-ext/e2fsprogs/output/host
--with-pkgversion='Buildroot 2023.08-rc1-68-g27dc493780-dirty'
--with-bugurl=http://bugs.buildroot.net/ --without-zstd --disable-libquadmath
--disable-libquadmath-support --enable-tls --enable-threads --without-isl
--without-cloog --enable-languages=c
--with-build-time-tools=/home/browa22-ext/e2fsprogs/output/host/sh4-buildroot-linux-gnu/bin
--with-multilib-list=m4,m4-nofpu --enable-shared --disable-libgomp
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 13.2.0 (Buildroot 2023.08-rc1-68-g27dc493780-dirty) 
COMPILER_PATH=/home/browa22-ext/e2fsprogs/output/host/libexec/gcc/sh4-buildroot-linux-gnu/13.2.0/:/home/browa22-ext/e2fsprogs/output/host/libexec/gcc/sh4-buildroot-linux-gnu/13.2.0/:/home/browa22-ext/e2fsprogs/output/host/libexec/gcc/sh4-buildroot-linux-gnu/:/home/browa22-ext/e2fsprogs/output/host/lib/gcc/sh4-buildroot-linux-gnu/13.2.0/:/home/browa22-ext/e2fsprogs/output/host/lib/gcc/sh4-buildroot-linux-gnu/:/home/browa22-ext/e2fsprogs/output/host/lib/gcc/sh4-buildroot-linux-gnu/13.2.0/../../../../sh4-buildroot-linux-gnu/bin/
LIBRARY_PATH=/home/browa22-ext/e2fsprogs/output/host/lib/gcc/sh4-buildroot-linux-gnu/13.2.0/:/home/browa22-ext/e2fsprogs/output/host/lib/gcc/sh4-buildroot-linux-gnu/13.2.0/../../../../sh4-buildroot-linux-gnu/lib/!m4/:/home/browa22-ext/e2fsprogs/output/host/lib/gcc/sh4-buildroot-linux-gnu/13.2.0/../../../../sh4-buildroot-linux-gnu/lib/:/home/browa22-ext/e2fsprogs/output/host/sh4-buildroot-linux-gnu/sysroot/lib/:/home/browa22-ext/e2fsprogs/output/host/sh4-buildroot-linux-gnu/sysroot/usr/lib/
COLLECT_GCC_OPTIONS='--sysroot=/home/browa22-ext/e2fsprogs/output/host/sh4-buildroot-linux-gnu/sysroot'
'-fstack-protector-strong' '-fPIE' '-pie' '-v' '-dumpdir' 'a.'

/home/browa22-ext/e2fsprogs/output/host/libexec/gcc/sh4-buildroot-linux-gnu/13.2.0/collect2
-plugin
/home/browa22-ext/e2fsprogs/output/host/libexec/gcc/sh4-buildroot-linux-gnu/13.2.0/liblto_plugin.so
-plugin-opt=/home/browa22-ext/e2fsprogs/output/host/libexec/gcc/sh4-buildroot-linux-gnu/13.2.0/lto-wrapper
-plugin-opt=-fresolution=/tmp/ccQ7cSBB.res -plugin-opt=-pass-through=-lgcc
-plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc
-plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s
--sysroot=/home/browa22-ext/e2fsprogs/output/host/sh4-buildroot-linux-gnu/sysroot
--eh-frame-hdr -m shlelf_linux -dynamic-linker /lib/ld-linux.so.2 -pie
/home/browa22-ext/e2fsprogs/output/host/sh4-buildroot-linux-gnu/sysroot/usr/lib/Scrt1.o
/home/browa22-ext/e2fsprogs/output/host/sh4-buildroot-linux-gnu/sysroot/usr/lib/crti.o
/home/browa22-ext/e2fsprogs/output/host/lib/gcc/sh4-buildroot-linux-gnu/13.2.0/crtbeginS.o
-L/home/browa22-ext/e2fsprogs/output/host/lib/gcc/sh4-buildroot-linux-gnu/13.2.0
-L/home/browa22-ext/e2fsprogs/output/host/lib/gcc/sh4-buildroot-linux-gnu/13.2.0/../../../../sh4-buildroot-linux-gnu/lib/!m4
-L/home/browa22-ext/e2fsprogs/output/host/lib/gcc/sh4-buildroot-linux-gnu/13.2.0/../../../../sh4-buildroot-linux-gnu/lib
-L/home/browa22-ext/e2fsprogs/output/host/sh4-buildroot-linux-gnu/sysroot/lib
-L/home/browa22-ext/e2fsprogs/output/host/sh4-buildroot-linux-gnu/sysroot/usr/lib
-z now -z relro -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc
--push-state --as-needed -lgcc_s --pop-state
/home/browa22-ext/e2fsprogs/output/host/lib/gcc/sh4-buildroot-linux-gnu/13.2.0/crtendS.o
/home/browa22-ext/e2fsprogs/output/host/sh4-buildroot-linux-gnu/sysroot/usr/lib/crtn.o
/home/browa22-ext/e2fsprogs/output/host/lib/gcc/sh4-buildroot-linux-gnu/13.2.0/../../../../sh4-buildroot-linux-gnu/bin/ld:
/home/browa22-ext/e2fsprogs/output/host/sh4-buildroot-linux-gnu/sysroot/usr/lib/Scrt1.o:
in function `L_main':
start.os:(.text+0x1c): undefined reference to `main'
/home/browa22-ext/e2fsprogs/output/host/lib/gcc/sh4-buildroot-linux-gnu/13.2.0/../../../../sh4-buildroot-linux-gnu/bin/ld:
BFD (GNU Binutils) 2.40 assertion fail elf32-sh.c:3924
collect2: error: ld returned 1 exit status
browa22-ext@lxwbrodk:~$

[Bug target/111001] New: SH: ICE during RTL pass: sh_treg_combine2

2023-08-12 Thread wbx at openadk dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111001

Bug ID: 111001
   Summary: SH: ICE during RTL pass: sh_treg_combine2
   Product: gcc
   Version: 13.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: wbx at openadk dot org
  Target Milestone: ---

Created attachment 55731
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55731=edit
preprocessed source code of rw_bitmaps.c

Hi,

following compile error occurs for Buildroot targeting sh4-linux-gnu for the
e2fsprogs package:
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
during RTL pass: sh_treg_combine2
rw_bitmaps.c: In function ‘read_bitmaps_range_start’:
rw_bitmaps.c:447:1: internal compiler error: Aborted
  447 | }
  | ^
0x7fe95c926f8f ???
./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
0x7fe95c975ccc __pthread_kill_implementation
./nptl/pthread_kill.c:44
0x7fe95c926ef1 __GI_raise
../sysdeps/posix/raise.c:26
0x7fe95c911471 __GI_abort
./stdlib/abort.c:79
0x7fe95c912189 __libc_start_call_main
../sysdeps/nptl/libc_start_call_main.h:58
0x7fe95c912244 __libc_start_main_impl
../csu/libc-start.c:381
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.

Attached is the preprocessed rw_bitmaps.c file.
The problem exist only for -O1/-O2/-O3, using -Os/O0 does not trigger the ICE.
And it is an new issue in gcc 13.2.0, it does not happen for 12.3.0. 

Do you need more information, do not hesitate to ask.
 best regards
  Waldemar

[Bug target/98784] [11/12/13/14 Regression] problematic build of uClibc with -fPIC

2023-08-08 Thread wbx at openadk dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98784

Waldemar Brodkorb  changed:

   What|Removed |Added

 CC||wbx at openadk dot org

--- Comment #18 from Waldemar Brodkorb  ---
Hi,

still happens with gcc 13.2.0.
You can boot a shell and then in strace you see a segfault error:

[pid28] fstat64(3, {st_mode=S_IFDIR|S_ISVTX|0777, st_size=400, ...}) = 0
[pid28] brk(0x154000)   = 0x154000
[pid28] getdents64(3, 0xefb11b80 /* 20 entries */, 4096) = 496
[pid28] brk(0x155000)   = 0x155000
[pid28] lstat64("./init", {st_mode=S_IFLNK|0777, st_size=10, ...}) = 0
[pid28] lstat64("./var", {st_mode=S_IFDIR|0755, st_size=40, ...}) = 0
[pid28] lstat64("./usr", {st_mode=S_IFDIR|0755, st_size=120, ...}) = 0
[pid28] lstat64("./tmp", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=40, ...}) =
0
[pid28] lstat64("./sys", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
[pid28] lstat64("./sbin", {st_mode=S_IFDIR|0755, st_size=1420, ...}) = 0
[pid28] lstat64("./run", {st_mode=S_IFDIR|0777, st_size=40, ...}) = 0
[pid28] lstat64("./root", {st_mode=S_IFDIR|0755, st_size=60, ...}) = 0
[pid28] lstat64("./proc", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
[pid28] lstat64("./mnt", {st_mode=S_IFDIR|0755, st_size=40, ...}) = 0
[pid28] lstat64("./media", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=40, ...})
= 0
[pid28] lstat64("./linuxrc", {st_mode=S_IFLNK|0777, st_size=11, ...}) = 0
[pid28] lstat64("./lib", {st_mode=S_IFDIR|0755, st_size=260, ...}) = 0
[pid28] lstat64("./etc", {st_mode=S_IFDIR|0755, st_size=640, ...}) = 0
[pid28] lstat64("./dev", {st_mode=S_IFDIR|0755, st_size=640, ...}) = 0
[pid28] lstat64("./boot", {st_mode=S_IFDIR|0755, st_size=40, ...}) = 0
[pid28] lstat64("./bin", {st_mode=S_IFDIR|0755, st_size=1920, ...}) = 0
[pid28] getdents64(3, 0xefb11b80 /* 0 entries */, 4096) = 0
[pid28] close(3)= 0
[pid28] write(1, "\33[1;34mbin\33[m  \33[1;34metc\33[m"..., 109bin 
etc  linuxrc  proc sbin usr
) = 109
[pid28] write(1, "\33[1;34mboot\33[m \33[1;36minit\33["..., 109boot
init mediaroot sys  var
) = 109
[pid28] write(1, "\33[1;34mdev\33[m  \33[1;34mlib\33[m"..., 90dev 
lib  mnt  run  tmp
) = 90
[pid28] exit_group(0)   = ?
[pid28] +++ exited with 0 +++
<... rt_sigsuspend resumed>)= ? ERESTARTNOHAND (To be restarted if
no handler)
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=28, si_uid=0,
si_status=0, si_utime=0, si_stime=3 /* 0.03 s */} ---
getrusage(RUSAGE_CHILDREN, {ru_utime={tv_sec=0, tv_usec=0}, ru_stime={tv_sec=0,
tv_usec=0}, ...}) = 0
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], WNOHANG|WSTOPPED|WCONTINUED,
NULL) = 28
getrusage(RUSAGE_CHILDREN, {ru_utime={tv_sec=0, tv_usec=8000},
ru_stime={tv_sec=0, tv_usec=32000}, ...}) = 0
wait4(-1, 0xefbe678c, WNOHANG|WSTOPPED|WCONTINUED, NULL) = -1 ECHILD (No child
processes)
sigreturn({mask=[INT RT_1 RT_8 RT_15 RT_21 RT_23 RT_31]}) = -1 (errno 629)
--- SIGSEGV {si_signo=SIGSEGV, si_code=SI_KERNEL, si_addr=NULL} ---
+++ killed by SIGSEGV +++

Any tipps how to debug this?

best regards
 Waldemar

[Bug rtl-optimization/110934] m68k: ICE with -fzero-call-used-regs=all compiling openssh 9.3p2

2023-08-07 Thread wbx at openadk dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110934

--- Comment #2 from Waldemar Brodkorb  ---
Created attachment 55701
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55701=edit
bsd-closefrom preprocessed

[Bug rtl-optimization/110934] m68k: ICE with -fzero-call-used-regs=all compiling openssh 9.3p2

2023-08-07 Thread wbx at openadk dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110934

--- Comment #3 from Waldemar Brodkorb  ---
Is this correct to use -E to generate the file?

[Bug c/110934] New: m68k: ICE with -fzero-call-used-regs=all compiling openssh 9.3p2

2023-08-07 Thread wbx at openadk dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110934

Bug ID: 110934
   Summary: m68k: ICE with -fzero-call-used-regs=all compiling
openssh 9.3p2
   Product: gcc
   Version: 13.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: wbx at openadk dot org
  Target Milestone: ---

Hi,

following ICE is generated when using Buildroot to compile OpenSSH 9.3p2 for
m68k.

 /home/browa22-ext/openssh/output/host/bin/m68k-buildroot-linux-uclibc-gcc
-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -Os -g0 
-pipe -Wno-error=format-truncation -Wall -Wpointer-arith -Wuninitialized
-Wsign-compare -Wformat-security -Wsizeof-pointer-memaccess -Wno-pointer-sign
-Wno-unused-result -Wimplicit-fallthrough -Wmisleading-indentation
-fno-strict-aliasing -D_FORTIFY_SOURCE=2 -ftrapv -fzero-call-used-regs=all
-ftrivial-auto-var-init=zero -fno-builtin-memset   -fPIC -I. -I.. -I. -I./..
-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
-D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_GNU_SOURCE
-DHAVE_CONFIG_H -c bsd-closefrom.c
during RTL pass: zero_call_used_regs
bsd-closefrom.c: In function ‘closefrom’:
bsd-closefrom.c:151:1: internal compiler error: in change_address_1, at
emit-rtl.cc:2287
  151 | }
  | ^
0x7f5f7d66f189 __libc_start_call_main
../sysdeps/nptl/libc_start_call_main.h:58
0x7f5f7d66f244 __libc_start_main_impl
../csu/libc-start.c:381
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.

Using -fzero-call-used-regs=used fixes the build issue.

gcc -v:
/home/browa22-ext/openssh/output/host/bin/m68k-buildroot-linux-uclibc-gcc -v
Using built-in specs.
COLLECT_GCC=/home/browa22-ext/openssh/output/host/bin/m68k-buildroot-linux-uclibc-gcc.br_real
COLLECT_LTO_WRAPPER=/home/browa22-ext/openssh/output/host/libexec/gcc/m68k-buildroot-linux-uclibc/13.2.0/lto-wrapper
Target: m68k-buildroot-linux-uclibc
Configured with: ./configure --prefix=/home/browa22-ext/openssh/output/host
--sysconfdir=/home/browa22-ext/openssh/output/host/etc --enable-static
--target=m68k-buildroot-linux-uclibc
--with-sysroot=/home/browa22-ext/openssh/output/host/m68k-buildroot-linux-uclibc/sysroot
--enable-__cxa_atexit --with-gnu-ld --disable-libssp --disable-multilib
--disable-decimal-float --enable-plugins --enable-lto
--with-gmp=/home/browa22-ext/openssh/output/host
--with-mpc=/home/browa22-ext/openssh/output/host
--with-mpfr=/home/browa22-ext/openssh/output/host --with-pkgversion='Buildroot
2023.08-rc1-23-g3693462a1f' --with-bugurl=http://bugs.buildroot.net/
--without-zstd --disable-libquadmath --disable-libquadmath-support
--disable-libsanitizer --enable-tls --enable-threads --without-isl
--without-cloog --with-cpu=68040 --enable-languages=c
--with-build-time-tools=/home/browa22-ext/openssh/output/host/m68k-buildroot-linux-uclibc/bin
--enable-shared --disable-libgomp
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 13.2.0 (Buildroot 2023.08-rc1-23-g3693462a1f) 
COMPILER_PATH=/home/browa22-ext/openssh/output/host/libexec/gcc/m68k-buildroot-linux-uclibc/13.2.0/:/home/browa22-ext/openssh/output/host/libexec/gcc/m68k-buildroot-linux-uclibc/13.2.0/:/home/browa22-ext/openssh/output/host/libexec/gcc/m68k-buildroot-linux-uclibc/:/home/browa22-ext/openssh/output/host/lib/gcc/m68k-buildroot-linux-uclibc/13.2.0/:/home/browa22-ext/openssh/output/host/lib/gcc/m68k-buildroot-linux-uclibc/:/home/browa22-ext/openssh/output/host/lib/gcc/m68k-buildroot-linux-uclibc/13.2.0/../../../../m68k-buildroot-linux-uclibc/bin/
LIBRARY_PATH=/home/browa22-ext/openssh/output/host/lib/gcc/m68k-buildroot-linux-uclibc/13.2.0/:/home/browa22-ext/openssh/output/host/lib/gcc/m68k-buildroot-linux-uclibc/13.2.0/../../../../m68k-buildroot-linux-uclibc/lib/:/home/browa22-ext/openssh/output/host/m68k-buildroot-linux-uclibc/sysroot/lib/:/home/browa22-ext/openssh/output/host/m68k-buildroot-linux-uclibc/sysroot/usr/lib/
COLLECT_GCC_OPTIONS='--sysroot=/home/browa22-ext/openssh/output/host/m68k-buildroot-linux-uclibc/sysroot'
'-v' '-mcpu=68040' '-dumpdir' 'a.'

/home/browa22-ext/openssh/output/host/libexec/gcc/m68k-buildroot-linux-uclibc/13.2.0/collect2
-plugin
/home/browa22-ext/openssh/output/host/libexec/gcc/m68k-buildroot-linux-uclibc/13.2.0/liblto_plugin.so
-plugin-opt=/home/browa22-ext/openssh/output/host/libexec/gcc/m68k-buildroot-linux-uclibc/13.2.0/lto-wrapper
-plugin-opt=-fresolution=/tmp/cclgUbWV.res -plugin-opt=-pass-through=-lgcc
-plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc
-plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s
--sysroot=/home/browa22-ext/openssh/output/host/m68k-buildroot-linux-uclibc/sysroot
--eh-frame-hdr -m m68kelf -dynamic-linker