When I try to compile one of my old program which uses ext3 structure with new Fedora 16
I get the message
# make
Compile main.c In file included from main.c:8:0:
giis.h:18:28: fatal error: linux/ext3_fs.h: No such file or directory
compilation terminated.
I did yum install kernel-devel and kernel-headers - but still it gives above message.
# uname -a
Linux space 3.2.9-2.fc16.x86_64 #1 SMP Mon Mar 5 20:55:39 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
The linux kernel does not export a header called ext3_fs.h, or does not do so anymore. Edit your giis.h to do without it. See commit v2.6.25-rc8~52: “Neither of the headers actually compiles when included from userpsace nor should it be made available as userspace tools should be using the libraries or at least headers from e2fsprogs.”
Related
I have recently started working on WSL environment.
I have compiled one program in WSL environment which is of type "ELF 64-bit LSB shared object" but when I try to run it in the same environment, it throws an error "cannot execute binary file: Exec format error".
I am not sure about what I am missing here. How can I run the binary.
Kindly suggest.
kshitij#APL-5CD010D2WP:~/runtime/bin$ ioc_broker &
[1] 3579
kshitij#APL-5CD010D2WP:~/runtime/bin$ bash: /bin/ioc_broker: cannot execute binary file: Exec format error
^C
[1]+ Exit 126 ioc_broker
kshitij#APL-5CD010D2WP:~/runtime/bin$ file ioc_broker
ioc_broker: ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=aa1e76d798d46d45f131cb53de8f947ddb4c8526, for GNU/Linux 3.2.0, not stripped
kshitij#APL-5CD010D2WP:~/runtime/bin$ uname -srv
Linux 5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2 00:30:59 UTC 2022
kshitij#APL-5CD010D2WP:~/runtime/bin$
kshitij#APL-5CD010D2WP:/mnt/d/src/myproject/build$ uname -a
Linux APL-5CD010D2WP 5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2 00:30:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
I have compiled the binary using cmake in which I have specified nothing specific about comiler being used.
kshitij#APL-5CD010D2WP:/mnt/d/src/myproject/build$ cmake -DCMAKE_INSTALL_PREFIX=/home/kshitij/runtime ..
-- The CXX compiler identification is GNU 9.4.0
-- Check for working CXX compiler: /bin/c++
-- Check for working CXX compiler: /bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Line: 57 Using COMMON_API_VERSION 3.1.12
uname -srv
Linux 5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2 00:30:59 UTC 2022
Try uname -a instead. It should identify the kernel as either i686 or x86_64.
I expect that your kernel says i686, in which case you've installed a 32-bit WSL2 and are trying to run a 64-bit binary on it. That doesn't work for obvious reason -- you need a 64-bit kernel to run 64-bit binaries.
Update:
I see x86_64
Ok, my guess was wrong. The other reason for Exec format error is that the file is corrupt in some way.
One possible source of corruption is if you run out of disk space and the file is truncated. Check df -h . output and if there is a lot of space, try rebuilding the binary again.
Also try eu-readelf -a ioc_broker -- eu-readelf is good at warning about corrupt ELF files.
Finally, look in /var/log/messages for any kernel warnings -- you may have a bad disk block or something else.
We have a legacy Linux application, written in C, using GTK.
We compile it on Ubuntu14/32-bit, we can also launch it
In production, we run it on Debian10/32-bit
We have some very old hosts, which runs Debian 5. The old version of the application runs on Debian 5, but when we compile a new one, we got a runtime message:
.../bin/gui: symbol lookup error: .../lib/libmkt.so: undefined symbol: g_malloc0_n
It's strange, because nm finds it:
$ nm .../lib/libmkt.so | grep g_malloc
U g_malloc0
U g_malloc0_n
Also the application has a good reference entry to the library:
$ ldd .../bin/gui | grep libmkt
libmkt.so => .../lib/libmkt.so (0xb7257000)
This is happening only on the old machine with Debian 5:
$ uname -a
Linux kiosk 2.6.26-2-686 #1 SMP Mon Aug 30 07:01:57 UTC 2010 i686 GNU/Linux
On the new machine, with Debian 10, the application starts:
$ uname -a
Linux kiosk 4.19.0-17-686-pae #1 SMP Debian 4.19.194-1 (2021-06-10) i686 GNU/Linux
The developer machine with Ubuntu14, the application starts:
$ uname -a
Linux ubuntu-build-server 4.4.0-142-generic #168~14.04.1-Ubuntu SMP
Sat Jan 19 11:28:33 UTC 2019 i686 i686 i686 GNU/Linux
We start the application with LD_LIBRARY_PATH=.../lib .../bin/gui, we have a bunch of .so files in the .../lib directory, including the .../lib/libmkt.so, which indicates the error.
My hint is that the compiler uses some feature for libmkt.so, which the 2.6 kernel does not like, but I haven't found such issue on the internet.
UPDATE: .../lib/libmkt.so does not contain the missing g_malloc0_n symbol, but it refers to the GTK library, which does. What should I do in order to find such second-hop symbols?
I have this situation:
Ubuntu 16.04;
When I called uname -a result is Linux pi 4.1.19-v7+ #858 SMP Tue Mar 15 15:56:00 GMT 2016 armv7l GNU/Linux.
The problem is when I want to compile new drivers, the system gives me the error:
make[1]: *** /lib/modules/4.1.19-v7+/build: No such file or directory. Stop.
But when I looked at /lib/modules/, I find only version 4.4.38-v7+.
Maybe someone knows what it can be?
Thanks.
You need to have kernel-headers installed for the kernel version that you are trying to compile for.
sudo apt-get install linux-headers-$(uname -r)
You have kernel headers for 4.4.38-v7+, but not for your booted kernel of 4.1.19-v7+ (uname -r)
If you don't want to install 4.1.19-v7+ kernel-headers, reboot the system and boot into 4.4.38-v7+, and then try make, and it would compile the module for that particular kernel.
I'm a newcomer for linux kernel development. This is second question about loading self-compiled kernel(current stable version 4.8.6). The error messages printed during booting are as below:
linux-05e3 mount[282]: mount: unknown filesystem type 'btrfs'
linux-05e3 systemd1: Dependency failed for Initrd Boot File System
linux-05e3 systemd1: Dependency failed for Reload Configuration
Actually the file system type of my root partition is 'btrfs', and it is no problem with kernel version 4.1.12.1-default.
My partition table is :
Result of uname -a is :
Linux linux-05e3 4.1.12-1-default #1 SMP PREEMPT Thu Oct 29 06:43:42
UTC 2015 (e24bad1) x86_64 x86_64 x86_64 GNU/Linux
The .config file is just copied from the one used for 4.1.12.1-default. And I've just ran make menuconfig with nothing modified after copying that file.
Can anyone give some useful tips to me. I really need a linux kernel development expert to give more instructions to me as a beginner. Thanks a million.
I have an application compiled at:
gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)
Linux debian 2.6.18-5-686 #1 SMP Fri Jun 1 00:47:00 UTC 2007 i686 GNU/Linux
and it runs well.
Now I want to run it at:
Linux 2.4.20_mvlcge31-tomas #7 Thu May 7 11:33:21 CEST 2009 i686 unknown
I got following errors:
libstdc++.so.6: cannot handle TLS data
From the web I saw someone suggested to do this: export LD_ASSUME_KERNEL=2.2.5
I tried but get even more errors:
ls: error while loading shared libraries: librt.so.1: cannot open shared object file: No such file or directory
Who can help me with it? thanks
You had compiled the application against much newer libc and kernel version, You can't compile program on 2.6 with newest libc and expect it to run on old kernel.
Also where do you actually still use Linux 2.4?