Skip to content
This repository was archived by the owner on Feb 7, 2023. It is now read-only.

Cross compiling fails when libtss_esys.a is used to build application using ESAPI library #248

Open
kuldeepmarker-eaton opened this issue Jul 5, 2022 · 0 comments

Comments

@kuldeepmarker-eaton
Copy link

HI All,

I have used the tpm2-tss recipe to build the stack. The stack gets build properly and creates respective library. I wanted to use ESAPI library to create an application. So I used libtss2_esys.a to build the application but the build failed as the lib has some undefined symbols which are related to openssl. So how to define those symbols in the TCG stack and regenerate proper library.
My application is build using cmake and my distro is ST openstlinux.

Below is the error I am getting during build.

Log data follows:
| DEBUG: Executing shell function do_compile
| NOTE: VERBOSE=1 cmake --build /home/eaton/workspace/edge-linux-yocto/build-openstlinuxweston-stm32mp1/tmp-glibc/work/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/tpm-test/1.0-r0/build --target all --
| [1/2] /home/eaton/workspace/edge-linux-yocto/build-openstlinuxweston-stm32mp1/tmp-glibc/work/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/tpm-test/1.0-r0/recipe-sysroot-native/usr/bin/arm-ostl-linux-gnueabi/arm-ostl-linux-gnueabi-gcc -mthumb -mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=/home/eaton/workspace/edge-linux-yocto/build-openstlinuxweston-stm32mp1/tmp-glibc/work/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/tpm-test/1.0-r0/recipe-sysroot -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=/home/eaton/workspace/edge-linux-yocto/build-openstlinuxweston-stm32mp1/tmp-glibc/work/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/tpm-test/1.0-r0=/usr/src/debug/tpm-test/1.0-r0 -fdebug-prefix-map=/home/eaton/workspace/edge-linux-yocto/build-openstlinuxweston-stm32mp1/tmp-glibc/work/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/tpm-test/1.0-r0=/usr/src/debug/tpm-test/1.0-r0 -fdebug-prefix-map=/home/eaton/workspace/edge-linux-yocto/build-openstlinuxweston-stm32mp1/tmp-glibc/work/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/tpm-test/1.0-r0/recipe-sysroot= -fdebug-prefix-map=/home/eaton/workspace/edge-linux-yocto/build-openstlinuxweston-stm32mp1/tmp-glibc/work/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/tpm-test/1.0-r0/recipe-sysroot-native= -mthumb -mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=/home/eaton/workspace/edge-linux-yocto/build-openstlinuxweston-stm32mp1/tmp-glibc/work/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/tpm-test/1.0-r0/recipe-sysroot -MD -MT CMakeFiles/tpm-test.dir/tpm2_fapi.o -MF CMakeFiles/tpm-test.dir/tpm2_fapi.o.d -o CMakeFiles/tpm-test.dir/tpm2_fapi.o -c ../tpm2_fapi.c
| [2/2] : && /home/eaton/workspace/edge-linux-yocto/build-openstlinuxweston-stm32mp1/tmp-glibc/work/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/tpm-test/1.0-r0/recipe-sysroot-native/usr/bin/arm-ostl-linux-gnueabi/arm-ostl-linux-gnueabi-gcc -mthumb -mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=/home/eaton/workspace/edge-linux-yocto/build-openstlinuxweston-stm32mp1/tmp-glibc/work/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/tpm-test/1.0-r0/recipe-sysroot -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=/home/eaton/workspace/edge-linux-yocto/build-openstlinuxweston-stm32mp1/tmp-glibc/work/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/tpm-test/1.0-r0=/usr/src/debug/tpm-test/1.0-r0 -fdebug-prefix-map=/home/eaton/workspace/edge-linux-yocto/build-openstlinuxweston-stm32mp1/tmp-glibc/work/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/tpm-test/1.0-r0=/usr/src/debug/tpm-test/1.0-r0 -fdebug-prefix-map=/home/eaton/workspace/edge-linux-yocto/build-openstlinuxweston-stm32mp1/tmp-glibc/work/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/tpm-test/1.0-r0/recipe-sysroot= -fdebug-prefix-map=/home/eaton/workspace/edge-linux-yocto/build-openstlinuxweston-stm32mp1/tmp-glibc/work/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/tpm-test/1.0-r0/recipe-sysroot-native= -mthumb -mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=/home/eaton/workspace/edge-linux-yocto/build-openstlinuxweston-stm32mp1/tmp-glibc/work/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/tpm-test/1.0-r0/recipe-sysroot -mthumb -mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=/home/eaton/workspace/edge-linux-yocto/build-openstlinuxweston-stm32mp1/tmp-glibc/work/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/tpm-test/1.0-r0/recipe-sysroot -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -rdynamic CMakeFiles/tpm-test.dir/tpm2_fapi.o -o tpm-test -Wl,-Bstatic -ltss2-esys -ltss2-rc -Wl,-Bdynamic -ldl && :
| FAILED: tpm-test
| : && /home/eaton/workspace/edge-linux-yocto/build-openstlinuxweston-stm32mp1/tmp-glibc/work/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/tpm-test/1.0-r0/recipe-sysroot-native/usr/bin/arm-ostl-linux-gnueabi/arm-ostl-linux-gnueabi-gcc -mthumb -mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=/home/eaton/workspace/edge-linux-yocto/build-openstlinuxweston-stm32mp1/tmp-glibc/work/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/tpm-test/1.0-r0/recipe-sysroot -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=/home/eaton/workspace/edge-linux-yocto/build-openstlinuxweston-stm32mp1/tmp-glibc/work/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/tpm-test/1.0-r0=/usr/src/debug/tpm-test/1.0-r0 -fdebug-prefix-map=/home/eaton/workspace/edge-linux-yocto/build-openstlinuxweston-stm32mp1/tmp-glibc/work/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/tpm-test/1.0-r0=/usr/src/debug/tpm-test/1.0-r0 -fdebug-prefix-map=/home/eaton/workspace/edge-linux-yocto/build-openstlinuxweston-stm32mp1/tmp-glibc/work/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/tpm-test/1.0-r0/recipe-sysroot= -fdebug-prefix-map=/home/eaton/workspace/edge-linux-yocto/build-openstlinuxweston-stm32mp1/tmp-glibc/work/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/tpm-test/1.0-r0/recipe-sysroot-native= -mthumb -mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=/home/eaton/workspace/edge-linux-yocto/build-openstlinuxweston-stm32mp1/tmp-glibc/work/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/tpm-test/1.0-r0/recipe-sysroot -mthumb -mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=/home/eaton/workspace/edge-linux-yocto/build-openstlinuxweston-stm32mp1/tmp-glibc/work/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/tpm-test/1.0-r0/recipe-sysroot -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -rdynamic CMakeFiles/tpm-test.dir/tpm2_fapi.o -o tpm-test -Wl,-Bstatic -ltss2-esys -ltss2-rc -Wl,-Bdynamic -ldl && :
| /home/eaton/workspace/edge-linux-yocto/build-openstlinuxweston-stm32mp1/tmp-glibc/work/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/tpm-test/1.0-r0/recipe-sysroot-native/usr/bin/arm-ostl-linux-gnueabi/../../libexec/arm-ostl-linux-gnueabi/gcc/arm-ostl-linux-gnueabi/9.3.0/ld: /home/eaton/workspace/edge-linux-yocto/build-openstlinuxweston-stm32mp1/tmp-glibc/work/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/tpm-test/1.0-r0/recipe-sysroot/usr/lib/libtss2-esys.a(libtss2_esys_la-esys_context.o): in function Esys_Initialize': | /usr/src/debug/tpm2-tss/3.2.0-r0/build/../tpm2-tss-3.2.0/src/tss2-esys/esys_context.c:61: undefined reference to Tss2_Sys_GetContextSize'
| /home/eaton/workspace/edge-linux-yocto/build-openstlinuxweston-stm32mp1/tmp-glibc/work/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/tpm-test/1.0-r0/recipe-sysroot-native/usr/bin/arm-ostl-linux-gnueabi/../../libexec/arm-ostl-linux-gnueabi/gcc/arm-ostl-linux-gnueabi/9.3.0/ld: /usr/src/debug/tpm2-tss/3.2.0-r0/build/../tpm2-tss-3.2.0/src/tss2-esys/esys_context.c:73: undefined reference to `Tss2_Sys_Initialize'

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant