a6b5b5e9da7d169ec5fe2ef33668460f82605852
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / uclibc / 0.9.33.2 / 0065-Do-not-include-__iconv_codesets-into-iconv-utility.patch
1 uclibc: Do not include __iconv_codesets into iconv utility
2
3 Backporting an upstream patch to fix a problem in the install step:
4
5 make[1]: Entering directory `/br/output/build/uclibc-0.9.33.2'
6 make[2]: Nothing to be done for `locale_headers'.
7         CC utils/getconf
8         STRIP -x -R .note -R .comment ../utils/getconf
9         CC utils/iconv
10 ../lib/libc.a(iconv.os):(.rodata+0x18): multiple definition of
11 `__iconv_codesets'
12 /tmp/ccVmV8Lq.o:(.rodata+0x18): first defined here
13 collect2: error: ld returned 1 exit status
14
15 Upstream commit:
16         http://git.uclibc.org/uClibc/commit/?id=d46dc8bc88e38251bfa3712efe7abf62933f5419
17
18 Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
19
20 From d46dc8bc88e38251bfa3712efe7abf62933f5419 Mon Sep 17 00:00:00 2001
21 From: Peter S. Mazinger <ps.m@gmx.net>
22 Date: Thu, 24 Mar 2011 00:15:25 +0000
23 Subject: iconv: Do not include __iconv_codesets into iconv utility
24
25 Host iconv needs only L_iconv_main defined and __iconv_codesets
26 has to included, as host system does not provide it.
27 Keep __iconv_codesets out of iconv linked against uClibc.
28
29 Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
30 Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
31 ---
32 diff --git a/libc/misc/wchar/wchar.c b/libc/misc/wchar/wchar.c
33 index 412c557..0704096 100644
34 --- a/libc/misc/wchar/wchar.c
35 +++ b/libc/misc/wchar/wchar.c
36 @@ -1196,6 +1196,9 @@ libc_hidden_proto(__iconv_codesets)
37  #endif
38  
39  #if defined L_iconv || defined L_iconv_main
40 +# ifdef L_iconv_main
41 +static
42 +# endif
43  const unsigned char __iconv_codesets[] =
44         "\x0a\xe0""WCHAR_T\x00"         /* superset of UCS-4 but platform-endian */
45  #if __BYTE_ORDER == __BIG_ENDIAN
46 diff --git a/utils/Makefile.in b/utils/Makefile.in
47 index bb85be3..1714d28 100644
48 --- a/utils/Makefile.in
49 +++ b/utils/Makefile.in
50 @@ -36,8 +36,7 @@ CFLAGS-ldd := $(CFLAGS-utils-shared) -DBUILDING_LINKAGE
51  # Need CFLAGS-utils explicitly, because the source file is not located in utils
52  CFLAGS-iconv := $(CFLAGS-utils) \
53      $(CFLAGS-utils-shared) \
54 -    -I$(top_srcdir)libc/misc/wchar \
55 -    -DL_iconv_main \
56 +    -I$(top_srcdir)libc/misc/wchar
57  
58  CFLAGS-locale := $(CFLAGS-utils)
59  CFLAGS-getconf :=$(CFLAGS-utils) \
60 diff --git a/utils/iconv.c b/utils/iconv.c
61 index 04e2c32..a0260df 100644
62 --- a/utils/iconv.c
63 +++ b/utils/iconv.c
64 @@ -108,7 +108,12 @@
65  #include <wchar.h>
66  #include "wchar.c" /* for _UC_iconv_t and __iconv_codesets */
67  
68 -extern const unsigned char __iconv_codesets[];
69 +#ifdef L_iconv_main
70 +static
71 +#else
72 +extern
73 +#endif
74 +const unsigned char __iconv_codesets[];
75  
76  #define IBUF BUFSIZ
77  #define OBUF BUFSIZ
78 --
79 cgit v0.9.1