0001-blackfin-build-fix.patch 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. Fix build on platforms where __USER_LABEL_PREFIX__ is not empty
  2. On most platforms, a C language symbol and its assembly equivalent are
  3. identical. However, on the Blackfin architecture, this isn't the case,
  4. the corresponding C language symbol in assembly is prepended with a
  5. "_". Blackfin therefore has __USER_LABEL_PREFIX__ defined to "_".
  6. Cairo already has some code to cope with __USER_LABEL_PREFIX__, but
  7. this code isn't completely correct: it prepends both assembly symbols
  8. and C symbols with __USER_LABEL_PREFIX__, which cannot work.
  9. This patch fixes that by using the existing slim_hidden_asmname() to
  10. define assembly symbols, and introduce a new slim_hidden_realname()
  11. for C symbols.
  12. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  13. Index: b/src/cairo-compiler-private.h
  14. ===================================================================
  15. --- a/src/cairo-compiler-private.h
  16. +++ b/src/cairo-compiler-private.h
  17. @@ -93,12 +93,13 @@
  18. __asm__ (slim_hidden_asmname (internal))
  19. # define slim_hidden_def1(name, internal) \
  20. extern __typeof (name) EXT_##name __asm__(slim_hidden_asmname(name)) \
  21. - __attribute__((__alias__(slim_hidden_asmname(internal))))
  22. + __attribute__((__alias__(slim_hidden_realname(internal))))
  23. # define slim_hidden_ulp slim_hidden_ulp1(__USER_LABEL_PREFIX__)
  24. # define slim_hidden_ulp1(x) slim_hidden_ulp2(x)
  25. # define slim_hidden_ulp2(x) #x
  26. # define slim_hidden_asmname(name) slim_hidden_asmname1(name)
  27. # define slim_hidden_asmname1(name) slim_hidden_ulp #name
  28. +# define slim_hidden_realname(name) #name
  29. #else
  30. # define slim_hidden_proto(name) int _cairo_dummy_prototype(void)
  31. # define slim_hidden_proto_no_warn(name) int _cairo_dummy_prototype(void)
  32. Index: b/util/cairo-script/cairo-script-private.h
  33. ===================================================================
  34. --- a/util/cairo-script/cairo-script-private.h
  35. +++ b/util/cairo-script/cairo-script-private.h
  36. @@ -109,12 +109,13 @@
  37. __asm__ (slim_hidden_asmname (internal))
  38. # define slim_hidden_def1(name, internal) \
  39. extern __typeof (name) EXT_##name __asm__(slim_hidden_asmname(name)) \
  40. - __attribute__((__alias__(slim_hidden_asmname(internal))))
  41. + __attribute__((__alias__(slim_hidden_realname(internal))))
  42. # define slim_hidden_ulp slim_hidden_ulp1(__USER_LABEL_PREFIX__)
  43. # define slim_hidden_ulp1(x) slim_hidden_ulp2(x)
  44. # define slim_hidden_ulp2(x) #x
  45. # define slim_hidden_asmname(name) slim_hidden_asmname1(name)
  46. # define slim_hidden_asmname1(name) slim_hidden_ulp #name
  47. +# define slim_hidden_realname(name) #name
  48. #else
  49. # define slim_hidden_proto(name) int _csi_dummy_prototype(void)
  50. # define slim_hidden_proto_no_warn(name) int _csi_dummy_prototype(void)