cirosantilli / linux-kernel-module-cheat

The perfect emulation setup to study and develop the Linux kernel v5.4.3, kernel modules, QEMU, gem5 and x86_64, ARMv7 and ARMv8 userland and baremetal assembly, ANSI C, C++ and POSIX. GDB step debug and KGDB just work. Powered by Buildroot and crosstool-NG. Highly automated. Thoroughly documented. Automated tests. "Tested" in an Ubuntu 24.04 host.
https://cirosantilli.com/linux-kernel-module-cheat
GNU General Public License v3.0
4.21k stars 605 forks source link

gem5 build fails with "build/X86/marshal: undefined symbol: PyUnicodeUCS2_FromString" on Ubuntu 18.04 #80

Closed cirosantilli closed 5 years ago

cirosantilli commented 5 years ago

At lkmc 062d1cf0857d577be583d4ac8192ce6e967c819b gem5 08c79a194d1a3430801c04f37d13216cc9ec1da3 on a non-clean Ubuntu 18.04 I have once seen ./build-gem5 fail with that error message.

But then I changed something on that machine and I cannot reproduce anymore.

Cannot reproduce on a clean Docker 18.04 with ./build --download-dependencies gem5 either.

Some related unconclusive threads:

The problem happened even when running scons directly from the gem5 repository without any LKMC scripts.

cirosantilli commented 5 years ago

I've found the problem: there were two Python 2 installed in the system, one from Ubuntu and the other manually, and the manual one was getting used. Please check your PATH , LD_LIBRARY_PATH, LIBRARY_PATH, etc. for the presence of any non Ubuntu Python installations!!!

pyenv is a prime suspect for this kind of stuff: https://github.com/pyenv/pyenv

If using any other installation, you have to make sure that the same installation gets used at build and compile time, i.e. that all required enviroment variables are well exported. So the easy solution will be to just get rid of the non-Ubuntu one if you can, which I am 100% sure works.