[coreboot - Bug #527] Can't compile coreboot on Arch Linux

Peter Daru <[email protected]>
Newsgroups gmane.linux.bios
Message-ID <[email protected]>
Issue #527 has been updated by Peter Daru.


Sorry if this doesn't fit here. I thought this is similar if not same issue as op's one.

I was following [doc tutorial](https://doc.coreboot.org/tutorial/part1.html) for qemu x64 and also couldn't compile. I run fully up to date installation (apart from kernel itself). Turns out doing `$  make clang CPUS=$(nproc)` and then `$ make` I was able to compile.

This is what I got following tutor:
```
#
# No change to /home/daru/Git/coreboot/payloads/coreinfo/.config
#
Makefile:358: warning: overriding recipe for target '/home/daru/Git/coreboot/payloads/coreinfo/libpayload/arch/x86/exec.libc.o'
Makefile:358: warning: ignoring old recipe for target '/home/daru/Git/coreboot/payloads/coreinfo/libpayload/arch/x86/exec.libc.o'
    LPGCC      coreinfo.bin
/home/daru/Git/coreboot/util/crossgcc/xgcc/lib/gcc/x86_64-elf/14.2.0/../../../../x86_64-elf/bin/ld.bfd: warning: exception_asm.libc.o: missing .note.GNU-stack section implies executable stack
/home/daru/Git/coreboot/util/crossgcc/xgcc/lib/gcc/x86_64-elf/14.2.0/../../../../x86_64-elf/bin/ld.bfd: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
/home/daru/Git/coreboot/util/crossgcc/xgcc/lib/gcc/x86_64-elf/14.2.0/../../../../x86_64-elf/bin/ld.bfd: warning: build/coreinfo.bin has a LOAD segment with RWX permissions
/home/daru/Git/coreboot/util/crossgcc/xgcc/lib/gcc/x86_64-elf/14.2.0/../../../../x86_64-elf/bin/ld.bfd: build/cpuinfo_module.o: in function `cpuinfo_module_init':
cpuinfo_module.c:(.text+0x474): undefined reference to `__udivdi3'
/home/daru/Git/coreboot/util/crossgcc/xgcc/lib/gcc/x86_64-elf/14.2.0/../../../../x86_64-elf/bin/ld.bfd: build/timestamps_module.o: in function `timestamp_print_entry.constprop.0':
timestamps_module.c:(.text+0x157): undefined reference to `__udivdi3'
/home/daru/Git/coreboot/util/crossgcc/xgcc/lib/gcc/x86_64-elf/14.2.0/../../../../x86_64-elf/bin/ld.bfd: timestamps_module.c:(.text+0x194): undefined reference to `__udivdi3'
/home/daru/Git/coreboot/util/crossgcc/xgcc/lib/gcc/x86_64-elf/14.2.0/../../../../x86_64-elf/bin/ld.bfd: /home/daru/Git/coreboot/payloads/coreinfo/libpayload/libpayload.a(time.libc.o): in function `update_clock':
/home/daru/Git/coreboot/payloads/libpayload/libc/time.c:60:(.text.time+0xe8): undefined reference to `__udivdi3'
/home/daru/Git/coreboot/util/crossgcc/xgcc/lib/gcc/x86_64-elf/14.2.0/../../../../x86_64-elf/bin/ld.bfd: /home/daru/Git/coreboot/payloads/libpayload/libc/time.c:65:(.text.time+0x11d): undefined reference to `__udivdi3'
/home/daru/Git/coreboot/util/crossgcc/xgcc/lib/gcc/x86_64-elf/14.2.0/../../../../x86_64-elf/bin/ld.bfd: /home/daru/Git/coreboot/payloads/coreinfo/libpayload/libpayload.a(time.libc.o):/home/daru/Git/coreboot/payloads/libpayload/libc/time.c:68: more undefined references to `__udivdi3' follow
/home/daru/Git/coreboot/util/crossgcc/xgcc/lib/gcc/x86_64-elf/14.2.0/../../../../x86_64-elf/bin/ld.bfd: /home/daru/Git/coreboot/payloads/coreinfo/libpayload/libpayload.a(printf.libc.o): in function `print_number':
/home/daru/Git/coreboot/payloads/libpayload/libc/printf.c:261:(.text.printf_core+0x5c0): undefined reference to `__udivmoddi4'
/home/daru/Git/coreboot/util/crossgcc/xgcc/lib/gcc/x86_64-elf/14.2.0/../../../../x86_64-elf/bin/ld.bfd: /home/daru/Git/coreboot/payloads/coreinfo/libpayload/libpayload.a(gcd.libc.o): in function `gcd':
/home/daru/Git/coreboot/src/commonlib/bsd/gcd.c:14:(.text.gcd+0x58): undefined reference to `__umoddi3'
/home/daru/Git/coreboot/util/crossgcc/xgcc/lib/gcc/x86_64-elf/14.2.0/../../../../x86_64-elf/bin/ld.bfd: /home/daru/Git/coreboot/src/commonlib/bsd/gcd.c:19:(.text.gcd+0x76): undefined reference to `__umoddi3'
/home/daru/Git/coreboot/util/crossgcc/xgcc/lib/gcc/x86_64-elf/14.2.0/../../../../x86_64-elf/bin/ld.bfd: /home/daru/Git/coreboot/payloads/coreinfo/libpayload/libpayload.a(timer.libc.o): in function `get_cpu_khz_xtal':
/home/daru/Git/coreboot/payloads/libpayload/arch/x86/timer.c:121:(.text.get_cpu_speed+0x9f): undefined reference to `__udivdi3'
/home/daru/Git/coreboot/util/crossgcc/xgcc/lib/gcc/x86_64-elf/14.2.0/../../../../x86_64-elf/bin/ld.bfd: /home/daru/Git/coreboot/payloads/libpayload/arch/x86/timer.c:121:(.text.get_cpu_speed+0xb0): undefined reference to `__udivdi3'
/home/daru/Git/coreboot/util/crossgcc/xgcc/lib/gcc/x86_64-elf/14.2.0/../../../../x86_64-elf/bin/ld.bfd: /home/daru/Git/coreboot/payloads/coreinfo/libpayload/libpayload.a(timer.libc.o): in function `calibrate_pit':
/home/daru/Git/coreboot/payloads/libpayload/arch/x86/timer.c:78:(.text.get_cpu_speed+0x17c): undefined reference to `__udivdi3'
collect2: error: ld returned 1 exit status
make[2]: *** [../libpayload/Makefile.payload:104: build/coreinfo.bin] Error 1
make[1]: *** [Makefile:64: defaultbuild] Error 2
make: *** [payloads/Makefile.mk:38: payloads/coreinfo/build/coreinfo.elf] Error 2
```

----------------------------------------
Bug #527: Can't compile coreboot on Arch Linux
https://ticket.coreboot.org/issues/527#change-1918

* Author: naixin Lv
* Status: New
* Priority: Normal
* Category: build system
* Target version: master
* Start date: 2024-02-23
* Affected versions: master
* Needs backport to: none
* Affected hardware: GIGABYTE GA-H61M-DS2
* Affected OS: none
----------------------------------------
I want to compile coreboot for my Gigabyte GA-H61M-DS2 mainboard, but I only found a short guide for this board at this site: https://www.iot-tech.dev/full.php?ar=166
After downloaded the coreboot git repository, It gave me this error:
``` shell
/home/zhongli/coreboot/util/crossgcc/xgcc/bin/x86_64-elf-ld.bfd: build/romstage/console/vtxprintf.o: in function `number':
/home/zhongli/coreboot/src/console/vtxprintf.c:63:(.text.number+0x12b): undefined reference to `__udivmoddi4'
/home/zhongli/coreboot/util/crossgcc/xgcc/bin/x86_64-elf-ld.bfd: build/romstage/lib/gcc.o: in function `__wrap___divdi3':
/home/zhongli/coreboot/src/lib/gcc.c:19:(.text.__wrap___divdi3+0x1): undefined reference to `__divdi3'
/home/zhongli/coreboot/util/crossgcc/xgcc/bin/x86_64-elf-ld.bfd: build/romstage/lib/gcc.o: in function `__wrap___udivdi3':
/home/zhongli/coreboot/src/lib/gcc.c:20:(.text.__wrap___udivdi3+0x1): undefined reference to `__udivdi3'
make: *** [src/arch/x86/Makefile.mk:191: build/cbfs/fallback/romstage.debug] Error 1

```
And I'll put my config file on here.
Any help ?

---Files--------------------------------
defconfig (726 Bytes)
ifd_shrinked.bin (4 KB)
me_shrinked.bin (96 KB)


-- 
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: https://ticket.coreboot.org/my/account
_______________________________________________
coreboot mailing list -- [email protected]
To unsubscribe send an email to [email protected]
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.