Skip to content

cannot find -lteec2 while building xtest with dual OP-TEE versions (xtest2) #15

@Hassan-Ali200786

Description

@Hassan-Ali200786

Summary

I'm trying to build the xtest test suite in a setup where two OP-TEE variants are built in parallel (with suffixes to avoid collision). The first xtest build succeeds, but the second build fails with a linker error:

work/crosscon/buildroot/build-aarch64/host/lib/gcc/aarch64-buildroot-linux-gnu/11.3.0/../../../../aarch64-buildroot-linux-gnu/bin/ld: cannot find -lteec2: No such file or directory

This happens during the linking stage of xtest when trying to use a renamed version of the libteec library (lteec2 instead of lteec), to support parallel OP-TEE builds.

First Build (Success)

# Environment setup for first variant export TA_DEV_KIT_DIR=../optee_os/optee-rpi4/export-ta_arm64export TEEC_EXPORT=../optee_client/out-aarch64/export/usr/# ...make clean && make -j$(nproc) && make install

This builds fine and xtest runs as expected.

Second Build (Failure)

# Environment setup for second variant export TA_DEV_KIT_DIR=../optee_os/optee2-rpi4/export-ta_arm64export TEEC_EXPORT=../optee_client/out2-aarch64/export/usr/# Patching Makefiles to avoid name collisionfind . -name "Makefile" -exec sed -i "s/-lteec$/-lteec2/g" {} +
find . -name "Makefile" -exec sed -i "s/optee_armtz/optee2_armtz/g" {} +
make clean
make -j$(nproc)

Error Output

 work/crosscon/optee_test/out2-aarch64/xtest/xtest/work/crosscon/buildroot/build-aarch64/host/lib/gcc/aarch64-buildroot-linux-gnu/11.3.0/../../../../aarch64-buildroot-linux-gnu/bin/ld: cannot find -lteec2: No such file or directory
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:194: xtest] Error 1make: *** [Makefile:42: xtest] Error 2

Request
Could maintainers or anyone know how to fix it so I can proceed with building the RPI demo and running it

Any advice would be greatly appreciated.
Thanks!

@DavidMCerdeira you mentioned here that you got some ideas regarding of the issue which is causing it, I tried running the Step 4: Build OP-TEE xtest one by one because of suspected sed race condition but that hasnt fixed anything

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions