Hi,
I'm running into a problem following the steps at https://doc.coreboot.org/tutorial/part1.html on an Ubuntu 21.04 based system. The host compiler is gcc 10.3 and apparently CoreBoot has installed gcc 8.3.0 for its own usage but seems to be missing some required parts.
Everything is good up until:
tcullen@alien:~/src/coreboot$ make -C payloads/coreinfo ... LPGCC coreinfo.bin /home/tcullen/src/coreboot/util/crossgcc/xgcc/lib/gcc/x86_64-elf/8.3.0/../../../../x86_64-elf/bin/ld.bfd: build/cpuinfo_module.o: in function `cpuinfo_module_init': cpuinfo_module.c:(.text+0x45e): undefined reference to `__udivdi3' /home/tcullen/src/coreboot/util/crossgcc/xgcc/lib/gcc/x86_64-elf/8.3.0/../../../../x86_64-elf/bin/ld.bfd: build/timestamps_module.o: in function `timestamp_print_entry.constprop.1': timestamps_module.c:(.text+0x153): undefined reference to `__udivdi3' /home/tcullen/src/coreboot/util/crossgcc/xgcc/lib/gcc/x86_64-elf/8.3.0/../../../../x86_64-elf/bin/ld.bfd: timestamps_module.c:(.text+0x190): undefined reference to `__udivdi3' /home/tcullen/src/coreboot/util/crossgcc/xgcc/lib/gcc/x86_64-elf/8.3.0/../../../../x86_64-elf/bin/ld.bfd: /home/tcullen/src/coreboot/payloads/coreinfo/libpayload/libpayload.a(timer.libc.o): in function `get_cpu_khz_xtal': /home/tcullen/src/coreboot/payloads/libpayload/arch/x86/timer.c:121: undefined reference to `__udivdi3' /home/tcullen/src/coreboot/util/crossgcc/xgcc/lib/gcc/x86_64-elf/8.3.0/../../../../x86_64-elf/bin/ld.bfd: /home/tcullen/src/coreboot/payloads/libpayload/arch/x86/timer.c:121: undefined reference to `__udivdi3' /home/tcullen/src/coreboot/util/crossgcc/xgcc/lib/gcc/x86_64-elf/8.3.0/../../../../x86_64-elf/bin/ld.bfd: /home/tcullen/src/coreboot/payloads/coreinfo/libpayload/libpayload.a(timer.libc.o):/home/tcullen/src/coreboot/payloads/libpayload/arch/x86/timer.c:78: more undefined references to `__udivdi3' follow /home/tcullen/src/coreboot/util/crossgcc/xgcc/lib/gcc/x86_64-elf/8.3.0/../../../../x86_64-elf/bin/ld.bfd: /home/tcullen/src/coreboot/payloads/coreinfo/libpayload/libpayload.a(printf.libc.o): in function `print_number': /home/tcullen/src/coreboot/payloads/libpayload/libc/printf.c:261: undefined reference to `__udivmoddi4' /home/tcullen/src/coreboot/util/crossgcc/xgcc/lib/gcc/x86_64-elf/8.3.0/../../../../x86_64-elf/bin/ld.bfd: /home/tcullen/src/coreboot/payloads/coreinfo/libpayload/libpayload.a(time.libc.o): in function `update_clock': /home/tcullen/src/coreboot/payloads/libpayload/libc/time.c:59: undefined reference to `__udivdi3' /home/tcullen/src/coreboot/util/crossgcc/xgcc/lib/gcc/x86_64-elf/8.3.0/../../../../x86_64-elf/bin/ld.bfd: /home/tcullen/src/coreboot/payloads/libpayload/libc/time.c:64: undefined reference to `__udivdi3' /home/tcullen/src/coreboot/util/crossgcc/xgcc/lib/gcc/x86_64-elf/8.3.0/../../../../x86_64-elf/bin/ld.bfd: /home/tcullen/src/coreboot/payloads/libpayload/libc/time.c:67: undefined reference to `__udivdi3' /home/tcullen/src/coreboot/util/crossgcc/xgcc/lib/gcc/x86_64-elf/8.3.0/../../../../x86_64-elf/bin/ld.bfd: /home/tcullen/src/coreboot/payloads/coreinfo/libpayload/libpayload.a(time.libc.o): in function `arch_ndelay': /home/tcullen/src/coreboot/payloads/libpayload/libc/time.c:166: undefined reference to `__udivdi3' /home/tcullen/src/coreboot/util/crossgcc/xgcc/lib/gcc/x86_64-elf/8.3.0/../../../../x86_64-elf/bin/ld.bfd: /home/tcullen/src/coreboot/payloads/coreinfo/libpayload/libpayload.a(time.libc.o): in function `timer_us': /home/tcullen/src/coreboot/payloads/libpayload/libc/time.c:185: undefined reference to `__udivdi3' collect2: error: ld returned 1 exit status make: *** [../libpayload/Makefile.payload:91: build/coreinfo.bin] Error 1 make: Leaving directory '/home/tcullen/src/coreboot/payloads/coreinfo'
Regards, Tim Cullen
Sent with [ProtonMail](https://protonmail.com/) Secure Email.
Hi Tim,
On 11.09.21 22:15, tcullen2018 via coreboot wrote:
... LPGCC coreinfo.bin /home/tcullen/src/coreboot/util/crossgcc/xgcc/lib/gcc/x86_64-elf/8.3.0/../../../../x86_64-elf/bin/ld.bfd: build/cpuinfo_module.o: in function `cpuinfo_module_init': cpuinfo_module.c:(.text+0x45e): undefined reference to `__udivdi3'
most of coreboot and its payloads are compiled for protected mode (32 bits), so you need the i386-elf toolchain. Earlier versions of the x86_64 toolchain supported multilib (to build for 32-bit targets as well), but currently it doesn't. Maybe it's time to make xgcc aware of that.
Nico