From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23052 invoked by alias); 10 May 2011 11:36:18 -0000 Received: (qmail 22950 invoked by uid 22791); 10 May 2011 11:36:18 -0000 X-SWARE-Spam-Status: No, hits=-0.4 required=5.0 tests=AWL,BAYES_50,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 10 May 2011 11:36:04 +0000 Received: (qmail 19435 invoked from network); 10 May 2011 11:36:03 -0000 Received: from unknown (HELO digraph.polyomino.org.uk) (joseph@127.0.0.2) by mail.codesourcery.com with ESMTPA; 10 May 2011 11:36:03 -0000 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.72) (envelope-from ) id 1QJlEQ-0000ub-Br; Tue, 10 May 2011 11:36:02 +0000 Date: Tue, 10 May 2011 13:14:00 -0000 From: "Joseph S. Myers" To: Nathan Sidwell cc: GCC Patches Subject: Re: [ARM] TLS Descriptor support In-Reply-To: <4DC8DFF6.4000600@codesourcery.com> Message-ID: References: <4DC8DFF6.4000600@codesourcery.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-05/txt/msg00727.txt.bz2 On Tue, 10 May 2011, Nathan Sidwell wrote: > +@item -mtls-dialect=@var{dialect} > +@opindex mtls-dialect > +Specify the dialect to use for accessing thread local storage. Two > +dialects are supported - @option{arm} and @option{gnu}. The Use "---" (em dash, unspaced) instead of " - ". > +@option{arm} dialect selects the ARM EABI scheme for supporting local > +and global dynamic tls models. The @option{gnu} dialect selects the "TLS" not "tls". > +Specify the default tls dialect, for systems were there is a choice. Likewise. > + with_tls=${with_tls:arm} Do you mean ${with_tls:-arm}? > @@ -1755,6 +1759,17 @@ arm_option_override (void) > error ("invalid thread pointer option: -mtp=%s", target_thread_switch); > } > > + if (target_tls_dialect_switch) > + { > + if (strcmp (target_tls_dialect_switch, "arm") == 0) > + target_tls_dialect = TLS_ARM; > + else if (strcmp (target_tls_dialect_switch, "gnu") == 0) > + target_tls_dialect = TLS_GNU; > + else > + error ("invalid thread dialect option: -mtls-dialect=%s", > + target_tls_dialect_switch); > + } Rather than checking for strings manually like this, it's now better to use the .opt Enum facility for options such as this with a fixed enumerated set of values, so target_tls_dialect can be set directly from the .opt file using Var and Enum. (If you want a custom error message, you can use UnknownError on the enumeration record to specify it.) -- Joseph S. Myers joseph@codesourcery.com