AMDmi3 писал(а):
И да, я вообще не понимаю зачем вам заголовки ядра. Для кросс-компиляции под Linux нужна glibc, а не ядро.
Из одного "мануала":
Цитата:
This step installs the Linux kernel header files to /opt/cross/aarch64-linux/include, which will ultimately allow programs built using our new toolchain to make system calls to the AArch64 kernel in the target environment.
Код:
$ cd linux-3.17.2
$ make ARCH=arm64 INSTALL_HDR_PATH=/opt/cross/aarch64-linux headers_install
$ cd ..
Из второго "мануала":
Цитата:
Obtain the operating system headers
The operating system headers are necessary for getting the information the
compiler needs for the system function calls that the target platform supports.
For Linux targets, the best way to obtain the headers is to download the latest
copy of the appropriate kernel. (I used the generic kernel in the previous panel.)
You'll need to do a basic configuration of the kernel so that the correct headers
are generated for you to copy; you don't, however, need to build or compile the
kernel. For my sample target, i386-linux, the necessary steps are:
$ cd linux-2.6.9
$ make ARCH=i386 CROSS_COMPILE=i386-linux- menuconfig
Note that the trailing hyphen above is not a typo. By running the command
above, you'll be prompted to configure the components for the kernel. Because
you don't need to worry too much about the contents of the kernel itself, you
can just use the default options, save the configuration, and quit the tool.
Now, you need to copy the headers to your target directory:
$ mkdir -p $TARGET_PREFIX/include
$ cp -r include/linux $TARGET_PREFIX/include
$ cp -r include/asm-i386 $TARGET_PREFIX/include/asm
$ cp -r include/asm-generic $TARGET_PREFIX/include/
Obviously I've made some assumptions in the code above based on the sample
target. If you were building for a PowerPC target, you would have copied files
from asm-ppc.
AMDmi3 писал(а):
As a side note, я лично в кросс-компиляцию не верю - с ней всё всегда криво и сложно.
Ну для Винды я собрал 8 тулчейнов со всем фаршем, включая Qt 5.6.0 (без mysqlconnector'а и webkit только shared-версии). Все это включено в QtCreator'е. Крайне удобно.
Код:
drwxr-xr-x 18 majestio majestio 18 11 июн 17:55 .
drwxr-xr-x 12 majestio majestio 24 20 июн 04:55 ..
drwxr-xr-x 2 majestio majestio 323 20 июн 04:02 bin
drwxr-xr-x 12 majestio majestio 12 19 июн 21:43 i686-w64-mingw32.shared
drwxr-xr-x 12 majestio majestio 12 20 июн 02:11 i686-w64-mingw32.shared.posix
drwxr-xr-x 12 majestio majestio 12 19 июн 20:31 i686-w64-mingw32.static
drwxr-xr-x 12 majestio majestio 12 20 июн 01:03 i686-w64-mingw32.static.posix
drwxr-xr-x 2 majestio majestio 2 11 июн 16:10 include
drwxr-xr-x 2 majestio majestio 5 11 июн 15:42 installed
drwxr-xr-x 3 majestio majestio 3 11 июн 16:10 lib
drwxr-xr-x 3 majestio majestio 3 11 июн 16:10 libexec
dr-xr-xr-x 2 majestio majestio 3 11 июн 15:42 readonly
drwxr-xr-x 6 majestio majestio 6 11 июн 16:16 share
drwxr-xr-x 8 majestio majestio 8 11 июн 15:51 x86_64-unknown-freebsd10.3
drwxr-xr-x 12 majestio majestio 12 19 июн 23:56 x86_64-w64-mingw32.shared
drwxr-xr-x 12 majestio majestio 12 20 июн 04:24 x86_64-w64-mingw32.shared.posix
drwxr-xr-x 12 majestio majestio 12 19 июн 22:50 x86_64-w64-mingw32.static
drwxr-xr-x 12 majestio majestio 12 20 июн 03:18 x86_64-w64-mingw32.static.posix