I am trying to build darling on Ubuntu16.04 but the build fails with the following error:
[ 95%] Building CXX object src/external/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/runtime/CommonIdentifiers.o
clang: error: unable to execute command: Killed
clang: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final)
Target: x86_64-apple-darwin11
Thread model: posix
InstalledDir: /usr/bin
clang: note: diagnostic msg: PLEASE submit a bug report to http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and associated run script.
clang: note: diagnostic msg: Error generating preprocessed source(s) - cannot generate preprocessed source with multiple -arch options.
src/external/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/build.make:4598: recipe for target 'src/external/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/runtime/CommonIdentifiers.o' failed
make[2]: *** [src/external/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/runtime/CommonIdentifiers.o] Error 254
CMakeFiles/Makefile2:51126: recipe for target 'src/external/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/all' failed
make[1]: *** [src/external/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
root@UbuntuSixteen:~/darling/build/src/external# uname -r
4.13.0-39-generic
root@UbuntuSixteen:~/darling/build/src/external# clang --version
clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Please help resolve this.
How much ram do you have?
Its a VM on a ESX host. It has 1GB RAM.
That sure looks like one of your compiler processes was OOM-killed. Try just running make again; if that doesn't help make sure you're not running too much compiler processes in parallel (as would be the case with e.g. make -j8), or increase RAM (and/or swap) size.
Hi , After increasing the RAM to 4GB, I was able to compile and install. But when i run "darling shell", I get the following error:
root@UbuntuSixteen:/lib/modules# darling shell
modprobe: ERROR: could not insert 'darling_mach': Exec format error
Failed to load the kernel module
Dmesg has the following logs:
[14586.647297] darling_mach: version magic '4.13.0-38-generic SMP mod_unload ' should be '4.13.0-39-generic SMP mod_unload '
root@UbuntuSixteen:/lib/modules# uname -r
4.13.0-39-generic
Please help.
Regards,
Muthu
This looks like the kernel module was built for a different version of the kernel that you are trying to use it with.
If you have recently updated your kernel, try rebooting to the new one first.
The kernel was upgraded from 4.10.0.28 to 4.10.0.39. But I started the build process after the kernel upgrade.
@lmuthu please try to re-build and re-install lkm
I can reproduce this:
$ modinfo /usr/lib/modules/4.16.7-300.fc28.x86_64/extra/darling-mach.ko
filename: /usr/lib/modules/4.16.7-300.fc28.x86_64/extra/darling-mach.ko
license: GPL
depends:
retpoline: Y
name: darling_mach
vermagic: 4.16.7-200.fc27.x86_64 SMP mod_unload
I have both 4.16.7-300.fc28 and 4.16.7-200.fc27 installed, it seems the kernel build system gets confused somewhere over them both being 4.16.7. uname -r, as used by src/lkm/Makefile, correctly reports 4.16.7-300.fc28.x86_64.
After a dnf remove kernel-4.16.7-200.fc27, the issue went away.
I resolved this on Ubuntu with the following (all paths relative to the Darling source root unless otherwise noted):
apt autoremovefind src/lkm -name \*.o -deleterm src/lkm/darling-mach.korm -rf src/lkm (In build root, very important this time)make lkm (In build root)make lkm_install (In build root)@bugaevc @lmuthu @stek29 I am getting this issue on Ubuntu 18.10. Our kernel module build system appears to build for the older kernel while installing to the folder for the newer kernel.
I have narrowed down the issue to the kernel build system not rebuilding darling-mach.mod.o, which is built once and never rebuilt when the kernel version changes. It contains the vermagic. I am going to implement a workaround.
Most helpful comment
I can reproduce this:
I have both 4.16.7-300.fc28 and 4.16.7-200.fc27 installed, it seems the kernel build system gets confused somewhere over them both being 4.16.7.
uname -r, as used bysrc/lkm/Makefile, correctly reports4.16.7-300.fc28.x86_64.After a
dnf remove kernel-4.16.7-200.fc27, the issue went away.