libutils: add stubs for pthread functions

When building with GCC 11.3.1 [1], the linker reports undefined symbols
in the C++ test TA:

 $ make 2>&1 | grep -E "(in function|undefined reference)" | sed 's@.*/@@'
 libstdc++.a(eh_alloc.o): in function `(anonymous namespace)::pool::free(void*) [clone .constprop.0]':
 gthr-default.h:749: undefined reference to `pthread_mutex_lock'
 gthr-default.h:779: undefined reference to `pthread_mutex_unlock'
 libstdc++.a(eh_alloc.o): in function `(anonymous namespace)::pool::allocate(unsigned long) [clone .constprop.0]':
 gthr-default.h:749: undefined reference to `pthread_mutex_lock'
 gthr-default.h:779: undefined reference to `pthread_mutex_unlock'
 libgcc_eh.a(unwind-dw2-fde-dip.o): in function `__gthread_mutex_lock':
 gthr-default.h:749: undefined reference to `pthread_mutex_lock'
 libgcc_eh.a(unwind-dw2-fde-dip.o): in function `__gthread_mutex_unlock':
 gthr-default.h:779: undefined reference to `pthread_mutex_unlock'
 [more of the same follow]

To fix that issue, introduce no-op stubs as weak symbols in libutils.
Doing so is valid because TAs are single threaded and non-reentrant.

Link: [1] https://developer.arm.com/-/media/Files/downloads/gnu/11.3.rel1/binrel/arm-gnu-toolchain-11.3.rel1-x86_64-aarch64-none-linux-gnu.tar.xz
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Acked-by: Sumit Garg <sumit.garg@linaro.org>
2 files changed
tree: b478f9d0c78d46b9765899007214b2e70b339dfb
  1. .github/
  2. core/
  3. keys/
  4. ldelf/
  5. lib/
  6. mk/
  7. scripts/
  8. ta/
  9. .checkpatch.conf
  10. .gitattributes
  11. .gitignore
  12. CHANGELOG.md
  13. LICENSE
  14. MAINTAINERS
  15. Makefile
  16. README.md
  17. typedefs.checkpatch
README.md

OP-TEE Trusted OS

This git contains source code for the secure side implementation of OP-TEE project.

All official OP-TEE documentation has moved to http://optee.readthedocs.io.

// OP-TEE core maintainers