All of lore.kernel.org
 help / color / mirror / Atom feed
From: Giulio Benetti <giulio.benetti@benettiengineering.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v16 1/4] package/libiberty: new package
Date: Fri, 7 Feb 2020 22:44:39 +0100	[thread overview]
Message-ID: <136ad9ce-b752-8609-edcb-7a538f284691@benettiengineering.com> (raw)
In-Reply-To: <20200207023834.877032-2-aduskett@gmail.com>

Hi Adam, All,

On 2/7/20 3:38 AM, aduskett at gmail.com wrote:
> From: Adam Duskett <Aduskett@gmail.com>
> 
> Some packages, like prelink-cross, want to use libiberty but do not bundle
> their own instance (which is good!).
> 
> However, libiberty is made for being bundled in packages: all GNU
> packages that use libiberty (gcc, Binutils, gdb, et al...) all have their own
> bundled variant. This common practice means that there is no official upstream
> for libiberty, the closest being as part of the combined Binutils-gdb tree.
> 
> So we introduce a new host-only package, that installs just libiberty from a
> Binutils released tarball.
> 
> Again, as packages usually bundle libiberty, it usually only installs a static
> version. Furthermore, it does not obey the usual --enable-shared and
> --disable-static flags; it only ever builds a static version.
> 
> Furthermore, -fPIC is not used with this library, but some packages may pick it
> to build shared objects. This behavior is the case for host-gdb, for example,
> which accidentally picks that library instead of its internal one.
> 
> So, rather than fix the various gdb versions and variants we can use, we ensure
> that the libiberty we install is usable in shared objects, and we always build
> before host-gdb.
> 
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Signed-off-by: Adam Duskett <Aduskett@gmail.com>

Tested-by: Giulio Benetti <giulio.benetti@benettiengineering.com>

> ---
> Changes v15 -> v16:
>    - Cleaned up the grammar in the commit message.
> 
> Changes v1 -> v15:
>    - Add this patch to the series
> 
>   DEVELOPERS                       |  1 +
>   package/libiberty/libiberty.hash |  2 ++
>   package/libiberty/libiberty.mk   | 27 +++++++++++++++++++++++++++
>   3 files changed, 30 insertions(+)
>   create mode 100644 package/libiberty/libiberty.hash
>   create mode 100644 package/libiberty/libiberty.mk
> 
> diff --git a/DEVELOPERS b/DEVELOPERS
> index d8ea23e0b3..79ddddd9c3 100644
> --- a/DEVELOPERS
> +++ b/DEVELOPERS
> @@ -2552,6 +2552,7 @@ F:	package/keyutils/
>   F:	package/libbsd/
>   F:	package/libedit/
>   F:	package/libgsm/
> +F:	package/libiberty/
>   F:	package/libinput/
>   F:	package/libiscsi/
>   F:	package/libpri/
> diff --git a/package/libiberty/libiberty.hash b/package/libiberty/libiberty.hash
> new file mode 100644
> index 0000000000..270f38dfa7
> --- /dev/null
> +++ b/package/libiberty/libiberty.hash
> @@ -0,0 +1,2 @@
> +# From ftp://gcc.gnu.org/pub/binutils/releases/sha512.sum
> +sha512  d326408f12a03d9a61a9de56584c2af12f81c2e50d2d7e835d51565df8314df01575724afa1e43bd0db45cfc9916b41519b67dfce03232aa4978704492a6994a  binutils-2.32.tar.xz
> diff --git a/package/libiberty/libiberty.mk b/package/libiberty/libiberty.mk
> new file mode 100644
> index 0000000000..17976fdd4f
> --- /dev/null
> +++ b/package/libiberty/libiberty.mk
> @@ -0,0 +1,27 @@
> +################################################################################
> +#
> +# libiberty
> +#
> +################################################################################
> +
> +LIBIBERTY_VERSION = 2.32
> +LIBIBERTY_SOURCE = binutils-$(LIBIBERTY_VERSION).tar.xz
> +LIBIBERTY_SITE = $(BR2_GNU_MIRROR)/binutils
> +LIBIBERTY_DL_SUBDIR = binutils
> +LIBIBERTY_SUBDIR = libiberty
> +
> +# We explicitly disable multilib, as we do in binutils.
> +# By default, libiberty installs nothing, so we must force it.
> +HOST_LIBIBERTY_CONF_OPTS = \
> +	--disable-multilib \
> +	--enable-install-libiberty
> +
> +# Some packages (e.g. host-gdb) will pick this library and build shared
> +# objects with it. But libiberty does not honour the --enable-shared and
> +# --disable-static flags; it only ever builds a static library no matter
> +# what. So we must force -fPIC in build flags.
> +HOST_LIBIBERTY_CONF_ENV = \
> +	CFLAGS="$(HOST_CFLAGS) -fPIC" \
> +	LDFLAGS="$(HOST_LDFLAGS) -fPIC"
> +
> +$(eval $(host-autotools-package))
> 

-- 
Giulio Benetti
Benetti Engineering sas

  reply	other threads:[~2020-02-07 21:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-07  2:38 [Buildroot] [PATCH v16 0/4] package/gobject-introspection: new package aduskett at gmail.com
2020-02-07  2:38 ` [Buildroot] [PATCH v16 1/4] package/libiberty: " aduskett at gmail.com
2020-02-07 21:44   ` Giulio Benetti [this message]
2020-02-07  2:38 ` [Buildroot] [PATCH v16 2/4] package/gdb: depend on libiberty aduskett at gmail.com
2020-02-07 21:45   ` Giulio Benetti
2020-02-07  2:38 ` [Buildroot] [PATCH v16 3/4] package/prelink-cross: new package aduskett at gmail.com
2020-02-07 21:45   ` Giulio Benetti
2020-02-07  2:38 ` [Buildroot] [PATCH v16 4/4] package/gobject-introspection: " aduskett at gmail.com
2020-02-07 21:45   ` Giulio Benetti
2020-02-08 19:14     ` Giulio Benetti
2020-02-07 21:34 ` [Buildroot] [PATCH v16 0/4] " Giulio Benetti

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=136ad9ce-b752-8609-edcb-7a538f284691@benettiengineering.com \
    --to=giulio.benetti@benettiengineering.com \
    --cc=buildroot@busybox.net \
    /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 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.