Message ID | 20210917162332.3511179-2-alex.bennee@linaro.org |
---|---|
State | New |
Headers | show |
Series | testing and plugin pre-PR (configure, gitlab, plugins) | expand |
On Fri, Sep 17, 2021 at 10:23 AM Alex Bennée <alex.bennee@linaro.org> wrote: > There are not many cases you would want to do this but one is if you > want to use a test friendly compiler like gcc instead of a system > compiler like clang. Either way we should honour the users choice if > they have made it. > > Signed-off-by: Alex Bennée <alex.bennee@linaro.org> > Cc: Warner Losh <imp@bsdimp.com> > --- > configure | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > Reviewed-by: Warner Losh <imp@bsdimp.com> > diff --git a/configure b/configure > index 1043ccce4f..049c50a933 100755 > --- a/configure > +++ b/configure > @@ -1686,8 +1686,11 @@ case "$cpu" in > # No special flags required for other host CPUs > esac > > -eval "cross_cc_${cpu}=\$cc" > -cross_cc_vars="$cross_cc_vars cross_cc_${cpu}" > +if eval test -z "\${cross_cc_$cpu}"; then > + eval "cross_cc_${cpu}=\$cc" > + cross_cc_vars="$cross_cc_vars cross_cc_${cpu}" > +fi > + > QEMU_CFLAGS="$CPU_CFLAGS $QEMU_CFLAGS" > > # For user-mode emulation the host arch has to be one we explicitly > -- > 2.30.2 > > <div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Sep 17, 2021 at 10:23 AM Alex Bennée <<a href="mailto:alex.bennee@linaro.org">alex.bennee@linaro.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">There are not many cases you would want to do this but one is if you<br> want to use a test friendly compiler like gcc instead of a system<br> compiler like clang. Either way we should honour the users choice if<br> they have made it.<br> <br> Signed-off-by: Alex Bennée <<a href="mailto:alex.bennee@linaro.org" target="_blank">alex.bennee@linaro.org</a>><br> Cc: Warner Losh <<a href="mailto:imp@bsdimp.com" target="_blank">imp@bsdimp.com</a>><br> ---<br> configure | 7 +++++--<br> 1 file changed, 5 insertions(+), 2 deletions(-)<br></blockquote><div><br></div><div>Reviewed-by: Warner Losh <<a href="mailto:imp@bsdimp.com">imp@bsdimp.com</a>></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> diff --git a/configure b/configure<br> index 1043ccce4f..049c50a933 100755<br> --- a/configure<br> +++ b/configure<br> @@ -1686,8 +1686,11 @@ case "$cpu" in<br> # No special flags required for other host CPUs<br> esac<br> <br> -eval "cross_cc_${cpu}=\$cc"<br> -cross_cc_vars="$cross_cc_vars cross_cc_${cpu}"<br> +if eval test -z "\${cross_cc_$cpu}"; then<br> + eval "cross_cc_${cpu}=\$cc"<br> + cross_cc_vars="$cross_cc_vars cross_cc_${cpu}"<br> +fi<br> +<br> QEMU_CFLAGS="$CPU_CFLAGS $QEMU_CFLAGS"<br> <br> # For user-mode emulation the host arch has to be one we explicitly<br> -- <br> 2.30.2<br> <br> </blockquote></div></div>
On Fri, 17 Sept 2021 at 12:27, Alex Bennée <alex.bennee@linaro.org> wrote: > > There are not many cases you would want to do this but one is if you > want to use a test friendly compiler like gcc instead of a system > compiler like clang. Either way we should honour the users choice if > they have made it. A little bit of a tangent, but I'm curious about this comment - what aspects of GCC make it more test friendly? (I help maintain LLVM tools on FreeBSD, and would like to make sure they provide as good an experience as possible.)
Ed Maste <emaste@freebsd.org> writes: > On Fri, 17 Sept 2021 at 12:27, Alex Bennée <alex.bennee@linaro.org> wrote: >> >> There are not many cases you would want to do this but one is if you >> want to use a test friendly compiler like gcc instead of a system >> compiler like clang. Either way we should honour the users choice if >> they have made it. > > A little bit of a tangent, but I'm curious about this comment - what > aspects of GCC make it more test friendly? (I help maintain LLVM tools > on FreeBSD, and would like to make sure they provide as good an > experience as possible.) Some of the inline assembler in the old tests trips up LLVM. There is a chance the inline assembly is a bit bogus with it's constraints and GCC is just a bit more lax and accepting. I'm totally fine with merging something that restores support for clang for building tests it just needs the appropriate fixups to the tests. We already use clang for the hexagon builds after all. Once that is done we can drop the stuff in cf22f936f2 (tests/tcg: don't allow clang as a cross compiler). -- Alex Bennée
diff --git a/configure b/configure index 1043ccce4f..049c50a933 100755 --- a/configure +++ b/configure @@ -1686,8 +1686,11 @@ case "$cpu" in # No special flags required for other host CPUs esac -eval "cross_cc_${cpu}=\$cc" -cross_cc_vars="$cross_cc_vars cross_cc_${cpu}" +if eval test -z "\${cross_cc_$cpu}"; then + eval "cross_cc_${cpu}=\$cc" + cross_cc_vars="$cross_cc_vars cross_cc_${cpu}" +fi + QEMU_CFLAGS="$CPU_CFLAGS $QEMU_CFLAGS" # For user-mode emulation the host arch has to be one we explicitly
There are not many cases you would want to do this but one is if you want to use a test friendly compiler like gcc instead of a system compiler like clang. Either way we should honour the users choice if they have made it. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Cc: Warner Losh <imp@bsdimp.com> --- configure | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) -- 2.30.2