From patchwork Mon Jun 15 15:25:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Ellcey X-Patchwork-Id: 484359 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 42D3D1401AF for ; Tue, 16 Jun 2015 01:25:57 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=S3UM7Yw9; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :date:to:cc:subject:mime-version:content-type :content-transfer-encoding:message-id; q=dns; s=default; b=NCKlv aSxcLR5Qn6pkNhVT19evO99H4CUJNvHhwr3yhl+L5NSS8Eo750icjx9BJP2yuw/4 Cvv58tCHgKAjGtUTJ797MhQzxmLJb9EapSQRIy7Zn24ZPNsw1NVNUX+Vf5the/08 OKmoL+IgOHirdiawFIQpDE+fDlErIi4klX5CCI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :date:to:cc:subject:mime-version:content-type :content-transfer-encoding:message-id; s=default; bh=F4atOM//53r ZUsT8o9gvpLw2ppo=; b=S3UM7Yw9C9422MqyTDRWhvNWAnTeQF1b/KLE+jyLDgE X8Sk/Kt0Kx6aFpw2BvzIeCItvaLx1tDFG5F02CtnlXx6zR1S6ITq8ZAzKTJ3Iquy XXIa3q3IjfqDdB4sb4vblOgH49bE3shMRsZhAq/bXgObr7bYfKw3QSETI+pnSmMg = Received: (qmail 109889 invoked by alias); 15 Jun 2015 15:25:50 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 109876 invoked by uid 89); 15 Jun 2015 15:25:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mailapp01.imgtec.com Received: from mailapp01.imgtec.com (HELO mailapp01.imgtec.com) (195.59.15.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 15 Jun 2015 15:25:47 +0000 Received: from KLMAIL01.kl.imgtec.org (unknown [192.168.5.35]) by Websense Email Security Gateway with ESMTPS id 71F42EA2783A7; Mon, 15 Jun 2015 16:25:40 +0100 (IST) Received: from hhmail02.hh.imgtec.org (10.100.10.20) by KLMAIL01.kl.imgtec.org (192.168.5.35) with Microsoft SMTP Server (TLS) id 14.3.195.1; Mon, 15 Jun 2015 16:25:43 +0100 Received: from BAMAIL02.ba.imgtec.org (10.20.40.28) by hhmail02.hh.imgtec.org (10.100.10.20) with Microsoft SMTP Server (TLS) id 14.3.224.2; Mon, 15 Jun 2015 16:25:42 +0100 Received: from ubuntu-sellcey.mips.com (10.20.3.58) by bamail02.ba.imgtec.org (10.20.40.28) with Microsoft SMTP Server id 14.3.174.1; Mon, 15 Jun 2015 08:25:40 -0700 Received: by ubuntu-sellcey.mips.com (sSMTP sendmail emulation); Mon, 15 Jun 2015 08:25:40 -0700 From: "Steve Ellcey " Date: Mon, 15 Jun 2015 08:25:39 -0700 To: CC: , Subject: [Patch, MIPS] Modify sysroot layout for mips-mti-* and mips-img-* User-Agent: Heirloom mailx 12.5 6/20/10 MIME-Version: 1.0 Message-ID: We (Imagination) would like to change the layout of the mips-mti-linux-gnu and mips-img-linux-gnu cross compiler toolchains. This patch, which affects nothing other than those targets, implements that change. Prior to this patch the mti and img cross compilers used a set of nested directories for the different options. For example, mips-mti-linux-gnu put the mips32r2 big-endian hard-float system libraries directly under the sysroot. Little-endian libraries were in a /el directory, soft-float libraries were in a /sof directory. Libraries that were both soft-float and little-endian were under el/sof. 64-bit libraries are in a subdirectory called /64, mips16 libraries are in a subdirectory called /mips16, etc. The problem with this layout is that it does not match the library layout of native MIPS linux systems and if you link a program with shared libraries and then try to move it to a native system and run it, it may not work because the libraries would not be where the executable expected them to be. This patch changes the expected layout of the sysroot libraries and headers to look more like native systems. The basic idea is that there is one level of directories under the sysroot directory for each 'kind' of native MIPS system: mips64r2 and big-endian and soft-float for example or mips64r6 and little-endian and hard-float. We do not have separate directories for mips32r2 and mips64r2 because under the one 'r2' directory there would be /lib, /lib32, and /lib64 directories for o32, n32, and n64 libraries so they can share one logical sysroot. The naming convention for the directories under the global sysroot (set with SYSROOT_SUFFIX_SPEC) is: [micro]mips[el]-r(1|2|6)[-mips16](-soft|-hard)[-nan2008][-uclibc] [] parts are optional [-micro] if build for micromips. [-el] if little-endian. [-mips16] if built in mips16 mode. [-nan2008] if built for nan2008 on a platform. where that is not the defualt. [-uclibc] if built with uclibc library (instead of glibc). () parts are a selection (1|2|6) refers to versions 1, 2, or 6 of mips32/mips64 architectures. (-soft|-hard) refers to a hard of soft float version. Tested by building both toolchains and inspecting the layout and by running the GCC testsuite with a subset of the various combinations. OK for checkin? Steve Ellcey sellcey@imgtec.com 2015-06-15 Steve Ellcey * config/mips/mti-linux.h (MIPS_SYSVERSION_SPEC): New. (SYSROOT_SUFFIX_SPEC): Update. (SYSROOT_HEADERS_SUFFIX_SPEC): New. (STARTFILE_PREFIX_SPEC): Update. * config/mips/t-mti-linux (MULTILIB_EXCEPTIONS): Remove. (MULTILIB_REQUIRED): New. (MULTILIB_OSDIRNAMES): New. * config/mips/t-img-linux (MULTILIB_EXCEPTIONS): Remove. (MULTILIB_REQUIRED): New. (MULTILIB_OSDIRNAMES): New. diff --git a/gcc/config/mips/mti-linux.h b/gcc/config/mips/mti-linux.h index 80d5925..32b84d1 100644 --- a/gcc/config/mips/mti-linux.h +++ b/gcc/config/mips/mti-linux.h @@ -18,16 +18,20 @@ along with GCC; see the file COPYING3. If not see . */ /* This target is a multilib target, specify the sysroot paths. */ +#define MIPS_SYSVERSION_SPEC \ + "%{mips32:r1}%{mips64:r1}%{mips32r2:r2}%{mips64r2:r2}%{mips32r6:r6}%{mips64r6:r6}%{mips16:-mips16}" + #undef SYSROOT_SUFFIX_SPEC -#if MIPS_ISA_DEFAULT == 33 /* mips32r2 is the default */ -#define SYSROOT_SUFFIX_SPEC \ - "%{mips32:/mips32}%{mips64:/mips64}%{mips64r2:/mips64r2}%{mips32r6:/mips32r6}%{mips64r6:/mips64r6}%{mips16:/mips16}%{mmicromips:/micromips}%{mabi=64:/64}%{mel|EL:/el}%{msoft-float:/sof}%{!mips32r6:%{!mips64r6:%{mnan=2008:/nan2008}}}" -#elif MIPS_ISA_DEFAULT == 37 /* mips32r6 is the default */ #define SYSROOT_SUFFIX_SPEC \ - "%{mips32:/mips32}%{mips64:/mips64}%{mips32r2:/mips32r2}%{mips64r2:/mips64r2}%{mips64r6:/mips64r6}%{mips16:/mips16}%{mmicromips:/micromips}%{mabi=64:/64}%{mel|EL:/el}%{msoft-float:/sof}%{!mips32r6:%{!mips64r6:%{mnan=2008:/nan2008}}}" -#else /* Unexpected default ISA. */ -#error No SYSROOT_SUFFIX_SPEC exists for this default ISA -#endif + "/%{mmicromips:micro}mips%{mel|EL:el}-"MIPS_SYSVERSION_SPEC"%{msoft-float:-soft;:-hard}%{!mips32r6:%{!mips64r6:%{mnan=2008:-nan2008}}}%{muclibc:-uclibc}" + +#define SYSROOT_HEADERS_SUFFIX_SPEC SYSROOT_SUFFIX_SPEC + +#undef STARTFILE_PREFIX_SPEC +#define STARTFILE_PREFIX_SPEC \ + "%{mabi=32: /usr/local/lib/ /lib/ /usr/lib/} \ + %{mabi=n32: /usr/local/lib32/ /lib32/ /usr/lib32/} \ + %{mabi=64: /usr/local/lib64/ /lib64/ /usr/lib64/}" #undef DRIVER_SELF_SPECS #define DRIVER_SELF_SPECS \ diff --git a/gcc/config/mips/t-img-linux b/gcc/config/mips/t-img-linux index 86b0a26..93d81920 100644 --- a/gcc/config/mips/t-img-linux +++ b/gcc/config/mips/t-img-linux @@ -23,8 +23,16 @@ MULTILIB_OPTIONS = mips64r6 mabi=64 EL MULTILIB_DIRNAMES = mips64r6 64 el MULTILIB_MATCHES = EL=mel EB=meb -# The 64 bit ABI is not supported on the mips32r6 architecture. -# Because mips32r6 is the default we can't use that flag to trigger -# the exception so we check for mabi=64 with no specific mips -# architecture flag instead. -MULTILIB_EXCEPTIONS += mabi=64* +MULTILIB_REQUIRED = +MULTILIB_OSDIRNAMES = .=mips-r6-hard/lib +MULTILIB_REQUIRED += mips64r6 +MULTILIB_OSDIRNAMES += mips64r6=!mips-r6-hard/lib32 +MULTILIB_REQUIRED += mips64r6/mabi=64 +MULTILIB_OSDIRNAMES += mips64r6/mabi.64=!mips-r6-hard/lib64 + +MULTILIB_REQUIRED += EL +MULTILIB_OSDIRNAMES += EL=!mipsel-r6-hard/lib +MULTILIB_REQUIRED += mips64r6/EL +MULTILIB_OSDIRNAMES += mips64r6/EL=!mipsel-r6-hard/lib32 +MULTILIB_REQUIRED += mips64r6/mabi=64/EL +MULTILIB_OSDIRNAMES += mips64r6/mabi.64/EL=!mipsel-r6-hard/lib64 diff --git a/gcc/config/mips/t-mti-linux b/gcc/config/mips/t-mti-linux index c0dcbf0..2404c4ca 100644 --- a/gcc/config/mips/t-mti-linux +++ b/gcc/config/mips/t-mti-linux @@ -23,26 +23,136 @@ MULTILIB_OPTIONS = mips32/mips64/mips64r2 mips16/mmicromips mabi=64 EL msoft-flo MULTILIB_DIRNAMES = mips32 mips64 mips64r2 mips16 micromips 64 el sof nan2008 MULTILIB_MATCHES = EL=mel EB=meb mips32r2=mips32r3 mips32r2=mips32r5 mips64r2=mips64r3 mips64r2=mips64r5 -# The 64 bit ABI is not supported on the mips32 architecture. -MULTILIB_EXCEPTIONS += *mips32*/*mabi=64* - -# The 64 bit ABI is not supported on the mips32r2 architecture. -# Because mips32r2 is the default we can't use that flag to trigger -# the exception so we check for mabi=64 with no specific mips -# architecture flag instead. -MULTILIB_EXCEPTIONS += mabi=64* - -# We do not want to build mips16 versions of mips64* architectures. -MULTILIB_EXCEPTIONS += *mips64*/*mips16* -MULTILIB_EXCEPTIONS += *mips16/mabi=64* - -# We only want micromips for mips32r2 architecture. -MULTILIB_EXCEPTIONS += *mips32/mmicromips* -MULTILIB_EXCEPTIONS += *mips64*/mmicromips* -MULTILIB_EXCEPTIONS += *mmicromips/mabi=64* - -# We do not want nan2008 libraries for soft-float, -# mips32[r1], or mips64[r1]. -MULTILIB_EXCEPTIONS += *msoft-float*/*mnan=2008* -MULTILIB_EXCEPTIONS += *mips32/*mnan=2008* -MULTILIB_EXCEPTIONS += *mips64/*mnan=2008* +MULTILIB_REQUIRED = +MULTILIB_OSDIRNAMES = .=mips-r2-hard/lib +MULTILIB_REQUIRED += mips64r2 +MULTILIB_OSDIRNAMES += mips64r2=!mips-r2-hard/lib32 +MULTILIB_REQUIRED += mips64r2/mabi=64 +MULTILIB_OSDIRNAMES += mips64r2/mabi.64=!mips-r2-hard/lib64 + +MULTILIB_REQUIRED += mnan=2008 +MULTILIB_OSDIRNAMES += mnan.2008=mips-r2-hard-nan2008/lib +MULTILIB_REQUIRED += mips64r2/mnan=2008 +MULTILIB_OSDIRNAMES += mips64r2/mnan.2008=!mips-r2-hard-nan2008/lib32 +MULTILIB_REQUIRED += mips64r2/mabi=64/mnan=2008 +MULTILIB_OSDIRNAMES += mips64r2/mabi.64/mnan.2008=!mips-r2-hard-nan2008/lib64 + +MULTILIB_REQUIRED += msoft-float +MULTILIB_OSDIRNAMES += msoft-float=mips-r2-soft/lib +MULTILIB_REQUIRED += mips64r2/msoft-float +MULTILIB_OSDIRNAMES += mips64r2/msoft-float=!mips-r2-soft/lib32 +MULTILIB_REQUIRED += mips64r2/mabi=64/msoft-float +MULTILIB_OSDIRNAMES += mips64r2/mabi.64/msoft-float=!mips-r2-soft/lib64 + +#MULTILIB_REQUIRED += msoft-float/mnan=2008 +#MULTILIB_OSDIRNAMES += msoft-float/mnan.2008=mips-r2-soft-nan2008/lib +#MULTILIB_REQUIRED += mips64r2/msoft-float/mnan=2008 +#MULTILIB_OSDIRNAMES += mips64r2/msoft-float/mnan.2008=!mips-r2-soft-nan2008/lib32 +#MULTILIB_REQUIRED += mips64r2/mabi=64/msoft-float/mnan=2008 +#MULTILIB_OSDIRNAMES += mips64r2/mabi.64/msoft-float/mnan.2008=!mips-r2-soft-nan2008/lib64 + +MULTILIB_REQUIRED += EL +MULTILIB_OSDIRNAMES += EL=!mipsel-r2-hard/lib +MULTILIB_REQUIRED += mips64r2/EL +MULTILIB_OSDIRNAMES += mips64r2/EL=!mipsel-r2-hard/lib32 +MULTILIB_REQUIRED += mips64r2/mabi=64/EL +MULTILIB_OSDIRNAMES += mips64r2/mabi.64/EL=!mipsel-r2-hard/lib64 + +MULTILIB_REQUIRED += EL/mnan=2008 +MULTILIB_OSDIRNAMES += EL/mnan.2008=!mipsel-r2-hard-nan2008/lib +MULTILIB_REQUIRED += mips64r2/EL/mnan=2008 +MULTILIB_OSDIRNAMES += mips64r2/EL/mnan.2008=!mipsel-r2-hard-nan2008/lib32 +MULTILIB_REQUIRED += mips64r2/mabi=64/EL/mnan=2008 +MULTILIB_OSDIRNAMES += mips64r2/mabi.64/EL/mnan.2008=!mipsel-r2-hard-nan2008/lib64 + +MULTILIB_REQUIRED += EL/msoft-float +MULTILIB_OSDIRNAMES += EL/msoft-float=!mipsel-r2-soft/lib +MULTILIB_REQUIRED += mips64r2/EL/msoft-float +MULTILIB_OSDIRNAMES += mips64r2/EL/msoft-float=!mipsel-r2-soft/lib32 +MULTILIB_REQUIRED += mips64r2/mabi=64/EL/msoft-float +MULTILIB_OSDIRNAMES += mips64r2/mabi.64/EL/msoft-float=!mipsel-r2-soft/lib64 + +#MULTILIB_REQUIRED += EL/msoft-float/mnan=2008 +#MULTILIB_OSDIRNAMES += EL/msoft-float/mnan.2008=!mipsel-r2-soft-nan2008/lib +#MULTILIB_REQUIRED += mips64r2/EL/msoft-float/mnan=2008 +#MULTILIB_OSDIRNAMES += mips64r2/EL/msoft-float/mnan.2008=!mipsel-r2-soft-nan2008/lib32 +#MULTILIB_REQUIRED += mips64r2/mabi=64/EL/msoft-float/mnan=2008 +#MULTILIB_OSDIRNAMES += mips64r2/mabi.64/EL/msoft-float/mnan.2008=!mipsel-r2-soft-nan2008/lib64 + +# We will not include any 64 bit mips16 combinations. +MULTILIB_REQUIRED += mips16 +MULTILIB_OSDIRNAMES += mips16=!mips-r2-mips16-hard/lib +MULTILIB_REQUIRED += mips16/mnan=2008 +MULTILIB_OSDIRNAMES += mips16/mnan.2008=!mips-r2-mips16-hard-nan2008/lib +MULTILIB_REQUIRED += mips16/msoft-float +MULTILIB_OSDIRNAMES += mips16/msoft-float=!mips-r2-mips16-soft/lib +#MULTILIB_REQUIRED += mips16/msoft-float/mnan=2008 +#MULTILIB_OSDIRNAMES += mips16/msoft-float/mnan.2008=!mips-r2-mips16-soft-nan2008/lib + +MULTILIB_REQUIRED += mips16/EL +MULTILIB_OSDIRNAMES += mips16/EL=!mipsel-r2-mips16-hard/lib +MULTILIB_REQUIRED += mips16/EL/mnan=2008 +MULTILIB_OSDIRNAMES += mips16/EL/mnan.2008=!mipsel-r2-mips16-hard-nan2008/lib +MULTILIB_REQUIRED += mips16/EL/msoft-float +MULTILIB_OSDIRNAMES += mips16/EL/msoft-float=!mipsel-r2-mips16-soft/lib +#MULTILIB_REQUIRED += mips16/EL/msoft-float/mnan=2008 +#MULTILIB_OSDIRNAMES += mips16/EL/msoft-float/mnan.2008=!mipsel-r2-mips16-soft-nan2008/lib + +MULTILIB_REQUIRED += mmicromips +MULTILIB_OSDIRNAMES += mmicromips=!micromips-r2-hard/lib +MULTILIB_REQUIRED += mmicromips/mnan=2008 +MULTILIB_OSDIRNAMES += mmicromips/mnan.2008=!micromips-r2-hard-nan2008/lib +MULTILIB_REQUIRED += mmicromips/msoft-float +MULTILIB_OSDIRNAMES += mmicromips/msoft-float=!micromips-r2-soft/lib +#MULTILIB_REQUIRED += mmicromips/msoft-float/mnan=2008 +#MULTILIB_OSDIRNAMES += mmicromips/msoft-float/mnan.2008=!micromips-r2-soft-nan2008/lib + +MULTILIB_REQUIRED += mmicromips/EL +MULTILIB_OSDIRNAMES += mmicromips/EL=!micromipsel-r2-hard/lib +MULTILIB_REQUIRED += mmicromips/EL/mnan=2008 +MULTILIB_OSDIRNAMES += mmicromips/EL/mnan.2008=!micromipsel-r2-hard-nan2008/lib +MULTILIB_REQUIRED += mmicromips/EL/msoft-float +MULTILIB_OSDIRNAMES += mmicromips/EL/msoft-float=!micromipsel-r2-soft/lib +#MULTILIB_REQUIRED += mmicromips/EL/msoft-float/mnan=2008 +#MULTILIB_OSDIRNAMES += mmicromips/EL/msoft-float/mnan.2008=!micromipsel-r2-soft-nan2008/lib + +# Version 1 multilibs + +MULTILIB_REQUIRED += mips32 +MULTILIB_OSDIRNAMES += mips32=mips-r1-hard/lib +MULTILIB_REQUIRED += mips64 +MULTILIB_OSDIRNAMES += mips64=!mips-r1-hard/lib32 +MULTILIB_REQUIRED += mips64/mabi=64 +MULTILIB_OSDIRNAMES += mips64/mabi.64=!mips-r1-hard/lib64 + +MULTILIB_REQUIRED += mips32/msoft-float +MULTILIB_OSDIRNAMES += mips32/msoft-float=mips-r1-soft/lib +MULTILIB_REQUIRED += mips64/msoft-float +MULTILIB_OSDIRNAMES += mips64/msoft-float=!mips-r1-soft/lib32 +MULTILIB_REQUIRED += mips64/mabi=64/msoft-float +MULTILIB_OSDIRNAMES += mips64/mabi.64/msoft-float=!mips-r1-soft/lib64 + +MULTILIB_REQUIRED += mips32/EL +MULTILIB_OSDIRNAMES += mips32/EL=!mipsel-r1-hard/lib +MULTILIB_REQUIRED += mips64/EL +MULTILIB_OSDIRNAMES += mips64/EL=!mipsel-r1-hard/lib32 +MULTILIB_REQUIRED += mips64/mabi=64/EL +MULTILIB_OSDIRNAMES += mips64/mabi.64/EL=!mipsel-r1-hard/lib64 + +MULTILIB_REQUIRED += mips32/EL/msoft-float +MULTILIB_OSDIRNAMES += mips32/EL/msoft-float=!mipsel-r1-soft/lib +MULTILIB_REQUIRED += mips64/EL/msoft-float +MULTILIB_OSDIRNAMES += mips64/EL/msoft-float=!mipsel-r1-soft/lib32 +MULTILIB_REQUIRED += mips64/mabi=64/EL/msoft-float +MULTILIB_OSDIRNAMES += mips64/mabi.64/EL/msoft-float=!mipsel-r1-soft/lib64 + +# We will not include any 64 bit mips16 combinations. +MULTILIB_REQUIRED += mips32/mips16 +MULTILIB_OSDIRNAMES += mips32/mips16=!mips-r1-mips16-hard/lib +MULTILIB_REQUIRED += mips32/mips16/msoft-float +MULTILIB_OSDIRNAMES += mips32/mips16/msoft-float=!mips-r1-mips16-soft/lib + +MULTILIB_REQUIRED += mips32/mips16/EL +MULTILIB_OSDIRNAMES += mips32/mips16/EL=!mipsel-r1-mips16-hard/lib +MULTILIB_REQUIRED += mips32/mips16/EL/msoft-float +MULTILIB_OSDIRNAMES += mips32/mips16/EL/msoft-float=!mipsel-r1-mips16-soft/lib