summaryrefslogtreecommitdiffstats
path: root/main/libc0.9.32
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2013-05-16 14:43:56 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2013-05-16 14:45:20 +0000
commiteca60a85ee25d06f8a5fd01a14f34de6abf3481d (patch)
tree0717a13bfb7d13c09850915aa8e9c31518b16aa2 /main/libc0.9.32
parentb96110fab261175d6e1957999a61187e527eef7d (diff)
downloadaports-eca60a85ee25d06f8a5fd01a14f34de6abf3481d.tar.bz2
aports-eca60a85ee25d06f8a5fd01a14f34de6abf3481d.tar.xz
main/libc0.9.32: make getchar/putchar as inlines
fixes issue with lvm2 which modifies stdin. Patch from Timo. ref #1527
Diffstat (limited to 'main/libc0.9.32')
-rw-r--r--main/libc0.9.32/0001-stdio-inline-getchar-putchar.patch114
-rw-r--r--main/libc0.9.32/APKBUILD7
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 000000000..e6fe9fed2
--- /dev/null
+++ b/main/libc0.9.32/0001-stdio-inline-getchar-putchar.patch
@@ -0,0 +1,114 @@
+From 79899f6b3cade5b0ad39b70d30ccf15f182ba045 Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Thu, 16 May 2013 14:04:39 +0000
+Subject: [PATCH] stdio: inline getchar/putchar
+
+Some apps like lvm2 modifies stdin. This breaks getchar since it is
+a macro that uses __stdin.
+(cherry picked from commit aabeb90f74aa2736fb993cd5840a894eff3b958f)
+
+Conflicts:
+ include/stdio.h
+ libc/sysdeps/linux/common/bits/uClibc_stdio.h
+---
+ include/stdio.h | 17 +++++++----------
+ libc/stdio/getchar.c | 2 --
+ libc/stdio/putchar.c | 3 ---
+ libc/sysdeps/linux/common/bits/uClibc_stdio.h | 6 ------
+ 4 files changed, 7 insertions(+), 21 deletions(-)
+
+diff --git a/include/stdio.h b/include/stdio.h
+index 289b861..4d6092a 100644
+--- a/include/stdio.h
++++ b/include/stdio.h
+@@ -906,19 +906,16 @@ extern void funlockfile (FILE *__stream) __THROW;
+ #define fputc_unlocked(_ch, _fp) __FPUTC_UNLOCKED(_ch, _fp)
+ #endif
+
+-#ifndef __STDIO_GETC_MACRO
+-#define __stdin stdin
+-#endif
+-#define getchar() __GETC(__stdin)
++#ifdef __USE_EXTERN_INLINES
+
+-#ifndef __STDIO_PUTC_MACRO
+-#define __stdout stdout
+-#endif
+-#define putchar(_ch) __PUTC((_ch), __stdout)
++__extern_inline int getchar(void) { return __GETC(stdin); }
++__extern_inline int putchar(int c) { return __PUTC(c, stdout); }
+
+ #if defined __USE_POSIX || defined __USE_MISC
+-#define getchar_unlocked() __GETC_UNLOCKED(__stdin)
+-#define putchar_unlocked(_ch) __PUTC_UNLOCKED((_ch), __stdout)
++__extern_inline int getchar_unlocked(void) { return __GETC_UNLOCKED(stdin); }
++__extern_inline int putchar_unlocked(int c) { return __PUTC_UNLOCKED(c, stdout); }
++#endif
++
+ #endif
+
+ /* Clear the error and EOF indicators for STREAM. */
+diff --git a/libc/stdio/getchar.c b/libc/stdio/getchar.c
+index b6c650c..f8c487b 100644
+--- a/libc/stdio/getchar.c
++++ b/libc/stdio/getchar.c
+@@ -8,11 +8,9 @@
+ #include "_stdio.h"
+
+
+-#undef getchar
+ #ifdef __DO_UNLOCKED
+
+ /* the only use of the hidden getchar_unlocked is in gets.c */
+-#undef getchar_unlocked
+ int getchar_unlocked(void)
+ {
+ register FILE *stream = stdin;
+diff --git a/libc/stdio/putchar.c b/libc/stdio/putchar.c
+index 583e90f..804b09d 100644
+--- a/libc/stdio/putchar.c
++++ b/libc/stdio/putchar.c
+@@ -7,11 +7,8 @@
+
+ #include "_stdio.h"
+
+-
+-#undef putchar
+ #ifdef __DO_UNLOCKED
+
+-#undef putchar_unlocked
+ int putchar_unlocked(int c)
+ {
+ register FILE *stream = stdout;
+diff --git a/libc/sysdeps/linux/common/bits/uClibc_stdio.h b/libc/sysdeps/linux/common/bits/uClibc_stdio.h
+index a8cf4eb..2ec8ad4 100644
+--- a/libc/sysdeps/linux/common/bits/uClibc_stdio.h
++++ b/libc/sysdeps/linux/common/bits/uClibc_stdio.h
+@@ -411,8 +411,6 @@ libc_hidden_proto(__fputc_unlocked)
+
+ #ifdef __STDIO_GETC_MACRO
+
+-extern FILE *__stdin; /* For getchar() macro. */
+-
+ # undef __GETC_UNLOCKED_MACRO
+ # define __GETC_UNLOCKED_MACRO(__stream) \
+ ( ((__stream)->__bufpos < (__stream)->__bufgetc_u) \
+@@ -463,15 +461,11 @@ extern FILE *__stdin; /* For getchar() macro. */
+ # endif
+ # endif
+
+-#else
+-
+ #endif /* __STDIO_GETC_MACRO */
+
+
+ #ifdef __STDIO_PUTC_MACRO
+
+-extern FILE *__stdout; /* For putchar() macro. */
+-
+ # undef __PUTC_UNLOCKED_MACRO
+ # define __PUTC_UNLOCKED_MACRO(__c, __stream) \
+ ( ((__stream)->__bufpos < (__stream)->__bufputc_u) \
+--
+1.8.2.3
+
diff --git a/main/libc0.9.32/APKBUILD b/main/libc0.9.32/APKBUILD
index 8c933ae20..20c186400 100644
--- a/main/libc0.9.32/APKBUILD
+++ b/main/libc0.9.32/APKBUILD
@@ -4,7 +4,7 @@ pkgname=libc$_abiver
_gitver=
pkgver=0.9.33.2
_ver=${pkgver/_/-}
-pkgrel=19
+pkgrel=20
pkgdesc="C library for developing embedded Linux systems"
url=http://uclibc.org
license="LGPL-2"
@@ -60,8 +60,8 @@ librt-re-add-SIGCANCEL-to-the-list-of-blocked-signal-in-helper-thread.patch
0001-libm-x86_64-implement-fegetround.patch
libdl.patch
-
0001-ldd-subdepends-check-stderr.patch
+ 0001-stdio-inline-getchar-putchar.patch
uclibcconfig.x86
uclibcconfig.x86_64
@@ -205,6 +205,7 @@ ffe7564afe846026a278dd8c0251ace9 uclibc-rtld_next-fix.patch
2e27c00c1af216eb5fb3aef81d7ba515 0001-libm-x86_64-implement-fegetround.patch
747efb42244760ad3ae72a42b18ec8c3 libdl.patch
e5352b7ebaa21e2ed787ce124ef67c9f 0001-ldd-subdepends-check-stderr.patch
+851808f9ec347dce3407d0ad4cb5ee49 0001-stdio-inline-getchar-putchar.patch
ce8a33a31f5a53031fbad8b1d1b66d44 uclibcconfig.x86
e861a17baa541accf4d4d39a98d74c32 uclibcconfig.x86_64
ce8a33a31f5a53031fbad8b1d1b66d44 uclibcconfig.i486
@@ -241,6 +242,7 @@ d7f11efbce5c4ef27849e7a3cd370be86540c635effd51d5374194b65c7c7e83 560-res_init_a
b4cd24a506f4f286144080b3e95a2999efb4ec58e759255e82e09a1d7c353549 0001-libm-x86_64-implement-fegetround.patch
b284cf0f0f19897272ca0c8e10c7aa05a837807efcaad2b44e4f1a2c2fb1bbe4 libdl.patch
2ec9f978c34e2ce573fc9dc91c70b170c0b7699fd393d0e93b9f1cd312af7532 0001-ldd-subdepends-check-stderr.patch
+703799e579e4c28eda028b49f8212c4d4447ffbcf83fadf48ee10db4eceaa0c4 0001-stdio-inline-getchar-putchar.patch
7f613b473adbbf38701125f3d298d11f91e102e5cda17eec8133e8463bdc10c9 uclibcconfig.x86
bec76f2c67c0c632b24bb8c3db01396cc56f208a8c5ca16543fd5e71050d8c88 uclibcconfig.x86_64
7f613b473adbbf38701125f3d298d11f91e102e5cda17eec8133e8463bdc10c9 uclibcconfig.i486
@@ -277,6 +279,7 @@ f6de454c16a56c5978b9e840440baf4b17cd92c30191407fd371a88a5764ea3f119a5b639ca9aab5
72e1aa3bb6b97c86d2539c370d47da5aa6b9ef80f1514229bf6acb366f91b87b55207c904f228cce6156cba8b10cf1318d00a69f677e498235ac69f10bf5c240 0001-libm-x86_64-implement-fegetround.patch
5e03d0a81145e572463642dd90aefe700979df7e5be9e2d3b029a7ff21f5b79064f97676c069cd287e6319b9c9a28ab5703bcc547f901e2d90cb09f85ca74ac6 libdl.patch
8a3d1ecc97e297be1b998a1117d41ae852a9c3d5e3c8ec0a760d8c29a11107c13875ecda2a7e091efded4e8a454669c9c23a28a7bf564348671e8bf4473b74aa 0001-ldd-subdepends-check-stderr.patch
+984b9ec269ba679d8ad94f62187b0966347adf2b3daea64588f0884df81534687c8e7dad141ad48ff6332334eb3bd158bdd4d2ee22526255105b427cd334ff77 0001-stdio-inline-getchar-putchar.patch
ab04402abefad1f239d27d9638c1d8d76bc6a8edd77bbb8ed5a4b1445dbc44d709bb1b5214fc9a37a2208c2b6e92dd0a147eddea5d0b2e1ca3ec227432fe86eb uclibcconfig.x86
063899afb5f3c20e5dae1b613aa8963408b66ef21228df2500366163aeda71ca4163cbef8c3e53f389ba4a85b8eec5991667cdb31576141ce2ccbc1dc3d33cab uclibcconfig.x86_64
ab04402abefad1f239d27d9638c1d8d76bc6a8edd77bbb8ed5a4b1445dbc44d709bb1b5214fc9a37a2208c2b6e92dd0a147eddea5d0b2e1ca3ec227432fe86eb uclibcconfig.i486