From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28064 invoked by alias); 15 Oct 2012 20:15:34 -0000 Received: (qmail 28038 invoked by uid 22791); 15 Oct 2012 20:15:32 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SARE_BAYES_5x8,SARE_BAYES_6x8 X-Spam-Check-By: sourceware.org Received: from dns1.mips.com (HELO dns1.mips.com) (12.201.5.69) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 15 Oct 2012 20:15:28 +0000 Received: from mailgate1.mips.com (mailgate1.mips.com [12.201.5.111]) by dns1.mips.com (8.13.8/8.13.8) with ESMTP id q9FKFRXg009075 for ; Mon, 15 Oct 2012 13:15:27 -0700 X-M-MSG: Received: from exchdb01.mips.com (unknown [192.168.36.84]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mailgate1.mips.com (Postfix) with ESMTP id 2250336465A for ; Mon, 15 Oct 2012 13:15:22 -0700 (PDT) Received: from ubuntu-sellcey.mips.com (192.168.65.53) by exchhub01.mips.com (192.168.36.84) with Microsoft SMTP Server id 14.1.270.1; Mon, 15 Oct 2012 13:15:20 -0700 Received: by ubuntu-sellcey.mips.com (sSMTP sendmail emulation); Mon, 15 Oct 2012 13:15:20 -0700 From: "Steve Ellcey " Date: Mon, 15 Oct 2012 20:15:00 -0000 To: Subject: [patch, mips] Fix stubs files for hard float vs. soft float User-Agent: Heirloom mailx 12.4 7/29/08 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-ID: X-EMS-Proccessed: 6LP3oGfGVdcdb8o1aBnt6w== X-EMS-STAMP: +UBLyGtfeo2mIjpy/JJrbA== Mailing-List: contact libc-ports-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: libc-ports-owner@sourceware.org X-SW-Source: 2012-10/txt/msg00022.txt.bz2 While working on various flavors of glibc, I found that building on MIPS with and without floating point enabled resulted in different stub files, but the MIPS makefile did not handle this difference correctly (it would always create a stubs-o32.h (or n32 or n64) header file and that file would look different depending on whether or not you enabled floating point. This patch creates different stub files for hard float vs. soft float, which combined with o32, n32, and n64 results in 6 different stub files. Rather then create 6 different Makefiles to set abi-default (there are 3 right now) I changed mips to use the ARM method of setting abi-default by preprocessing a C file. This allowed me to remove the 3 Makefiles that did nothing but set abi-default instead of having to add 3 more Makefiles to handle the soft vs. hard differences. Tested by building soft and hard float versions glibc on MIPS for o32, n32, and n64 versions. OK to checkin? Steve Ellcey sellcey@mips.com 2012-10-15 Steve Ellcey * sysdeps/unix/sysv/linux/mips/mips32/Makefile: Remove. * sysdeps/unix/sysv/linux/mips/mips64/n32/Makefile: Remove. * sysdeps/unix/sysv/linux/mips/mips64/n64/Makefile: Remove. * sysdeps/unix/sysv/linux/mips/Makefile (default-abi): Set. * (abi-variants): Add hard and soft float versions. * (abi-*-options): update with hard and soft flags. * (abi-*-condition): Ditto. diff --git a/ports/sysdeps/unix/sysv/linux/mips/Makefile b/ports/sysdeps/unix/sysv/linux/mips/Makefile index 99c554f..27f74fc 100644 --- a/ports/sysdeps/unix/sysv/linux/mips/Makefile +++ b/ports/sysdeps/unix/sysv/linux/mips/Makefile @@ -8,15 +8,60 @@ sysdep_routines += cachectl cacheflush sysmips _test_and_set sysdep_headers += sys/cachectl.h sys/sysmips.h sys/tas.h endif +define default-abi-prog +echo '#if defined(__mips_soft_float) && (_MIPS_SIM == _ABIO32)'; +echo 'o32_soft'; +echo '#elif defined(__mips_hard_float) && (_MIPS_SIM == _ABIO32)'; +echo 'o32_hard'; +echo '#elif defined(__mips_soft_float) && (_MIPS_SIM == _ABIN32)'; +echo 'n32_soft'; +echo '#elif defined(__mips_hard_float) && (_MIPS_SIM == _ABIN32)'; +echo 'n32_hard'; +echo '#elif defined(__mips_soft_float) && (_MIPS_SIM == _ABI64)'; +echo 'n64_soft'; +echo '#elif defined(__mips_hard_float) && (_MIPS_SIM == _ABI64)'; +echo 'n64_hard'; +echo '#endif' +endef +default-abi := $(strip $(shell \ + ($(default-abi-prog)) | $(CC) $(CFLAGS) $(CPPFLAGS) -E -P -)) + +ifneq ($(default-abi),o32_soft) +ifneq ($(default-abi),o32_hard) +ifneq ($(default-abi),n32_soft) +ifneq ($(default-abi),n32_hard) +ifneq ($(default-abi),n64_soft) +ifneq ($(default-abi),n64_hard) +Unknown ABI, must be "o32_soft", "o32_hard", "n32_soft", "n32_hard", +"n64_soft", or "n64_hard" +endif +endif +endif +endif +endif +endif + # _MIPS_SIM_ABI32 == 1, _MIPS_SIM_NABI32 == 2, _MIPS_SIM_ABI64 == 3 -abi-variants := o32 n32 n64 +abi-variants := o32_soft o32_hard n32_soft n32_hard n64_soft n64_hard abi-includes := sgidefs.h -abi-o32-options := -D_MIPS_SIM=1 -abi-o32-condition := _MIPS_SIM == _MIPS_SIM_ABI32 -abi-n32-options := -D_MIPS_SIM=2 -abi-n32-condition := _MIPS_SIM == _MIPS_SIM_NABI32 -abi-n64-options := -D_MIPS_SIM=3 -abi-n64-condition := _MIPS_SIM == _MIPS_SIM_ABI64 +abi-o32_soft-options := -D_MIPS_SIM=1 -D__mips_soft_float +abi-o32_soft-condition := defined(__mips_soft_float) \ + && (_MIPS_SIM == _MIPS_SIM_ABI32) +abi-o32_hard-options := -D_MIPS_SIM=1 -D__mips_hard_float +abi-o32_hard-condition := defined(__mips_hard_float) \ + && (_MIPS_SIM == _MIPS_SIM_ABI32) +abi-n32_soft-options := -D_MIPS_SIM=2 -D__mips_soft_float +abi-n32_soft-condition := defined(__mips_soft_float) \ + && (_MIPS_SIM == _MIPS_SIM_NABI32) +abi-n32_hard-options := -D_MIPS_SIM=2 -D__mips_hard_float +abi-n32_hard-condition := defined(__mips_hard_float) \ + && (_MIPS_SIM == _MIPS_SIM_NABI32) +abi-n64_soft-options := -D_MIPS_SIM=3 -D__mips_soft_float +abi-n64_soft-condition := defined(__mips_soft_float) \ + && (_MIPS_SIM == _MIPS_SIM_ABI64) +abi-n64_hard-options := -D_MIPS_SIM=3 -D__mips_hard_float +abi-n64_hard-condition := defined(__mips_hard_float) \ + && (_MIPS_SIM == _MIPS_SIM_ABI64) ifeq ($(subdir),elf) ifeq ($(build-shared),yes)