Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 350480 Details for
Bug 470884
dev-libs/elfutils: build fails on uclibc
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Use asprintf+obstack_grow if obstack_printf is not available
0003-Fall-back-on-asprintf-if-obstack_printf-is-not-avail.patch (text/plain), 1.99 KB, created by
Anthony Basile
on 2013-06-09 01:31:42 UTC
(
hide
)
Description:
Use asprintf+obstack_grow if obstack_printf is not available
Filename:
MIME Type:
Creator:
Anthony Basile
Created:
2013-06-09 01:31:42 UTC
Size:
1.99 KB
patch
obsolete
>From 8e296115313b4fa5bb631a53d2670033a9016603 Mon Sep 17 00:00:00 2001 >From: "Anthony G. Basile" <blueness@gentoo.org> >Date: Sat, 8 Jun 2013 19:43:30 -0400 >Subject: [PATCH 3/6] Fall back on asprintf if obstack_printf is not available > >uClibc provides support for obstacks, but does not provide >obstack_printf. We check if obstack_printf is available, >and if it is not, we fall back on asprintf plus obstack_grow. > >This is not sufficient on libc systems which do not support obstacks >which is not part of POSIX standards. > >Signed-off-by: Anthony G. Basile <blueness@gentoo.org> >--- > configure.ac | 3 +++ > libcpu/i386_parse.y | 9 +++++++++ > src/nm.c | 9 +++++++++ > 3 files changed, 21 insertions(+), 0 deletions(-) > >diff --git a/configure.ac b/configure.ac >index 9d41918..5966453 100644 >--- a/configure.ac >+++ b/configure.ac >@@ -262,6 +262,9 @@ AC_SUBST([argp_LDADD]) > dnl Check for __mempcpy > AC_CHECK_FUNCS_ONCE([__mempcpy]) > >+dnl Chekf for obstack_printf >+AC_CHECK_FUNCS_ONCE([obstack_printf]) >+ > dnl The directories with content. > > dnl Documentation. >diff --git a/libcpu/i386_parse.y b/libcpu/i386_parse.y >index 689ba22..d567785 100644 >--- a/libcpu/i386_parse.y >+++ b/libcpu/i386_parse.y >@@ -48,6 +48,15 @@ > > #include <system.h> > >+#ifndef HAVE_OBSTACK_PRINTF >+# define obstack_printf(x, ...) ({ \ >+ char *s; \ >+ int n = asprintf(&s, __VA_ARGS__); \ >+ obstack_grow(&os, s, n); \ >+ n; \ >+}) >+#endif >+ > #define obstack_chunk_alloc xmalloc > #define obstack_chunk_free free > >diff --git a/src/nm.c b/src/nm.c >index 7aae84b..18c374a 100644 >--- a/src/nm.c >+++ b/src/nm.c >@@ -47,6 +47,15 @@ > #include <system.h> > #include "../libebl/libeblP.h" > >+/* Fall back on asprintf if we don't have obstack_printf */ >+#ifndef HAVE_OBSTACK_PRINTF >+# define obstack_printf(x, ...) ({ \ >+ char *s; \ >+ int n = asprintf(&s, __VA_ARGS__); \ >+ obstack_grow(&whereob, s, n); \ >+ n; \ >+}) >+#endif > > /* Name and version of program. */ > static void print_version (FILE *stream, struct argp_state *state); >-- >1.7.8.6 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 470884
:
348828
|
348830
|
348832
|
348908
|
349604
|
349608
|
350476
|
350478
|
350480
|
350482
|
350484
|
350486
|
376194
|
376196
|
376198
|
459426
|
459428
|
459430
|
459432
|
459434