u-boot-002-gcc5-use_gcc_inline_version_instead_c99.patch 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. [RFC 08/10] inline: use the gcc inline version instead of the c99 one.
  2. Jeroen Hofstee jeroen at myspectrum.nl
  3. Sat May 31 22:32:22 CEST 2014
  4. Previous message: [U-Boot] [RFC 07/10] ARM: make gd a function a function for clang
  5. Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
  6. ---
  7. This fixes errors like:
  8. make[1]: Entering directory `/home/jeroen/software/u-boot/arch/arm/cpu/armv7/omap-common'
  9. arm-linux-gnueabi-ld.bfd -r -o libomap-common.o reset.o timer.o utils.o
  10. timer.o: In function `get_tbclk':
  11. /home/jeroen/software/u-boot/include/asm/io.h:81: multiple definition of `__raw_writesb'
  12. reset.o:/home/jeroen/software/u-boot/include/asm/io.h:81: first defined here
  13. timer.o: In function `__udelay':
  14. /home/jeroen/software/u-boot/include/asm/io.h:88: multiple definition of `__raw_writesw'
  15. reset.o:/home/jeroen/software/u-boot/include/asm/io.h:88: first defined here
  16. timer.o: In function `get_ticks':
  17. /home/jeroen/software/u-boot/include/asm/io.h:95: multiple definition of `__raw_writesl'
  18. reset.o:/home/jeroen/software/u-boot/include/asm/io.h:95: first defined here
  19. timer.o: In function `__raw_readsb':
  20. /home/jeroen/software/u-boot/include/asm/io.h:102: multiple definition of `__raw_readsb'
  21. reset.o:/home/jeroen/software/u-boot/include/asm/io.h:102: first defined here
  22. timer.o: In function `__raw_readsw':
  23. /home/jeroen/software/u-boot/include/asm/io.h:109: multiple definition of `__raw_readsw'
  24. reset.o:/home/jeroen/software/u-boot/include/asm/io.h:109: first defined here
  25. timer.o: In function `__raw_readsl':
  26. /home/jeroen/software/u-boot/include/asm/io.h:116: multiple definition of `__raw_readsl'
  27. reset.o:/home/jeroen/software/u-boot/include/asm/io.h:116: first defined here
  28. make[1]: *** [libomap-common.o] Error 1
  29. make[1]: Leaving directory `/home/jeroen/software/u-boot/arch/arm/cpu/armv7/omap-common'
  30. make: *** [arch/arm/cpu/armv7/omap-common/libomap-common.o] Error 2
  31. ---
  32. include/linux/compiler-gcc.h | 7 ++++---
  33. 1 file changed, 4 insertions(+), 3 deletions(-)
  34. diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
  35. index 9896e54..99c6dcc 100644
  36. --- a/include/linux/compiler-gcc.h
  37. +++ b/include/linux/compiler-gcc.h
  38. @@ -44,9 +44,10 @@
  39. */
  40. #if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) || \
  41. !defined(CONFIG_OPTIMIZE_INLINING) || (__GNUC__ < 4)
  42. -# define inline inline __attribute__((always_inline))
  43. -# define __inline__ __inline__ __attribute__((always_inline))
  44. -# define __inline __inline __attribute__((always_inline))
  45. +/* XXX: check __GNUC_STDC_INLINE__, fix line length */
  46. +# define inline inline __attribute__((always_inline)) __attribute__((__gnu_inline__))
  47. +# define __inline__ __inline__ __attribute__((always_inline)) __attribute__((__gnu_inline__))
  48. +# define __inline __inline __attribute__((always_inline)) __attribute__((__gnu_inline__))
  49. #endif
  50. #define __deprecated __attribute__((deprecated))
  51. --
  52. 1.8.3.2