[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/2] build: Move TARGET_* assignments earlier
From: |
John Paul Adrian Glaubitz |
Subject: |
Re: [PATCH 1/2] build: Move TARGET_* assignments earlier |
Date: |
Sun, 23 Feb 2020 15:28:24 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 |
On 2/20/20 7:51 AM, Matt Turner wrote:
> From: Mike Gilbert <address@hidden>
>
> On a 32-bit SPARC userland, configure fails to compile assembly and the
> build fails:
>
> checking for options to compile assembly... configure: error: could not
> compile assembly
>
> config.log shows:
>
> asm-tests/sparc64.S: Assembler messages:
> asm-tests/sparc64.S:5: Error: Architecture mismatch on "lduw [%o4+4],%o4".
> asm-tests/sparc64.S:5: (Requires v9|v9a|v9b|v9c|v9d|v9e|v9v|v9m|m8;
> requested architecture is sparclite.)
> asm-tests/sparc64.S:7: Error: Architecture mismatch on "stw %o5,[%o3]".
> asm-tests/sparc64.S:7: (Requires v9|v9a|v9b|v9c|v9d|v9e|v9v|v9m|m8;
> requested architecture is sparclite.)
> asm-tests/sparc64.S:8: Error: Architecture mismatch on "bne,pt %icc,1b
> ,pt %icc,1b".
> asm-tests/sparc64.S:8: (Requires v9|v9a|v9b|v9c|v9d|v9e|v9v|v9m|m8;
> requested architecture is sparclite.)
>
> Simply moving these blocks earlier in configure.ac is sufficient to
> ensure that the tests are executed with the appropriate flags
> (specifically -m64 in this case).
>
> Bug: https://bugs.gentoo.org/667850
> ---
> configure.ac | 36 ++++++++++++++++++------------------
> 1 file changed, 18 insertions(+), 18 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index e07ba4b56..b5e31c787 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -562,6 +562,24 @@ CPPFLAGS="$TARGET_CPPFLAGS"
> LDFLAGS="$TARGET_LDFLAGS"
> LIBS=""
>
> +if test "x$target_m32" = x1; then
> + # Force 32-bit mode.
> + TARGET_CFLAGS="$TARGET_CFLAGS -m32"
> + TARGET_CCASFLAGS="$TARGET_CCASFLAGS -m32"
> + TARGET_CPPFLAGS="$TARGET_CPPFLAGS -m32"
> + TARGET_LDFLAGS="$TARGET_LDFLAGS -m32"
> + TARGET_MODULE_FORMAT="elf32"
> +fi
> +
> +if test "x$target_m64" = x1; then
> + # Force 64-bit mode.
> + TARGET_CFLAGS="$TARGET_CFLAGS -m64"
> + TARGET_CCASFLAGS="$TARGET_CCASFLAGS -m64"
> + TARGET_CPPFLAGS="$TARGET_CPPFLAGS -m64"
> + TARGET_LDFLAGS="$TARGET_LDFLAGS -m64"
> + TARGET_MODULE_FORMAT="elf64"
> +fi
> +
> # debug flags.
> TARGET_CFLAGS="$TARGET_CFLAGS $WARN_FLAGS -g -Wredundant-decls
> -Wmissing-prototypes -Wmissing-declarations"
> TARGET_CCASFLAGS="$TARGET_CCASFLAGS -g"
> @@ -750,24 +768,6 @@ if test "x$target_cpu" = xi386 && test "x$platform" !=
> xemu; then
> TARGET_CFLAGS="$TARGET_CFLAGS -march=i386"
> fi
>
> -if test "x$target_m32" = x1; then
> - # Force 32-bit mode.
> - TARGET_CFLAGS="$TARGET_CFLAGS -m32"
> - TARGET_CCASFLAGS="$TARGET_CCASFLAGS -m32"
> - TARGET_CPPFLAGS="$TARGET_CPPFLAGS -m32"
> - TARGET_LDFLAGS="$TARGET_LDFLAGS -m32"
> - TARGET_MODULE_FORMAT="elf32"
> -fi
> -
> -if test "x$target_m64" = x1; then
> - # Force 64-bit mode.
> - TARGET_CFLAGS="$TARGET_CFLAGS -m64"
> - TARGET_CCASFLAGS="$TARGET_CCASFLAGS -m64"
> - TARGET_CPPFLAGS="$TARGET_CPPFLAGS -m64"
> - TARGET_LDFLAGS="$TARGET_LDFLAGS -m64"
> - TARGET_MODULE_FORMAT="elf64"
> -fi
> -
> if test "x$grub_cv_cc_target_clang" = xno && test "x$target_cpu" = xi386 &&
> test "x$platform" != xemu && test "x$platform" != xefi; then
> TARGET_CFLAGS="$TARGET_CFLAGS -mrtd -mregparm=3"
> fi
>
While I cannot say whether this fixes the issue reported as we are building
grub with
a 64-bit SPARC userland, I can confirm that these changes don't break the build
on
sparc64.
Tested-by: John Paul Adrian Glaubitz <address@hidden>
Adrian
--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer - address@hidden
`. `' Freie Universitaet Berlin - address@hidden
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913