From patchwork Thu Sep 30 18:28:50 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 66233 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]) by ozlabs.org (Postfix) with SMTP id 726D8B70A8 for ; Fri, 1 Oct 2010 04:29:06 +1000 (EST) Received: (qmail 13706 invoked by alias); 30 Sep 2010 18:29:04 -0000 Received: (qmail 13690 invoked by uid 22791); 30 Sep 2010 18:29:03 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL, BAYES_00, TW_MF, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from snape.CeBiTec.Uni-Bielefeld.DE (HELO smtp-relay.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 30 Sep 2010 18:28:58 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 0148E403 for ; Thu, 30 Sep 2010 20:28:56 +0200 (CEST) Received: from smtp-relay.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id M-hOuAEub2qP for ; Thu, 30 Sep 2010 20:28:51 +0200 (CEST) Received: from manam.CeBiTec.Uni-Bielefeld.DE (manam.CeBiTec.Uni-Bielefeld.DE [129.70.161.120]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPS id E2763400 for ; Thu, 30 Sep 2010 20:28:50 +0200 (CEST) Received: (from ro@localhost) by manam.CeBiTec.Uni-Bielefeld.DE (8.14.4+Sun/8.14.4/Submit) id o8UISo5v016339; Thu, 30 Sep 2010 20:28:50 +0200 (MEST) From: Rainer Orth To: gcc-patches@gcc.gnu.org Subject: Correctly document Solaris 2 options Date: Thu, 30 Sep 2010 20:28:50 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (usg-unix-v) MIME-Version: 1.0 X-IsSubscribed: yes 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 I happened to notice that -mimpure-text is currently documented as a Solaris/SPARC-only option, while it is in fact implemented in common code (gcc/config/sol2.h) and works on both SPARC and x86. The following patch corrects this by moving the definition to a new config/sol2.opt file. At the same time, it introduces a new Solaris 2 Options section in invoke.texi to move the -mimpure-text description there. I also move the descriptions of -threads, -pthreads, and -pthread there which are common as well. None of them occurs in gcc --help -v output, though. Bootstrapped on i386-pc-solaris2.10 and sparc-sun-solaris2.10, verified that -mimpure-text occurs in the gcc --help -v output on both platforms, installed. Rainer 2010-06-18 Rainer Orth * config/sparc/sparc.opt (mimpure-text): Move ... * config/sol2.opt: ... here. Correct description. * config.gcc (*-*-solaris2*): Add sol2.opt to extra_options. * doc/invoke.texi (Option Summary, SPARC Options): Move -mimpure-text, -mno-impure-text, -threads, -pthreads, -pthread ... (Option Summary, Solaris 2 Options): ... here. (Submodel Options, Solaris 2 Options): New menu entry. (SPARC Options): Move -mimpure-text, -threads, -pthreads, -pthread ... (Solaris 2 Options): ... here. diff -r 1c6d1fb0e76f gcc/config.gcc --- a/gcc/config.gcc Fri Jun 18 12:56:45 2010 +0200 +++ b/gcc/config.gcc Fri Jun 18 13:27:35 2010 +0200 @@ -612,6 +612,9 @@ *-*-uclinux*) use_gcc_stdint=wrap ;; +*-*-solaris2*) + extra_options="${extra_options} sol2.opt" + ;; *-*-vxworks*) tmake_file=t-vxworks xm_defines=POSIX diff -r 1c6d1fb0e76f gcc/config/sol2.opt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gcc/config/sol2.opt Fri Jun 18 13:27:35 2010 +0200 @@ -0,0 +1,23 @@ +; Options for the Solaris 2 port of the compiler +; +; Copyright (C) 2010 Free Software Foundation, Inc. +; +; This file is part of GCC. +; +; GCC is free software; you can redistribute it and/or modify it under +; the terms of the GNU General Public License as published by the Free +; Software Foundation; either version 3, or (at your option) any later +; version. +; +; GCC is distributed in the hope that it will be useful, but WITHOUT +; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +; License for more details. +; +; You should have received a copy of the GNU General Public License +; along with GCC; see the file COPYING3. If not see +; . + +mimpure-text +Target Report +Pass -z text to linker diff -r 1c6d1fb0e76f gcc/config/sparc/sparc.opt --- a/gcc/config/sparc/sparc.opt Fri Jun 18 12:56:45 2010 +0200 +++ b/gcc/config/sparc/sparc.opt Fri Jun 18 13:27:35 2010 +0200 @@ -34,10 +34,6 @@ Target Report Mask(UNALIGNED_DOUBLES) Assume possible double misalignment -mimpure-text -Target Report -Pass -assert pure-text to linker - mapp-regs Target Report Mask(APP_REGS) Use ABI reserved registers diff -r 1c6d1fb0e76f gcc/doc/invoke.texi --- a/gcc/doc/invoke.texi Fri Jun 18 12:56:45 2010 +0200 +++ b/gcc/doc/invoke.texi Fri Jun 18 13:27:35 2010 +0200 @@ -833,6 +833,10 @@ -madjust-unroll -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol -maccumulate-outgoing-args -minvalid-symbols} +@emph{Solaris 2 Options} +@gccoptlist{-mimpure-text -mno-impure-text @gol +-threads -pthreads -pthread} + @emph{SPARC Options} @gccoptlist{-mcpu=@var{cpu-type} @gol -mtune=@var{cpu-type} @gol @@ -841,11 +845,10 @@ -mfaster-structs -mno-faster-structs @gol -mfpu -mno-fpu -mhard-float -msoft-float @gol -mhard-quad-float -msoft-quad-float @gol --mimpure-text -mno-impure-text -mlittle-endian @gol +-mlittle-endian @gol -mstack-bias -mno-stack-bias @gol -munaligned-doubles -mno-unaligned-doubles @gol --mv8plus -mno-v8plus -mvis -mno-vis --threads -pthreads -pthread} +-mv8plus -mno-v8plus -mvis -mno-vis} @emph{SPU Options} @gccoptlist{-mwarn-reloc -merror-reloc @gol @@ -9711,6 +9714,7 @@ * S/390 and zSeries Options:: * Score Options:: * SH Options:: +* Solaris 2 Options:: * SPARC Options:: * SPU Options:: * System V Options:: @@ -16376,6 +16380,51 @@ of symbol loads. The default is @option{-mno-invalid-symbols}. @end table +@node Solaris 2 Options +@subsection Solaris 2 Options +@cindex Solaris 2 options + +These @samp{-m} options are supported on Solaris 2: + +@table @gcctabopt +@item -mimpure-text +@opindex mimpure-text +@option{-mimpure-text}, used in addition to @option{-shared}, tells +the compiler to not pass @option{-z text} to the linker when linking a +shared object. Using this option, you can link position-dependent +code into a shared object. + +@option{-mimpure-text} suppresses the ``relocations remain against +allocatable but non-writable sections'' linker error message. +However, the necessary relocations will trigger copy-on-write, and the +shared object is not actually shared across processes. Instead of +using @option{-mimpure-text}, you should compile all source code with +@option{-fpic} or @option{-fPIC}. + +@end table + +These switches are supported in addition to the above on Solaris 2: + +@table @gcctabopt +@item -threads +@opindex threads +Add support for multithreading using the Solaris threads library. This +option sets flags for both the preprocessor and linker. This option does +not affect the thread safety of object code produced by the compiler or +that of libraries supplied with it. + +@item -pthreads +@opindex pthreads +Add support for multithreading using the POSIX threads library. This +option sets flags for both the preprocessor and linker. This option does +not affect the thread safety of object code produced by the compiler or +that of libraries supplied with it. + +@item -pthread +@opindex pthread +This is a synonym for @option{-pthreads}. +@end table + @node SPARC Options @subsection SPARC Options @cindex SPARC options @@ -16464,22 +16513,6 @@ acknowledges that their resulting code will not be directly in line with the rules of the ABI@. -@item -mimpure-text -@opindex mimpure-text -@option{-mimpure-text}, used in addition to @option{-shared}, tells -the compiler to not pass @option{-z text} to the linker when linking a -shared object. Using this option, you can link position-dependent -code into a shared object. - -@option{-mimpure-text} suppresses the ``relocations remain against -allocatable but non-writable sections'' linker error message. -However, the necessary relocations will trigger copy-on-write, and the -shared object is not actually shared across processes. Instead of -using @option{-mimpure-text}, you should compile all source code with -@option{-fpic} or @option{-fPIC}. - -This option is only available on SunOS and Solaris. - @item -mcpu=@var{cpu_type} @opindex mcpu Set the instruction set, register set, and instruction scheduling parameters @@ -16628,28 +16661,6 @@ Otherwise, assume no such offset is present. @end table -These switches are supported in addition to the above on Solaris: - -@table @gcctabopt -@item -threads -@opindex threads -Add support for multithreading using the Solaris threads library. This -option sets flags for both the preprocessor and linker. This option does -not affect the thread safety of object code produced by the compiler or -that of libraries supplied with it. - -@item -pthreads -@opindex pthreads -Add support for multithreading using the POSIX threads library. This -option sets flags for both the preprocessor and linker. This option does -not affect the thread safety of object code produced by the compiler or -that of libraries supplied with it. - -@item -pthread -@opindex pthread -This is a synonym for @option{-pthreads}. -@end table - @node SPU Options @subsection SPU Options @cindex SPU options