0004-Makefile-add-fno-builtin.patch 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. From 25fc567ba8a0cd199e48bfa82863247d953784ea Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. Date: Sun, 30 Aug 2020 20:59:29 +0200
  4. Subject: [PATCH] Makefile: add -fno-builtin
  5. Build with gcc 10 fails on:
  6. /srv/storage/autobuild/run/instance-2/output-1/host/lib/gcc/arm-buildroot-linux-gnueabihf/10.2.0/../../../../arm-buildroot-linux-gnueabihf/bin/ld: src/foundation/startup.o: in function `reset_handler':
  7. /srv/storage/autobuild/run/instance-2/output-1/build/am33x-cm3-11107db2f1e9e58ee75d4fe9cc38423c9a6e4365/src/foundation/startup.c:177: undefined reference to `memcpy'
  8. This is due to the fact that gcc 10 replaces the following statement by
  9. a memcpy call:
  10. *puldest++ = *pulsrc++;
  11. To fix this build failure, add -fno-builtin
  12. Fixes:
  13. - http://autobuild.buildroot.org/results/a991e6efa012df518ff1bb35017ad2c96c8feedc
  14. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  15. ---
  16. Makefile | 2 +-
  17. 1 file changed, 1 insertion(+), 1 deletion(-)
  18. diff --git a/Makefile b/Makefile
  19. index fe3d844..fa24d4b 100644
  20. --- a/Makefile
  21. +++ b/Makefile
  22. @@ -17,7 +17,7 @@ CFLAGS =-march=armv7-m -mcpu=cortex-m3 -mthumb -nostdlib -Wall -Wundef \
  23. -Werror-implicit-function-declaration -Wstrict-prototypes \
  24. -Wdeclaration-after-statement -fno-delete-null-pointer-checks \
  25. -Wempty-body -fno-strict-overflow -fno-stack-protector \
  26. - -fno-pie -g -I$(INCLUDES) -O2
  27. + -fno-pie -fno-builtin -g -I$(INCLUDES) -O2
  28. LDFLAGS =-nostartfiles -fno-exceptions -Tfirmware.ld
  29. EXECUTABLE=am335x-pm-firmware.elf
  30. --
  31. 2.28.0