Linux SNPS ARC Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [linux-next:master 8956/10560] main.c:undefined reference to `__st_r13_to_r15'
@ 2026-11-21  0:53 kernel test robot
  2026-11-21 10:18 ` Arnd Bergmann
  0 siblings, 1 reply; 4+ messages in thread
From: kernel test robot @ 2026-11-21  0:53 UTC (permalink / raw)
  To: Vineet Gupta; +Cc: oe-kbuild-all, linux-snps-arc, Arnd Bergmann

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'
   arc-linux-ld: init/main.o: in function `perf_trace_initcall_start':
>> main.c:(.text+0xe0): undefined reference to `__st_r13_to_r16'
>> arc-linux-ld: main.c:(.text+0xe0): undefined reference to `__st_r13_to_r16'
>> arc-linux-ld: main.c:(.text+0x16e): undefined reference to `__ld_r13_to_r16_ret'
>> arc-linux-ld: main.c:(.text+0x16e): undefined reference to `__ld_r13_to_r16_ret'
   arc-linux-ld: init/main.o: in function `perf_trace_initcall_finish':
>> main.c:(.text+0x178): undefined reference to `__st_r13_to_r17'
>> arc-linux-ld: main.c:(.text+0x178): undefined reference to `__st_r13_to_r17'
>> arc-linux-ld: main.c:(.text+0x20c): undefined reference to `__ld_r13_to_r17_ret'
>> arc-linux-ld: main.c:(.text+0x20c): undefined reference to `__ld_r13_to_r17_ret'
   arc-linux-ld: init/main.o: in function `trace_event_raw_event_initcall_level':
   main.c:(.text+0x214): undefined reference to `__st_r13_to_r17'
   arc-linux-ld: main.c:(.text+0x214): undefined reference to `__st_r13_to_r17'
   arc-linux-ld: main.c:(.text+0x2f2): undefined reference to `__ld_r13_to_r17_ret'
   arc-linux-ld: main.c:(.text+0x2f2): undefined reference to `__ld_r13_to_r17_ret'
   arc-linux-ld: init/main.o: in function `trace_event_raw_event_initcall_start':
   main.c:(.text+0x2fc): undefined reference to `__st_r13_to_r17'
   arc-linux-ld: main.c:(.text+0x2fc): undefined reference to `__st_r13_to_r17'
   arc-linux-ld: main.c:(.text+0x36e): undefined reference to `__ld_r13_to_r17_ret'
   arc-linux-ld: main.c:(.text+0x36e): undefined reference to `__ld_r13_to_r17_ret'
   arc-linux-ld: init/main.o: in function `trace_event_raw_event_initcall_finish':
>> main.c:(.text+0x3a8): undefined reference to `__st_r13_to_r18'
>> arc-linux-ld: main.c:(.text+0x3a8): undefined reference to `__st_r13_to_r18'
>> arc-linux-ld: main.c:(.text+0x41c): undefined reference to `__ld_r13_to_r18_ret'
>> arc-linux-ld: main.c:(.text+0x41c): undefined reference to `__ld_r13_to_r18_ret'
   arc-linux-ld: init/main.o: in function `__srcu_read_lock_fast.constprop.0':
   main.c:(.text+0x624): undefined reference to `__st_r13_to_r15'
   arc-linux-ld: main.c:(.text+0x624): undefined reference to `__st_r13_to_r15'
   arc-linux-ld: main.c:(.text+0x678): undefined reference to `__ld_r13_to_r15_ret'
   arc-linux-ld: main.c:(.text+0x678): undefined reference to `__ld_r13_to_r15_ret'
   arc-linux-ld: init/main.o: in function `trace_initcall_finish_cb':
>> main.c:(.text+0x680): undefined reference to `__st_r13_to_r19'
>> arc-linux-ld: main.c:(.text+0x680): undefined reference to `__st_r13_to_r19'
>> arc-linux-ld: main.c:(.text+0x764): undefined reference to `__ld_r13_to_r19'
>> arc-linux-ld: main.c:(.text+0x764): undefined reference to `__ld_r13_to_r19'
   arc-linux-ld: init/main.o: in function `perf_trace_initcall_level':
   main.c:(.text+0x778): undefined reference to `__st_r13_to_r20'
   arc-linux-ld: main.c:(.text+0x778): undefined reference to `__st_r13_to_r20'
   arc-linux-ld: main.c:(.text+0x856): undefined reference to `__ld_r13_to_r20_ret'
   arc-linux-ld: main.c:(.text+0x856): undefined reference to `__ld_r13_to_r20_ret'
   arc-linux-ld: init/main.o: in function `do_one_initcall':
   main.c:(.text+0x860): undefined reference to `__st_r13_to_r19'
   arc-linux-ld: main.c:(.text+0x860): undefined reference to `__st_r13_to_r19'
   arc-linux-ld: main.c:(.text+0xd4a): undefined reference to `__ld_r13_to_r19_ret'
   arc-linux-ld: main.c:(.text+0xd4a): undefined reference to `__ld_r13_to_r19_ret'
   arc-linux-ld: init/main.o: in function `do_early_param':
   main.c:(.init.text+0x78): undefined reference to `__st_r13_to_r15'
   arc-linux-ld: main.c:(.init.text+0x78): undefined reference to `__st_r13_to_r15'
   arc-linux-ld: main.c:(.init.text+0x96): undefined reference to `__ld_r13_to_r15_ret'
   arc-linux-ld: main.c:(.init.text+0x96): undefined reference to `__ld_r13_to_r15_ret'
   arc-linux-ld: init/main.o: in function `unknown_bootoption':
   main.c:(.init.text+0x17c): undefined reference to `__st_r13_to_r18'
   arc-linux-ld: main.c:(.init.text+0x17c): undefined reference to `__st_r13_to_r18'
   arc-linux-ld: main.c:(.init.text+0x264): undefined reference to `__ld_r13_to_r18_ret'
   arc-linux-ld: main.c:(.init.text+0x264): undefined reference to `__ld_r13_to_r18_ret'
   arc-linux-ld: init/main.o: in function `xbc_kernel_param_filter':
   main.c:(.init.text+0x2cc): undefined reference to `__st_r13_to_r18'
   arc-linux-ld: main.c:(.init.text+0x2cc): undefined reference to `__st_r13_to_r18'
   arc-linux-ld: main.c:(.init.text+0x322): undefined reference to `__ld_r13_to_r18_ret'
   arc-linux-ld: main.c:(.init.text+0x322): undefined reference to `__ld_r13_to_r18_ret'
   arc-linux-ld: init/main.o: in function `xbc_make_cmdline':
   main.c:(.init.text+0x37c): undefined reference to `__st_r13_to_r17'
   arc-linux-ld: main.c:(.init.text+0x37c): undefined reference to `__st_r13_to_r17'
   arc-linux-ld: main.c:(.init.text+0x3e2): undefined reference to `__ld_r13_to_r17_ret'
   arc-linux-ld: main.c:(.init.text+0x3e2): undefined reference to `__ld_r13_to_r17_ret'
   arc-linux-ld: init/main.o: in function `initcall_blacklist':
   main.c:(.init.text+0x444): undefined reference to `__st_r13_to_r16'
   arc-linux-ld: main.c:(.init.text+0x444): undefined reference to `__st_r13_to_r16'
   arc-linux-ld: main.c:(.init.text+0x4f8): undefined reference to `__ld_r13_to_r16_ret'
   arc-linux-ld: main.c:(.init.text+0x4f8): undefined reference to `__ld_r13_to_r16_ret'
   arc-linux-ld: init/main.o: in function `start_kernel':
   main.c:(.init.text+0x588): undefined reference to `__st_r13_to_r18'
   arc-linux-ld: main.c:(.init.text+0x588): undefined reference to `__st_r13_to_r18'
   arc-linux-ld: init/main.o: in function `kernel_init_freeable':
   main.c:(.init.text+0xcb8): undefined reference to `__st_r13_to_r19'
   arc-linux-ld: main.c:(.init.text+0xcb8): undefined reference to `__st_r13_to_r19'
   arc-linux-ld: main.c:(.init.text+0xff8): undefined reference to `__ld_r13_to_r19'
   arc-linux-ld: main.c:(.init.text+0xff8): undefined reference to `__ld_r13_to_r19'
   arc-linux-ld: main.c:(.init.text+0x1016): undefined reference to `__ld_r13_to_r19_ret'
   arc-linux-ld: main.c:(.init.text+0x1016): undefined reference to `__ld_r13_to_r19_ret'
   arc-linux-ld: init/main.o: in function `run_init_process':
   main.c:(.text.unlikely+0x3c): undefined reference to `__st_r13_to_r16'
   arc-linux-ld: main.c:(.text.unlikely+0x3c): undefined reference to `__st_r13_to_r16'
   arc-linux-ld: main.c:(.text.unlikely+0xde): undefined reference to `__ld_r13_to_r16'
   arc-linux-ld: main.c:(.text.unlikely+0xde): undefined reference to `__ld_r13_to_r16'
   arc-linux-ld: init/main.o: in function `trace_initcall_level':
   main.c:(.text.unlikely+0x210): undefined reference to `__st_r13_to_r17'
   arc-linux-ld: main.c:(.text.unlikely+0x210): undefined reference to `__st_r13_to_r17'
   arc-linux-ld: main.c:(.text.unlikely+0x42e): undefined reference to `__ld_r13_to_r17'
   arc-linux-ld: main.c:(.text.unlikely+0x42e): undefined reference to `__ld_r13_to_r17'
   arc-linux-ld: main.c:(.text.unlikely+0x43e): undefined reference to `__ld_r13_to_r17_ret'
   arc-linux-ld: main.c:(.text.unlikely+0x43e): undefined reference to `__ld_r13_to_r17_ret'
   arc-linux-ld: init/do_mounts.o: in function `do_mount_root':
   do_mounts.c:(.init.text+0x130): undefined reference to `__st_r13_to_r21'
   arc-linux-ld: do_mounts.c:(.init.text+0x130): undefined reference to `__st_r13_to_r21'
   arc-linux-ld: do_mounts.c:(.init.text+0x28c): undefined reference to `__ld_r13_to_r21_ret'
   arc-linux-ld: do_mounts.c:(.init.text+0x28c): undefined reference to `__ld_r13_to_r21_ret'
   arc-linux-ld: init/do_mounts.o: in function `mount_root_generic':
   do_mounts.c:(.init.text+0x318): undefined reference to `__st_r13_to_r20'
   arc-linux-ld: do_mounts.c:(.init.text+0x318): undefined reference to `__st_r13_to_r20'
   arc-linux-ld: do_mounts.c:(.init.text+0x4c4): undefined reference to `__ld_r13_to_r20_ret'
   arc-linux-ld: do_mounts.c:(.init.text+0x4c4): undefined reference to `__ld_r13_to_r20_ret'
   arc-linux-ld: init/do_mounts.o: in function `mount_root':
   do_mounts.c:(.init.text+0x598): undefined reference to `__st_r13_to_r21'
   arc-linux-ld: do_mounts.c:(.init.text+0x598): undefined reference to `__st_r13_to_r21'
   arc-linux-ld: do_mounts.c:(.init.text+0x5ce): undefined reference to `__ld_r13_to_r21'
   arc-linux-ld: do_mounts.c:(.init.text+0x5ce): undefined reference to `__ld_r13_to_r21'
   arc-linux-ld: do_mounts.c:(.init.text+0x7a6): undefined reference to `__ld_r13_to_r21_ret'
   arc-linux-ld: do_mounts.c:(.init.text+0x7a6): undefined reference to `__ld_r13_to_r21_ret'
   arc-linux-ld: init/do_mounts.o: in function `prepare_namespace':
   do_mounts.c:(.init.text+0x7b0): undefined reference to `__st_r13_to_r15'
   arc-linux-ld: do_mounts.c:(.init.text+0x7b0): undefined reference to `__st_r13_to_r15'
   arc-linux-ld: do_mounts.c:(.init.text+0x8b2): undefined reference to `__ld_r13_to_r15_ret'
   arc-linux-ld: do_mounts.c:(.init.text+0x8b2): undefined reference to `__ld_r13_to_r15_ret'
   arc-linux-ld: init/initramfs.o: in function `do_utime':
   initramfs.c:(.init.text+0x14): undefined reference to `__st_r13_to_r15'
   arc-linux-ld: initramfs.c:(.init.text+0x14): undefined reference to `__st_r13_to_r15'
   arc-linux-ld: initramfs.c:(.init.text+0x3e): undefined reference to `__ld_r13_to_r15_ret'
   arc-linux-ld: initramfs.c:(.init.text+0x3e): undefined reference to `__ld_r13_to_r15_ret'
   arc-linux-ld: init/initramfs.o: in function `do_skip':
   initramfs.c:(.init.text+0xc4): undefined reference to `__st_r13_to_r15'
   arc-linux-ld: initramfs.c:(.init.text+0xc4): undefined reference to `__st_r13_to_r15'
   arc-linux-ld: initramfs.c:(.init.text+0xf8): undefined reference to `__ld_r13_to_r15_ret'
   arc-linux-ld: initramfs.c:(.init.text+0xf8): undefined reference to `__ld_r13_to_r15_ret'
   arc-linux-ld: init/initramfs.o: in function `flush_buffer':
   initramfs.c:(.init.text+0x1cc): undefined reference to `__st_r13_to_r16'
   arc-linux-ld: initramfs.c:(.init.text+0x1cc): undefined reference to `__st_r13_to_r16'
   arc-linux-ld: initramfs.c:(.init.text+0x22e): undefined reference to `__ld_r13_to_r16_ret'
   arc-linux-ld: initramfs.c:(.init.text+0x22e): undefined reference to `__ld_r13_to_r16_ret'
   arc-linux-ld: init/initramfs.o: in function `maybe_link':
   initramfs.c:(.init.text+0x310): undefined reference to `__st_r13_to_r24'
   arc-linux-ld: initramfs.c:(.init.text+0x310): undefined reference to `__st_r13_to_r24'
   arc-linux-ld: initramfs.c:(.init.text+0x4a6): undefined reference to `__ld_r13_to_r24_ret'
   arc-linux-ld: initramfs.c:(.init.text+0x4a6): undefined reference to `__ld_r13_to_r24_ret'
   arc-linux-ld: init/initramfs.o: in function `do_header':

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki


_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [linux-next:master 8956/10560] main.c:undefined reference to `__st_r13_to_r15'
  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
  0 siblings, 1 reply; 4+ messages in thread
From: Arnd Bergmann @ 2026-11-21 10:18 UTC (permalink / raw)
  To: kernel test robot, Vineet Gupta; +Cc: oe-kbuild-all, linux-snps-arc

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. 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__
 
 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:

--- 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [linux-next:master 8956/10560] main.c:undefined reference to `__st_r13_to_r15'
  2026-11-21 10:18 ` Arnd Bergmann
@ 2026-11-22 23:14   ` Vineet Gupta
  2026-11-22 23:24     ` Arnd Bergmann
  0 siblings, 1 reply; 4+ messages in thread
From: Vineet Gupta @ 2026-11-22 23:14 UTC (permalink / raw)
  To: Arnd Bergmann, kernel test robot, Vineet Gupta
  Cc: oe-kbuild-all, linux-snps-arc

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [linux-next:master 8956/10560] main.c:undefined reference to `__st_r13_to_r15'
  2026-11-22 23:14   ` Vineet Gupta
@ 2026-11-22 23:24     ` Arnd Bergmann
  0 siblings, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2026-11-22 23:24 UTC (permalink / raw)
  To: Vineet Gupta, kernel test robot; +Cc: oe-kbuild-all, linux-snps-arc

On Mon, Nov 23, 2026, at 00:14, Vineet Gupta wrote:
> On 11/21/26 02:18, Arnd Bergmann wrote:
>> On Sat, Nov 21, 2026, at 01:53, kernel test robot wrote:
>>>
>>>     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.

You can always use the toolchains from

https://mirrors.edge.kernel.org/pub/tools/crosstool/

>>   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.

Ok

>>   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.

Sounds good, thanks!

      Arnd

_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-22 23:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2026-11-22 23:24     ` Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox