Re: Toybox make root no longer works as expected

John Paul Adrian Glaubitz <[email protected]>
Newsgroups gmane.linux.ports.sh.devel
Message-ID <a9acb387eb573a6b1e2cfad6bb406e8fbafda412.camel@physik.fu-berlin.de>
Hi Jeff,

On Fri, 2026-05-01 at 12:44 +0900, D. Jeff Dionne wrote:
> On May 1, 2026, at 07:46, John Paul Adrian Glaubitz <[email protected]> wrote:
> 
> > Could you maybe build an updated toolchain for sh2eb which is based on a more recent GCC version?
> 
> The main problem here, I think if it’s a version issue, is there is breakage in the GCC optimiser
> when used against the SH backend.  But it could also be the J-Core instruction set variant of SH2.
> 
> GCC 9.4 is probably what you need, we don’t actually use GCC 11… Rob uses a different work flow
> methodology, with the goal of self contained builds.  Most of us benefit from 'golden compilers'
> on the path, and for J-Core that been GCC 9.4 series because of similar problems.  This choice
> came about after some testing, so it’s what Rich Felker’s musl cross make still does.  The results
> of that build script are used in every day work.

GCC 9.4.0 has the same problem, unfortunately:

glaubitz@node54:/data/home/glaubitz/toybox.good> sh2eb-linux-muslfdpic-cc --version
sh2eb-linux-muslfdpic-cc (GCC) 9.4.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

glaubitz@node54:/data/home/glaubitz/toybox.good> 


  CC      io_uring/bpf_filter.o
during RTL pass: final
In file included from kernel/nstree.c:8:
kernel/nstree.c: In function '__se_sys_listns':
./include/linux/syscalls.h:261:2: internal compiler error: in change_address_1, at emit-rtl.c:2286
  261 |  }        \
      |  ^
./include/linux/syscalls.h:236:2: note: in expansion of macro '__SYSCALL_DEFINEx'
  236 |  __SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
      |  ^~~~~~~~~~~~~~~~~
./include/linux/syscalls.h:228:36: note: in expansion of macro 'SYSCALL_DEFINEx'
  228 | #define SYSCALL_DEFINE4(name, ...) SYSCALL_DEFINEx(4, _##name, __VA_ARGS__)
      |                                    ^~~~~~~~~~~~~~~
kernel/nstree.c:763:1: note: in expansion of macro 'SYSCALL_DEFINE4'
  763 | SYSCALL_DEFINE4(listns, const struct ns_id_req __user *, req,
      | ^~~~~~~~~~~~~~~
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://gcc.gnu.org/bugs/> for instructions.
{standard input}: Assembler messages:
{standard input}: Warning: end of file not at end of a line; newline inserted
{standard input}:1547: Error: missing operand
{standard input}:1547: Error: invalid operands for opcode
{standard input}:1004: Error: displacement to undefined symbol .L344 overflows 12-bit field
{standard input}:1042: Error: displacement to undefined symbol .L456 overflows 12-bit field
{standard input}:1049: Error: displacement to undefined symbol .L588 overflows 12-bit field
{standard input}:1056: Error: displacement to undefined symbol .L345 overflows 12-bit field
{standard input}:1068: Error: displacement to undefined symbol .L458 overflows 12-bit field
{standard input}:1085: Error: displacement to undefined symbol .L459 overflows 12-bit field
{standard input}:1095: Error: displacement to undefined symbol .L252 overflows 12-bit field
{standard input}:1107: Error: displacement to undefined symbol .L346 overflows 12-bit field
{standard input}:1116: Error: displacement to undefined symbol .L254 overflows 12-bit field
{standard input}:1119: Error: displacement to undefined symbol .L256 overflows 12-bit field
{standard input}:1159: Error: displacement to undefined symbol .L339 overflows 12-bit field
{standard input}:1322: Error: displacement to undefined symbol .L451 overflows 12-bit field
{standard input}:1335: Error: displacement to undefined symbol .L355 overflows 12-bit field
{standard input}:1379: Error: displacement to undefined symbol .L588 overflows 12-bit field
{standard input}:1436: Error: displacement to undefined symbol .L295 overflows 8-bit field 
{standard input}:1439: Error: displacement to undefined symbol .L466 overflows 8-bit field 
{standard input}:1455: Error: displacement to undefined symbol .L292 overflows 12-bit field
{standard input}:1465: Error: displacement to undefined symbol .L468 overflows 12-bit field
{standard input}:1475: Error: displacement to undefined symbol .L304 overflows 12-bit field
{standard input}:1488: Error: displacement to undefined symbol .L353 overflows 12-bit field
{standard input}:1497: Error: displacement to undefined symbol .L306 overflows 12-bit field
{standard input}:1510: Error: displacement to undefined symbol .L354 overflows 12-bit field
{standard input}:1414: Error: pcrel too far
{standard input}:1417: Error: pcrel too far
{standard input}:1500: Error: pcrel too far
make[3]: *** [scripts/Makefile.build:289: kernel/nstree.o] Error 1
make[3]: *** Waiting for unfinished jobs....
  CC      kernel/utsname_sysctl.o

Might be an idea to try an LRA-enabled GCC [1].

Adrian

> [1] https://github.com/olegendo/gcc/tree/devel/sh-lra

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.