Since I'm tired of cross-compiling and already have a working (cross-compiled) gcc on my Synology DiskStation DS214 with DSM 6.1, I'd like to install the Linux headers of the Linux version running on the DiskStation into /usr/include which is initially empty. There's a tookkit for developers by Synology, but the headers in /usr/include create a linux/version.h with LINUX_VERSION_CODE=132636 which is much lower than 3.2.40 given by uname -a. Maybe this is due to the version mismatch of DSM 6.1 and the 5.2 for the toolkit. Downgrading DSM to 5.2 is not an option, maybe impossible.

Running sudo make headers_install in the Linux 3.2.40 source on the DiskStation fails due to

$ sudo env CFLAGS="-mfloat-abi=hard -mfpu=vfpv3-d16 -I/usr/include" \
CPPFLAGS="-mfloat-abi=hard -mfpu=vfpv3-d16 -I/usr/include" \
CXXFLAGS="-mfloat-abi=hard -mfpu=vfpv3-d16 -I/usr/include" \
LDFLAGS="-mfloat-abi=hard -mfpu=vfpv3-d16" \
make headers_install \
CFLAGS="-mfloat-abi=hard -mfpu=vfpv3-d16 -I/usr/include" \
CPPFLAGS="-mfloat-abi=hard -mfpu=vfpv3-d16 -I/usr/include" \
CXXFLAGS="-mfloat-abi=hard -mfpu=vfpv3-d16 -I/usr/include" \
LDFLAGS="-mfloat-abi=hard -mfpu=vfpv3-d16" \
  CHK     include/linux/version.h
  HOSTCC  scripts/basic/fixdep
In file included from /opt/toolchain/include/features.h:434:0,
                 from /opt/toolchain/include/sys/types.h:25,
                 from scripts/basic/fixdep.c:106:
/opt/toolchain/include/gnu/stubs.h:7:29: fatal error: gnu/stubs-soft.h: No such file or directory
 # include 
compilation terminated.
make[1]: *** [scripts/basic/fixdep] Error 1
make: *** [scripts_basic] Error 2

Other build setups, like binutils, make, etc., don't have any problem picking up the -mfloat-abi and not including gnu/stubs-soft.h. Linux 3.2.86 which is the latest of 3.2.x has the same problem.

I know that there might be an easier way, that the setup is supposed to work primarily with cross-compilation and that there's no use case for what I want to do, but I'd like to understand how things work or why it's impossible to do what I want to do.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.