LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   slarm64 (https://www.linuxquestions.org/questions/slarm64-132/)
-   -   Slarm64-15.0 trusted-firmware-a-master aarch64-none-elf-gcc (https://www.linuxquestions.org/questions/slarm64-132/slarm64-15-0-trusted-firmware-a-master-aarch64-none-elf-gcc-4175735057/)

Stragonian 03-19-2024 03:46 AM

Slarm64-15.0 trusted-firmware-a-master aarch64-none-elf-gcc
 
Greetings Slarm64 community, I have been attempting to build the trusted-firmware-a-master from a default Slarm64-15.0 install, running on a Banana Pi M64.

Compile instruction can be found here ....
https://trustedfirmware-a.readthedoc...allwinner.html

When I attempt to compile the firmware using the instruction from the website, I get:

Code:

export BL31=$(pwd)/build/sun50i_a64/debug/bl31.bin
make PLAT=sun50i_a64 DEBUG=1 bl31

/bin/sh: line 1: aarch64-none-elf-gcc: command not found

The compile immediately produces the above error ...

All the online pre-packaged aarch64-none-elf-gcc compilers I have found for native Aarch64 systems, are all built from different glibc, so the Slarm64-15.0 system fails to use them successfully. So, now I am left with some question ....

First, what is the difference between the aarch64-slackware-linux-gcc and the aarch64-none-elf-gcc?

Second, Is there a workaround, so I can use the aarch64-slackware-linux-gcc which is already installed in the system rather than an aarch64-none-elf-gcc to compile the trusted-firmware-a-master?

Third, would building an aarch64-none-elf-gcc for slarm64-15.0 and Slackware-current Aarch64 be beneficial for Slackware Arm's & Aarch64's further development? ( Since the trusted-firmware-a-master used by u-boot for Arm / Aarch64 depends on an aarch64-none-elf-gcc compiler )

Fourth, do I need to compile my own aarch64-none-elf-gcc compiler from the gcc-11.2.0 source with ./configure --target=aarch64-none-elf?

Fifth, How would I go about compiling my own aarch64-none-elf-gcc compile if it is more complicated than just ./configure --target=aarch64-none-elf?

Anyway, I'm not sure if this is more of the whole cross-compiling nightmare of using an Arm32/Arm64 systems or not.

Plus: Why do some many build scripts from github assume I am cross-compiling from a x86_64 system?

sndwvs 03-19-2024 12:47 PM

all this is already in images_build_kit, link 1, link 2

Stragonian 03-19-2024 09:44 PM

Thank you for the information!

I downloaded the source and ...

Code:

# tar xvf images_build_kit-arm.tar.gz
There was no selection for the Banana Pi M64, so I selected the Pinebook, as they both use an Allwinner A64, and hoped the build script doesn't clean up it's mess, so I can use the bl31.bin in my own u-boot build - as I am currently just after the TF-A bl31.bin to compile into BPI-M64 uboot for Slarm64-15.0.

Code:

|info| added        configuration file environment.conf
|info| added        configuration file build-packages.conf
|info| added        configuration file pinebook.conf
|info| added        configuration file sun50iw1.conf
|info| download    gcc-arm-10.3-2021.07-aarch64-arm-none-linux-gnueabihf
|info| extract      gcc-arm-10.3-2021.07-aarch64-arm-none-linux-gnueabihf
|info| download    u-boot
|err | details      /opt/images_build_kit-arm/build/source/build.log

The build.log ended with the following lines ...

Code:

|----------- delimiter ----------- "download" "u-boot" -----------|
Cloning into '/opt/images_build_kit-arm/build/source/u-boot'...
fatal: unable to access 'https://gitlab.denx.de/u-boot/u-boot.git/': SSL certificate problem: unable to get local issuer certificate

So, it looks like there is a problem with my SSL certificates, I'll have to investigate it.

sndwvs 03-20-2024 11:57 AM

Quote:

Originally Posted by Stragonian (Post 6490725)
Code:

|----------- delimiter ----------- "download" "u-boot" -----------|
Cloning into '/opt/images_build_kit-arm/build/source/u-boot'...
fatal: unable to access 'https://gitlab.denx.de/u-boot/u-boot.git/': SSL certificate problem: unable to get local issuer certificate

So, it looks like there is a problem with my SSL certificates, I'll have to investigate it.

this problem is described.
solution:
Code:

git config --global http.sslVerify false

Stragonian 03-22-2024 01:41 AM

Ok, Thank you for the link, I followed solution 114 of the link, and it worked.

Code:

mkdir ~/certs
curl https://curl.haxx.se/ca/cacert.pem -o ~/certs/cacert.pem

touch .gitconfig

added the lines below to .gitconfig

[http]
sslCAinfo = /<path>/certs/cacert.pem

The images_build_kit-arm got this far into the build.
Code:

|info| added        configuration file environment.conf
|info| added        configuration file build-packages.conf
|info| added        configuration file pinebook.conf
|info| added        configuration file sun50iw1.conf
|info| download    gcc-arm-10.3-2021.07-aarch64-arm-none-linux-gnueabihf
|info| extract      gcc-arm-10.3-2021.07-aarch64-arm-none-linux-gnueabihf
|info| download    u-boot
|info| download    arm-trusted-firmware
|info| download    linux-legacy
|info| download    linux-firmware
|info| start        build slarm64 ARCH aarch64 images: core server
|info| clear        boot tools
|info| compiling    arm-trusted-firmware master:tag:v2.9
|info| patching    succeeded: allwinner-a10-spi-driver.patch
|info| patching    succeeded: allwinner-disable-de2-to-improve-edid-detection.patch
|info| patching    succeeded: allwinner-enable-autoboot-keyed.patch
|info| patching    succeeded: allwinner-enable-r_pio-gpio-access-h3-h5.patch
|info| patching    succeeded: allwinner-fdt-setprop-fix-unaligned-access.patch
|info| patching    succeeded: allwinner-h3-enable-power-led.patch
|info| patching    succeeded: allwinner-h3-fix-pll1-setup-to-never-use-dividers.patch
|info| patching    succeeded: allwinner-h3-set-safe-axi_apb-clock-dividers.patch
|info| patching    succeeded: allwinner-h616-GPU-enable-hack.patch
|info| patching    succeeded: allwinner-h616-THS-workaround.patch
|info| patching    succeeded: allwinner-sun8i-set-machid.patch
|warn| patching    not succeeded: do-not-relocate-initrd.patch
|info| patching    succeeded: enable-old-kernel-compat.patch
|info| patching    succeeded: pinebook-add-rare-panel-support.patch
|info| patching    succeeded: pinebook-analog-audio-jack-fix.patch
|info| compiling    u-boot 2023.10
|info| compiler    gcc 11.2.0
|err | details      /opt/images_build_kit-arm/build/source/build.log

Which is totally fine, because I am not running a pinebook, but rather I just needed the bl31.bin TF-A for the Allwinner A64, to use on a Banaba Pi M64.
After the compiler crash, I ...
Code:

export BL31=/opt/images_build_kit-arm/build/source/arm-trusted-firmware/build/sun50i_a64/release/bl31.bin
cd /opt/images_build_kit-arm/build/source/u-boot
make mrproper (to clean up the pinebook uboot build)
make bananapi_m64_defconfig
make menuconfig (set to boot from ext4 environment - so I don't need a fat partition)
        > Environment >
                [*] Environment is in a EXT4 filesystem
                (mmc) Name of the block device for the environment
                (:auto) Device and partition for where to store the environemt in EXT4
                (/boot/uboot.env) Name of the EXT4 file to use for the environment
make all
...
crash

The custom bpi-m64 uboot compile in images_build_kit-arm crashed. So I copied the bl31.bin into the BPI-Mainline-uboot-master u-boot-2022.07, then repeated the same steps above, but changed the export BL to the BPI-Mainline-uboot-master u-boot-2022.07 directory, and the compile worked.
Code:

cd /opt/BPI-Mainline-uboot-master/u-boot-2022.07
cp /opt/images_build_kit-arm/build/source/arm-trusted-firmware/build/sun50i_a64/release/bl31.bin ./
export BL31=`pwd`/bl31.bin
make mrproper ( just for good measure )
make bananapi_m64_defconfig
make menuconfig (set to boot from ext4 environment - so I don't need a fat partition)
        > Environment >
                [*] Environment is in a EXT4 filesystem
                (mmc) Name of the block device for the environment
                (:auto) Device and partition for where to store the environemt in EXT4
                (/boot/uboot.env) Name of the EXT4 file to use for the environment
make all
...
u-boot-sunxi-with-spl.bin finished successfully

I still need to test the u-boot, and I have a lot more to do before I'm finished, but it's good to get this far. Thank You!


All times are GMT -5. The time now is 07:00 AM.