Error building trusty (32.4.2)

Hi,
I am trying to build the trusty OS and am encountering errors.

I have set “export CROSS_COMPILE=$HOME/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-”

Then I ran the command
make t186 PROJECT=t186 TARGET=t186 BUILDROOT=./t186ref \

     TOOLCHAIN_PREFIX="${CROSS_COMPILE}" \
     ARCH_arm_TOOLCHAIN_PREFIX="${CROSS_COMPILE}" \
     ARCH_arm64_TOOLCHAIN_PREFIX="${CROSS_COMPILE}" \
     DEBUG=0 DEBUG_LVL=0 DEFAULT_OTE_APP_DEBUGLEVEL=1 NOECHO=@ \
     TRUSTY_VARIANT=l4t-public TRUSTY_MULTI_GUEST_CONFIGURATION= \
     TARGET_SOC=t186

I slightly modified the above command from the one in the instructions replacing
CROSS_COMPILE_ARM and CROSS_COMPILE_AARCH64 with CROSS_COMPILE as I am assuming both have the same values. Please let me know if this assumption is incorrect.

I got the following error:
compiling app/sample/ipc-unittest/main/manifest.c
aarch64-linux-gnu-gcc: error: unrecognized argument in option ‘-mabi=aapcs-linux’
aarch64-linux-gnu-gcc: note: valid arguments to ‘-mabi=’ are: ilp32 lp64
aarch64-linux-gnu-gcc: error: unrecognized command line option ‘-marm’; did you mean ‘-fasm’?
make/compile.mk:41: recipe for target ‘t186ref/build-t186/user_tasks/sample/ipc-unittest/main/app/sample/ipc-unittest/main/manifest.o’ failed

I would appreciate if you could help me build the trusty binary.

Complete build output is below:
make[1]: Entering directory ‘/home/linuxdev/Nvidia_L4T/Linux_for_Tegra/source/public/atf_and_trusty/trusty/trusty’
make[2]: Entering directory ‘/home/linuxdev/Nvidia_L4T/Linux_for_Tegra/source/public/atf_and_trusty/trusty/trusty’
PROJECT = t186
PLATFORM = t18x
TARGET = t186
TOOLCHAIN_PREFIX = /home/linuxdev/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
including app dev dev/interrupt/arm_gic dev/timer/arm_generic kernel lib/boot_profiler lib/memlog lib/sm lib/trusty platform target
including kernel/vm lib/debug lib/fixed_point lib/heap lib/libc lib/syscall lib/uthread lib/version
Include Trusty user tasks support
XBIN_TOOLCHAIN_PREFIX = /home/linuxdev/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
XBIN_LIBGCC = /home/linuxdev/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/…/lib/gcc/aarch64-linux-gnu/7.3.1/libgcc.a
including app/trusty lib/libc-trusty
including lib/libc
XBIN_TOOLCHAIN_PREFIX = /home/linuxdev/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
XBIN_LIBGCC = /home/linuxdev/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/…/lib/gcc/aarch64-linux-gnu/7.3.1/libgcc.a
including app/trusty lib/libc-trusty
including lib/libc
XBIN_TOOLCHAIN_PREFIX = /home/linuxdev/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
XBIN_LIBGCC = /home/linuxdev/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/…/lib/gcc/aarch64-linux-gnu/7.3.1/libgcc.a
including app/trusty lib/libc-trusty lib/openssl
including lib/libc lib/openssl-stubs
including lib/rng
including interface/hwrng
LIBGCC = /home/linuxdev/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/…/lib/gcc/aarch64-linux-gnu/7.3.1/libgcc.a
GLOBAL_COMPILEFLAGS = -g -fno-builtin -finline -include ./t186ref/build-t186/config.h -W -Wall -Wno-multichar -Wno-unused-parameter -Wno-nonnull-compare -ffunction-sections -fdata-sections
GLOBAL_OPTFLAGS = -O2
generating t186ref/build-t186/tegra/public/platform/t18x/module_config.h
generating t186ref/build-t186/config.h
generating t186ref/build-t186/lk/common/arch/arm64/module_config.h
generating t186ref/build-t186/lk/common/top/module_config.h
generating t186ref/build-t186/lk/common/app/module_config.h
generating t186ref/build-t186/lk/common/dev/module_config.h
generating t186ref/build-t186/lk/common/dev/interrupt/arm_gic/module_config.h
generating t186ref/build-t186/lk/common/dev/timer/arm_generic/module_config.h
generating t186ref/build-t186/lk/common/kernel/module_config.h
generating t186ref/build-t186/tegra/public/lib/boot_profiler/module_config.h
generating t186ref/build-t186/lk/trusty/lib/memlog/module_config.h
generating t186ref/build-t186/lk/trusty/lib/sm/module_config.h
generating t186ref/build-t186/lk/trusty/lib/trusty/module_config.h
generating t186ref/build-t186/lk/common/platform/module_config.h
generating t186ref/build-t186/lk/common/target/module_config.h
generating t186ref/build-t186/lk/common/kernel/vm/module_config.h
generating t186ref/build-t186/lk/common/lib/debug/module_config.h
generating t186ref/build-t186/lk/common/lib/fixed_point/module_config.h
generating t186ref/build-t186/lk/common/lib/heap/module_config.h
generating t186ref/build-t186/lk/common/lib/libc/module_config.h
generating t186ref/build-t186/lk/trusty/lib/syscall/module_config.h
generating t186ref/build-t186/lk/trusty/lib/uthread/module_config.h
generating t186ref/build-t186/lk/trusty/lib/version/module_config.h
make[2]: Circular t186ref/build-t186/lk/trusty/lib/version/version.o ← t186ref/build-t186/lk/trusty/lib/version.mod.o dependency dropped.
generating t186ref/build-t186/user_tasks/sample/ipc-unittest/main/app/sample/ipc-unittest/main/module_config.h
compiling app/sample/ipc-unittest/main/manifest.c
aarch64-linux-gnu-gcc: error: unrecognized argument in option ‘-mabi=aapcs-linux’
aarch64-linux-gnu-gcc: note: valid arguments to ‘-mabi=’ are: ilp32 lp64
aarch64-linux-gnu-gcc: error: unrecognized command line option ‘-marm’; did you mean ‘-fasm’?
make/compile.mk:41: recipe for target ‘t186ref/build-t186/user_tasks/sample/ipc-unittest/main/app/sample/ipc-unittest/main/manifest.o’ failed
make[2]: *** [t186ref/build-t186/user_tasks/sample/ipc-unittest/main/app/sample/ipc-unittest/main/manifest.o] Error 1
make[2]: Leaving directory ‘/home/linuxdev/Nvidia_L4T/Linux_for_Tegra/source/public/atf_and_trusty/trusty/trusty’
lk/common/engine.mk:28: recipe for target ‘make-make’ failed
make[1]: *** [make-make] Error 2
make[1]: Leaving directory ‘/home/linuxdev/Nvidia_L4T/Linux_for_Tegra/source/public/atf_and_trusty/trusty/trusty’
makefile:27: recipe for target ‘t186’ failed
make: *** [t186] Error 2

hello rayees.shamsuddin,

we also found this building failure and we’re checking this internally.
will update this discussion thread after we come out solutions.
thanks

Yes, this is the problem. You do need to have both a 32-bit and a 64-bit toolchain, and CROSS_COMPILE_ARM needs to point to the 32-bit compiler.

Could you please point me towards the 32-bit package that needs to be installed? The package pointed to in the L4T page only points to the 64 bit Linaro package.
Also it would be helpful if I could have the exact settings for these defines that works for you.

Thanks
Rayees

You should be able to find the armhf (32-bit) toolchain here - from the same site mentioned in the L4T documentation for the aarch64 toolchain. Then just follow the instructions in the README file for building.

If you set CROSS_COMPILE_AARCH64_PATH to point to the directory where you unpacked the 64-bit toolchain, and CROSS_COMPILE_ARM_PATH to point to where you unpacked this one, you can use the nvbuild.sh script included in the trusty source package to run the make command for you.

Thanks a lot for your help. I am able to compile successfully.

1 Like

Hello,
Can you elaborate on your compilation process? I don’t know if CROSS_COMPILE_AARCH64 and CROSS_COMPILE_ARM both need to point to the same file (here is .bashrc). No matter how I change it, it will report an error.

Hi fanyangyf688,

Please help to open a new topic for your issue.

Thanks

hello,
I solved it, please refer to [here].(Error when building trusty in TX2 - #6 by fanyangyf688)
thanks

1 Like