All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/gdb: fix when gmp is installed on the host machine
@ 2022-02-19 15:43 John Keeping
  2022-03-07 21:46 ` Arnout Vandecappelle
  2022-03-17 12:18 ` Peter Korsgaard
  0 siblings, 2 replies; 3+ messages in thread
From: John Keeping @ 2022-02-19 15:43 UTC (permalink / raw)
  To: buildroot; +Cc: John Keeping

gdb's AC_LIB_HAVE_LINKFLAGS macro hardcodes a search starting with
/usr/lib/ which can lead to libgmp from the wrong architecture with the
result that the test fails.  Even if a libgmp is found there it is now
the one that should be used.

This is the same macro used for expat and lzma for which there are
already specific CONF_OPTS flags added here.  Add the same flag for
libgmp and move the handling down so that it is logically grouped with
the other similar options.

Note that there is no --with(out)-gmp flag to configure, as the
dependency is mandatory, so only the --with-libgmp-prefix option is
specified.

Signed-off-by: John Keeping <john@metanate.com>
---
 package/gdb/gdb.mk | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/package/gdb/gdb.mk b/package/gdb/gdb.mk
index 05de3c14d1..9bde2beea1 100644
--- a/package/gdb/gdb.mk
+++ b/package/gdb/gdb.mk
@@ -77,14 +77,6 @@ ifeq ($(BR2_GDB_VERSION_11),y)
 HOST_GDB_DEPENDENCIES += host-gmp
 endif
 
-# When BR2_GDB_VERSION_11=y (because it's enabled for the host) and
-# we're building the full gdb for the target, we need gmp as a
-# dependency. For now the default gdb version in Buildroot doesn't
-# require gmp.
-ifeq ($(BR2_GDB_VERSION_11)$(BR2_PACKAGE_GDB_DEBUGGER),yy)
-GDB_DEPENDENCIES += gmp
-endif
-
 # When gdb sources are fetched from the binutils-gdb repository, they
 # also contain the binutils sources, but binutils shouldn't be built,
 # so we disable it (additionally the option --disable-install-libbfd
@@ -169,6 +161,16 @@ GDB_CONF_OPTS += \
 	--without-curses
 endif
 
+# When BR2_GDB_VERSION_11=y (because it's enabled for the host) and
+# we're building the full gdb for the target, we need gmp as a
+# dependency. For now the default gdb version in Buildroot doesn't
+# require gmp.
+ifeq ($(BR2_GDB_VERSION_11)$(BR2_PACKAGE_GDB_DEBUGGER),yy)
+GDB_CONF_OPTS += \
+	--with-libgmp-prefix=$(STAGING_DIR)/usr
+GDB_DEPENDENCIES += gmp
+endif
+
 ifeq ($(BR2_PACKAGE_GDB_SERVER),y)
 GDB_CONF_OPTS += --enable-gdbserver
 GDB_DEPENDENCIES += $(TARGET_NLS_DEPENDENCIES)
-- 
2.35.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH] package/gdb: fix when gmp is installed on the host machine
  2022-02-19 15:43 [Buildroot] [PATCH] package/gdb: fix when gmp is installed on the host machine John Keeping
@ 2022-03-07 21:46 ` Arnout Vandecappelle
  2022-03-17 12:18 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Arnout Vandecappelle @ 2022-03-07 21:46 UTC (permalink / raw)
  To: John Keeping, buildroot



On 19/02/2022 16:43, John Keeping wrote:
> gdb's AC_LIB_HAVE_LINKFLAGS macro hardcodes a search starting with
> /usr/lib/ which can lead to libgmp from the wrong architecture with the
> result that the test fails.  Even if a libgmp is found there it is now
> the one that should be used.
> 
> This is the same macro used for expat and lzma for which there are
> already specific CONF_OPTS flags added here.  Add the same flag for
> libgmp and move the handling down so that it is logically grouped with
> the other similar options.
> 
> Note that there is no --with(out)-gmp flag to configure, as the
> dependency is mandatory, so only the --with-libgmp-prefix option is
> specified.
> 
> Signed-off-by: John Keeping <john@metanate.com>

  Applied to master, thanks.

  Regards,
  Arnout

> ---
>   package/gdb/gdb.mk | 18 ++++++++++--------
>   1 file changed, 10 insertions(+), 8 deletions(-)
> 
> diff --git a/package/gdb/gdb.mk b/package/gdb/gdb.mk
> index 05de3c14d1..9bde2beea1 100644
> --- a/package/gdb/gdb.mk
> +++ b/package/gdb/gdb.mk
> @@ -77,14 +77,6 @@ ifeq ($(BR2_GDB_VERSION_11),y)
>   HOST_GDB_DEPENDENCIES += host-gmp
>   endif
>   
> -# When BR2_GDB_VERSION_11=y (because it's enabled for the host) and
> -# we're building the full gdb for the target, we need gmp as a
> -# dependency. For now the default gdb version in Buildroot doesn't
> -# require gmp.
> -ifeq ($(BR2_GDB_VERSION_11)$(BR2_PACKAGE_GDB_DEBUGGER),yy)
> -GDB_DEPENDENCIES += gmp
> -endif
> -
>   # When gdb sources are fetched from the binutils-gdb repository, they
>   # also contain the binutils sources, but binutils shouldn't be built,
>   # so we disable it (additionally the option --disable-install-libbfd
> @@ -169,6 +161,16 @@ GDB_CONF_OPTS += \
>   	--without-curses
>   endif
>   
> +# When BR2_GDB_VERSION_11=y (because it's enabled for the host) and
> +# we're building the full gdb for the target, we need gmp as a
> +# dependency. For now the default gdb version in Buildroot doesn't
> +# require gmp.
> +ifeq ($(BR2_GDB_VERSION_11)$(BR2_PACKAGE_GDB_DEBUGGER),yy)
> +GDB_CONF_OPTS += \
> +	--with-libgmp-prefix=$(STAGING_DIR)/usr
> +GDB_DEPENDENCIES += gmp
> +endif
> +
>   ifeq ($(BR2_PACKAGE_GDB_SERVER),y)
>   GDB_CONF_OPTS += --enable-gdbserver
>   GDB_DEPENDENCIES += $(TARGET_NLS_DEPENDENCIES)
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH] package/gdb: fix when gmp is installed on the host machine
  2022-02-19 15:43 [Buildroot] [PATCH] package/gdb: fix when gmp is installed on the host machine John Keeping
  2022-03-07 21:46 ` Arnout Vandecappelle
@ 2022-03-17 12:18 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2022-03-17 12:18 UTC (permalink / raw)
  To: John Keeping; +Cc: buildroot

>>>>> "John" == John Keeping <john@metanate.com> writes:

 > gdb's AC_LIB_HAVE_LINKFLAGS macro hardcodes a search starting with
 > /usr/lib/ which can lead to libgmp from the wrong architecture with the
 > result that the test fails.  Even if a libgmp is found there it is now
 > the one that should be used.

 > This is the same macro used for expat and lzma for which there are
 > already specific CONF_OPTS flags added here.  Add the same flag for
 > libgmp and move the handling down so that it is logically grouped with
 > the other similar options.

 > Note that there is no --with(out)-gmp flag to configure, as the
 > dependency is mandatory, so only the --with-libgmp-prefix option is
 > specified.

 > Signed-off-by: John Keeping <john@metanate.com>

Committed to 2021.11.x, thanks.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

end of thread, other threads:[~2022-03-17 12:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-19 15:43 [Buildroot] [PATCH] package/gdb: fix when gmp is installed on the host machine John Keeping
2022-03-07 21:46 ` Arnout Vandecappelle
2022-03-17 12:18 ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.