If you are on an amd64 installation, you can try to install the package libc6-dev-i386. This helped me solve the same issue you encountered while trying to compile smm from i8kutils.
If you are on an amd64 installation, you can try to install the package libc6-dev-i386. This helped me solve the same issue you encountered while trying to compile smm from i8kutils.
On my machine, where I've probably screwed around too much with 32 and 64 bit architecture files, I resolved this issue by installing g++-multilib.
Fatal error: sys/cdefs.h: No such file or directory
c++ - gcc won't compile missing sys/cdefs.h - Stack Overflow
android - fatal error: sys/cdefs.h: No such file or directory while compiling openssl-1.1.0h - Stack Overflow
/usr/include/features.h:367:12: fatal error: 'sys/cdefs.h' file not found # include <sys/cdefs.h>
Needed to add --with-float=hard to the configure line.
This is because MULTIARCH_DIRNAME is defined based on the with-float configuration option
MULTIARCH_DIRNAME = $(call if_multiarch,arm$(ARM_EB)-linux-gnueabi(filter hard,$(with_float)),hf))
As pointed out by the kind fellows at gcc
add the parameter: -I/usr/arm-linux-gnueabihf
to the compile statement
To compile 32 bit binaries on 64 bit Linux version, you have to Install libx32gcc development package and 32 bit GNU C Library
try this
sudo apt-get install libx32gcc-4.8-dev
and
sudo apt-get install libc6-dev-i386
You need gcc multilib support. Install the package gcc-multilib. E.g.:
sudo apt-get install gcc-multilib
I had similar problem with compiling gcc-8.2. I tried to do as described here with reinstalling:
sudo apt-get --reinstall install libc6 libc6-dev
After that I was locating all missing headers:
find / -name cdefs.h
and copying them to /usr/include: those steps allowed only to move forward but I still didn't manage to completely build gcc.
The best solution I found is to download compiled version of gcc-8.1 from: https://solarianprogrammer.com/2017/12/07/raspberry-pi-raspbian-compiling-gcc/
I also ran into this problem when creating a containerized build environment for cross-compiled Qt applications for raspberry pi 4.
I found I needed to edit the mkspec for the linux-rasp-pi4-v3d device and add another cflag so that gcc could find the header from my Raspi sysroot that was used to cross-compile Qt.
Specifically under qtbase/mkspecs/devices/linux-rasp-pi4-v3d-g++/qmake.conf:
QMAKE_CFLAGS = -march=armv8-a -mtune=cortex-a72 -mfpu=crypto-neon-fp-armv8 -I$$[QT_SYSROOT]/usr/include/arm-linux-gnueabihf