交叉工具链构建时 arm-trusted-firmware 编译错误
Error with arm-trusted-firmware compilation when built by cross toolchain
我正在研究 Renesas 的 rcar gen 3 平台,尤其是在 arm-trusted-firmware 级别。
1. bootparam_sa0.srec Loader(Boot parameter) <======= arm-trusted-firmware
2. bl2-m3ulcb.srec Loader <======= arm-trusted-firmware
3. cert_header_sa6.srec Loader(Certification) <======= arm-trusted-firmware
4. bl31-m3ulcb.srec ARM Trusted Firmware <======= arm-trusted-firmware
5. tee-m3ulcb.srec Open Portable Trusted OS <======= optee-os
6. u-boot-elf.srec U-Boot <======= u-boot
我用 Gcc v5.4 通过命令构建了 BL31
$ make ARCH=aarch64 CROSS_COMPILE=aarch64-linux-gnu- PLAT=rcar LSI=M3 RCAR_GEN3_ULCB=1 RCAR_LOSSY_ENABLE=1 RCAR_DRAM_SPLIT=2 PMIC_LEVEL_MODE=0 bl31
但是我运行进入了下面的err:
"
Including services/spd/opteed/opteed.mk
AS bl31/aarch64/runtime_exceptions.S
bl31/aarch64/runtime_exceptions.S: Assembler messages:
bl31/aarch64/runtime_exceptions.S:183: Error: non-constant expression in ".if" statement
bl31/aarch64/runtime_exceptions.S:191: Error: non-constant expression in ".if" statement
bl31/aarch64/runtime_exceptions.S:196: Error: non-constant expression in ".if" statement
bl31/aarch64/runtime_exceptions.S:201: Error: non-constant expression in ".if" statement
bl31/aarch64/runtime_exceptions.S:215: Error: non-constant expression in ".if" statement
bl31/aarch64/runtime_exceptions.S:219: Error: non-constant expression in ".if" statement
bl31/aarch64/runtime_exceptions.S:223: Error: non-constant expression in ".if" statement
bl31/aarch64/runtime_exceptions.S:227: Error: non-constant expression in ".if" statement
bl31/aarch64/runtime_exceptions.S:241: Error: non-constant expression in ".if" statement
bl31/aarch64/runtime_exceptions.S:245: Error: non-constant expression in ".if" statement
bl31/aarch64/runtime_exceptions.S:249: Error: non-constant expression in ".if" statement
bl31/aarch64/runtime_exceptions.S:257: Error: non-constant expression in ".if" statement
bl31/aarch64/runtime_exceptions.S:271: Error: non-constant expression in ".if" statement
bl31/aarch64/runtime_exceptions.S:275: Error: non-constant expression in ".if" statement
bl31/aarch64/runtime_exceptions.S:279: Error: non-constant expression in ".if" statement
bl31/aarch64/runtime_exceptions.S:287: Error: non-constant expression in ".if" statement
Makefile:556: recipe for target 'build/rcar/release/bl31/runtime_exceptions.o' failed
make: *** [build/rcar/release/bl31/runtime_exceptions.o] Error 1
"
同样的错误:https://github.com/ARM-software/tf-issues/issues/417
汇编代码正确,显然不是问题。
看来是依赖Compiler。我正在尝试安装 gcc/g++ 7.4 cross:
在Ubuntu 16.04,修改了Makefile,改用gcc-7(cross),g++-7(cross),还是报这个错。我怎样才能克服这个错误?
您可以停止使用随 Linux 发行版提供的工具链,而开始使用 Linaro 工具链:
wget https://releases.linaro.org/components/toolchain/binaries/latest-7/aarch64-elf/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-elf.tar.xz
tar Jxf gcc-linaro-7.4.1-2019.02-x86_64_aarch64-elf.tar.xz -C /opt
git clone https://github.com/renesas-rcar/arm-trusted-firmware arm-trusted-firmware-renesas
cd arm-trusted-firmware-renesas
make ARCH=aarch64 CROSS_COMPILE=/opt/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-elf/bin/aarch64-elf- PLAT=rcar LSI=M3 RCAR_GEN3_ULCB=1 RCAR_LOSSY_ENABLE=1 RCAR_DRAM_SPLIT=2 PMIC_LEVEL_MODE=0 bl31
Including services/spd/opteed/opteed.mk
CC drivers/arm/gic/common/gic_common.c
CC drivers/arm/gic/v2/gicv2_main.c
CC drivers/arm/gic/v2/gicv2_helpers.c
CC plat/common/plat_gicv2.c
CC drivers/arm/cci/cci.c
CC plat/renesas/rcar/bl31_rcar_setup.c
CC plat/renesas/rcar/rcar_pm.c
CC plat/renesas/rcar/rcar_sip_svc.c
CC plat/renesas/rcar/drivers/board/board.c
CC plat/renesas/rcar/drivers/dramconf/dramconf.c
CC plat/renesas/rcar/drivers/memdrv/rcar_printf.c
CC plat/renesas/rcar/rcar_topology.c
CC plat/renesas/rcar/aarch64/rcar_common.c
CC plat/renesas/rcar/aarch64/rcar_drivers_common.c
CC plat/renesas/rcar/drivers/pwrc/rcar_pwrc.c
CC plat/renesas/rcar/drivers/cpld/ulcb_cpld.c
CC plat/renesas/rcar/drivers/wait/micro_wait.c
CC plat/common/plat_psci_common.c
CC plat/compat/plat_pm_compat.c
CC plat/compat/plat_topology_compat.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 services/spd/opteed/opteed_common.c
CC services/spd/opteed/opteed_main.c
CC services/spd/opteed/opteed_pm.c
CC common/bl_common.c
CC common/tf_log.c
CC common/tf_printf.c
CC common/tf_snprintf.c
CC plat/common/plat_bl_common.c
CC plat/common/plat_log_common.c
CC plat/common/aarch64/plat_common.c
CC lib/stdlib/abort.c
CC lib/stdlib/assert.c
CC lib/stdlib/exit.c
CC lib/stdlib/mem.c
CC lib/stdlib/printf.c
CC lib/stdlib/putchar.c
CC lib/stdlib/puts.c
CC lib/stdlib/sscanf.c
CC lib/stdlib/strchr.c
CC lib/stdlib/strcmp.c
CC lib/stdlib/strlen.c
CC lib/stdlib/strncmp.c
CC lib/stdlib/strnlen.c
CC lib/stdlib/subr_prf.c
CC lib/stdlib/timingsafe_bcmp.c
CC plat/renesas/rcar/drivers/iic_dvfs/iic_dvfs.c
CC lib/xlat_tables_v2/aarch64/xlat_tables_arch.c
CC lib/xlat_tables_v2/xlat_tables_internal.c
AS lib/cpus/aarch64/aem_generic.S
AS lib/cpus/aarch64/cortex_a53.S
AS lib/cpus/aarch64/cortex_a57.S
AS plat/renesas/rcar/drivers/memdrv/rcar_console.S
AS plat/renesas/rcar/aarch64/rcar_helpers.S
AS plat/renesas/rcar/drivers/pwrc/rcar_call_sram.S
AS bl31/aarch64/bl31_entrypoint.S
AS bl31/aarch64/runtime_exceptions.S
AS bl31/aarch64/crash_reporting.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 services/spd/opteed/opteed_helpers.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/compat/aarch64/plat_helpers_compat.S
PP bl31/bl31.ld.S
LD build/rcar/release/bl31/bl31.elf
SREC build/rcar/release/bl31.srec
BIN build/rcar/release/bl31.bin
Built build/rcar/release/bl31.bin successfully
OD build/rcar/release/bl31/bl31.dump
我正在研究 Renesas 的 rcar gen 3 平台,尤其是在 arm-trusted-firmware 级别。
1. bootparam_sa0.srec Loader(Boot parameter) <======= arm-trusted-firmware
2. bl2-m3ulcb.srec Loader <======= arm-trusted-firmware
3. cert_header_sa6.srec Loader(Certification) <======= arm-trusted-firmware
4. bl31-m3ulcb.srec ARM Trusted Firmware <======= arm-trusted-firmware
5. tee-m3ulcb.srec Open Portable Trusted OS <======= optee-os
6. u-boot-elf.srec U-Boot <======= u-boot
我用 Gcc v5.4 通过命令构建了 BL31
$ make ARCH=aarch64 CROSS_COMPILE=aarch64-linux-gnu- PLAT=rcar LSI=M3 RCAR_GEN3_ULCB=1 RCAR_LOSSY_ENABLE=1 RCAR_DRAM_SPLIT=2 PMIC_LEVEL_MODE=0 bl31
但是我运行进入了下面的err:
"
Including services/spd/opteed/opteed.mk
AS bl31/aarch64/runtime_exceptions.S
bl31/aarch64/runtime_exceptions.S: Assembler messages:
bl31/aarch64/runtime_exceptions.S:183: Error: non-constant expression in ".if" statement
bl31/aarch64/runtime_exceptions.S:191: Error: non-constant expression in ".if" statement
bl31/aarch64/runtime_exceptions.S:196: Error: non-constant expression in ".if" statement
bl31/aarch64/runtime_exceptions.S:201: Error: non-constant expression in ".if" statement
bl31/aarch64/runtime_exceptions.S:215: Error: non-constant expression in ".if" statement
bl31/aarch64/runtime_exceptions.S:219: Error: non-constant expression in ".if" statement
bl31/aarch64/runtime_exceptions.S:223: Error: non-constant expression in ".if" statement
bl31/aarch64/runtime_exceptions.S:227: Error: non-constant expression in ".if" statement
bl31/aarch64/runtime_exceptions.S:241: Error: non-constant expression in ".if" statement
bl31/aarch64/runtime_exceptions.S:245: Error: non-constant expression in ".if" statement
bl31/aarch64/runtime_exceptions.S:249: Error: non-constant expression in ".if" statement
bl31/aarch64/runtime_exceptions.S:257: Error: non-constant expression in ".if" statement
bl31/aarch64/runtime_exceptions.S:271: Error: non-constant expression in ".if" statement
bl31/aarch64/runtime_exceptions.S:275: Error: non-constant expression in ".if" statement
bl31/aarch64/runtime_exceptions.S:279: Error: non-constant expression in ".if" statement
bl31/aarch64/runtime_exceptions.S:287: Error: non-constant expression in ".if" statement
Makefile:556: recipe for target 'build/rcar/release/bl31/runtime_exceptions.o' failed
make: *** [build/rcar/release/bl31/runtime_exceptions.o] Error 1
"
同样的错误:https://github.com/ARM-software/tf-issues/issues/417
汇编代码正确,显然不是问题。
看来是依赖Compiler。我正在尝试安装 gcc/g++ 7.4 cross:
在Ubuntu 16.04,修改了Makefile,改用gcc-7(cross),g++-7(cross),还是报这个错。我怎样才能克服这个错误?
您可以停止使用随 Linux 发行版提供的工具链,而开始使用 Linaro 工具链:
wget https://releases.linaro.org/components/toolchain/binaries/latest-7/aarch64-elf/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-elf.tar.xz
tar Jxf gcc-linaro-7.4.1-2019.02-x86_64_aarch64-elf.tar.xz -C /opt
git clone https://github.com/renesas-rcar/arm-trusted-firmware arm-trusted-firmware-renesas
cd arm-trusted-firmware-renesas
make ARCH=aarch64 CROSS_COMPILE=/opt/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-elf/bin/aarch64-elf- PLAT=rcar LSI=M3 RCAR_GEN3_ULCB=1 RCAR_LOSSY_ENABLE=1 RCAR_DRAM_SPLIT=2 PMIC_LEVEL_MODE=0 bl31
Including services/spd/opteed/opteed.mk
CC drivers/arm/gic/common/gic_common.c
CC drivers/arm/gic/v2/gicv2_main.c
CC drivers/arm/gic/v2/gicv2_helpers.c
CC plat/common/plat_gicv2.c
CC drivers/arm/cci/cci.c
CC plat/renesas/rcar/bl31_rcar_setup.c
CC plat/renesas/rcar/rcar_pm.c
CC plat/renesas/rcar/rcar_sip_svc.c
CC plat/renesas/rcar/drivers/board/board.c
CC plat/renesas/rcar/drivers/dramconf/dramconf.c
CC plat/renesas/rcar/drivers/memdrv/rcar_printf.c
CC plat/renesas/rcar/rcar_topology.c
CC plat/renesas/rcar/aarch64/rcar_common.c
CC plat/renesas/rcar/aarch64/rcar_drivers_common.c
CC plat/renesas/rcar/drivers/pwrc/rcar_pwrc.c
CC plat/renesas/rcar/drivers/cpld/ulcb_cpld.c
CC plat/renesas/rcar/drivers/wait/micro_wait.c
CC plat/common/plat_psci_common.c
CC plat/compat/plat_pm_compat.c
CC plat/compat/plat_topology_compat.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 services/spd/opteed/opteed_common.c
CC services/spd/opteed/opteed_main.c
CC services/spd/opteed/opteed_pm.c
CC common/bl_common.c
CC common/tf_log.c
CC common/tf_printf.c
CC common/tf_snprintf.c
CC plat/common/plat_bl_common.c
CC plat/common/plat_log_common.c
CC plat/common/aarch64/plat_common.c
CC lib/stdlib/abort.c
CC lib/stdlib/assert.c
CC lib/stdlib/exit.c
CC lib/stdlib/mem.c
CC lib/stdlib/printf.c
CC lib/stdlib/putchar.c
CC lib/stdlib/puts.c
CC lib/stdlib/sscanf.c
CC lib/stdlib/strchr.c
CC lib/stdlib/strcmp.c
CC lib/stdlib/strlen.c
CC lib/stdlib/strncmp.c
CC lib/stdlib/strnlen.c
CC lib/stdlib/subr_prf.c
CC lib/stdlib/timingsafe_bcmp.c
CC plat/renesas/rcar/drivers/iic_dvfs/iic_dvfs.c
CC lib/xlat_tables_v2/aarch64/xlat_tables_arch.c
CC lib/xlat_tables_v2/xlat_tables_internal.c
AS lib/cpus/aarch64/aem_generic.S
AS lib/cpus/aarch64/cortex_a53.S
AS lib/cpus/aarch64/cortex_a57.S
AS plat/renesas/rcar/drivers/memdrv/rcar_console.S
AS plat/renesas/rcar/aarch64/rcar_helpers.S
AS plat/renesas/rcar/drivers/pwrc/rcar_call_sram.S
AS bl31/aarch64/bl31_entrypoint.S
AS bl31/aarch64/runtime_exceptions.S
AS bl31/aarch64/crash_reporting.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 services/spd/opteed/opteed_helpers.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/compat/aarch64/plat_helpers_compat.S
PP bl31/bl31.ld.S
LD build/rcar/release/bl31/bl31.elf
SREC build/rcar/release/bl31.srec
BIN build/rcar/release/bl31.bin
Built build/rcar/release/bl31.bin successfully
OD build/rcar/release/bl31/bl31.dump