From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20336 invoked by alias); 24 May 2011 04:46:49 -0000 Received: (qmail 20327 invoked by uid 22791); 24 May 2011 04:46:48 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.44.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 24 May 2011 04:46:33 +0000 Received: from wpaz37.hot.corp.google.com (wpaz37.hot.corp.google.com [172.24.198.101]) by smtp-out.google.com with ESMTP id p4O4kWkx013264 for ; Mon, 23 May 2011 21:46:32 -0700 Received: from yib12 (yib12.prod.google.com [10.243.65.76]) by wpaz37.hot.corp.google.com with ESMTP id p4O4jrGs016378 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Mon, 23 May 2011 21:46:31 -0700 Received: by yib12 with SMTP id 12so2756000yib.29 for ; Mon, 23 May 2011 21:46:31 -0700 (PDT) MIME-Version: 1.0 Received: by 10.151.25.11 with SMTP id c11mr3541095ybj.445.1306212391251; Mon, 23 May 2011 21:46:31 -0700 (PDT) Received: by 10.151.107.3 with HTTP; Mon, 23 May 2011 21:46:31 -0700 (PDT) In-Reply-To: <4DCD34BC.3080506@codesourcery.com> References: <4DC956D0.3040306@codesourcery.com> <4DCD34BC.3080506@codesourcery.com> Date: Tue, 24 May 2011 10:33:00 -0000 Message-ID: Subject: Re: Prefixes for libgcc symbols (C6X 9.5/11) From: Ian Lance Taylor To: Bernd Schmidt Cc: GCC Patches , "Henderson, Stuart" , Mike Frysinger Content-Type: text/plain; charset=ISO-8859-1 X-System-Of-Record: true X-IsSubscribed: yes 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/msg01700.txt.bz2 > gcc/ > * libgcc2.h (__NW, __NDW): Define using a __gnu_ prefix if > LIBGCC2_GNU_PREFIX is defined. > (__N): New macro. > (__powisf2, __powidf2, __powitf2, __powixf2, __bswapsi2, __bswapdi2, > __mulsc3, __muldc3, __mulxc3, __multc3, __divsc3, __divdc3, __divxc3, > __divtc3, __udiv_w_sdiv, __clear_cache, __enable_execute_stack, > __clz_tab): Define using __N. > (__absvsi2, __negvsi2, __addvsi3, __subvsi3, __mulvsi3): Likewise if > COMPAT_SIMODE_TRAPPING_ARITHMETIC. > * target.def (libfunc_gnu_prefix): New hook. > * doc/tm.texi.in (LIBGCC2_GNU_PREFIX): Document. > (TARGET_LIBFUNC_GNU_PREFIX): Add hook. > * doc/tm.texi: Regenerate. > * system.h (LIBGCC2_GNU_PREFIX): Poison. > * optabs.c (gen_libfunc): Take the libfunc_gnu_prefix hook into > account. > (gen_interclass_conv_libfunc, gen_intraclass_conv_libfunc): Likewise. > (init_optabs): Likewise for the bswap libfuncs. > * tree.c (build_common_builtin_nodes): Likewise for complex multiply > and divide. > * config/t-slibgcc-elf-ver (SHLIB_MAPFILES): Use $$(libgcc_objdir). > * config/t-slibgcc-sld (SHLIB_MAPFILES): Likewise. > * libgcc-std.ver: Remove. > * Makefile.in (srcdirify): Handle $$(libgcc_objdir). > * config/frv/t-linux (SHLIB_MAPFILES): Use $$(libgcc_objdir) for > libgcc-std.ver. > * config/i386/t-linux (SHLIB_MAPFILES): Likewise. > * config/mips/t-slibgcc-irix (SHLIB_MAPFILES): Likewise. > * config/rs6000/t-aix43 (SHLIB_MAPFILES): Likewise. > * config/rs6000/t-aix52 (SHLIB_MAPFILES): Likewise. > * config/sparc/t-linux (SHLIB_MAPFILES): Likewise. > * config/i386/t-linux (SHLIB_MAPFILES): Likewise. > * config/i386/t-linux (SHLIB_MAPFILES): Likewise. > * config/fixed-bit.h (FIXED_OP): Define differently depending on > LIBGCC2_GNU_PREFIX. All uses changed not to pass leading underscores. > (FIXED_CONVERT_OP, FIXED_CONVERT_OP2): Likewise. > > libgcc/ > * libgcc-std.ver.in: New file. > * Makefile.in (LIBGCC_VER_GNU_PREFIX, LIBGCC_VER_SYMBOLS_PREFIX): New > variables. > (libgcc-std.ver): New rule. > * config/t-gnu-prefix: New file. > + /* Add a __gnu_ prefix to library functions rather than just __. */ > +DEFHOOKPOD > +(libfunc_gnu_prefix, > + "This hook can be used to override the default prefix given to library\n\ > +routines. Normally, this is just two underscores, @code{__}, but\n\ > +it if changed to true, then for example a name like @code{__gnu_muldi3}\n\ > +is used instead of the default @code{__muldi3}. This applies only to\n\ > +functions defined in @file{libgcc2.c}.", > + bool, false) This documentation needs to be better. This does not permit overridding the default prefix. I'm not sure what "it if changed to true" is trying to say. How about something more like: If false (the default) internal library routines start with two underscores. If set to true, these routines start with @code{__gnu_} instead. E.g., @code{__muldi3} changes to @code{__gnu_muldi3}. This currently only affects functions defined in @file{libgcc2.c}. If this is set to true, the @file{tm.h} file must also @code{#define LIBGCC2_GNU_PREFIX}. > +@defmac LIBGCC2_GNU_PREFIX > +This macro corresponds to the @code{TARGET_LIBFUNC_GNU_PREFIX} target > +hook and should be defined if this hook is overriden to be true. It > +causes function names in libgcc to be changed to use a @code{__gnu_} > +prefix for their name rather than the default @code{__}. A port which > +uses this macro should also arrange to use @file{t-gnu-prefix} in > +the libgcc @file{config.host}. > +@end defmac s/this hook/that hook/ This is OK with those changes. Thanks. Ian