All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Fuchs <fuchsfl@gmail.com>
To: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Cc: Rob Landley <rob@landley.net>,
	linux-sh <linux-sh@vger.kernel.org>,
	Geert Uytterhoeven <geert+renesas@glider.be>
Subject: Re: Toybox make root no longer works as expected
Date: Tue, 14 Jul 2026 09:47:44 +0200	[thread overview]
Message-ID: <alXpoJOjg5HrSvhE@lithos> (raw)
In-Reply-To: <71c6a925c748fb3c9c2af30362387f0e562c0f6f.camel@physik.fu-berlin.de>

On 30 Apr 08:57, John Paul Adrian Glaubitz wrote:
> Hi,
> 
> On Wed, 2026-04-29 at 09:46 +0200, John Paul Adrian Glaubitz wrote:
> > I'm trying to build a new root image after updating Toybox but that no longer works:
> > 
> > glaubitz@node54:/data/home/glaubitz/toybox> make root CROSS=sh2eb-linux-muslfdpic- LINUX=/data/home/glaubitz/sh-linux
> > mkroot/mkroot.sh  -- LINUX=/data/home/glaubitz/sh-linux CROSS=sh2eb-linux-muslfdpic-
> > No ccc symlink to compiler directory.
> > make: *** [Makefile:108: root] Error 1
> > glaubitz@node54:/data/home/glaubitz/toybox>
> > 
> > It asks me to create a "ccc" symlink but I have no clue where that link is supposed
> > to point to. The FAQ says the link is supposed to »pointing at a directory full of
> > cross compilers« but I don't have that and that's not my personal setup. I have the
> > cross compilers installed in my home directory and their bin directories added to
> > the PATH variable which has always worked in the past without any problems.
> > 
> > Can you explain how that "ccc" symlink works?
> 
> OK, for some reason it works now. Unfortunately, the toolchain doesn't like the current kernel:
> 
>   CC      net/ipv4/inetpeer.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:9: internal compiler error: in change_address_1, at emit-rtl.c:2275
>   261 |         }                                                               \
>       |         ^
> ./include/linux/syscalls.h:236:9: 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}:1592: Error: missing operand
> {standard input}:1592: Error: invalid operands for opcode
> {standard input}:976: Error: displacement to undefined symbol .L339 overflows 12-bit field
> {standard input}:1014: Error: displacement to undefined symbol .L459 overflows 12-bit field
> {standard input}:1028: Error: displacement to undefined symbol .L340 overflows 12-bit field
> {standard input}:1040: Error: displacement to undefined symbol .L461 overflows 12-bit field
> {standard input}:1060: Error: displacement to undefined symbol .L462 overflows 12-bit field
> {standard input}:1082: Error: displacement to undefined symbol .L463 overflows 12-bit field
> {standard input}:1100: Error: displacement to undefined symbol .L252 overflows 12-bit field
> {standard input}:1201: Error: displacement to undefined symbol .L286 overflows 12-bit field
> {standard input}:1211: Error: displacement to undefined symbol .L468 overflows 12-bit field
> {standard input}:1221: Error: displacement to undefined symbol .L298 overflows 12-bit field
> {standard input}:1234: Error: displacement to undefined symbol .L469 overflows 12-bit field
> {standard input}:1256: Error: displacement to undefined symbol .L349 overflows 12-bit field
> {standard input}:1341: Error: displacement to undefined symbol .L314 overflows 12-bit field
> {standard input}:1488: Error: displacement to undefined symbol .L454 overflows 8-bit field 
> {standard input}:1498: Error: displacement to undefined symbol .L471 overflows 8-bit field 
> make[3]: *** [scripts/Makefile.build:289: kernel/nstree.o] Error 1
> make[3]: *** Waiting for unfinished jobs....
> 
> Adrian

I also crafted a bit with gcc-17, and my first issue was a duplicate
symbols (LPCS0) compiling libgcc like in
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89012 I could only work
around with explicitly using O1 instead of O2 in INTERNAL_CFLAGS of gcc.

And errors with libbacktrace, I worked around by --enable-languages=c

I got gcc to not ICE, but it then fails with invalid assembler thats why
I became suspicious about the asm in question. turns out, delcaring the
adresses as offsetable, seems to "fix" the ICE and compile and work for
fdpic, means it is maybe not necessarily only a GCC issue.

diff --git a/arch/sh/include/asm/uaccess_32.h b/arch/sh/include/asm/uaccess_32.h
index 5d7ddc092afd..cef40414bfb1 100644
--- a/arch/sh/include/asm/uaccess_32.h
+++ b/arch/sh/include/asm/uaccess_32.h
@@ -92,7 +92,7 @@ __asm__ __volatile__( \
 	".long	1b + 2, 3b\n\t" \
 	".previous" \
 	:"=&r" (err), "=&r" (x) \
-	:"m" (__m(addr)), "i" (-EFAULT), "0" (err)); })
+	:"o" (__m(addr)), "i" (-EFAULT), "0" (err)); })
 #else
 #define __get_user_u64(x, addr, err) \
 ({ \
@@ -116,7 +116,7 @@ __asm__ __volatile__( \
 	".long	1b + 2, 3b\n\t" \
 	".previous" \
 	:"=&r" (err), "=&r" (x) \
-	:"m" (__m(addr)), "i" (-EFAULT), "0" (err)); })
+	:"o" (__m(addr)), "i" (-EFAULT), "0" (err)); })
 #endif
 
 #define __put_user_size(x,ptr,size,retval)		\
@@ -196,7 +196,7 @@ __asm__ __volatile__( \
 	".long	1b, 3b\n\t" \
 	".previous" \
 	: "=r" (retval) \
-	: "r" (val), "m" (__m(addr)), "i" (-EFAULT), "0" (retval) \
+	: "r" (val), "o" (__m(addr)), "i" (-EFAULT), "0" (retval) \
         : "memory"); })
 #else
 #define __put_user_u64(val,addr,retval) \
@@ -218,7 +218,7 @@ __asm__ __volatile__( \
 	".long	1b, 3b\n\t" \
 	".previous" \
 	: "=r" (retval) \
-	: "r" (val), "m" (__m(addr)), "i" (-EFAULT), "0" (retval) \
+	: "r" (val), "o" (__m(addr)), "i" (-EFAULT), "0" (retval) \
         : "memory"); })
 #endif
 
-- 
2.43.0

Then there is register clobbering in the sh2 shift helpers, thats a
separate runtime issue.

Regards
Florian

  parent reply	other threads:[~2026-07-14  7:47 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-29  7:46 Toybox make root no longer works as expected John Paul Adrian Glaubitz
2026-04-30  6:57 ` John Paul Adrian Glaubitz
2026-04-30  7:13   ` D. Jeff Dionne
2026-04-30  7:17     ` John Paul Adrian Glaubitz
2026-05-01 18:20       ` Rob Landley
2026-05-01 18:32         ` John Paul Adrian Glaubitz
2026-05-01 21:27           ` Rob Landley
2026-05-02  6:55             ` John Paul Adrian Glaubitz
2026-05-11 23:08               ` Rob Landley
2026-05-13  4:35                 ` Rob Landley
2026-07-10 13:32               ` John Paul Adrian Glaubitz
2026-05-01 18:04   ` Rob Landley
2026-07-14  7:47   ` Florian Fuchs [this message]
2026-07-14  8:14     ` John Paul Adrian Glaubitz
2026-07-14 10:46       ` Florian Fuchs
2026-07-14 22:02       ` Rob Landley
2026-07-14 19:32     ` Rob Landley
2026-04-30 20:10 ` Rob Landley
2026-04-30 22:46   ` John Paul Adrian Glaubitz
2026-05-01  3:44     ` D. Jeff Dionne
2026-05-01  9:21       ` John Paul Adrian Glaubitz
     [not found] <570e4053-9e57-4e63-9808-0b770a3a3791@landley.net>
2026-07-12  6:00 ` D. Jeff Dionne
2026-07-12  8:02   ` Rob Landley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alXpoJOjg5HrSvhE@lithos \
    --to=fuchsfl@gmail.com \
    --cc=geert+renesas@glider.be \
    --cc=glaubitz@physik.fu-berlin.de \
    --cc=linux-sh@vger.kernel.org \
    --cc=rob@landley.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.