* [Buildroot] [PATCH] Compile static versions of gcc libraries
2013-10-10 9:40 [Buildroot] [PATCH] Compile static versions of gcc libraries Jérôme Pouiller
@ 2013-10-11 21:23 ` Thomas Petazzoni
2013-10-12 6:58 ` Jérôme Pouiller
2013-10-13 13:33 ` Thomas Petazzoni
` (2 subsequent siblings)
3 siblings, 1 reply; 8+ messages in thread
From: Thomas Petazzoni @ 2013-10-11 21:23 UTC (permalink / raw)
To: buildroot
Dear J?r?me Pouiller,
On Thu, 10 Oct 2013 11:40:42 +0200, J?r?me Pouiller wrote:
> +define HOST_GCC_FINAL_CONFIGURE_CMDS
> + (cd $(HOST_GCC_FINAL_SRCDIR) && rm -rf config.cache; \
> + $(HOST_CONFIGURE_OPTS) \
> + CFLAGS="$(HOST_CFLAGS)" \
> + LDFLAGS="$(HOST_LDFLAGS)" \
> + $(HOST_GCC_FINAL_CONF_ENV) \
> + ./configure \
> + --prefix="$(HOST_DIR)/usr" \
> + --sysconfdir="$(HOST_DIR)/etc" \
> + --enable-shared --enable-static \
> + $(QUIET) $(HOST_GCC_FINAL_CONF_OPT) \
> + )
Why aren't you simply doing:
HOST_GCC_FINAL_CONF_OPT += \
--enable-shared --enable-static
instead ?
Thanks,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 8+ messages in thread* [Buildroot] [PATCH] Compile static versions of gcc libraries
2013-10-11 21:23 ` Thomas Petazzoni
@ 2013-10-12 6:58 ` Jérôme Pouiller
0 siblings, 0 replies; 8+ messages in thread
From: Jérôme Pouiller @ 2013-10-12 6:58 UTC (permalink / raw)
To: buildroot
On Friday 11 October 2013 23:23:07 Thomas Petazzoni wrote:
> Dear J?r?me Pouiller,
>
> On Thu, 10 Oct 2013 11:40:42 +0200, J?r?me Pouiller wrote:
> > +define HOST_GCC_FINAL_CONFIGURE_CMDS
> > + (cd $(HOST_GCC_FINAL_SRCDIR) && rm -rf config.cache; \
> > + $(HOST_CONFIGURE_OPTS) \
> > + CFLAGS="$(HOST_CFLAGS)" \
> > + LDFLAGS="$(HOST_LDFLAGS)" \
> > + $(HOST_GCC_FINAL_CONF_ENV) \
> > + ./configure \
> > + --prefix="$(HOST_DIR)/usr" \
> > + --sysconfdir="$(HOST_DIR)/etc" \
> > + --enable-shared --enable-static \
> > + $(QUIET) $(HOST_GCC_FINAL_CONF_OPT) \
> > + )
>
> Why aren't you simply doing:
>
> HOST_GCC_FINAL_CONF_OPT += \
> --enable-shared --enable-static
It was the first thing I tried. In this case, ./configure is called with
--enable-shared --disable-static --enable-static.
We can think --enable-static will overload --disable-static.
config.status correctly contains enable_static=yes, but libstdc++.la
does not contains any reference to libstdc++.a and libstdc++.a is not
installed. I surely missed something.
Whatever the case, if ./configure is called without --disable-static, it
works.
--
J?r?me Pouiller, Sysmic
Embedded Linux specialist
http://www.sysmic.fr
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH] Compile static versions of gcc libraries
2013-10-10 9:40 [Buildroot] [PATCH] Compile static versions of gcc libraries Jérôme Pouiller
2013-10-11 21:23 ` Thomas Petazzoni
@ 2013-10-13 13:33 ` Thomas Petazzoni
2013-10-14 9:16 ` Jérôme Pouiller
2014-01-03 11:55 ` [Buildroot] " Baruch Siach
2014-01-11 22:47 ` [Buildroot] [PATCH] " Peter Korsgaard
3 siblings, 1 reply; 8+ messages in thread
From: Thomas Petazzoni @ 2013-10-13 13:33 UTC (permalink / raw)
To: buildroot
Dear J?r?me Pouiller,
On Thu, 10 Oct 2013 11:40:42 +0200, J?r?me Pouiller wrote:
> Since default configure options for host packages include
> --disable-static, gcc was not configured to build static version of its
> libraries (libgcc.a, libstdc++.a, ...).
I'm a bit confused, the toolchains I have here definitely do have
libgcc.a :
$ find . -name 'libgcc.a'
./host/usr/lib/gcc/sh4-buildroot-linux-uclibc/4.7.3/libgcc.a
What practical issue are you seeing?
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH] Compile static versions of gcc libraries
2013-10-13 13:33 ` Thomas Petazzoni
@ 2013-10-14 9:16 ` Jérôme Pouiller
2013-10-14 9:27 ` Thomas Petazzoni
0 siblings, 1 reply; 8+ messages in thread
From: Jérôme Pouiller @ 2013-10-14 9:16 UTC (permalink / raw)
To: buildroot
On Sunday 13 October 2013 15:33:55 Thomas Petazzoni wrote:
> Dear J?r?me Pouiller,
>
> On Thu, 10 Oct 2013 11:40:42 +0200, J?r?me Pouiller wrote:
> > Since default configure options for host packages include
> > --disable-static, gcc was not configured to build static version of
> > its libraries (libgcc.a, libstdc++.a, ...).
>
> I'm a bit confused, the toolchains I have here definitely do have
> libgcc.a :
>
> $ find . -name 'libgcc.a'
> ./host/usr/lib/gcc/sh4-buildroot-linux-uclibc/4.7.3/libgcc.a
Sorry, in contrary of what I wrote in my commit message, this does not
impact libgcc.a. However, it impacts libstdc++.a, libgomp.a,
libmudflap*.a, ...
> What practical issue are you seeing?
My main concern is libstdc++.a.
--
J?r?me Pouiller, Sysmic
Embedded Linux specialist
http://www.sysmic.fr
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH] Compile static versions of gcc libraries
2013-10-14 9:16 ` Jérôme Pouiller
@ 2013-10-14 9:27 ` Thomas Petazzoni
0 siblings, 0 replies; 8+ messages in thread
From: Thomas Petazzoni @ 2013-10-14 9:27 UTC (permalink / raw)
To: buildroot
Dear J?r?me Pouiller,
On Mon, 14 Oct 2013 11:16:08 +0200, J?r?me Pouiller wrote:
> On Sunday 13 October 2013 15:33:55 Thomas Petazzoni wrote:
> > Dear J?r?me Pouiller,
> >
> > On Thu, 10 Oct 2013 11:40:42 +0200, J?r?me Pouiller wrote:
> > > Since default configure options for host packages include
> > > --disable-static, gcc was not configured to build static version of
> > > its libraries (libgcc.a, libstdc++.a, ...).
> >
> > I'm a bit confused, the toolchains I have here definitely do have
> > libgcc.a :
> >
> > $ find . -name 'libgcc.a'
> > ./host/usr/lib/gcc/sh4-buildroot-linux-uclibc/4.7.3/libgcc.a
>
> Sorry, in contrary of what I wrote in my commit message, this does not
> impact libgcc.a. However, it impacts libstdc++.a, libgomp.a,
> libmudflap*.a, ...
>
> > What practical issue are you seeing?
> My main concern is libstdc++.a.
Ah, ok. I'll retry then and see what happens :)
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] Compile static versions of gcc libraries
2013-10-10 9:40 [Buildroot] [PATCH] Compile static versions of gcc libraries Jérôme Pouiller
2013-10-11 21:23 ` Thomas Petazzoni
2013-10-13 13:33 ` Thomas Petazzoni
@ 2014-01-03 11:55 ` Baruch Siach
2014-01-11 22:47 ` [Buildroot] [PATCH] " Peter Korsgaard
3 siblings, 0 replies; 8+ messages in thread
From: Baruch Siach @ 2014-01-03 11:55 UTC (permalink / raw)
To: buildroot
Hi J?r?me,
On Thu, Oct 10, 2013 at 11:40:42AM +0200, J?r?me Pouiller wrote:
> Since default configure options for host packages include
> --disable-static, gcc was not configured to build static version of its
> libraries (libgcc.a, libstdc++.a, ...).
>
> This patch replace --disable-static by --enable-static in configure
> command. Notice some options was removed sinces they was ignored by gcc
> configure script.
>
> Once it was compiled, this commit takes care to copy static libraries to
> $STAGING
>
> Signed-off-by: J?r?me Pouiller <jezz@sysmic.org>
Thanks. This patched fixes:
http://autobuild.buildroot.net/results/7cc/7ccbf088cac523f5cccc36d4b5edc3a45c670044/
http://autobuild.buildroot.net/results/678/678f5340f4e43fde12ff8d453ef38f76b6c89722/
Tested-by: Baruch Siach <baruch@tkos.co.il>
baruch
> ---
> package/gcc/gcc-final/gcc-final.mk | 17 +++++++++++++++++
> 1 file changed, 17 insertions(+)
>
> diff --git a/package/gcc/gcc-final/gcc-final.mk b/package/gcc/gcc-final/gcc-final.mk
> index b396382..49de481 100644
> --- a/package/gcc/gcc-final/gcc-final.mk
> +++ b/package/gcc/gcc-final/gcc-final.mk
> @@ -26,6 +26,21 @@ HOST_GCC_FINAL_SUBDIR = build
>
> HOST_GCC_FINAL_PRE_CONFIGURE_HOOKS += HOST_GCC_CONFIGURE_SYMLINK
>
> +define HOST_GCC_FINAL_CONFIGURE_CMDS
> + (cd $(HOST_GCC_FINAL_SRCDIR) && rm -rf config.cache; \
> + $(HOST_CONFIGURE_OPTS) \
> + CFLAGS="$(HOST_CFLAGS)" \
> + LDFLAGS="$(HOST_LDFLAGS)" \
> + $(HOST_GCC_FINAL_CONF_ENV) \
> + ./configure \
> + --prefix="$(HOST_DIR)/usr" \
> + --sysconfdir="$(HOST_DIR)/etc" \
> + --enable-shared --enable-static \
> + $(QUIET) $(HOST_GCC_FINAL_CONF_OPT) \
> + )
> +endef
> +
> +
> # Languages supported by the cross-compiler
> GCC_FINAL_CROSS_LANGUAGES-y = c
> GCC_FINAL_CROSS_LANGUAGES-$(BR2_INSTALL_LIBSTDCPP) += c++
> @@ -133,6 +148,8 @@ define HOST_GCC_FINAL_INSTALL_USR_LIBS
> for i in $(HOST_GCC_FINAL_USR_LIBS) ; do \
> cp -dpf $(HOST_DIR)/usr/$(GNU_TARGET_NAME)/lib*/$${i}.so* \
> $(STAGING_DIR)/usr/lib/ ; \
> + cp -dpf $(HOST_DIR)/usr/$(GNU_TARGET_NAME)/lib*/$${i}.a \
> + $(STAGING_DIR)/usr/lib/ ; \
> cp -dpf $(HOST_DIR)/usr/$(GNU_TARGET_NAME)/lib*/$${i}.so* \
> $(TARGET_DIR)/usr/lib/ ; \
> done
--
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
^ permalink raw reply [flat|nested] 8+ messages in thread* [Buildroot] [PATCH] Compile static versions of gcc libraries
2013-10-10 9:40 [Buildroot] [PATCH] Compile static versions of gcc libraries Jérôme Pouiller
` (2 preceding siblings ...)
2014-01-03 11:55 ` [Buildroot] " Baruch Siach
@ 2014-01-11 22:47 ` Peter Korsgaard
3 siblings, 0 replies; 8+ messages in thread
From: Peter Korsgaard @ 2014-01-11 22:47 UTC (permalink / raw)
To: buildroot
On Thu, Oct 10, 2013 at 11:40 AM, J?r?me Pouiller <jezz@sysmic.org> wrote:
> Since default configure options for host packages include
> --disable-static, gcc was not configured to build static version of its
> libraries (libgcc.a, libstdc++.a, ...).
>
> This patch replace --disable-static by --enable-static in configure
> command. Notice some options was removed sinces they was ignored by gcc
> configure script.
>
> Once it was compiled, this commit takes care to copy static libraries to
> $STAGING
>
> Signed-off-by: J?r?me Pouiller <jezz@sysmic.org>
Committed, thanks.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 8+ messages in thread