From: Vineet Gupta <vgupta@kernel.org>
To: Arnd Bergmann <arnd@arndb.de>, kernel test robot <lkp@intel.com>,
Vineet Gupta <vgupta@kernel.org>
Cc: oe-kbuild-all@lists.linux.dev, linux-snps-arc@lists.infradead.org
Subject: Re: [linux-next:master 8956/10560] main.c:undefined reference to `__st_r13_to_r15'
Date: Sun, 22 Nov 2026 15:14:41 -0800 [thread overview]
Message-ID: <e96c9d87-53e6-4e82-9502-40e86bac3edc@kernel.org> (raw)
In-Reply-To: <5d49465f-8584-4e75-8973-9fbf326bce58@app.fastmail.com>
On 11/21/26 02:18, Arnd Bergmann wrote:
> On Sat, Nov 21, 2026, at 01:53, kernel test robot wrote:
>> tree:
>> https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
>> master
>> head: 909ef7a9a30fa139e69e555e3606680f5cca7726
>> commit: 86a4eab2bd8313fec6e54742e3ea187b65b86b07 [8956/10560] ARC: stop
>> linking libgcc
>> config: arc-randconfig-2000-20261120
>> (https://download.01.org/0day-ci/archive/20261121/20261121004452.TskH9STt-lkp@intel.com/config)
>> compiler: arc-linux-gcc (GCC) 9.5.0
>> reproduce (this is a W=1 build):
>> (https://download.01.org/0day-ci/archive/20261121/20261121004452.TskH9STt-lkp@intel.com/reproduce)
>>
>> If you fix the issue in a separate patch/commit (i.e. not just a new version of
>> the same patch/commit), kindly add following tags
>> | Reported-by: kernel test robot <lkp@intel.com>
>> | Closes: https://lore.kernel.org/r/20261121004452.TskH9STt-lkp@intel.com/
>>
>> All errors (new ones prefixed by >>):
>>
>> arc-linux-ld: init/main.o: in function `__traceiter_initcall_finish':
>>>> main.c:(.text+0x90): undefined reference to `__st_r13_to_r15'
>>>> arc-linux-ld: main.c:(.text+0x90): undefined reference to `__st_r13_to_r15'
>>>> arc-linux-ld: main.c:(.text+0xba): undefined reference to `__ld_r13_to_r15_ret'
>>>> arc-linux-ld: main.c:(.text+0xba): undefined reference to `__ld_r13_to_r15_ret'
> I've managed to reproduce this, but only with gcc-12 and older,
> not gcc-13 and up.
Thanks I was trying to do this as well, but couldn't since I didn't have
an older toolchain handy.
> I also found a workaround, but I'm not sure if this
> is a good idea or not:
>
> --- a/arch/arc/Makefile
> +++ b/arch/arc/Makefile
> @@ -9,7 +9,7 @@ ifeq ($(CROSS_COMPILE),)
> CROSS_COMPILE := $(call cc-cross-prefix, arc-linux- arceb-linux- arc-linux-gnu-)
> endif
>
> -cflags-y += -fno-common -pipe -fno-builtin -mmedium-calls -mswape -D__linux__
> +cflags-y += -fno-common -pipe -fno-builtin -mmedium-calls -mswape -mno-millicode -D__linux__
I thik this is the right fix.
Ideally this is only needed for OPTIMIZE_FOR_SIZE, let me send a v2.
> tune-mcpu-def-$(CONFIG_ISA_ARCOMPACT) := -mcpu=arc700
> tune-mcpu-def-$(CONFIG_ISA_ARCV2) := -mcpu=hs38
>
> The alternative of course is to include the libgcc file that includes the
> millicode helpers.
>
> I also came across the "-fno-builtin", which seems like a bad idea because
> it prevents a number of optimizations. I could get it to build without the
> argument using two oneline changes, but that doesn't mean this is correct
> or complete:
I don't recall the history behind this is, seems like its been since
since th eoriginal port.
I can do a follow up cleanup.
Thx,
-Vineet
>
> --- a/arch/arc/include/asm/bitops.h
> +++ b/arch/arc/include/asm/bitops.h
> @@ -143,7 +143,7 @@ static inline __attribute__ ((const)) unsigned long __fls(unsigned long x)
> * ffs = Find First Set in word (LSB to MSB)
> * @result: [1-32], 0 if all 0's
> */
> -static inline __attribute__ ((const)) int ffs(unsigned int x)
> +static inline __attribute__ ((const)) int ffs(int x)
> {
> int n;
>
> a/arch/arc/kernel/traps.c
> +++ b/arch/arc/kernel/traps.c
> @@ -156,4 +156,5 @@ void do_insterror_or_kprobe(unsigned long address, struct pt_regs *regs)
> void abort(void)
> {
> __asm__ __volatile__("trap_s 5\n");
> + unreachable();
> }
>
> Arnd
_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
next prev parent reply other threads:[~2026-11-22 23:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-21 0:53 [linux-next:master 8956/10560] main.c:undefined reference to `__st_r13_to_r15' kernel test robot
2026-11-21 10:18 ` Arnd Bergmann
2026-11-22 23:14 ` Vineet Gupta [this message]
2026-11-22 23:24 ` Arnd Bergmann
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=e96c9d87-53e6-4e82-9502-40e86bac3edc@kernel.org \
--to=vgupta@kernel.org \
--cc=arnd@arndb.de \
--cc=linux-snps-arc@lists.infradead.org \
--cc=lkp@intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox