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