diff mbox

[3/3] package/gcc: align gcc-final configure-cmds to the generic ones

Message ID 4d9f7a6896c496372a4f415987e60eeeac79225b.1448202976.git.yann.morin.1998@free.fr
State Rejected
Headers show

Commit Message

Yann E. MORIN Nov. 22, 2015, 2:39 p.m. UTC
Since 7d6c79 (Compile static versions of gcc libraries) was applied, the
generic configure commands have been updated, but those changes have not
been propagated to the gcc-final custom configure commands.

Update the gcc-final custom configure commands to better match the
generic ones.

We do not propagate --disable-dependency-tracking because it breaks the
build, and --enable-shared (because of 169141a).

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 package/gcc/gcc-final/gcc-final.mk | 25 ++++++++++++++++++++-----
 1 file changed, 20 insertions(+), 5 deletions(-)

Comments

Arnout Vandecappelle Nov. 22, 2015, 8:59 p.m. UTC | #1
On 22-11-15 15:39, Yann E. MORIN wrote:
> Since 7d6c79 (Compile static versions of gcc libraries) was applied, the
> generic configure commands have been updated, but those changes have not
> been propagated to the gcc-final custom configure commands.
> 
> Update the gcc-final custom configure commands to better match the
> generic ones.
> 
> We do not propagate --disable-dependency-tracking because it breaks the
> build, and --enable-shared (because of 169141a).
> 
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---
>  package/gcc/gcc-final/gcc-final.mk | 25 ++++++++++++++++++++-----
>  1 file changed, 20 insertions(+), 5 deletions(-)
> 
> diff --git a/package/gcc/gcc-final/gcc-final.mk b/package/gcc/gcc-final/gcc-final.mk
> index dbdb615..53199c3 100644
> --- a/package/gcc/gcc-final/gcc-final.mk
> +++ b/package/gcc/gcc-final/gcc-final.mk
> @@ -36,16 +36,31 @@ HOST_GCC_FINAL_PRE_CONFIGURE_HOOKS += HOST_GCC_CONFIGURE_SYMLINK
>  #
>  # So we must completely override the generic commands and provide our own.
>  #
> +# Except for --disable-dependency-tracking which breaks the build, and
> +# --enable-shared (see 169141a, gcc-final: disable shared build for
> +# static), we reproduce the exact same command as the autotools infra
> +# uses.
> +#
>  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 \
> +	$(HOST_CONFIGURE_OPTS) \
> +	CFLAGS="$(HOST_CFLAGS)" \
> +	LDFLAGS="$(HOST_LDFLAGS)" \
> +	$(HOST_GCC_FINAL_CONF_ENV) \

 I do agree with the whitespace change.

> +	CONFIG_SITE=/dev/null \

 This makes sense to me as well.

> +	./configure \
>  		--prefix="$(HOST_DIR)/usr" \
>  		--sysconfdir="$(HOST_DIR)/etc" \
> +		--localstatedir="$(HOST_DIR)/var" \

 This one is pointless but harmless.

>  		--enable-static \
> +		--disable-gtk-doc \
> +		--disable-gtk-doc-html \
> +		--disable-doc \
> +		--disable-docs \
> +		--disable-documentation \
> +		--disable-debug \
> +		--with-xmlto=no \
> +		--with-fop=no \

 But all of this gains us nothing IMHO, and is in a way harmful because it will
produce warnings. We accept those warnings for the generic configure commands
because it gives us the advantage of avoiding that we forget to add them when
creating a package, but in this case I really don't see the point.


 Regards,
 Arnout

>  		$(QUIET) $(HOST_GCC_FINAL_CONF_OPTS) \
>  	)
>  endef
>
Yann E. MORIN Nov. 22, 2015, 9:02 p.m. UTC | #2
Arnout, All,

On 2015-11-22 21:59 +0100, Arnout Vandecappelle spake thusly:
> On 22-11-15 15:39, Yann E. MORIN wrote:
> > Since 7d6c79 (Compile static versions of gcc libraries) was applied, the
> > generic configure commands have been updated, but those changes have not
> > been propagated to the gcc-final custom configure commands.
> > 
> > Update the gcc-final custom configure commands to better match the
> > generic ones.
> > 
> > We do not propagate --disable-dependency-tracking because it breaks the
> > build, and --enable-shared (because of 169141a).
> > 
> > Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> > Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> > ---
> >  package/gcc/gcc-final/gcc-final.mk | 25 ++++++++++++++++++++-----
> >  1 file changed, 20 insertions(+), 5 deletions(-)
> > 
> > diff --git a/package/gcc/gcc-final/gcc-final.mk b/package/gcc/gcc-final/gcc-final.mk
> > index dbdb615..53199c3 100644
> > --- a/package/gcc/gcc-final/gcc-final.mk
> > +++ b/package/gcc/gcc-final/gcc-final.mk
> > @@ -36,16 +36,31 @@ HOST_GCC_FINAL_PRE_CONFIGURE_HOOKS += HOST_GCC_CONFIGURE_SYMLINK
> >  #
> >  # So we must completely override the generic commands and provide our own.
> >  #
> > +# Except for --disable-dependency-tracking which breaks the build, and
> > +# --enable-shared (see 169141a, gcc-final: disable shared build for
> > +# static), we reproduce the exact same command as the autotools infra
> > +# uses.
> > +#
> >  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 \
> > +	$(HOST_CONFIGURE_OPTS) \
> > +	CFLAGS="$(HOST_CFLAGS)" \
> > +	LDFLAGS="$(HOST_LDFLAGS)" \
> > +	$(HOST_GCC_FINAL_CONF_ENV) \
> 
>  I do agree with the whitespace change.
> 
> > +	CONFIG_SITE=/dev/null \
> 
>  This makes sense to me as well.
> 
> > +	./configure \
> >  		--prefix="$(HOST_DIR)/usr" \
> >  		--sysconfdir="$(HOST_DIR)/etc" \
> > +		--localstatedir="$(HOST_DIR)/var" \
> 
>  This one is pointless but harmless.
> 
> >  		--enable-static \
> > +		--disable-gtk-doc \
> > +		--disable-gtk-doc-html \
> > +		--disable-doc \
> > +		--disable-docs \
> > +		--disable-documentation \
> > +		--disable-debug \
> > +		--with-xmlto=no \
> > +		--with-fop=no \
> 
>  But all of this gains us nothing IMHO, and is in a way harmful because it will
> produce warnings. We accept those warnings for the generic configure commands
> because it gives us the advantage of avoiding that we forget to add them when
> creating a package, but in this case I really don't see the point.

The point is to diverge as little as possible from the generic command.

Even if some options are useless, or cause the same warning as if we
were using the generic command, they are replicated here. Only those
options we really do not want are omitted.

Regards,
Yann E. MORIN.
Thomas Petazzoni Nov. 23, 2015, 8:14 p.m. UTC | #3
Yann,

On Sun, 22 Nov 2015 15:39:43 +0100, Yann E. MORIN wrote:
> Since 7d6c79 (Compile static versions of gcc libraries) was applied, the
> generic configure commands have been updated, but those changes have not
> been propagated to the gcc-final custom configure commands.
> 
> Update the gcc-final custom configure commands to better match the
> generic ones.
> 
> We do not propagate --disable-dependency-tracking because it breaks the
> build, and --enable-shared (because of 169141a).
> 
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

A little bit like Arnout, I am not sure to see the value of fully
aligning the configure commands just for the sake of it.

Another possibility is to add a mechanism in the infra to exclude some
generic config options from being used. But I tend to hate package
infrastructure that are needed only for one package, especially when
there is a way of not changing the infrastructure (which is the case
here).

Thomas
Yann E. MORIN Nov. 24, 2015, 6:39 p.m. UTC | #4
Thomas, All,

On 2015-11-23 21:14 +0100, Thomas Petazzoni spake thusly:
> On Sun, 22 Nov 2015 15:39:43 +0100, Yann E. MORIN wrote:
> > Since 7d6c79 (Compile static versions of gcc libraries) was applied, the
> > generic configure commands have been updated, but those changes have not
> > been propagated to the gcc-final custom configure commands.
> > 
> > Update the gcc-final custom configure commands to better match the
> > generic ones.
> > 
> > We do not propagate --disable-dependency-tracking because it breaks the
> > build, and --enable-shared (because of 169141a).
> > 
> > Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> > Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> 
> A little bit like Arnout, I am not sure to see the value of fully
> aligning the configure commands just for the sake of it.

My reasoning is that, when we update the ./configure command in the
infra, it's always for a good reason. The current set of options is the
result of many successive fixes to so many build failures and corner
cases, that we applied over time, and that we know ensure a proper
build, hopefully in even the harshest conditions.

It seems logical that we propagate those options to all packages that
have to override the ./configure command (unless said options actually
prevent the package from building, obviously). For gcc, we already know
that the additional options (except the omitted ones) are not causing
problems when building gcc-initial, at least (and I actually tested that
they did not cause build failures in gcc-final either, on: arm, mips,
i386 and xtensa).

That way, when we update the command in the infra, we can easily
propagate it down to overriding packages.

> Another possibility is to add a mechanism in the infra to exclude some
> generic config options from being used. But I tend to hate package
> infrastructure that are needed only for one package, especially when
> there is a way of not changing the infrastructure (which is the case
> here).

Let's see how many autotools packages do redefine their ./configure
command:

    $ git grep -l -E 'eval \$\((host-)?autotools-package' |wc -l
    1055

So, we have roughly 1055 (minus the manual) packages using the autotools
(or the host-autotools) infra.

    $ grep CONFIGURE_CMDS $(git grep -l -E 'eval \$\((host-)?autotools-package') |wc -l
    10

So, we have 8 (one hit is in the manual, one in a comment) packages that
override their ./configure command, with the associated reason:

  - berkeleydb: does not support in-tree build

  - fbv:        does not support cross-compilation

  - ffmpeg:     does not support --target and such

  - gcc-final:  needs --enable-static and not --enable-shared, does not
                support in-tree build, misses options from the infra

  - glibc:      does not support in-tree build, needs bash to execute
                ./configure, needs -O2 in CFLAGS, touches two files
                after the ./configure, uses extra options and misses
                some from the infra

  - libgtk3:    host variant redefines all of the configure, build and
                install commands, to build just the strictly required
                stuff

  - libplayer:  does not support --target and --host

  - mdadm:      does nothing!

So, it seems we could go with some cleanup there (any taker?):

  - fbv, ffmpeg, libplayer, mdadm:
                are not autotools packages, should be switched to the
                generic package infrastructure

  - libgtk3:    host variant should be switched to the generic package
                infrastructure

We'd be left with just three packages, berkeleydb, gcc-final and glibc.
The common symptom for all three in the inability to build in-tree.
Wecould probably ad dsupport for this in the gneeric infra, but it does
not make sense to work on the infra just for those three cases, when you
have a series do it so unconditionally, and for all the infras.

So, only gcc-final needs to ditch one option. It does not make sense to
add support in the infra just for this case.

Regards,
Yann E. MORIN.
Yann E. MORIN Dec. 29, 2015, 10:06 p.m. UTC | #5
Me, All,

On 2015-11-22 15:39 +0100, Yann E. MORIN spake thusly:
> Since 7d6c79 (Compile static versions of gcc libraries) was applied, the
> generic configure commands have been updated, but those changes have not
> been propagated to the gcc-final custom configure commands.
> 
> Update the gcc-final custom configure commands to better match the
> generic ones.
> 
> We do not propagate --disable-dependency-tracking because it breaks the
> build, and --enable-shared (because of 169141a).
> 
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Rejected. ;-p

Regards,
Yann E. MORIN.

> ---
>  package/gcc/gcc-final/gcc-final.mk | 25 ++++++++++++++++++++-----
>  1 file changed, 20 insertions(+), 5 deletions(-)
> 
> diff --git a/package/gcc/gcc-final/gcc-final.mk b/package/gcc/gcc-final/gcc-final.mk
> index dbdb615..53199c3 100644
> --- a/package/gcc/gcc-final/gcc-final.mk
> +++ b/package/gcc/gcc-final/gcc-final.mk
> @@ -36,16 +36,31 @@ HOST_GCC_FINAL_PRE_CONFIGURE_HOOKS += HOST_GCC_CONFIGURE_SYMLINK
>  #
>  # So we must completely override the generic commands and provide our own.
>  #
> +# Except for --disable-dependency-tracking which breaks the build, and
> +# --enable-shared (see 169141a, gcc-final: disable shared build for
> +# static), we reproduce the exact same command as the autotools infra
> +# uses.
> +#
>  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 \
> +	$(HOST_CONFIGURE_OPTS) \
> +	CFLAGS="$(HOST_CFLAGS)" \
> +	LDFLAGS="$(HOST_LDFLAGS)" \
> +	$(HOST_GCC_FINAL_CONF_ENV) \
> +	CONFIG_SITE=/dev/null \
> +	./configure \
>  		--prefix="$(HOST_DIR)/usr" \
>  		--sysconfdir="$(HOST_DIR)/etc" \
> +		--localstatedir="$(HOST_DIR)/var" \
>  		--enable-static \
> +		--disable-gtk-doc \
> +		--disable-gtk-doc-html \
> +		--disable-doc \
> +		--disable-docs \
> +		--disable-documentation \
> +		--disable-debug \
> +		--with-xmlto=no \
> +		--with-fop=no \
>  		$(QUIET) $(HOST_GCC_FINAL_CONF_OPTS) \
>  	)
>  endef
> -- 
> 1.9.1
>
diff mbox

Patch

diff --git a/package/gcc/gcc-final/gcc-final.mk b/package/gcc/gcc-final/gcc-final.mk
index dbdb615..53199c3 100644
--- a/package/gcc/gcc-final/gcc-final.mk
+++ b/package/gcc/gcc-final/gcc-final.mk
@@ -36,16 +36,31 @@  HOST_GCC_FINAL_PRE_CONFIGURE_HOOKS += HOST_GCC_CONFIGURE_SYMLINK
 #
 # So we must completely override the generic commands and provide our own.
 #
+# Except for --disable-dependency-tracking which breaks the build, and
+# --enable-shared (see 169141a, gcc-final: disable shared build for
+# static), we reproduce the exact same command as the autotools infra
+# uses.
+#
 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 \
+	$(HOST_CONFIGURE_OPTS) \
+	CFLAGS="$(HOST_CFLAGS)" \
+	LDFLAGS="$(HOST_LDFLAGS)" \
+	$(HOST_GCC_FINAL_CONF_ENV) \
+	CONFIG_SITE=/dev/null \
+	./configure \
 		--prefix="$(HOST_DIR)/usr" \
 		--sysconfdir="$(HOST_DIR)/etc" \
+		--localstatedir="$(HOST_DIR)/var" \
 		--enable-static \
+		--disable-gtk-doc \
+		--disable-gtk-doc-html \
+		--disable-doc \
+		--disable-docs \
+		--disable-documentation \
+		--disable-debug \
+		--with-xmlto=no \
+		--with-fop=no \
 		$(QUIET) $(HOST_GCC_FINAL_CONF_OPTS) \
 	)
 endef