c-sky / buildroot

Buildroot for T-HEAD XuanTie CPU Series
Apache License 2.0
107 stars 53 forks source link

The toolchain only support 4.9 version? how to make the new commit of kernel #14

Open Vidos opened 5 years ago

Vidos commented 5 years ago

The commit message said:The release is for toolchain v3.8.x/3.10.x with linux-4.9.56 headers. (Ubuntu-16.04-64bit). Then how to build the new version?

Vidos commented 5 years ago

And I follow the guide of https://c-sky.gitlab.io/-/buildroot/-/jobs/197227857/artifacts/output/images/readme.txt. I clone kernel code and reset v4.9 --hard. Then make it with: cfan@inn:~/cross-gcc/linus$ BR_BINARIES_DIR=.. make ARCH=csky CROSS_COMPILE=../csky/host/bin/csky-linux- vmlinux -j32

And get fail: LD vmlinux.o ../csky/host/bin/csky-linux-ld: /home/cfan/cross-gcc/csky/host/bin/../lib/gcc/csky-buildroot-linux-gnuabiv2/6.3.0/libgcc.a(_muldi3.o): machine flag conflict with target ../csky/host/bin/csky-linux-ld: failed to merge target specific data of file /home/cfan/cross-gcc/csky/host/bin/../lib/gcc/csky-buildroot-linux-gnuabiv2/6.3.0/libgcc.a(_muldi3.o) ../csky/host/bin/csky-linux-ld: /home/cfan/cross-gcc/csky/host/bin/../lib/gcc/csky-buildroot-linux-gnuabiv2/6.3.0/libgcc.a(_lshrdi3.o): machine flag conflict with target ../csky/host/bin/csky-linux-ld: failed to merge target specific data of file /home/cfan/cross-gcc/csky/host/bin/../lib/gcc/csky-buildroot-linux-gnuabiv2/6.3.0/libgcc.a(_lshrdi3.o) ../csky/host/bin/csky-linux-ld: /home/cfan/cross-gcc/csky/host/bin/../lib/gcc/csky-buildroot-linux-gnuabiv2/6.3.0/libgcc.a(_ashldi3.o): machine flag conflict with target ../csky/host/bin/csky-linux-ld: failed to merge target specific data of file /home/cfan/cross-gcc/csky/host/bin/../lib/gcc/csky-buildroot-linux-gnuabiv2/6.3.0/libgcc.a(_ashldi3.o) ../csky/host/bin/csky-linux-ld: /home/cfan/cross-gcc/csky/host/bin/../lib/gcc/csky-buildroot-linux-gnuabiv2/6.3.0/libgcc.a(_ashrdi3.o): machine flag conflict with target ../csky/host/bin/csky-linux-ld: failed to merge target specific data of file /home/cfan/cross-gcc/csky/host/bin/../lib/gcc/csky-buildroot-linux-gnuabiv2/6.3.0/libgcc.a(_ashrdi3.o) ../csky/host/bin/csky-linux-ld: /home/cfan/cross-gcc/csky/host/bin/../lib/gcc/csky-buildroot-linux-gnuabiv2/6.3.0/libgcc.a(_ucmpdi2.o): machine flag conflict with target ../csky/host/bin/csky-linux-ld: failed to merge target specific data of file /home/cfan/cross-gcc/csky/host/bin/../lib/gcc/csky-buildroot-linux-gnuabiv2/6.3.0/libgcc.a(_ucmpdi2.o) Makefile:969: recipe for target 'vmlinux' failed make: *** [vmlinux] Error 1

Vidos commented 5 years ago

If my understanding is wrong, please let me know

guoren83 commented 5 years ago

The commit message said:The release is for toolchain v3.8.x/3.10.x with linux-4.9.56 headers. (Ubuntu-16.04-64bit). Then how to build the new version?

This is for some people have exteranl toolchain with linux-4.9.56, don't care about this.

The toolchain is built from buildroot

See https://gitlab.com/c-sky/buildroot/pipelines/56964790, there are 4.9 4.14 4.19 5.x linux version.

guoren83 commented 5 years ago

And I follow the guide of https://c-sky.gitlab.io/-/buildroot/-/jobs/197227857/artifacts/output/images/readme.txt. I clone kernel code and reset v4.9 --hard. Then make it with: cfan@inn:~/cross-gcc/linus$ BR_BINARIES_DIR=.. make ARCH=csky CROSS_COMPILE=../csky/host/bin/csky-linux- vmlinux -j32

And get fail: LD vmlinux.o ../csky/host/bin/csky-linux-ld: /home/cfan/cross-gcc/csky/host/bin/../lib/gcc/csky-buildroot-linux-gnuabiv2/6.3.0/libgcc.a(_muldi3.o): machine flag conflict with target ../csky/host/bin/csky-linux-ld: failed to merge target specific data of file /home/cfan/cross-gcc/csky/host/bin/../lib/gcc/csky-buildroot-linux-gnuabiv2/6.3.0/libgcc.a(_muldi3.o) ../csky/host/bin/csky-linux-ld: /home/cfan/cross-gcc/csky/host/bin/../lib/gcc/csky-buildroot-linux-gnuabiv2/6.3.0/libgcc.a(_lshrdi3.o): machine flag conflict with target ../csky/host/bin/csky-linux-ld: failed to merge target specific data of file /home/cfan/cross-gcc/csky/host/bin/../lib/gcc/csky-buildroot-linux-gnuabiv2/6.3.0/libgcc.a(_lshrdi3.o) ../csky/host/bin/csky-linux-ld: /home/cfan/cross-gcc/csky/host/bin/../lib/gcc/csky-buildroot-linux-gnuabiv2/6.3.0/libgcc.a(_ashldi3.o): machine flag conflict with target ../csky/host/bin/csky-linux-ld: failed to merge target specific data of file /home/cfan/cross-gcc/csky/host/bin/../lib/gcc/csky-buildroot-linux-gnuabiv2/6.3.0/libgcc.a(_ashldi3.o) ../csky/host/bin/csky-linux-ld: /home/cfan/cross-gcc/csky/host/bin/../lib/gcc/csky-buildroot-linux-gnuabiv2/6.3.0/libgcc.a(_ashrdi3.o): machine flag conflict with target ../csky/host/bin/csky-linux-ld: failed to merge target specific data of file /home/cfan/cross-gcc/csky/host/bin/../lib/gcc/csky-buildroot-linux-gnuabiv2/6.3.0/libgcc.a(_ashrdi3.o) ../csky/host/bin/csky-linux-ld: /home/cfan/cross-gcc/csky/host/bin/../lib/gcc/csky-buildroot-linux-gnuabiv2/6.3.0/libgcc.a(_ucmpdi2.o): machine flag conflict with target ../csky/host/bin/csky-linux-ld: failed to merge target specific data of file /home/cfan/cross-gcc/csky/host/bin/../lib/gcc/csky-buildroot-linux-gnuabiv2/6.3.0/libgcc.a(_ucmpdi2.o) Makefile:969: recipe for target 'vmlinux' failed make: *** [vmlinux] Error 1

Please follow "Quick Start for qemu run" & "Build linux kernel" :

wget https://gitlab.com/c-sky/buildroot/-/jobs/197227857/artifacts/raw/output/images/csky_toolchain_csky_810f_qemu_4.9_glibc_br_defconfig_56683a5a67ecf1dd0e67b05b9541de74530d0047.tar.xz; mkdir host; tar -Jxf csky_toolchain_csky_810f_qemu_4.9_glibc_br_defconfig_56683a5a67ecf1dd0e67b05b9541de74530d0047.tar.xz -C host; echo "Download kernel source, csky patch and rootfs"; wget https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.9.56.tar.xz; wget https://gitlab.com/c-sky/buildroot/-/jobs/197227857/artifacts/raw/output/images/linux-4.9.56.patch.xz; wget https://gitlab.com/c-sky/buildroot/-/jobs/197227857/artifacts/raw/output/images/rootfs.cpio.xz;

echo "Now extra kernel source, patch it and compile"; tar -Jxf linux-4.9.56.tar.xz; xz -d rootfs.cpio.xz; xz -d linux-4.9.56.patch.xz; cd linux-4.9.56; patch -p1 < ../linux-4.9.56.patch; BR_BINARIES_DIR=.. make ARCH=csky CROSS_COMPILE=../host/bin/csky-linux- vmlinux;

guoren83 commented 5 years ago

It has been tested on gitlab cloud runner with ubuntu 64-bits 16.04 docker image

Vidos commented 5 years ago

The commit message said:The release is for toolchain v3.8.x/3.10.x with linux-4.9.56 headers. (Ubuntu-16.04-64bit). Then how to build the new version?

This is for some people have exteranl toolchain with linux-4.9.56, don't care about this.

The toolchain is built from buildroot

See https://gitlab.com/c-sky/buildroot/pipelines/56964790, there are 4.9 4.14 4.19 5.x linux version.

Thanks so much for your reply. I will try as you suggested. But I am puzzled, c-sky has been merged into mainline, but the new version can't build. Anyway, thanks so much for your help, I will read the doc again