Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linker error on mcu.c with some specific config #104

Open
clandmeter opened this issue Feb 11, 2024 · 4 comments
Open

Linker error on mcu.c with some specific config #104

clandmeter opened this issue Feb 11, 2024 · 4 comments

Comments

@clandmeter
Copy link

After applying sophgo_mango_normal_defconfig on top of our alpine linux edge kernel im receiving the following linker error. It seems to happen only on some specific config cases but im not sure which ones. This is based on commit: beafa88
With the following config: https://sprunge.us/PP7uUK

>>> linux-sophgo: Build kernel
  SYNC    include/config/auto.conf
  GEN     Makefile
  GEN     Makefile
  CALL    /home/clandmeter/aports/testing/linux-sophgo/src/linux-riscv-beafa8820ba0ea1e8aab84c4ebb0c907f828c963/scripts/checksyscalls.sh
  UPD     init/utsversion-tmp.h
  CC      init/version.o
  AR      init/built-in.a
  AR      built-in.a
  AR      vmlinux.a
  LD      vmlinux.o
  OBJCOPY modules.builtin.modinfo
  GEN     modules.builtin
  MODPOST Module.symvers
  UPD     include/generated/utsversion.h
  CC      init/version-timestamp.o
  LD      .tmp_vmlinux.kallsyms1
ld: drivers/soc/sophgo/umcu/mcu.o: in function `.L0 ':
mcu.c:(.text+0xf3e): undefined reference to `devm_hwmon_device_register_with_info'
make[1]: *** [/home/clandmeter/aports/testing/linux-sophgo/src/linux-riscv-beafa8820ba0ea1e8aab84c4ebb0c907f828c963/scripts/Makefile.vmlinux:34: vmlinux] Error 1
make: *** [/home/clandmeter/aports/testing/linux-sophgo/src/linux-riscv-beafa8820ba0ea1e8aab84c4ebb0c907f828c963/Makefile:1255: vmlinux] Error 2
make: *** Waiting for unfinished jobs....
>>> ERROR: linux-sophgo: build failed
@clandmeter
Copy link
Author

Looks like CONFIG_HWMON cannot be build as module. Changing it to Y fixes the linker issue.

@skeuchel
Copy link

I ran into something similar with CONFIG_I2C. Essentially umcu/mcu.o is always compiled in, so its dependencies also need to be compiled in and cannot be built as modules.

@skeuchel
Copy link

About the commit beafa88 you mentioned. I did not find that kernel to be very stable. Under load, it would just randomly kill processes like sshd or nix. I had the impression it was related to scheduling or numa balancing. The commit a8d746b from the master branch works much better for me. The only thing that does not seem to work with that branch is access to the onboard flash.

@clandmeter
Copy link
Author

The dev branch is more stable IIUC, this is also where they base the firmware on in CI.
The master branch is based on 6.8, not sure it has the same amount of changes and tests (docs would be appreciated).
I have tried master but it gave me issues which cpu's not coming online, but that could have been a config issue.
FWIW, for me beafa88 works okish, although the nvme gives problems and sometimes stalles, I think upgarding the nvme could make a difference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants