OP-TEE / optee_os

Trusted side of the TEE
Other
1.57k stars 1.06k forks source link

Not able to compile optee_os after commit ID cdcba4f3de3d44f0f4109ea0f186b1e48944c8b9 #2163

Closed pangupta closed 5 years ago

pangupta commented 6 years ago

One other comments. I am successfully able to compile OPTEE-OS repo till the commit ID: cdcba4f3de3d44f0f4109ea0f186b1e48944c8b9.

Post this commit id, there are following errors: (Please share your suggestion what could be wrong.) pankaj@pankaj-S2600CP:~/tee_dev/optee_os$ rm -rf out/; make clean;make CFG_ARM64_core=y PLATFORM=ls-ls1043ardb ARCH=arm CLEAN out/arm-plat-vexpress CLEAN out GEN out/arm-plat-ls/core/ta_pub_key.c CHK out/arm-plat-ls/conf.mk UPD out/arm-plat-ls/conf.mk CHK out/arm-plat-ls/include/generated/conf.h UPD out/arm-plat-ls/include/generated/conf.h CHK out/arm-plat-ls/core/include/generated/asm-defines.h UPD out/arm-plat-ls/core/include/generated/asm-defines.h CC out/arm-plat-ls/core/arch/arm/kernel/user_ta.o CC out/arm-plat-ls/core/arch/arm/kernel/ree_fs_ta.o CC out/arm-plat-ls/core/arch/arm/kernel/secstor_ta.o CC out/arm-plat-ls/core/arch/arm/kernel/pseudo_ta.o CC out/arm-plat-ls/core/arch/arm/kernel/elf_load.o CC out/arm-plat-ls/core/arch/arm/kernel/tee_time.o CC out/arm-plat-ls/core/arch/arm/kernel/otp_stubs.o CC out/arm-plat-ls/core/arch/arm/kernel/delay.o CC out/arm-plat-ls/core/arch/arm/kernel/tee_time_arm_cntpct.o AS out/arm-plat-ls/core/arch/arm/kernel/proc_a64.o AS out/arm-plat-ls/core/arch/arm/kernel/spin_lock_a64.o CC out/arm-plat-ls/core/arch/arm/kernel/spin_lock_debug.o AS out/arm-plat-ls/core/arch/arm/kernel/tlb_helpers_a64.o AS out/arm-plat-ls/core/arch/arm/kernel/cache_helpers_a64.o AS out/arm-plat-ls/core/arch/arm/kernel/thread_a64.o core/arch/arm/kernel/thread_a64.S: Assembler messages: core/arch/arm/kernel/thread_a64.S:420: Error: non-constant expression in ".if" statement core/arch/arm/kernel/thread_a64.S:426: Error: non-constant expression in ".if" statement core/arch/arm/kernel/thread_a64.S:432: Error: non-constant expression in ".if" statement core/arch/arm/kernel/thread_a64.S:437: Error: non-constant expression in ".if" statement core/arch/arm/kernel/thread_a64.S:446: Error: non-constant expression in ".if" statement core/arch/arm/kernel/thread_a64.S:451: Error: non-constant expression in ".if" statement core/arch/arm/kernel/thread_a64.S:456: Error: non-constant expression in ".if" statement core/arch/arm/kernel/thread_a64.S:461: Error: non-constant expression in ".if" statement core/arch/arm/kernel/thread_a64.S:477: Error: non-constant expression in ".if" statement core/arch/arm/kernel/thread_a64.S:484: Error: non-constant expression in ".if" statement core/arch/arm/kernel/thread_a64.S:491: Error: non-constant expression in ".if" statement core/arch/arm/kernel/thread_a64.S:496: Error: non-constant expression in ".if" statement core/arch/arm/kernel/thread_a64.S:512: Error: non-constant expression in ".if" statement core/arch/arm/kernel/thread_a64.S:519: Error: non-constant expression in ".if" statement core/arch/arm/kernel/thread_a64.S:526: Error: non-constant expression in ".if" statement core/arch/arm/kernel/thread_a64.S:531: Error: non-constant expression in ".if" statement core/arch/arm/kernel/thread_a64.S:548: Error: non-constant expression in ".if" statement core/arch/arm/kernel/thread_a64.S:553: Error: non-constant expression in ".if" statement core/arch/arm/kernel/thread_a64.S:558: Error: non-constant expression in ".if" statement core/arch/arm/kernel/thread_a64.S:563: Error: non-constant expression in ".if" statement core/arch/arm/kernel/thread_a64.S:572: Error: non-constant expression in ".if" statement core/arch/arm/kernel/thread_a64.S:577: Error: non-constant expression in ".if" statement core/arch/arm/kernel/thread_a64.S:582: Error: non-constant expression in ".if" statement core/arch/arm/kernel/thread_a64.S:587: Error: non-constant expression in ".if" statement core/arch/arm/kernel/thread_a64.S:597: Error: non-constant expression in ".if" statement core/arch/arm/kernel/thread_a64.S:603: Error: non-constant expression in ".if" statement core/arch/arm/kernel/thread_a64.S:609: Error: non-constant expression in ".if" statement core/arch/arm/kernel/thread_a64.S:614: Error: non-constant expression in ".if" statement core/arch/arm/kernel/thread_a64.S:624: Error: non-constant expression in ".if" statement core/arch/arm/kernel/thread_a64.S:630: Error: non-constant expression in ".if" statement core/arch/arm/kernel/thread_a64.S:636: Error: non-constant expression in ".if" statement core/arch/arm/kernel/thread_a64.S:641: Error: non-constant expression in ".if" statement mk/compile.mk:146: recipe for target 'out/arm-plat-ls/core/arch/arm/kernel/thread_a64.o' failed make: *** [out/arm-plat-ls/core/arch/arm/kernel/thread_a64.o] Error 1

jforissier commented 6 years ago

https://github.com/OP-TEE/optee_os/pull/2160#issuecomment-367989016

pangupta commented 5 years ago

It is resolved by upgrading the GCC version.

Ganesha17 commented 5 years ago

I have upgared to gcc version 7.4.0. But still I get the same error like you for thread_a64.c

which compiler version are you using?

Xinyao90 commented 5 years ago
s1@s1-Ryzen:~/rpi3/optee_os$ make \
>     CFG_ARM64_core=y \
>     CFG_TEE_BENCHMARK=n \
>     CFG_TEE_CORE_LOG_LEVEL=3 \
>     CROSS_COMPILE=aarch64-linux-gnu- \
>     CROSS_COMPILE_core=aarch64-linux-gnu- \
>     CROSS_COMPILE_ta_arm32=arm-linux-gnueabihf- \
>     CROSS_COMPILE_ta_arm64=aarch64-linux-gnu- \
>     DEBUG=1 \
>     O=out/arm \
>     PLATFORM=vexpress-qemu_armv8a
  CHK     out/arm/conf.mk
  UPD     out/arm/conf.mk
  CHK     out/arm/include/generated/conf.h
  UPD     out/arm/include/generated/conf.h
  CHK     out/arm/core/include/generated/asm-defines.h
  CC      out/arm/core/arch/arm/kernel/user_ta.o
  CC      out/arm/core/arch/arm/kernel/ree_fs_ta.o
  CC      out/arm/core/arch/arm/kernel/secstor_ta.o
  CC      out/arm/core/arch/arm/kernel/pseudo_ta.o
  CC      out/arm/core/arch/arm/kernel/elf_load.o
  CC      out/arm/core/arch/arm/kernel/elf_load_dyn.o
  CC      out/arm/core/arch/arm/kernel/tee_time.o
  CC      out/arm/core/arch/arm/kernel/otp_stubs.o
  CC      out/arm/core/arch/arm/kernel/delay.o
  CC      out/arm/core/arch/arm/kernel/tee_time_arm_cntpct.o
  CC      out/arm/core/arch/arm/kernel/timer_a64.o
  AS      out/arm/core/arch/arm/kernel/proc_a64.o
  AS      out/arm/core/arch/arm/kernel/spin_lock_a64.o
  CC      out/arm/core/arch/arm/kernel/spin_lock_debug.o
  AS      out/arm/core/arch/arm/kernel/tlb_helpers_a64.o
  AS      out/arm/core/arch/arm/kernel/cache_helpers_a64.o
  AS      out/arm/core/arch/arm/kernel/thread_a64.o
core/arch/arm/kernel/thread_a64.S: Assembler messages:
core/arch/arm/kernel/thread_a64.S:422: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:428: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:434: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:439: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:448: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:453: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:458: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:463: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:479: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:486: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:493: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:498: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:514: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:521: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:528: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:533: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:553: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:558: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:563: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:568: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:577: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:582: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:587: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:592: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:602: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:608: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:614: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:619: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:629: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:635: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:641: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:646: Error: non-constant expression in ".if" statement
mk/compile.mk:147: recipe for target 'out/arm/core/arch/arm/kernel/thread_a64.o' failed
make: *** [out/arm/core/arch/arm/kernel/thread_a64.o] Error 1
s1@s1-Ryzen:~/rpi3/optee_os$ gcc --version
gcc (Ubuntu 7.4.0-1ubuntu1~16.04~ppa1) 7.4.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Xinyao90 commented 5 years ago

I updated to gcc version 7.4 and still have the errors.

vchong commented 5 years ago

@Ganesha17 @Xinyao90 please try Linaro gcc 7.* here: http://releases.linaro.org/components/toolchain/binaries

jbech-linaro commented 5 years ago

Even though we try to be backwards compatible when it comes to toolchains (and problems like this should be fixed regardless), why stay on 7.4? We've been using GCC8.x since August last year. Any particular reason why you're not downloading and using the GCC version that we are suggesting?

Xinyao90 commented 5 years ago

@vchong @jbech-linaro Thanks so much for your comments and sorry for my late reply. I update my gcc to 8.1.0 but the errors are not fixed. Moreover, I follows @jbech-linaro suggested link and download the toolchains. However, it also does not fix the errors.

Xinyao90 commented 5 years ago
make     CFG_ARM64_core=y     CFG_TEE_BENCHMARK=n     CFG_TEE_CORE_LOG_LEVEL=3     CROSS_COMPILE=aarch64-linux-gnu-     CROSS_COMPILE_core=aarch64-linux-gnu-     CROSS_COMPILE_ta_arm32=arm-linux-gnueabihf-     CROSS_COMPILE_ta_arm64=aarch64-linux-gnu-     DEBUG=1     O=out/arm     PLATFORM=vexpress-qemu_armv8a
  CHK     out/arm/conf.mk
  CHK     out/arm/include/generated/conf.h
  AS      out/arm/core/arch/arm/kernel/thread_a64.o
core/arch/arm/kernel/thread_a64.S: Assembler messages:
core/arch/arm/kernel/thread_a64.S:422: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:428: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:434: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:439: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:448: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:453: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:458: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:463: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:479: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:486: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:493: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:498: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:514: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:521: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:528: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:533: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:553: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:558: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:563: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:568: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:577: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:582: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:587: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:592: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:602: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:608: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:614: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:619: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:629: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:635: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:641: Error: non-constant expression in ".if" statement
core/arch/arm/kernel/thread_a64.S:646: Error: non-constant expression in ".if" statement
mk/compile.mk:147: recipe for target 'out/arm/core/arch/arm/kernel/thread_a64.o' failed
make: *** [out/arm/core/arch/arm/kernel/thread_a64.o] Error 1
tj@tj-Precision-T1650:~/tmp/optee_os$ gcc --version
gcc (Ubuntu 8.1.0-5ubuntu1~16.04) 8.1.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
jbech-linaro commented 5 years ago

@Xinyao90 not sure what is going wrong on your end. Our automatic regression testing seems to work and I cannot recall anyone else reporting this issue. In any case, we're about to release a new stable version of OP-TEE in about 2 weeks. For that we are doing all sorts of regression builds and testing. Keep an eye for that pull request (will be created any day here in optee_os).

vchong commented 5 years ago

@Xinyao90 Seems like you just updated the host native gcc? You need to download and install a cross gcc to compile binaries for your target board. You also need to make sure the cross compiler is in your PATH. Are you sure you followed exactly the instructions in https://optee.readthedocs.io/building/toolchains.html? If so, then you should see something similar to below:

cd $HOME/toolchains/aarch64/bin
./aarch64-linux-gnu-gcc --version

aarch64-linux-gnu-gcc (GNU Toolchain for the A-profile Architecture 8.2-2018-08 (arm-rel-8.23)) 8.2.1 20180802
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.