diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2013-05-16 14:43:56 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2013-05-16 14:45:20 +0000 |
commit | eca60a85ee25d06f8a5fd01a14f34de6abf3481d (patch) | |
tree | 0717a13bfb7d13c09850915aa8e9c31518b16aa2 | |
parent | b96110fab261175d6e1957999a61187e527eef7d (diff) | |
download | alpine_aports-eca60a85ee25d06f8a5fd01a14f34de6abf3481d.tar.bz2 alpine_aports-eca60a85ee25d06f8a5fd01a14f34de6abf3481d.tar.xz alpine_aports-eca60a85ee25d06f8a5fd01a14f34de6abf3481d.zip |
main/libc0.9.32: make getchar/putchar as inlines
fixes issue with lvm2 which modifies stdin.
Patch from Timo.
ref #1527
-rw-r--r-- | main/libc0.9.32/0001-stdio-inline-getchar-putchar.patch | 114 | ||||
-rw-r--r-- | main/libc0.9.32/APKBUILD | 7 |
2 files changed, 119 insertions, 2 deletions
diff --git a/main/libc0.9.32/0001-stdio-inline-getchar-putchar.patch b/main/libc0.9.32/0001-stdio-inline-getchar-putchar.patch new file mode 100644 index 0000000000..e6fe9fed2b --- /dev/null +++ b/main/libc0.9.32/0001-stdio-inline-getchar-putchar.patch | |||
@@ -0,0 +1,114 @@ | |||
1 | From 79899f6b3cade5b0ad39b70d30ccf15f182ba045 Mon Sep 17 00:00:00 2001 | ||
2 | From: Natanael Copa <ncopa@alpinelinux.org> | ||
3 | Date: Thu, 16 May 2013 14:04:39 +0000 | ||
4 | Subject: [PATCH] stdio: inline getchar/putchar | ||
5 | |||
6 | Some apps like lvm2 modifies stdin. This breaks getchar since it is | ||
7 | a macro that uses __stdin. | ||
8 | (cherry picked from commit aabeb90f74aa2736fb993cd5840a894eff3b958f) | ||
9 | |||
10 | Conflicts: | ||
11 | include/stdio.h | ||
12 | libc/sysdeps/linux/common/bits/uClibc_stdio.h | ||
13 | --- | ||
14 | include/stdio.h | 17 +++++++---------- | ||
15 | libc/stdio/getchar.c | 2 -- | ||
16 | libc/stdio/putchar.c | 3 --- | ||
17 | libc/sysdeps/linux/common/bits/uClibc_stdio.h | 6 ------ | ||
18 | 4 files changed, 7 insertions(+), 21 deletions(-) | ||
19 | |||
20 | diff --git a/include/stdio.h b/include/stdio.h | ||
21 | index 289b861..4d6092a 100644 | ||
22 | --- a/include/stdio.h | ||
23 | +++ b/include/stdio.h | ||
24 | @@ -906,19 +906,16 @@ extern void funlockfile (FILE *__stream) __THROW; | ||
25 | #define fputc_unlocked(_ch, _fp) __FPUTC_UNLOCKED(_ch, _fp) | ||
26 | #endif | ||
27 | |||
28 | -#ifndef __STDIO_GETC_MACRO | ||
29 | -#define __stdin stdin | ||
30 | -#endif | ||
31 | -#define getchar() __GETC(__stdin) | ||
32 | +#ifdef __USE_EXTERN_INLINES | ||
33 | |||
34 | -#ifndef __STDIO_PUTC_MACRO | ||
35 | -#define __stdout stdout | ||
36 | -#endif | ||
37 | -#define putchar(_ch) __PUTC((_ch), __stdout) | ||
38 | +__extern_inline int getchar(void) { return __GETC(stdin); } | ||
39 | +__extern_inline int putchar(int c) { return __PUTC(c, stdout); } | ||
40 | |||
41 | #if defined __USE_POSIX || defined __USE_MISC | ||
42 | -#define getchar_unlocked() __GETC_UNLOCKED(__stdin) | ||
43 | -#define putchar_unlocked(_ch) __PUTC_UNLOCKED((_ch), __stdout) | ||
44 | +__extern_inline int getchar_unlocked(void) { return __GETC_UNLOCKED(stdin); } | ||
45 | +__extern_inline int putchar_unlocked(int c) { return __PUTC_UNLOCKED(c, stdout); } | ||
46 | +#endif | ||
47 | + | ||
48 | #endif | ||
49 | |||
50 | /* Clear the error and EOF indicators for STREAM. */ | ||
51 | diff --git a/libc/stdio/getchar.c b/libc/stdio/getchar.c | ||
52 | index b6c650c..f8c487b 100644 | ||
53 | --- a/libc/stdio/getchar.c | ||
54 | +++ b/libc/stdio/getchar.c | ||
55 | @@ -8,11 +8,9 @@ | ||
56 | #include "_stdio.h" | ||
57 | |||
58 | |||
59 | -#undef getchar | ||
60 | #ifdef __DO_UNLOCKED | ||
61 | |||
62 | /* the only use of the hidden getchar_unlocked is in gets.c */ | ||
63 | -#undef getchar_unlocked | ||
64 | int getchar_unlocked(void) | ||
65 | { | ||
66 | register FILE *stream = stdin; | ||
67 | diff --git a/libc/stdio/putchar.c b/libc/stdio/putchar.c | ||
68 | index 583e90f..804b09d 100644 | ||
69 | --- a/libc/stdio/putchar.c | ||
70 | +++ b/libc/stdio/putchar.c | ||
71 | @@ -7,11 +7,8 @@ | ||
72 | |||
73 | #include "_stdio.h" | ||
74 | |||
75 | - | ||
76 | -#undef putchar | ||
77 | #ifdef __DO_UNLOCKED | ||
78 | |||
79 | -#undef putchar_unlocked | ||
80 | int putchar_unlocked(int c) | ||
81 | { | ||
82 | register FILE *stream = stdout; | ||
83 | diff --git a/libc/sysdeps/linux/common/bits/uClibc_stdio.h b/libc/sysdeps/linux/common/bits/uClibc_stdio.h | ||
84 | index a8cf4eb..2ec8ad4 100644 | ||
85 | --- a/libc/sysdeps/linux/common/bits/uClibc_stdio.h | ||
86 | +++ b/libc/sysdeps/linux/common/bits/uClibc_stdio.h | ||
87 | @@ -411,8 +411,6 @@ libc_hidden_proto(__fputc_unlocked) | ||
88 | |||
89 | #ifdef __STDIO_GETC_MACRO | ||
90 | |||
91 | -extern FILE *__stdin; /* For getchar() macro. */ | ||
92 | - | ||
93 | # undef __GETC_UNLOCKED_MACRO | ||
94 | # define __GETC_UNLOCKED_MACRO(__stream) \ | ||
95 | ( ((__stream)->__bufpos < (__stream)->__bufgetc_u) \ | ||
96 | @@ -463,15 +461,11 @@ extern FILE *__stdin; /* For getchar() macro. */ | ||
97 | # endif | ||
98 | # endif | ||
99 | |||
100 | -#else | ||
101 | - | ||
102 | #endif /* __STDIO_GETC_MACRO */ | ||
103 | |||
104 | |||
105 | #ifdef __STDIO_PUTC_MACRO | ||
106 | |||
107 | -extern FILE *__stdout; /* For putchar() macro. */ | ||
108 | - | ||
109 | # undef __PUTC_UNLOCKED_MACRO | ||
110 | # define __PUTC_UNLOCKED_MACRO(__c, __stream) \ | ||
111 | ( ((__stream)->__bufpos < (__stream)->__bufputc_u) \ | ||
112 | -- | ||
113 | 1.8.2.3 | ||
114 | |||
diff --git a/main/libc0.9.32/APKBUILD b/main/libc0.9.32/APKBUILD index 8c933ae20e..20c1864007 100644 --- a/main/libc0.9.32/APKBUILD +++ b/main/libc0.9.32/APKBUILD | |||
@@ -4,7 +4,7 @@ pkgname=libc$_abiver | |||
4 | _gitver= | 4 | _gitver= |
5 | pkgver=0.9.33.2 | 5 | pkgver=0.9.33.2 |
6 | _ver=${pkgver/_/-} | 6 | _ver=${pkgver/_/-} |
7 | pkgrel=19 | 7 | pkgrel=20 |
8 | pkgdesc="C library for developing embedded Linux systems" | 8 | pkgdesc="C library for developing embedded Linux systems" |
9 | url=http://uclibc.org | 9 | url=http://uclibc.org |
10 | license="LGPL-2" | 10 | license="LGPL-2" |
@@ -60,8 +60,8 @@ librt-re-add-SIGCANCEL-to-the-list-of-blocked-signal-in-helper-thread.patch | |||
60 | 60 | ||
61 | 0001-libm-x86_64-implement-fegetround.patch | 61 | 0001-libm-x86_64-implement-fegetround.patch |
62 | libdl.patch | 62 | libdl.patch |
63 | |||
64 | 0001-ldd-subdepends-check-stderr.patch | 63 | 0001-ldd-subdepends-check-stderr.patch |
64 | 0001-stdio-inline-getchar-putchar.patch | ||
65 | 65 | ||
66 | uclibcconfig.x86 | 66 | uclibcconfig.x86 |
67 | uclibcconfig.x86_64 | 67 | uclibcconfig.x86_64 |
@@ -205,6 +205,7 @@ ffe7564afe846026a278dd8c0251ace9 uclibc-rtld_next-fix.patch | |||
205 | 2e27c00c1af216eb5fb3aef81d7ba515 0001-libm-x86_64-implement-fegetround.patch | 205 | 2e27c00c1af216eb5fb3aef81d7ba515 0001-libm-x86_64-implement-fegetround.patch |
206 | 747efb42244760ad3ae72a42b18ec8c3 libdl.patch | 206 | 747efb42244760ad3ae72a42b18ec8c3 libdl.patch |
207 | e5352b7ebaa21e2ed787ce124ef67c9f 0001-ldd-subdepends-check-stderr.patch | 207 | e5352b7ebaa21e2ed787ce124ef67c9f 0001-ldd-subdepends-check-stderr.patch |
208 | 851808f9ec347dce3407d0ad4cb5ee49 0001-stdio-inline-getchar-putchar.patch | ||
208 | ce8a33a31f5a53031fbad8b1d1b66d44 uclibcconfig.x86 | 209 | ce8a33a31f5a53031fbad8b1d1b66d44 uclibcconfig.x86 |
209 | e861a17baa541accf4d4d39a98d74c32 uclibcconfig.x86_64 | 210 | e861a17baa541accf4d4d39a98d74c32 uclibcconfig.x86_64 |
210 | ce8a33a31f5a53031fbad8b1d1b66d44 uclibcconfig.i486 | 211 | ce8a33a31f5a53031fbad8b1d1b66d44 uclibcconfig.i486 |
@@ -241,6 +242,7 @@ d7f11efbce5c4ef27849e7a3cd370be86540c635effd51d5374194b65c7c7e83 560-res_init_a | |||
241 | b4cd24a506f4f286144080b3e95a2999efb4ec58e759255e82e09a1d7c353549 0001-libm-x86_64-implement-fegetround.patch | 242 | b4cd24a506f4f286144080b3e95a2999efb4ec58e759255e82e09a1d7c353549 0001-libm-x86_64-implement-fegetround.patch |
242 | b284cf0f0f19897272ca0c8e10c7aa05a837807efcaad2b44e4f1a2c2fb1bbe4 libdl.patch | 243 | b284cf0f0f19897272ca0c8e10c7aa05a837807efcaad2b44e4f1a2c2fb1bbe4 libdl.patch |
243 | 2ec9f978c34e2ce573fc9dc91c70b170c0b7699fd393d0e93b9f1cd312af7532 0001-ldd-subdepends-check-stderr.patch | 244 | 2ec9f978c34e2ce573fc9dc91c70b170c0b7699fd393d0e93b9f1cd312af7532 0001-ldd-subdepends-check-stderr.patch |
245 | 703799e579e4c28eda028b49f8212c4d4447ffbcf83fadf48ee10db4eceaa0c4 0001-stdio-inline-getchar-putchar.patch | ||
244 | 7f613b473adbbf38701125f3d298d11f91e102e5cda17eec8133e8463bdc10c9 uclibcconfig.x86 | 246 | 7f613b473adbbf38701125f3d298d11f91e102e5cda17eec8133e8463bdc10c9 uclibcconfig.x86 |
245 | bec76f2c67c0c632b24bb8c3db01396cc56f208a8c5ca16543fd5e71050d8c88 uclibcconfig.x86_64 | 247 | bec76f2c67c0c632b24bb8c3db01396cc56f208a8c5ca16543fd5e71050d8c88 uclibcconfig.x86_64 |
246 | 7f613b473adbbf38701125f3d298d11f91e102e5cda17eec8133e8463bdc10c9 uclibcconfig.i486 | 248 | 7f613b473adbbf38701125f3d298d11f91e102e5cda17eec8133e8463bdc10c9 uclibcconfig.i486 |
@@ -277,6 +279,7 @@ f6de454c16a56c5978b9e840440baf4b17cd92c30191407fd371a88a5764ea3f119a5b639ca9aab5 | |||
277 | 72e1aa3bb6b97c86d2539c370d47da5aa6b9ef80f1514229bf6acb366f91b87b55207c904f228cce6156cba8b10cf1318d00a69f677e498235ac69f10bf5c240 0001-libm-x86_64-implement-fegetround.patch | 279 | 72e1aa3bb6b97c86d2539c370d47da5aa6b9ef80f1514229bf6acb366f91b87b55207c904f228cce6156cba8b10cf1318d00a69f677e498235ac69f10bf5c240 0001-libm-x86_64-implement-fegetround.patch |
278 | 5e03d0a81145e572463642dd90aefe700979df7e5be9e2d3b029a7ff21f5b79064f97676c069cd287e6319b9c9a28ab5703bcc547f901e2d90cb09f85ca74ac6 libdl.patch | 280 | 5e03d0a81145e572463642dd90aefe700979df7e5be9e2d3b029a7ff21f5b79064f97676c069cd287e6319b9c9a28ab5703bcc547f901e2d90cb09f85ca74ac6 libdl.patch |
279 | 8a3d1ecc97e297be1b998a1117d41ae852a9c3d5e3c8ec0a760d8c29a11107c13875ecda2a7e091efded4e8a454669c9c23a28a7bf564348671e8bf4473b74aa 0001-ldd-subdepends-check-stderr.patch | 281 | 8a3d1ecc97e297be1b998a1117d41ae852a9c3d5e3c8ec0a760d8c29a11107c13875ecda2a7e091efded4e8a454669c9c23a28a7bf564348671e8bf4473b74aa 0001-ldd-subdepends-check-stderr.patch |
282 | 984b9ec269ba679d8ad94f62187b0966347adf2b3daea64588f0884df81534687c8e7dad141ad48ff6332334eb3bd158bdd4d2ee22526255105b427cd334ff77 0001-stdio-inline-getchar-putchar.patch | ||
280 | ab04402abefad1f239d27d9638c1d8d76bc6a8edd77bbb8ed5a4b1445dbc44d709bb1b5214fc9a37a2208c2b6e92dd0a147eddea5d0b2e1ca3ec227432fe86eb uclibcconfig.x86 | 283 | ab04402abefad1f239d27d9638c1d8d76bc6a8edd77bbb8ed5a4b1445dbc44d709bb1b5214fc9a37a2208c2b6e92dd0a147eddea5d0b2e1ca3ec227432fe86eb uclibcconfig.x86 |
281 | 063899afb5f3c20e5dae1b613aa8963408b66ef21228df2500366163aeda71ca4163cbef8c3e53f389ba4a85b8eec5991667cdb31576141ce2ccbc1dc3d33cab uclibcconfig.x86_64 | 284 | 063899afb5f3c20e5dae1b613aa8963408b66ef21228df2500366163aeda71ca4163cbef8c3e53f389ba4a85b8eec5991667cdb31576141ce2ccbc1dc3d33cab uclibcconfig.x86_64 |
282 | ab04402abefad1f239d27d9638c1d8d76bc6a8edd77bbb8ed5a4b1445dbc44d709bb1b5214fc9a37a2208c2b6e92dd0a147eddea5d0b2e1ca3ec227432fe86eb uclibcconfig.i486 | 285 | ab04402abefad1f239d27d9638c1d8d76bc6a8edd77bbb8ed5a4b1445dbc44d709bb1b5214fc9a37a2208c2b6e92dd0a147eddea5d0b2e1ca3ec227432fe86eb uclibcconfig.i486 |