From patchwork Fri Sep 5 20:17:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Ellcey X-Patchwork-Id: 386514 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id AAC381400E9 for ; Sat, 6 Sep 2014 06:17:32 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:subject:from:to:cc:date:in-reply-to :references:content-type:content-transfer-encoding:mime-version; q=dns; s=default; b=qN5djfN++qPOPrWFF5ZWFpczhLBTkDKr9NmXpvtqbM0 /ZqEPeQGJTHoZoRKtJ6Xp5iW+y2TxDSKrWvYHvM/KiMRznDJLyVYrprA8Qmw5M7E eoDMLWQ5dmijwHdKc1nf8enpK7YHQ4YFUEXaXP82wSgIGYK/82jyzQrjQWL0GB0Q = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:subject:from:to:cc:date:in-reply-to :references:content-type:content-transfer-encoding:mime-version; s=default; bh=gp8sKKKVJE99SKkrunfrOiDQofY=; b=q3KbxYdMUKt6pCVhX u7lc1KQECeAs8c42WIYqbIJi8q2CKFxE0649v+GiM8mhajEfGfAajGsC4qGGCyuG thMgh09z3q4LSuTLtHrvQzgWYe1epCkeheCl9giuTopJObBBHLUc/lfTMPNRQfYA agjl+3zDofq+LwAWu9I3/BpBMg= Received: (qmail 26624 invoked by alias); 5 Sep 2014 20:17:26 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 26612 invoked by uid 89); 5 Sep 2014 20:17:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mailapp01.imgtec.com Message-ID: <1409948236.2740.110.camel@ubuntu-sellcey> Subject: Re: [PATCH] Cleanup MIPS preconfigure script From: Steve Ellcey To: "Maciej W. Rozycki" CC: , , Catherine Moore Date: Fri, 5 Sep 2014 13:17:16 -0700 In-Reply-To: References: <6b5ce132-2a69-4ee9-aaa5-d07792e72b50@BAMAIL02.ba.imgtec.org> <1409871127.2740.76.camel@ubuntu-sellcey> MIME-Version: 1.0 On Fri, 2014-09-05 at 00:23 +0100, Maciej W. Rozycki wrote: > Hmm, I never thought of such use and I keep considering it weird, but > having looked through the current script again we already permit e.g. > `mips64-linux-gnuabi32' to select o32, so I take my concern back, no need > for any checks here. OK, that shrinks the preconfigure script even more. > Good. Frankly (with the observation I made above) I think there should > be no difference between configuring for `mips-linux-gnu' and > `mips64-linux-gnuabi32'. I agree, here is a new patch. I complete removed the setting of base_machine since it is not used and I removed the line: machine=$machine/$config_machine that was in my earlier patch because that did serve any purpose that I could find, it was part of the original 32 bit mips preconfigure path, which is why I originally had left it in. Steve Ellcey sellcey@mips.com 2014-09-05 Steve Ellcey * sysdeps/mips/preconfigure: Modify ABI tests. diff --git a/sysdeps/mips/preconfigure b/sysdeps/mips/preconfigure index b215eb2..343ef16 100644 --- a/sysdeps/mips/preconfigure +++ b/sysdeps/mips/preconfigure @@ -1,34 +1,20 @@ -case "$machine" in -mips64*) base_machine=mips64 - case "$CC $CFLAGS $CPPFLAGS " in - *" -mabi=n32 "*) mips_cc_abi=n32 ;; - *" -mabi=64 "*|*" -mabi=n64 "*) mips_cc_abi=64 ;; - *" -mabi=32 "*|*" -mabi=o32 "*) mips_cc_abi=32 ;; - *) mips_cc_abi=default ;; - esac - case $config_os in - *abin32*) mips_config_abi=n32 ;; - *abi64*|*abin64*) mips_config_abi=64 ;; - *abi32*|*abio32*) mips_config_abi=32 ;; - *) mips_config_abi=$mips_cc_abi ;; - esac - case $mips_config_abi in - default) machine=mips/mips64/n32 mips_config_abi=n32 ;; - n32) machine=mips/mips64/n32 ;; - 64) machine=mips/mips64/n64 ;; - 32) machine=mips/mips32/kern64 ;; - esac - machine=$machine/$config_machine - if test $mips_config_abi != $mips_cc_abi; then - # This won't make it to config.make, but we want to - # set this in case configure tests depend on it. - CPPFLAGS="$CPPFLAGS -mabi=$mips_config_abi" - fi - ;; -mips*) base_machine=mips - case "$CC $CFLAGS $CPPFLAGS " in - *" -mips16 "*) machine=mips/mips32/mips16/$machine ;; - *) machine=mips/mips32/$machine ;; - esac - ;; -esac +abiflag=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | sed -n 's/^#define _MIPS_SIM \(.*\)/\1/p'` +mips16flag=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | sed -n 's/^#define __mips16 \(.*\)/\1/p'` + +if test "$abiflag" = "_ABIO32" ; then + if test "$mips16flag" = "1" ; then + machine=mips/mips32/mips16 + else + machine=mips/mips32 + fi +elif test "$abiflag" = "_ABIN32" ; then + machine=mips/mips64/n32 +elif test "$abiflag" = "_ABI64" ; then + machine=mips/mips64/n64 +else + as_fn_error $? "Unable to determine ABI." "$LINENO" 5 +fi + +if test "$abiflag" != "_ABIO32" -a "$mips16flag" = "1"; then + as_fn_error $? "mips16 is only supported with the O32 ABI." "$LINENO" 5 +fi