From: Iain Buclaw <ibuclaw@gdcproject.org>
To: gdb-patches@sourceware.org, lgustavo@codesourcery.com
Subject: [PATCH] bfd: Fix regression when building bfd on mingw32
Date: Mon, 20 Jul 2015 19:14:00 -0000 [thread overview]
Message-ID: <CABOHX+fAiKiNgmns+FRY_tuNbEhvvvdQWD=LD4ENcX-O2yeaFQ@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 914 bytes --]
Hi,
This patch is as per suggestion from Pedro, I've also added a check
for vasprintf just for completeness sake, and that there is a similar
condition for HAVE_DECL_VASPRINTF in libiberty.h.
https://sourceware.org/ml/gdb-patches/2015-06/msg00654.html
As per my comments earlier, I am going blind on this, but it looks
correct to me, and I can at least verify on my machine that I can see:
configure stage
---
checking whether asprintf is declared... yes
checking whether vasprintf is declared... yes
---
config.h
---
/* Define to 1 if you have the declaration of `asprintf', and to 0 if you
don't. */
#define HAVE_DECL_ASPRINTF 1
/* Define to 1 if you have the declaration of `vasprintf', and to 0 if you
don't. */
#define HAVE_DECL_VASPRINTF 1
---
So should either one be false, they should have a proper declaration
in libiberty.h
Luis, can you check this patch is good for you?
Regards
Iain
---
[-- Attachment #2: bfd_asprintf.patch --]
[-- Type: text/x-diff, Size: 1967 bytes --]
2015-07-20 Iain Buclaw <ibuclaw@gdcproject.org>
* configure.in: Add asprintf and vasprintf to AC_CHECK_DECLS.
* config.in, configure: Regenerate.
--- a/bfd/config.in
+++ b/bfd/config.in
@@ -17,6 +17,10 @@
/* Define to 1 if you have the <alloca.h> header file. */
#undef HAVE_ALLOCA_H
+/* Define to 1 if you have the declaration of `asprintf', and to 0 if you
+ don't. */
+#undef HAVE_DECL_ASPRINTF
+
/* Define to 1 if you have the declaration of `basename', and to 0 if you
don't. */
#undef HAVE_DECL_BASENAME
@@ -72,6 +76,10 @@
*/
#undef HAVE_DECL_STRSTR
+/* Define to 1 if you have the declaration of `vasprintf', and to 0 if you
+ don't. */
+#undef HAVE_DECL_VASPRINTF
+
/* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you
don't. */
#undef HAVE_DECL_VSNPRINTF
--- a/bfd/configure
+++ b/bfd/configure
@@ -13819,6 +13819,28 @@ cat >>confdefs.h <<_ACEOF
#define HAVE_DECL_STRSTR $ac_have_decl
_ACEOF
+ac_fn_c_check_decl "$LINENO" "asprintf" "ac_cv_have_decl_asprintf" "$ac_includes_default"
+if test "x$ac_cv_have_decl_asprintf" = x""yes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_ASPRINTF $ac_have_decl
+_ACEOF
+
+ac_fn_c_check_decl "$LINENO" "vasprintf" "ac_cv_have_decl_vasprintf" "$ac_includes_default"
+if test "x$ac_cv_have_decl_vasprintf" = x""yes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_VASPRINTF $ac_have_decl
+_ACEOF
+
ac_fn_c_check_decl "$LINENO" "snprintf" "ac_cv_have_decl_snprintf" "$ac_includes_default"
if test "x$ac_cv_have_decl_snprintf" = x""yes; then :
ac_have_decl=1
--- a/bfd/configure.ac
+++ b/bfd/configure.ac
@@ -232,6 +232,8 @@ AC_CHECK_DECLS(malloc)
AC_CHECK_DECLS(realloc)
AC_CHECK_DECLS(stpcpy)
AC_CHECK_DECLS(strstr)
+AC_CHECK_DECLS(asprintf)
+AC_CHECK_DECLS(vasprintf)
AC_CHECK_DECLS(snprintf)
AC_CHECK_DECLS(vsnprintf)
AC_CHECK_DECLS(strnlen)
next reply other threads:[~2015-07-20 19:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-20 19:14 Iain Buclaw [this message]
2015-08-04 15:42 ` Joel Brobecker
2015-08-04 15:51 ` Iain Buclaw
2015-08-04 15:54 ` Joel Brobecker
2015-08-04 15:55 ` Pedro Alves
2015-08-04 16:09 ` Iain Buclaw
2015-08-04 16:14 ` Pedro Alves
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CABOHX+fAiKiNgmns+FRY_tuNbEhvvvdQWD=LD4ENcX-O2yeaFQ@mail.gmail.com' \
--to=ibuclaw@gdcproject.org \
--cc=gdb-patches@sourceware.org \
--cc=lgustavo@codesourcery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox