LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - ARM
User Name
Password
Slackware - ARM This forum is for the discussion of Slackware ARM.

Notices


Reply
  Search this Thread
Old 02-13-2020, 10:54 AM   #16
sndwvs
Senior Member
 
Registered: Aug 2014
Posts: 1,919

Rep: Reputation: Disabled

Quote:
Originally Posted by wowbaggerHU View Post
Okay, understood. So what should I do? Should I go ahead and modify them in those scripts?
Or if not, then what am I supposed to do? If I don't set them anywhere, and go with the script's defaults, the compilation will simply fail at uboot.
(If I simply don't set any of these environment variables, and go with the defaults in the script, it won't even bother downloading the cross compilation toolchains.)
try so
Code:
NATIVE_ARCH=false ./build.sh
 
Old 02-14-2020, 01:09 AM   #17
wowbaggerHU
Member
 
Registered: Feb 2017
Location: Hungary
Distribution: Slackware
Posts: 288

Rep: Reputation: Disabled
Quote:
Originally Posted by sndwvs View Post
try so
Code:
NATIVE_ARCH=false ./build.sh
I did as you asked, but the result stayed the same:
Code:
|info| add          configuration file 00-environment.conf
|info| add          configuration file build-packages.conf
|info| add          configuration file pinebook_pro.conf
|info| add          configuration file rk3399.conf
|info| download     gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf
|info| extract      gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf
|info| download     gcc-linaro-7.2.1-2017.11-x86_64_aarch64-linux-gnu
|info| extract      gcc-linaro-7.2.1-2017.11-x86_64_aarch64-linux-gnu
|info| download     gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf
|info| extract      gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf
|info| download     gcc-linaro-5.5.0-2017.10-x86_64_aarch64-linux-gnu
|info| extract      gcc-linaro-5.5.0-2017.10-x86_64_aarch64-linux-gnu
|info| download     u-boot-pinebook_pro
|info| download     u-boot-tools
|info| download     arm-trusted-firmware
|info| download     rkbin
|info| download     linux-rk3399-next-pinebook_pro
|info| start        build slarm64 ARCH aarch64
|info| compiling    u-boot-tools next-dev::
|err | details      /home/user/slackbuild/slackware_arm_build_kit/build/source/build.log
The end of the build log looks like this:
Code:
2020-02-12 02:07:40 (3.23 MB/s) - '/home/janos/slackbuild/slackware_arm_build_kit/build/source/gcc-linaro-5.5.0-2017.10-x86_64_aarch64-linux-gnu.tar.xz' saved [94218924/94218924]

~/slackbuild/slackware_arm_build_kit/build/source/u-boot-pinebook_pro ~/slackbuild/slackware_arm_build_kit
~/slackbuild/slackware_arm_build_kit
~/slackbuild/slackware_arm_build_kit/build/source/u-boot-tools ~/slackbuild/slackware_arm_build_kit
~/slackbuild/slackware_arm_build_kit
~/slackbuild/slackware_arm_build_kit/build/source/arm-trusted-firmware ~/slackbuild/slackware_arm_build_kit
~/slackbuild/slackware_arm_build_kit
~/slackbuild/slackware_arm_build_kit/build/source/rkbin ~/slackbuild/slackware_arm_build_kit
~/slackbuild/slackware_arm_build_kit
~/slackbuild/slackware_arm_build_kit/build/source/linux-rk3399-next-pinebook_pro ~/slackbuild/slackware_arm_build_kit
~/slackbuild/slackware_arm_build_kit
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  SHIPPED scripts/kconfig/zconf.tab.c
  SHIPPED scripts/kconfig/zconf.lex.c
  SHIPPED scripts/kconfig/zconf.hash.c
  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
#
scripts/kconfig/conf  --silentoldconfig Kconfig
  CHK     include/config.h
  UPD     include/config.h
  GEN     include/autoconf.mk.dep
  CFG     u-boot.cfg
  CFG     spl/u-boot.cfg
cc1: error: unknown register name: x18 [-Werror]
cc1: error: unknown register name: x18 [-Werror]
cc1: error: unknown register name: x18 [-Werror]
cc1: all warnings being treated as errors
cc1: all warnings being treated as errors
cc1: all warnings being treated as errors
make[1]: *** [scripts/Makefile.autoconf:50: include/autoconf.mk.dep] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [scripts/Makefile.autoconf:79: u-boot.cfg] Error 1
make[1]: *** [scripts/Makefile.autoconf:83: spl/u-boot.cfg] Error 1
make: *** No rule to make target 'include/config/auto.conf', needed by 'include/config/uboot.release'.  Stop.
 
Old 02-14-2020, 07:33 AM   #18
wowbaggerHU
Member
 
Registered: Feb 2017
Location: Hungary
Distribution: Slackware
Posts: 288

Rep: Reputation: Disabled
I believe I found the reason why the build is failing:
In slackware_arm_build_kit/build/source/u-boot-tools/scripts/Makefile.autoconf there is a part like this:

Code:
# Need to define CC and CPP again here in case the top Makefile did not
# include config.mk.  Some architectures expect CROSS_COMPILE to be defined
# in arch/$(ARCH)/config.mk
CC              = $(CROSS_COMPILE)gcc
CPP             = $(CC) -E
Here, the value of CROSS_COMPILE is not set, or set to empty string, and I believe that that may be the reason that the script tries to use the host's own x86_64 gcc, which obviously doesn't know anything about aarch64 registers.
Although fixing that doesn't get me much further:

Code:
  CHK     include/config.h
  CFG     u-boot.cfg
  GEN     include/autoconf.mk.dep
  CFG     spl/u-boot.cfg
  CFG     tpl/u-boot.cfg
  GEN     include/autoconf.mk
  GEN     spl/include/autoconf.mk
  GEN     tpl/include/autoconf.mk
  CHK     include/config/uboot.release
  CHK     include/generated/timestamp_autogenerated.h
  UPD     include/generated/timestamp_autogenerated.h
  HOSTCC  scripts/dtc/flattree.o
  HOSTCC  scripts/dtc/dtc.o
  HOSTCC  scripts/dtc/fstree.o
  HOSTCC  scripts/dtc/data.o
  HOSTCC  scripts/dtc/livetree.o
  HOSTCC  scripts/dtc/treesource.o
  HOSTCC  scripts/dtc/srcpos.o
  HOSTCC  scripts/dtc/checks.o
  HOSTCC  scripts/dtc/util.o
  SHIPPED scripts/dtc/dtc-lexer.lex.c
  SHIPPED scripts/dtc/dtc-parser.tab.h
  SHIPPED scripts/dtc/dtc-parser.tab.c
  HOSTCC  scripts/dtc/dtc-lexer.lex.o
  HOSTCC  scripts/dtc/dtc-parser.tab.o
  HOSTLD  scripts/dtc/dtc
  UPD     include/config/uboot.release
  CHK     include/generated/version_autogenerated.h
  UPD     include/generated/version_autogenerated.h
  CC      lib/asm-offsets.s
  CC      arch/arm/lib/asm-offsets.s
cc1: error: unknown register name: x18 [-Werror]
cc1: error: unknown register name: x18 [-Werror]
cc1: error: bad value ('armv8-a+nosimd') for '-march=' switch
cc1: note: valid arguments to '-march=' switch are: nocona core2 nehalem corei7 westmere sandybridge corei7-avx ivybridge core-avx-i haswell core-avx2 broadwell skylake skylake-avx512 cannonlake icelake-client icelake-server cascadelake bonnell atom silvermont slm goldmont goldmont-plus tremont knl knm x86-64 eden-x2 nano nano-1000 nano-2000 nano-3000 nano-x2 eden-x4 nano-x4 k8 k8-sse3 opteron opteron-sse3 athlon64 athlon64-sse3 athlon-fx amdfam10 barcelona bdver1 bdver2 bdver3 bdver4 znver1 znver2 btver1 btver2 native
cc1: all warnings being treated as errors
cc1: error: bad value ('armv8-a+nosimd') for '-march=' switch
cc1: note: valid arguments to '-march=' switch are: nocona core2 nehalem corei7 westmere sandybridge corei7-avx ivybridge core-avx-i haswell core-avx2 broadwell skylake skylake-avx512 cannonlake icelake-client icelake-server cascadelake bonnell atom silvermont slm goldmont goldmont-plus tremont knl knm x86-64 eden-x2 nano nano-1000 nano-2000 nano-3000 nano-x2 eden-x4 nano-x4 k8 k8-sse3 opteron opteron-sse3 athlon64 athlon64-sse3 athlon-fx amdfam10 barcelona bdver1 bdver2 bdver3 bdver4 znver1 znver2 btver1 btver2 native
cc1: all warnings being treated as errors
make[1]: *** [Kbuild:44: lib/asm-offsets.s] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [Kbuild:65: arch/arm/lib/asm-offsets.s] Error 1
But again it seems that the native x86_64 compiler is being used for some reason.
 
1 members found this post helpful.
Old 02-14-2020, 07:56 AM   #19
wowbaggerHU
Member
 
Registered: Feb 2017
Location: Hungary
Distribution: Slackware
Posts: 288

Rep: Reputation: Disabled
After another try, when I edited the file slackware_arm_build_kit/build/source/u-boot-tools/Makefile, as follows:

Code:
# We need some generic definitions (do not try to remake the file).
scripts/Kbuild.include: ;
include scripts/Kbuild.include

# Make variables (CC, etc...)

+CROSS_COMPILE   = $(CROSS)
+
AS              = $(CROSS_COMPILE)as
# Always use GNU ld
ifneq ($(shell $(CROSS_COMPILE)ld.bfd -v 2> /dev/null),)
LD              = $(CROSS_COMPILE)ld.bfd
else
LD              = $(CROSS_COMPILE)ld
endif
CC              = $(CROSS_COMPILE)gcc
CPP             = $(CC) -E
AR              = $(CROSS_COMPILE)ar
NM              = $(CROSS_COMPILE)nm
LDR             = $(CROSS_COMPILE)ldr
STRIP           = $(CROSS_COMPILE)strip
OBJCOPY         = $(CROSS_COMPILE)objcopy
OBJDUMP         = $(CROSS_COMPILE)objdump
AWK             = awk
PERL            = perl
PYTHON          ?= python
DTC             ?= $(objtree)/scripts/dtc/dtc
CHECK           = sparse

CHECKFLAGS     := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
                  -Wbitwise -Wno-return-void -D__CHECK_ENDIAN__ $(CF)

KBUILD_CPPFLAGS := -D__KERNEL__ -D__UBOOT__

KBUILD_CFLAGS   := -Wall -Wstrict-prototypes \
                   -Wno-format-security \
After this, uboot-tools compiled successfully, but then it failed when compiling arm-trusted-firmware:

Code:
make[1]: Leaving directory '/home/user/slackbuild/slackware_arm_build_kit/build/source/arm-trusted-firmware/plat/rockchip/rk3399/drivers/m0'
  CC      plat/rockchip/rk3399/drivers/pmu/pmu_fw.c
  CC      plat/rockchip/rk3399/drivers/pmu/m0_ctl.c
  CC      plat/rockchip/rk3399/drivers/pwm/pwm.c
  CC      plat/rockchip/rk3399/drivers/secure/secure.c
  CC      plat/rockchip/rk3399/drivers/soc/soc.c
  CC      plat/rockchip/rk3399/drivers/dram/dfs.c
  CC      plat/rockchip/rk3399/drivers/dram/dram.c
  CC      plat/rockchip/rk3399/drivers/dram/dram_spec_timing.c
  CC      plat/rockchip/rk3399/drivers/dram/suspend.c
  CC      bl31/bl31_main.c
  CC      bl31/interrupt_mgmt.c
  CC      bl31/bl31_context_mgmt.c
  CC      common/runtime_svc.c
  CC      services/arm_arch_svc/arm_arch_svc_setup.c
  CC      services/std_svc/std_svc_setup.c
  CC      lib/el3_runtime/cpu_data_array.c
  CC      lib/el3_runtime/aarch64/context_mgmt.c
  CC      lib/cpus/errata_report.c
  CC      lib/psci/psci_off.c
  CC      lib/psci/psci_on.c
  CC      lib/psci/psci_suspend.c
  CC      lib/psci/psci_common.c
  CC      lib/psci/psci_main.c
  CC      lib/psci/psci_setup.c
  CC      lib/psci/psci_system_off.c
  CC      lib/psci/psci_mem_protect.c
  CC      lib/locks/bakery/bakery_lock_coherent.c
  CC      lib/extensions/spe/spe.c
  CC      common/bl_common.c
  CC      common/tf_log.c
  CC      drivers/console/multi_console.c
  CC      plat/common/plat_bl_common.c
  CC      plat/common/plat_log_common.c
  CC      plat/common/aarch64/plat_common.c
  CC      lib/compiler-rt/builtins/popcountdi2.c
  CC      lib/compiler-rt/builtins/popcountsi2.c
  CC      common/desc_image_load.c
  CC      lib/bl_aux_params/bl_aux_params.c
  CC      lib/xlat_tables/xlat_tables_common.c
  CC      lib/xlat_tables/aarch64/xlat_tables.c
  CC      plat/common/plat_psci_common.c
  AS      drivers/ti/uart/aarch64/16550_console.S
  AS      lib/cpus/aarch64/cortex_a53.S
  AS      lib/cpus/aarch64/cortex_a72.S
  AS      plat/rockchip/common/aarch64/plat_helpers.S
  AS      plat/rockchip/common/aarch64/pmu_sram_cpus_on.S
  AS      bl31/aarch64/bl31_entrypoint.S
  AS      bl31/aarch64/crash_reporting.S
  AS      bl31/aarch64/ea_delegate.S
  AS      bl31/aarch64/runtime_exceptions.S
  AS      lib/cpus/aarch64/dsu_helpers.S
  AS      plat/common/aarch64/platform_mp_stack.S
  AS      lib/el3_runtime/aarch64/cpu_data.S
  AS      lib/cpus/aarch64/cpu_helpers.S
  AS      lib/locks/exclusive/aarch64/spinlock.S
  AS      lib/psci/aarch64/psci_helpers.S
  AS      lib/el3_runtime/aarch64/context.S
  AS      lib/cpus/aarch64/wa_cve_2017_5715_bpiall.S
  AS      lib/cpus/aarch64/wa_cve_2017_5715_mmu.S
  AS      common/aarch64/debug.S
  AS      lib/aarch64/cache_helpers.S
  AS      lib/aarch64/misc_helpers.S
  AS      plat/common/aarch64/platform_helpers.S
  AS      plat/common/aarch64/crash_console_helpers.S
  PP      bl31/bl31.ld.S
  CC      lib/libfdt/fdt.c
  CC      lib/libfdt/fdt_addresses.c
  CC      lib/libfdt/fdt_empty_tree.c
  CC      lib/libfdt/fdt_ro.c
  CC      lib/libfdt/fdt_rw.c
  CC      lib/libfdt/fdt_strerror.c
  CC      lib/libfdt/fdt_sw.c
  CC      lib/libfdt/fdt_wip.c
  AR      build/rk3399/release/lib/libfdt.a
  CC      lib/libc/abort.c
  CC      lib/libc/assert.c
  CC      lib/libc/exit.c
  CC      lib/libc/memchr.c
  CC      lib/libc/memcmp.c
  CC      lib/libc/memcpy.c
  CC      lib/libc/memmove.c
  CC      lib/libc/memrchr.c
  CC      lib/libc/memset.c
  CC      lib/libc/printf.c
  CC      lib/libc/putchar.c
  CC      lib/libc/puts.c
  CC      lib/libc/snprintf.c
  CC      lib/libc/strchr.c
  CC      lib/libc/strcmp.c
  CC      lib/libc/strlcpy.c
  CC      lib/libc/strlen.c
  CC      lib/libc/strncmp.c
  CC      lib/libc/strnlen.c
  CC      lib/libc/strrchr.c
  AS      lib/libc/aarch64/setjmp.S
  AR      build/rk3399/release/lib/libc.a
  LD      build/rk3399/release/bl31/bl31.elf

Built build/rk3399/release/bl31/bl31.elf successfully

  OD      build/rk3399/release/bl31/bl31.dump
E: [mergetrust] filter_elf bl32.bin file failed
merge failed!
out:trust.img
However I'm not familiar with this error message, so I don't know where to look.
 
1 members found this post helpful.
Old 02-14-2020, 10:51 AM   #20
sndwvs
Senior Member
 
Registered: Aug 2014
Posts: 1,919

Rep: Reputation: Disabled
wowbaggerHU thank,
this is when creating ATF, the file does not find, you need to fix it.
 
Old 02-14-2020, 11:23 AM   #21
wowbaggerHU
Member
 
Registered: Feb 2017
Location: Hungary
Distribution: Slackware
Posts: 288

Rep: Reputation: Disabled
Quote:
Originally Posted by sndwvs View Post
this is when creating ATF, the file does not find, you need to fix it.
Okay, but what should I do exactly?

The output says that build/rk3399/release/bl31/bl31.elf was created successfully, and then od-ing build/rk3399/release/bl31/bl31.dump was successful as well, but then
[mergetrust] filter_elf bl32.bin file failed

I assume you are saying that the file bl32.bin likely doesn't exist. What should I do to fix it?
 
Old 02-14-2020, 11:38 AM   #22
sndwvs
Senior Member
 
Registered: Aug 2014
Posts: 1,919

Rep: Reputation: Disabled
Now in the root of ATF a symlink is created on the blob (this is with aarch64) with x86 this was not taken into account.
just make a symlink after the assembly phase of ATF
Code:
ln -s build/rk3399/release/bl31/bl31.elf bl31.elf
 
Old 02-14-2020, 03:25 PM   #23
wowbaggerHU
Member
 
Registered: Feb 2017
Location: Hungary
Distribution: Slackware
Posts: 288

Rep: Reputation: Disabled
Quote:
Originally Posted by sndwvs View Post
Code:
ln -s build/rk3399/release/bl31/bl31.elf bl31.elf
Thanks for the suggestion, but the symlink is already present. What seems to be missing is the entire bl32 directory, and that seems to be the cause why the bl32.bin symlink is broken:

Code:
user@slackbuild:~/slackbuild/slackware_arm_build_kit/build/source/arm-trusted-firmware$ ls -l
total 116
-rw-r--r--  1 user user 37673 Feb 12 18:53 Makefile
drwxr-xr-x  5 user user  4096 Feb 12 18:53 bl1
drwxr-xr-x  4 user user  4096 Feb 12 18:53 bl2
drwxr-xr-x  4 user user  4096 Feb 12 18:53 bl2u
drwxr-xr-x  3 user user  4096 Feb 12 18:53 bl31
lrwxrwxrwx  1 user user    36 Feb 12 20:31 bl31.elf -> ./build/rk3399/release/bl31/bl31.elf
drwxr-xr-x  5 user user  4096 Feb 12 18:53 bl32
lrwxrwxrwx  1 user user    36 Feb 12 20:31 bl32.bin -> ./build/rk3399/release/bl32/bl32.bin
drwxr-xr-x  3 user user  4096 Feb 12 20:31 build
drwxr-xr-x  5 user user  4096 Feb 12 18:53 common
-rw-r--r--  1 user user  1421 Feb 12 18:53 dco.txt
drwxr-xr-x 11 user user  4096 Feb 12 18:53 docs
drwxr-xr-x 26 user user  4096 Feb 12 18:53 drivers
drwxr-xr-x  2 user user  4096 Feb 12 18:53 fdts
drwxr-xr-x 16 user user  4096 Feb 12 18:53 include
drwxr-xr-x 25 user user  4096 Feb 12 18:53 lib
-rw-r--r--  1 user user    21 Feb 12 18:53 license.rst
drwxr-xr-x  3 user user  4096 Feb 12 18:53 make_helpers
drwxr-xr-x 21 user user  4096 Feb 12 18:53 plat
-rw-r--r--  1 user user  2689 Feb 12 18:53 readme.rst
drwxr-xr-x  5 user user  4096 Feb 12 18:53 services
drwxr-xr-x 10 user user  4096 Feb 12 18:53 tools
user@slackbuild:~/slackbuild/slackware_arm_build_kit/build/source/arm-trusted-firmware$ ls ./build/rk3399/release/bl31/bl31.elf
./build/rk3399/release/bl31/bl31.elf
user@slackbuild:~/slackbuild/slackware_arm_build_kit/build/source/arm-trusted-firmware$ ls ./build/rk3399/release/bl32/bl32.bin
ls: cannot access './build/rk3399/release/bl32/bl32.bin': No such file or directory
user@slackbuild:~/slackbuild/slackware_arm_build_kit/build/source/arm-trusted-firmware$ ls ./build/rk3399/release/bl* -ld
drwxr-xr-x 2 user user 4096 Feb 12 20:31 ./build/rk3399/release/bl31
user@slackbuild:~/slackbuild/slackware_arm_build_kit/build/source/arm-trusted-firmware$
 
Old 02-14-2020, 03:33 PM   #24
sndwvs
Senior Member
 
Registered: Aug 2014
Posts: 1,919

Rep: Reputation: Disabled
removed trust.img bl32 for assembly.
 
Old 02-14-2020, 04:36 PM   #25
wowbaggerHU
Member
 
Registered: Feb 2017
Location: Hungary
Distribution: Slackware
Posts: 288

Rep: Reputation: Disabled
Could you please explain what should I do next?
 
Old 02-14-2020, 04:59 PM   #26
sndwvs
Senior Member
 
Registered: Aug 2014
Posts: 1,919

Rep: Reputation: Disabled
can try trust.img should now be created
 
Old 02-14-2020, 06:40 PM   #27
sndwvs
Senior Member
 
Registered: Aug 2014
Posts: 1,919

Rep: Reputation: Disabled
i made changes to build atf using cross-compiler for aarch64 and minor fixes for x86_64
 
Old 02-16-2020, 04:40 AM   #28
wowbaggerHU
Member
 
Registered: Feb 2017
Location: Hungary
Distribution: Slackware
Posts: 288

Rep: Reputation: Disabled
Quote:
Originally Posted by sndwvs View Post
i made changes to build atf using cross-compiler for aarch64 and minor fixes for x86_64
Well, things did not get any better. I discovered the following things:
* ARCH is by default unset on slackware64-current => I had to manually export it, and set it to x86_64, because your checks depend on it
* I still have to set "CROSS_COMPILE = $(CROSS)" in slackware_arm_build_kit/build/source/u-boot-tools/Makefile
* now the build fails because it is looking for /home/user/slackbuild/slackware_arm_build_kit/build/source/gcc-linaro-7.2.1-2017.11-x86_64_aarch64-linux-gnu/bin/arm-linux-gnueabihf-gcc however there is no such file, only aarch64-linux-gnu-gcc in that very directory
 
Old 02-16-2020, 05:50 AM   #29
wowbaggerHU
Member
 
Registered: Feb 2017
Location: Hungary
Distribution: Slackware
Posts: 288

Rep: Reputation: Disabled
configation.sh doesn't make sense to me:

Code:
#---------------------------------------------
# xtools configuration
#---------------------------------------------
if [[ $ARCH == "x86_64" ]]; then
    BASE_URL_XTOOLS="https://releases.linaro.org/components/toolchain/binaries"
    XTOOLS_ARM_SUFFIX="arm-linux-gnueabihf"
    XTOOLS_ARM64_SUFFIX="aarch64-linux-gnu"
    XTOOLS_PREFIX="gcc-linaro"

    OLD_BASE_VERSION_XTOOLS="5.5-2017.10"
    OLD_VERSION_XTOOLS="5.5.0-2017.10"
    BASE_VERSION_XTOOLS="7.2-2017.11"
    VERSION_XTOOLS="7.2.1-2017.11"

    XTOOLS+=("$XTOOLS_PREFIX-$VERSION_XTOOLS-${ARCH}_$XTOOLS_ARM_SUFFIX")
    XTOOLS+=("$XTOOLS_PREFIX-$VERSION_XTOOLS-${ARCH}_$XTOOLS_ARM64_SUFFIX")
    XTOOLS+=("$XTOOLS_PREFIX-$OLD_VERSION_XTOOLS-${ARCH}_$XTOOLS_ARM_SUFFIX")
    XTOOLS+=("$XTOOLS_PREFIX-$OLD_VERSION_XTOOLS-${ARCH}_$XTOOLS_ARM64_SUFFIX")
    URL_XTOOLS+=("$BASE_URL_XTOOLS/$BASE_VERSION_XTOOLS/$XTOOLS_ARM_SUFFIX")
    URL_XTOOLS+=("$BASE_URL_XTOOLS/$BASE_VERSION_XTOOLS/$XTOOLS_ARM64_SUFFIX")
    URL_XTOOLS+=("$BASE_URL_XTOOLS/$OLD_BASE_VERSION_XTOOLS/$XTOOLS_ARM_SUFFIX")
    URL_XTOOLS+=("$BASE_URL_XTOOLS/$OLD_BASE_VERSION_XTOOLS/$XTOOLS_ARM64_SUFFIX")
elif [[ $ARCH == "aarch64" ]]; then
    # https://developer.arm.com/-/media/Files/downloads/gnu-a/9.2-2019.12/binrel/gcc-arm-9.2-2019.12-aarch64-arm-none-linux-gnueabihf.tar.xz
    BASE_URL_XTOOLS="https://developer.arm.com/-/media/Files/downloads/gnu-a"
    XTOOLS_ARM_SUFFIX="arm-none-linux-gnueabihf"
    XTOOLS_PREFIX="gcc-arm"
    BASE_VERSION_XTOOLS="9.2-2019.12"
    VERSION_XTOOLS=$BASE_VERSION_XTOOLS
    XTOOLS+=("$XTOOLS_PREFIX-$VERSION_XTOOLS-$ARCH-$XTOOLS_ARM_SUFFIX")
    URL_XTOOLS+=("$BASE_URL_XTOOLS/$BASE_VERSION_XTOOLS/binrel")
fi


#---------------------------------------------
# rootfs configuration
#---------------------------------------------
if [[ ${DISTR} == slackwarearm ]];then
    URL_ROOTFS="https://ftp.arm.slackware.com/slackwarearm/slackwarearm-devtools/minirootfs/roots/"
else
    URL_ROOTFS="http://dl.fail.pp.ua/slackware/rootfs/"
fi
ROOTFS_NAME=$(wget --no-check-certificate -q -O - $URL_ROOTFS | grep -oP "(sla(ck|rm64)-current-[\.\-\+\d\w]+.tar.xz)" | sort -ur | head -n1 | cut -d '.' -f1)
ROOTFS_VERSION=$(date +%Y%m%d)

#---------------------------------------------
# cross compilation
#---------------------------------------------
for XTOOL in ${XTOOLS[*]}; do
    if [[ $(echo $XTOOL | grep $ARCH) ]]; then
        [[ $(echo $XTOOLS_ARM_SUFFIX | grep $ARCH) ]] && _XTOOLS_ARM_SUFFIX=$XTOOLS_ARM_SUFFIX
        [[ $(echo $XTOOLS_ARM64_SUFFIX | grep $ARCH) ]] && _XTOOLS_ARM_SUFFIX=$XTOOLS_ARM64_SUFFIX
As far as I understood, ARCH is expected to be set to x86_64 in my case.
Then why are we grepping for x86_64 in the strings arm-linux-gnueabihf and aarch64-linux-gnu ?
Neither of them will match, and we'll end up with values like /home/user/slackbuild/slackware_arm_build_kit/build/source/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/bin/-
Code:
#        VER=$(echo $XTOOL | cut -f3 -d "-")
        VER=$(echo $XTOOL | sed 's/^.*-\([0-9].[0-9].[0-9]*\)-.*/\1/')
        if [[ $VER > 6 ]]; then
            export CROSS="${SOURCE}/$XTOOL/bin/${_XTOOLS_ARM_SUFFIX}-"
            message "" "eeee" "export CROSS=\"${SOURCE}/$XTOOL/bin/${_XTOOLS_ARM_SUFFIX}-\""
        else
            export OLD_CROSS="${SOURCE}/$XTOOL/bin/${_XTOOLS_ARM_SUFFIX}-"
            message "" "eeee" "export OLD_CROSS=\"${SOURCE}/$XTOOL/bin/${_XTOOLS_ARM_SUFFIX}-\""
        fi
#        echo $XTOOL $VER
    fi

    if [[ $ARCH != arm ]] && [[ $(echo $XTOOL | grep arm) ]]; then
        [[ $(echo $XTOOLS_ARM_SUFFIX | grep arm) ]] && _XTOOLS_ARM_SUFFIX=$XTOOLS_ARM_SUFFIX
#        VER=$(echo $XTOOL | cut -f3 -d "-")
        VER=$(echo $XTOOL | sed 's/^.*-\([0-9].[0-9].[0-9]*\)-.*/\1/')
        if [[ $VER > 6 ]]; then
            export CROSS32="${SOURCE}/$XTOOL/bin/${_XTOOLS_ARM_SUFFIX}-"
            message "" "ffff" "export CROSS32=\"${SOURCE}/$XTOOL/bin/${_XTOOLS_ARM_SUFFIX}-\""
        else
            export OLD_CROSS32="${SOURCE}/$XTOOL/bin/${_XTOOLS_ARM_SUFFIX}-"
            message "" "ffff" "export OLD_CROSS32=\"${SOURCE}/$XTOOL/bin/${_XTOOLS_ARM_SUFFIX}-\""
        fi
#        echo $XTOOL $VER
    fi
done

My suggestion would be something like this:

Code:
for XTOOL in ${XTOOLS[*]}; do
    if [[ $(echo $XTOOL | grep $ARCH) ]]; then
        echo $XTOOL | grep -q "arm-" && _XTOOLS_ARM_SUFFIX=$XTOOLS_ARM_SUFFIX
        echo $XTOOL | grep -q "aarch64-" && _XTOOLS_ARM_SUFFIX=$XTOOLS_ARM64_SUFFIX
#        VER=$(echo $XTOOL | cut -f3 -d "-")
        VER=$(echo $XTOOL | sed 's/^.*-\([0-9].[0-9].[0-9]*\)-.*/\1/')
        if [[ $VER > 6 ]]; then
            export CROSS="${SOURCE}/$XTOOL/bin/${_XTOOLS_ARM_SUFFIX}-"
            echo $XTOOL | grep -q "arm-" && ARM_XTOOLS=$XTOOL
            echo $XTOOL | grep -q "aarch64-" && ARM64_XTOOLS=$XTOOL
        else
            export OLD_CROSS="${SOURCE}/$XTOOL/bin/${_XTOOLS_ARM_SUFFIX}-"
        fi
#        echo $XTOOL $VER
    fi

    if [[ $ARCH != arm ]] && [[ $(echo $XTOOL | grep arm) ]]; then
        [[ $(echo $XTOOLS_ARM_SUFFIX | grep arm) ]] && _XTOOLS_ARM_SUFFIX=$XTOOLS_ARM_SUFFIX
#        VER=$(echo $XTOOL | cut -f3 -d "-")
        VER=$(echo $XTOOL | sed 's/^.*-\([0-9].[0-9].[0-9]*\)-.*/\1/')
        if [[ $VER > 6 ]]; then
            export CROSS32="${SOURCE}/$XTOOL/bin/${_XTOOLS_ARM_SUFFIX}-"
        else
            export OLD_CROSS32="${SOURCE}/$XTOOL/bin/${_XTOOLS_ARM_SUFFIX}-"
        fi
#        echo $XTOOL $VER
    fi
done

[[ $ARCH != "x86_64" ]] && export CROSS="" OLD_CROSS=""

#export PATH=/bin:/sbin:/usr/bin:/usr/sbin:$BUILD/$OUTPUT/$TOOLS/
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:$SOURCE/$ARM_XTOOLS/bin:$SOURCE/$ARM64_XTOOLS/bin:$BUILD/$OUTPUT/$TOOLS/
#export CROSS="${XTOOLS_ARM_SUFFIX}-"
export CROSS="${XTOOLS_ARM64_SUFFIX}-"

Last edited by wowbaggerHU; 02-16-2020 at 06:17 AM.
 
Old 02-16-2020, 06:23 AM   #30
wowbaggerHU
Member
 
Registered: Feb 2017
Location: Hungary
Distribution: Slackware
Posts: 288

Rep: Reputation: Disabled
After these changes, I managed to reach a bit further than before:

Code:
|info| add          configuration file 00-environment.conf  
|info| add          configuration file build-packages.conf  
|info| add          configuration file pinebook_pro.conf  
|info| add          configuration file rk3399.conf  
|info| start        build slarm64 ARCH x86_64    
|info| compiling    u-boot-tools next-dev::  
|info| compiling    arm-trusted-firmware master::  
|info| compiling    u-boot-pinebook_pro rockchip-master::  
|info| version      aarch64-linux-gnu-gcc GCC  
|err | details      /home/janos/slackbuild/slackware_arm_build_kit/build/source/build.log
Build.log now ends with this:
Code:
merge success(trust.img)
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  SHIPPED scripts/kconfig/zconf.tab.c
  SHIPPED scripts/kconfig/zconf.lex.c
  SHIPPED scripts/kconfig/zconf.hash.c
  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
#
scripts/kconfig/conf  --silentoldconfig Kconfig
  CHK     include/config.h
  UPD     include/config.h
  GEN     include/autoconf.mk.dep
  CFG     u-boot.cfg
  CFG     spl/u-boot.cfg
  GEN     include/autoconf.mk
  GEN     spl/include/autoconf.mk
  CHK     include/config/uboot.release
  CHK     include/generated/timestamp_autogenerated.h
./scripts/dtc-version.sh: line 17: dtc: command not found
  UPD     include/generated/timestamp_autogenerated.h
./scripts/dtc-version.sh: line 18: dtc: command not found
  UPD     include/config/uboot.release
*** Your dtc is too old, please upgrade to dtc 1.4 or newer
make: *** [Makefile:1450: checkdtc] Error 1
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Destination Linux 131 - Endeavour OS, Deepin, OnlyOffice, Silverblue, Pinebook Pro, Ubuntu Mate, GPD LXer Syndicated Linux News 0 07-25-2019 06:41 AM
LXer: Linux 5.2, Debian 10, Pinebook Pro, Mageia, Whonix, GRUB, Valve, Zorin, Mint | This Week in Linux 73 LXer Syndicated Linux News 0 07-10-2019 06:43 AM
Video : New PINE64 Products. PineBook Pro, PinePhone, PineCam, PineH64 NicoD SBC Linux - Embedded & Single-board computer 2 02-06-2019 04:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - ARM

All times are GMT -5. The time now is 12:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration