stack_protector.mk 725 B

12345678910111213141516171819202122232425262728
  1. #
  2. # Copyright (c) 2017-2019, Arm Limited and Contributors. All rights reserved.
  3. #
  4. # SPDX-License-Identifier: BSD-3-Clause
  5. #
  6. # Boolean macro to be used in C code
  7. STACK_PROTECTOR_ENABLED := 0
  8. ifeq (${ENABLE_STACK_PROTECTOR},0)
  9. ENABLE_STACK_PROTECTOR := none
  10. endif
  11. ifeq (${ENABLE_STACK_PROTECTOR},none)
  12. TF_CFLAGS += -fno-stack-protector
  13. else
  14. STACK_PROTECTOR_ENABLED := 1
  15. BL_COMMON_SOURCES += lib/stack_protector/stack_protector.c \
  16. lib/stack_protector/${ARCH}/asm_stack_protector.S
  17. ifeq (${ENABLE_STACK_PROTECTOR},default)
  18. TF_CFLAGS += -fstack-protector
  19. else
  20. TF_CFLAGS += -fstack-protector-${ENABLE_STACK_PROTECTOR}
  21. endif
  22. endif
  23. $(eval $(call add_define,STACK_PROTECTOR_ENABLED))