public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] bfd: Fix regression when building bfd on mingw32
@ 2015-07-20 19:14 Iain Buclaw
  2015-08-04 15:42 ` Joel Brobecker
  0 siblings, 1 reply; 7+ messages in thread
From: Iain Buclaw @ 2015-07-20 19:14 UTC (permalink / raw)
  To: gdb-patches, lgustavo

[-- 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)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] bfd: Fix regression when building bfd on mingw32
  2015-07-20 19:14 [PATCH] bfd: Fix regression when building bfd on mingw32 Iain Buclaw
@ 2015-08-04 15:42 ` Joel Brobecker
  2015-08-04 15:51   ` Iain Buclaw
  0 siblings, 1 reply; 7+ messages in thread
From: Joel Brobecker @ 2015-08-04 15:42 UTC (permalink / raw)
  To: Iain Buclaw; +Cc: gdb-patches, lgustavo

Hi Iain,

Thanks for the patch. I've been trying to reproduce, but haven't
had much luck so far, not sure why.

In the meantime, this patch touches bfd, so it needs to be sent
to binutils@ instead.

Thanks!

On Mon, Jul 20, 2015 at 09:14:04PM +0200, Iain Buclaw wrote:
> 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
> ---

> 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)


-- 
Joel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] bfd: Fix regression when building bfd on mingw32
  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
  0 siblings, 2 replies; 7+ messages in thread
From: Iain Buclaw @ 2015-08-04 15:51 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: GDB Patches, Luis Machado

On 4 August 2015 at 17:41, Joel Brobecker <brobecker@adacore.com> wrote:
> Hi Iain,
>
> Thanks for the patch. I've been trying to reproduce, but haven't
> had much luck so far, not sure why.
>
> In the meantime, this patch touches bfd, so it needs to be sent
> to binutils@ instead.
>
> Thanks!
>

Hi Joel,

Actually, I got redirected to the binutils ml in the other thread,
it's already been submitted and pushed in.

https://sourceware.org/ml/binutils/2015-07/msg00305.html
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=d6f1bafa2c05241b89c0303a9f6a2af89f51c39c

So if you are having difficulties reproducing...

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] bfd: Fix regression when building bfd on mingw32
  2015-08-04 15:51   ` Iain Buclaw
@ 2015-08-04 15:54     ` Joel Brobecker
  2015-08-04 15:55     ` Pedro Alves
  1 sibling, 0 replies; 7+ messages in thread
From: Joel Brobecker @ 2015-08-04 15:54 UTC (permalink / raw)
  To: Iain Buclaw; +Cc: GDB Patches, Luis Machado

> Actually, I got redirected to the binutils ml in the other thread,
> it's already been submitted and pushed in.
> 
> https://sourceware.org/ml/binutils/2015-07/msg00305.html
> https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=d6f1bafa2c05241b89c0303a9f6a2af89f51c39c

Ah, wonderful, thank you! (catching up after a week away)

-- 
Joel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] bfd: Fix regression when building bfd on mingw32
  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
  1 sibling, 1 reply; 7+ messages in thread
From: Pedro Alves @ 2015-08-04 15:55 UTC (permalink / raw)
  To: Iain Buclaw, Joel Brobecker; +Cc: GDB Patches, Luis Machado

On 08/04/2015 04:51 PM, Iain Buclaw wrote:

> Actually, I got redirected to the binutils ml in the other thread,
> it's already been submitted and pushed in.
> 
> https://sourceware.org/ml/binutils/2015-07/msg00305.html
> https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=d6f1bafa2c05241b89c0303a9f6a2af89f51c39c
> 
> So if you are having difficulties reproducing...

I think this should be pushed to the 7.10 branch as well.
Could you handle that?

Thanks,
Pedro Alves

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] bfd: Fix regression when building bfd on mingw32
  2015-08-04 15:55     ` Pedro Alves
@ 2015-08-04 16:09       ` Iain Buclaw
  2015-08-04 16:14         ` Pedro Alves
  0 siblings, 1 reply; 7+ messages in thread
From: Iain Buclaw @ 2015-08-04 16:09 UTC (permalink / raw)
  To: Pedro Alves; +Cc: Joel Brobecker, GDB Patches, Luis Machado

On 4 August 2015 at 17:55, Pedro Alves <palves@redhat.com> wrote:
> On 08/04/2015 04:51 PM, Iain Buclaw wrote:
>
>> Actually, I got redirected to the binutils ml in the other thread,
>> it's already been submitted and pushed in.
>>
>> https://sourceware.org/ml/binutils/2015-07/msg00305.html
>> https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=d6f1bafa2c05241b89c0303a9f6a2af89f51c39c
>>
>> So if you are having difficulties reproducing...
>
> I think this should be pushed to the 7.10 branch as well.
> Could you handle that?
>
> Thanks,
> Pedro Alves
>

Will have to wait until this evening if that's OK.  Is there a general
guideline on pushing patches to branch?  I assume that you don't do
anything fancy with git such as merge or cherry-pick.

Regards
Iain

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] bfd: Fix regression when building bfd on mingw32
  2015-08-04 16:09       ` Iain Buclaw
@ 2015-08-04 16:14         ` Pedro Alves
  0 siblings, 0 replies; 7+ messages in thread
From: Pedro Alves @ 2015-08-04 16:14 UTC (permalink / raw)
  To: Iain Buclaw; +Cc: Joel Brobecker, GDB Patches, Luis Machado

On 08/04/2015 05:09 PM, Iain Buclaw wrote:

> Will have to wait until this evening if that's OK.  

That's super fine.

> Is there a general
> guideline on pushing patches to branch?  I assume that you don't do
> anything fancy with git such as merge or cherry-pick.

Nothing fancy.  non-fast-forward merges are disabled, the server
rejects them.  So to push to branch, simply rebase the patch on top of
the branch and then push to it.  cherry-picking is fine as it's just a
way to get the patch in the first place.

Thanks,
Pedro Alves

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-08-04 16:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-20 19:14 [PATCH] bfd: Fix regression when building bfd on mingw32 Iain Buclaw
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).