Slackware - ARMThis forum is for the discussion of Slackware ARM.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
so it’s clear that this is not connected with compilers and the environment, but with architecture.
Let's check
go to slackware_arm_build_kit/build/source/u-boot-tools
Code:
make clean
make qemu-x86_64_defconfig
make -j6
ls tools/ | grep merge
I just tried that with the following results:
Code:
root@slackbuild:/home/user/slackbuild/new/c/slackware_arm_build_kit/build/source/u-boot-tools# make clean
CLEAN spl/u-boot.cfg
CLEAN u-boot.cfg
root@slackbuild:/home/user/slackbuild/new/c/slackware_arm_build_kit/build/source/u-boot-tools# make qemu-x86_64_defconfig
HOSTCC scripts/basic/fixdep
HOSTCC scripts/kconfig/conf.o
HOSTCC scripts/kconfig/zconf.tab.o
In file included from scripts/kconfig/zconf.tab.c:2468:
scripts/kconfig/confdata.c: In function ‘conf_write’:
scripts/kconfig/confdata.c:771:19: warning: ‘%s’ directive writing likely 7 or more bytes into a region of size between 1 and 4097 [-Wformat-overflow=]
771 | sprintf(newname, "%s%s", dirname, basename);
| ^~~~~~
scripts/kconfig/confdata.c:771:19: note: assuming directive output of 7 bytes
scripts/kconfig/confdata.c:771:2: note: ‘sprintf’ output 1 or more bytes (assuming 4104) into a destination of size 4097
771 | sprintf(newname, "%s%s", dirname, basename);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
scripts/kconfig/confdata.c:774:20: warning: ‘.tmpconfig.’ directive writing 11 bytes into a region of size between 1 and 4097 [-Wformat-overflow=]
774 | sprintf(tmpname, "%s.tmpconfig.%d", dirname, (int)getpid());
| ^~~~~~~~~~~~~~~~~
scripts/kconfig/confdata.c:774:3: note: ‘sprintf’ output between 13 and 4119 bytes into a destination of size 4097
774 | sprintf(tmpname, "%s.tmpconfig.%d", dirname, (int)getpid());
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HOSTLD scripts/kconfig/conf
#
# configuration written to .config
#
root@slackbuild:/home/user/slackbuild/new/c/slackware_arm_build_kit/build/source/u-boot-tools# make
scripts/kconfig/conf --silentoldconfig Kconfig
CHK include/config.h
CFG u-boot.cfg
GEN include/autoconf.mk
GEN include/autoconf.mk.dep
CFG spl/u-boot.cfg
GEN spl/include/autoconf.mk
CHK include/config/uboot.release
CHK include/generated/version_autogenerated.h
CHK include/generated/timestamp_autogenerated.h
UPD include/generated/timestamp_autogenerated.h
CC lib/asm-offsets.s
In file included from include/configs/qemu-x86.h:14,
from include/config.h:5,
from include/common.h:21,
from lib/asm-offsets.c:15:
include/configs/x86-common.h:91: error: "CONFIG_SYS_STACK_SIZE" redefined [-Werror]
91 | #define CONFIG_SYS_STACK_SIZE (32 * 1024)
|
In file included from ././include/linux/kconfig.h:4,
from <command-line>:
include/generated/autoconf.h:153: note: this is the location of the previous definition
153 | #define CONFIG_SYS_STACK_SIZE 0x200000
|
cc1: all warnings being treated as errors
make[1]: *** [Kbuild:44: lib/asm-offsets.s] Error 1
make: *** [Makefile:1350: prepare0] Error 2
root@slackbuild:/home/user/slackbuild/new/c/slackware_arm_build_kit/build/source/u-boot-tools#
Hmmm, something seems to be off with gcc-linaro-7.2.1-2017.11-x86_64_aarch64-linux-gnu:
Code:
root@slackbuild:/home/user/slackbuild/new/c/slackware_arm_build_kit/build/source/gcc-linaro-7.2.1-2017.11-x86_64_aarch64-linux-gnu/bin# ./aarch64-linux-gnu-gcc
bash: ./aarch64-linux-gnu-gcc: No such file or directory
root@slackbuild:/home/user/slackbuild/new/c/slackware_arm_build_kit/build/source/gcc-linaro-7.2.1-2017.11-x86_64_aarch64-linux-gnu/bin# ls -l ./aarch64-linux-gnu-gcc
-rwxr-xr-x 1 11827 9000 985504 Mar 3 11:50 ./aarch64-linux-gnu-gcc
root@slackbuild:/home/user/slackbuild/new/c/slackware_arm_build_kit/build/source/gcc-linaro-7.2.1-2017.11-x86_64_aarch64-linux-gnu/bin# file ./aarch64-linux-gnu-gcc
./aarch64-linux-gnu-gcc: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-aarch64.so.1, BuildID[sha1]=0cdc4bdda9aeecdefd65c748ad7441793a56aa10, stripped
root@slackbuild:/home/user/slackbuild/new/c/slackware_arm_build_kit/build/source/gcc-linaro-7.2.1-2017.11-x86_64_aarch64-linux-gnu/bin# file /home/user/gcc-aarch64/bin/aarch64-linux-gcc
/home/user/gcc-aarch64/bin/aarch64-linux-gcc: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, with debug_info, not stripped
The last one being the cross-compiler I compiled myself earlier.
I believe something is fishy here. I tested it by downloading the same package on my desktop and running file on the same binary, and voila:
The interpreter is different for some reason on the build machine, and the freshly uncompressed cross-compiler package...
The sha1sum of the two files also differ... I am puzzled.
Last edited by wowbaggerHU; 03-03-2020 at 09:42 AM.
I am not convinced that this step is needed when using the aarch64 cross-compilation toolchain on an x86_64 host.
It basically breaks the compiler and other related executables making them unrunnable as /lib64/ld-linux-aarch64.so.1 is usually not present on an x86_64 machine.
I tried disabling that patching I mentioned above, and made u-boot-tools to cross-compile (I have compiled and installed it from SlackBuild too).
This is where it failed (I tried compiling the legacy option):
Code:
CC drivers/gpio/gpio.c
CC plat/rockchip/common/bl31_plat_setup.c
CC plat/rockchip/common/params_setup.c
CC plat/rockchip/common/plat_pm.c
CC plat/rockchip/common/plat_topology.c
CC plat/rockchip/common/aarch64/platform_common.c
CC plat/rockchip/common/rockchip_sip_svc.c
CC plat/rockchip/rk3399/plat_sip_calls.c
CC plat/rockchip/rk3399/drivers/gpio/rk3399_gpio.c
CC plat/rockchip/rk3399/drivers/pmu/pmu.c
make -C plat/rockchip/rk3399/drivers/m0 BUILD=/home/user/slackbuild/new/c/slackware_arm_build_kit/build/source/arm-trusted-firmware/build/rk3399/release/m0
make[1]: Entering directory '/home/user/slackbuild/new/c/slackware_arm_build_kit/build/source/arm-trusted-firmware/plat/rockchip/rk3399/drivers/m0'
CC src/dram.c
/home/user/slackbuild/new/c/slackware_arm_build_kit/build/source/gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu/bin/arm-none-linux-gnueabihf-gcc -g -mcpu=cortex-m0 -mthumb -Wall -O3 -nostdlib -mfloat-abi=soft -ffunction-sections -fdata-sections -fomit-frame-pointer -fno-common -Iinclude/ -I../../include/shared/ -MMD -MT /home/user/slackbuild/new/c/slackware_arm_build_kit/build/source/arm-trusted-firmware/build/rk3399/release/m0/dram.o -c src/dram.c -o /home/user/slackbuild/new/c/slackware_arm_build_kit/build/source/arm-trusted-firmware/build/rk3399/release/m0/dram.o
make[1]: /home/user/slackbuild/new/c/slackware_arm_build_kit/build/source/gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu/bin/arm-none-linux-gnueabihf-gcc: Command not found
make[1]: *** [Makefile:125: /home/user/slackbuild/new/c/slackware_arm_build_kit/build/source/arm-trusted-firmware/build/rk3399/release/m0/dram.o] Error 127
make[1]: Leaving directory '/home/user/slackbuild/new/c/slackware_arm_build_kit/build/source/arm-trusted-firmware/plat/rockchip/rk3399/drivers/m0'
make: *** [plat/rockchip/rk3399/platform.mk:107: build/rk3399/release/m0/rk3399m0.bin] Error 2
I have no idea why it tries to build arm-trusted-firmware with the 32-bit ARM cross-compiler. Could you please explain?
Last edited by wowbaggerHU; 03-04-2020 at 11:38 AM.
CC drivers/gpio/gpio.c
CC src/dram.c
/home/user/slackbuild/new/c/slackware_arm_build_kit/build/source/gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu/bin/arm-none-linux-gnueabihf-gcc -g -mcpu=cortex-m0 -mthumb -Wall -O3 -nostdlib -mfloat-abi=soft -ffunction-sections -fdata-sections -fomit-frame-pointer -fno-common -Iinclude/ -I../../include/shared/ -MMD -MT /home/user/slackbuild/new/c/slackware_arm_build_kit/build/source/arm-trusted-firmware/build/rk3399/release/m0/dram.o -c src/dram.c -o /home/user/slackbuild/new/c/slackware_arm_build_kit/build/source/arm-trusted-firmware/build/rk3399/release/m0/dram.o
make[1]: /home/user/slackbuild/new/c/slackware_arm_build_kit/build/source/gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu/bin/arm-none-linux-gnueabihf-gcc: Command not found
It seems it tries to combine the aarch64 cross-compiler's path with the arm cross-compiler's file name prefix, which is wrong. I believe it's due to this:
This is due to the compiler name being gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu, as it will match on [[ $XTOOL =~ "arm" ]], which should be checked some other way.
And an extra thought:
You mentioned that u-boot-tools is supposed to be compiled to become a binary that is meant to be run on the machine where the image is being built (x86_64 in this case).
If that is the case, then why do we have this?
I mean the SOCFAMILY variable is set up based on your choices in the dialog screens at the beginning, so it doesn't depend on what machine you are building the image on, but the target machine. That approach is flawed, as I end up with building u-boot-tools with the config rk3399_defconfig instead of qemu-x86_64_defconfig.
Last edited by wowbaggerHU; 03-06-2020 at 05:40 AM.
thanks wowbaggerHU,
again fixing paths to cross compilers on x86_64 and aarch64 platforms
Thanks sndwvs! The CROSS32 thing works now okay.
However there still are problems with the patching I showed you in my previous comment. In a clean environment the build will fail due to inappropriate pathces:
Code:
MKIMAGE u-boot.itb
/home/user/slackbuild/new/c/slackware_arm_build_kit/build/source/u-boot-pinebook_pro /home/user/slackbuild/new/c/slackware_arm_build_kit/build/source/u-boot-pinebook_pro
Image Type: Rockchip RK33 (SD/MMC) boot image
Init Data Size: 69632 bytes
/home/user/slackbuild/new/c/slackware_arm_build_kit/build/source/u-boot-pinebook_pro
/home/user/slackbuild/new/c/slackware_arm_build_kit/build/source/linux-rk3399-legacy /home/user/slackbuild/new/c/slackware_arm_build_kit/build/source/u-boot-pinebook_pro
Reversed (or previously applied) patch detected! Skipping patch.
4 out of 4 hunks ignored -- saving rejects to file include/media/cec.h.rej
Furthermore I still have to patch compile_boot_tools() with CROSS_COMPILE=${CROSS} as otherwise it will fail the already known "unknown register name: x18" error. I believe this is due to the way how SOCFAMILY is used.
Also, the kernel compilation step asks quite a lot of config related questions (appropriate questions this time, not x86_64 related ones like before), so the kernel config used is likely somewhat outdated.
Thanks sndwvs! The CROSS32 thing works now okay.
However there still are problems with the patching I showed you in my previous comment. In a clean environment the build will fail due to inappropriate pathces:
Code:
MKIMAGE u-boot.itb
/home/user/slackbuild/new/c/slackware_arm_build_kit/build/source/u-boot-pinebook_pro /home/user/slackbuild/new/c/slackware_arm_build_kit/build/source/u-boot-pinebook_pro
Image Type: Rockchip RK33 (SD/MMC) boot image
Init Data Size: 69632 bytes
/home/user/slackbuild/new/c/slackware_arm_build_kit/build/source/u-boot-pinebook_pro
/home/user/slackbuild/new/c/slackware_arm_build_kit/build/source/linux-rk3399-legacy /home/user/slackbuild/new/c/slackware_arm_build_kit/build/source/u-boot-pinebook_pro
Reversed (or previously applied) patch detected! Skipping patch.
4 out of 4 hunks ignored -- saving rejects to file include/media/cec.h.rej
Furthermore I still have to patch compile_boot_tools() with CROSS_COMPILE=${CROSS} as otherwise it will fail the already known "unknown register name: x18" error. I believe this is due to the way how SOCFAMILY is used.
Also, the kernel compilation step asks quite a lot of config related questions (appropriate questions this time, not x86_64 related ones like before), so the kernel config used is likely somewhat outdated.
No problem!
The legacy base image now builds successfully. I will now test the "next", and will try to build the legacy and next xfce images as well later on the weekend.
The next time I will have the opportunity to try and boot these images will be on next Tuesday.
If I encounter any problems with building the images, I will let you know!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.