From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1j4fh7-0002eW-Ft for mharc-grub-devel@gnu.org; Thu, 20 Feb 2020 01:52:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59617) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j4fh2-0002eO-C4 for grub-devel@gnu.org; Thu, 20 Feb 2020 01:52:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j4fgz-0003xs-Jm for grub-devel@gnu.org; Thu, 20 Feb 2020 01:52:16 -0500 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]:41216) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j4fgz-0003xG-CV for grub-devel@gnu.org; Thu, 20 Feb 2020 01:52:13 -0500 Received: by mail-pl1-x644.google.com with SMTP id t14so1157604plr.8 for ; Wed, 19 Feb 2020 22:52:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=0/sv8StLIzQ0bKInqedQI46NQPvaALRY9uo4qASddhI=; b=Z2cS1r9cv5t0j0kGIvpF/OquM0dpi0H9hnLjMRGrBbbBe1OQpr8eou0CGA9mSfhkVc BPvXZl+JiYl6w5knj2nIqUe48Yk8j+qvUb1myGrHRMn79QGRFwVZkrEIoc+bizh8fxdm UyVIESQRE0kfl9E301Hp9lRWvyXPppMvmZv349XDJ++BatDxmcJwrmToRWftDWbOgL13 hH399sldhGSF/eCZld3hLmZ48R9IlbF5wnKDdw2JkqA1aW8Dl67u9B2cD4hUozmPcZdp 0T3aaJStMSxt8S4zqNAn/Hq2OiLR1Qg3sko4kMazmxxsXpAOrOYAoRCH19LPUnwWapWe aZBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=0/sv8StLIzQ0bKInqedQI46NQPvaALRY9uo4qASddhI=; b=lO5IG4d5C2dslAVF/kVzx/tryQv5SamFYfAIelNDwYdPMW8cSoFA1i8O1Tq7Y2gPoK Kv8XArqtN50Ii2GrZ/BgNuujU6cIFQ4q13M3R8Msx6hDVzAb9dyvs8PdopzvJ2+yuKu+ BT0upzt+T65j17Lx058LdBRtQWSmkqWGGWvu+bOJ0sat4Ha9qwllgSqZl7qZEfCYxF4k a1i49YDBVs/gFnhh5WinS1vjvQw4CzCDqlzRxSxqxePqDrGFeShT/k+2bNNMUyvnvYO1 DkrGC659lXjlYheCgnFOIyIguqm3nSF2P3v9S1f45FfRT0h/afkyf5OB0do30j4Oil1m RLIg== X-Gm-Message-State: APjAAAVI5V9A2Fi3IyNUaGV72ZDCTHmIZdLhQT7oWiLWiuybCEPTfce7 +c3UGcHDDW9nl7JegNi9W3N98pwt X-Google-Smtp-Source: APXvYqx/CYctqk/61pnQ1wNqO1mz9Nz5aDKsoVeDn6HzPBwEk4k68h8oVlRAYAUdEBSEwTPAFm84eg== X-Received: by 2002:a17:902:8303:: with SMTP id bd3mr30425291plb.171.1582181531619; Wed, 19 Feb 2020 22:52:11 -0800 (PST) Received: from localhost ([108.161.26.224]) by smtp.gmail.com with ESMTPSA id e26sm2008352pfl.59.2020.02.19.22.52.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Feb 2020 22:52:10 -0800 (PST) From: Matt Turner To: The development of GNU GRUB Cc: Mike Gilbert Subject: [PATCH 1/2] build: Move TARGET_* assignments earlier Date: Wed, 19 Feb 2020 22:51:41 -0800 Message-Id: <20200220065142.869129-1-mattst88@gmail.com> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::644 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Feb 2020 06:52:20 -0000 From: Mike Gilbert 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 -- 2.24.1