libgcc2.h (__NW, __NDW): Define using a __gnu_ prefix if LIBGCC2_GNU_PREFIX is defined.

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.

From-SVN: r174187
This commit is contained in:
Bernd Schmidt 2011-05-25 12:11:42 +00:00 committed by Bernd Schmidt
parent f242c0a5c0
commit cdbf45414a
23 changed files with 2181 additions and 60 deletions

View File

@ -1,3 +1,42 @@
2011-05-25 Bernd Schmidt <bernds@codesourcery.com>
* 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.
2011-05-25 Jan Hubicka <jh@suse.cz> 2011-05-25 Jan Hubicka <jh@suse.cz>
* lto-streamer-out.c (output_record_start): Use lto_output_enum * lto-streamer-out.c (output_record_start): Use lto_output_enum

View File

@ -1898,7 +1898,10 @@ LIB2ADD_ST = $(LIB2FUNCS_STATIC_EXTRA)
# which case they will start with $(srcdir)), or generated into the build # which case they will start with $(srcdir)), or generated into the build
# directory (in which case they will be relative paths). # directory (in which case they will be relative paths).
srcdirify = $(patsubst $(srcdir)%,$$(gcc_srcdir)%,$(filter $(srcdir)%,$(1))) \ srcdirify = $(patsubst $(srcdir)%,$$(gcc_srcdir)%,$(filter $(srcdir)%,$(1))) \
$(patsubst %,$$(gcc_objdir)/%,$(filter-out $(srcdir)%,$(1))) $(patsubst $$(libgcc_objdir)/%,%, \
$(filter $$(libgcc_objdir)%,$(1))) \
$(patsubst %,$$(gcc_objdir)/%, \
$(filter-out $(srcdir)% $$(libgcc_objdir)%,$(1)))
# The distinction between these two variables is no longer relevant, # The distinction between these two variables is no longer relevant,
# so we combine them. Sort removes duplicates. # so we combine them. Sort removes duplicates.

View File

@ -445,35 +445,39 @@ typedef union
#define IBITS IBITS2(MODE_NAME) #define IBITS IBITS2(MODE_NAME)
#define I_F_BITS (FBITS + IBITS) #define I_F_BITS (FBITS + IBITS)
#define FIXED_OP(OP,MODE,NUM) OP ## MODE ## NUM #ifdef LIBGCC2_GNU_PREFIX
#define FIXED_OP(OP,MODE,NUM) __gnu_ ## OP ## MODE ## NUM
#else
#define FIXED_OP(OP,MODE,NUM) __ ## OP ## MODE ## NUM
#endif
#define FIXED_SATURATE1_TEMP(NAME) FIXED_OP(__saturate1,NAME,) #define FIXED_SATURATE1_TEMP(NAME) FIXED_OP(saturate1,NAME,)
#define FIXED_SATURATE2_TEMP(NAME) FIXED_OP(__saturate2,NAME,) #define FIXED_SATURATE2_TEMP(NAME) FIXED_OP(saturate2,NAME,)
#define FIXED_MULHELPER_TEMP(NAME) FIXED_OP(__mulhelper,NAME,) #define FIXED_MULHELPER_TEMP(NAME) FIXED_OP(mulhelper,NAME,)
#define FIXED_DIVHELPER_TEMP(NAME) FIXED_OP(__divhelper,NAME,) #define FIXED_DIVHELPER_TEMP(NAME) FIXED_OP(divhelper,NAME,)
#define FIXED_ASHLHELPER_TEMP(NAME) FIXED_OP(__ashlhelper,NAME,) #define FIXED_ASHLHELPER_TEMP(NAME) FIXED_OP(ashlhelper,NAME,)
#define FIXED_ADD_TEMP(NAME) FIXED_OP(__add,NAME,3) #define FIXED_ADD_TEMP(NAME) FIXED_OP(add,NAME,3)
#define FIXED_SSADD_TEMP(NAME) FIXED_OP(__ssadd,NAME,3) #define FIXED_SSADD_TEMP(NAME) FIXED_OP(ssadd,NAME,3)
#define FIXED_USADD_TEMP(NAME) FIXED_OP(__usadd,NAME,3) #define FIXED_USADD_TEMP(NAME) FIXED_OP(usadd,NAME,3)
#define FIXED_SUB_TEMP(NAME) FIXED_OP(__sub,NAME,3) #define FIXED_SUB_TEMP(NAME) FIXED_OP(sub,NAME,3)
#define FIXED_SSSUB_TEMP(NAME) FIXED_OP(__sssub,NAME,3) #define FIXED_SSSUB_TEMP(NAME) FIXED_OP(sssub,NAME,3)
#define FIXED_USSUB_TEMP(NAME) FIXED_OP(__ussub,NAME,3) #define FIXED_USSUB_TEMP(NAME) FIXED_OP(ussub,NAME,3)
#define FIXED_MUL_TEMP(NAME) FIXED_OP(__mul,NAME,3) #define FIXED_MUL_TEMP(NAME) FIXED_OP(mul,NAME,3)
#define FIXED_SSMUL_TEMP(NAME) FIXED_OP(__ssmul,NAME,3) #define FIXED_SSMUL_TEMP(NAME) FIXED_OP(ssmul,NAME,3)
#define FIXED_USMUL_TEMP(NAME) FIXED_OP(__usmul,NAME,3) #define FIXED_USMUL_TEMP(NAME) FIXED_OP(usmul,NAME,3)
#define FIXED_DIV_TEMP(NAME) FIXED_OP(__div,NAME,3) #define FIXED_DIV_TEMP(NAME) FIXED_OP(div,NAME,3)
#define FIXED_UDIV_TEMP(NAME) FIXED_OP(__udiv,NAME,3) #define FIXED_UDIV_TEMP(NAME) FIXED_OP(udiv,NAME,3)
#define FIXED_SSDIV_TEMP(NAME) FIXED_OP(__ssdiv,NAME,3) #define FIXED_SSDIV_TEMP(NAME) FIXED_OP(ssdiv,NAME,3)
#define FIXED_USDIV_TEMP(NAME) FIXED_OP(__usdiv,NAME,3) #define FIXED_USDIV_TEMP(NAME) FIXED_OP(usdiv,NAME,3)
#define FIXED_NEG_TEMP(NAME) FIXED_OP(__neg,NAME,2) #define FIXED_NEG_TEMP(NAME) FIXED_OP(neg,NAME,2)
#define FIXED_SSNEG_TEMP(NAME) FIXED_OP(__ssneg,NAME,2) #define FIXED_SSNEG_TEMP(NAME) FIXED_OP(ssneg,NAME,2)
#define FIXED_USNEG_TEMP(NAME) FIXED_OP(__usneg,NAME,2) #define FIXED_USNEG_TEMP(NAME) FIXED_OP(usneg,NAME,2)
#define FIXED_ASHL_TEMP(NAME) FIXED_OP(__ashl,NAME,3) #define FIXED_ASHL_TEMP(NAME) FIXED_OP(ashl,NAME,3)
#define FIXED_ASHR_TEMP(NAME) FIXED_OP(__ashr,NAME,3) #define FIXED_ASHR_TEMP(NAME) FIXED_OP(ashr,NAME,3)
#define FIXED_LSHR_TEMP(NAME) FIXED_OP(__lshr,NAME,3) #define FIXED_LSHR_TEMP(NAME) FIXED_OP(lshr,NAME,3)
#define FIXED_SSASHL_TEMP(NAME) FIXED_OP(__ssashl,NAME,3) #define FIXED_SSASHL_TEMP(NAME) FIXED_OP(ssashl,NAME,3)
#define FIXED_USASHL_TEMP(NAME) FIXED_OP(__usashl,NAME,3) #define FIXED_USASHL_TEMP(NAME) FIXED_OP(usashl,NAME,3)
#define FIXED_CMP_TEMP(NAME) FIXED_OP(__cmp,NAME,2) #define FIXED_CMP_TEMP(NAME) FIXED_OP(cmp,NAME,2)
#if defined (MODE_NAME) #if defined (MODE_NAME)
#if defined (DINT_C_TYPE) #if defined (DINT_C_TYPE)
@ -1146,14 +1150,19 @@ extern FIXED_C_TYPE FIXED_USASHL (FIXED_C_TYPE, word_type);
#define TO_HAVE_PADDING_BITS (TO_PADDING_BITS > 0) #define TO_HAVE_PADDING_BITS (TO_PADDING_BITS > 0)
#endif /* TO_TYPE == 4 */ #endif /* TO_TYPE == 4 */
#define FIXED_CONVERT_OP(OP,FROM,TO) OP ## FROM ## TO #ifdef LIBGCC2_GNU_PREFIX
#define FIXED_CONVERT_OP2(OP,FROM,TO) OP ## FROM ## TO ## 2 #define FIXED_CONVERT_OP(OP,FROM,TO) __gnu_ ## OP ## FROM ## TO
#define FRACT_TEMP(N1,N2) FIXED_CONVERT_OP(__fract,N1,N2) #define FIXED_CONVERT_OP2(OP,FROM,TO) __gnu_ ## OP ## FROM ## TO ## 2
#define FRACT2_TEMP(N1,N2) FIXED_CONVERT_OP2(__fract,N1,N2) #else
#define SATFRACT_TEMP(N1,N2) FIXED_CONVERT_OP(__satfract,N1,N2) #define FIXED_CONVERT_OP(OP,FROM,TO) __ ## OP ## FROM ## TO
#define SATFRACT2_TEMP(N1,N2) FIXED_CONVERT_OP2(__satfract,N1,N2) #define FIXED_CONVERT_OP2(OP,FROM,TO) __ ## OP ## FROM ## TO ## 2
#define FRACTUNS_TEMP(N1,N2) FIXED_CONVERT_OP(__fractuns,N1,N2) #endif
#define SATFRACTUNS_TEMP(N1,N2) FIXED_CONVERT_OP(__satfractuns,N1,N2) #define FRACT_TEMP(N1,N2) FIXED_CONVERT_OP(fract,N1,N2)
#define FRACT2_TEMP(N1,N2) FIXED_CONVERT_OP2(fract,N1,N2)
#define SATFRACT_TEMP(N1,N2) FIXED_CONVERT_OP(satfract,N1,N2)
#define SATFRACT2_TEMP(N1,N2) FIXED_CONVERT_OP2(satfract,N1,N2)
#define FRACTUNS_TEMP(N1,N2) FIXED_CONVERT_OP(fractuns,N1,N2)
#define SATFRACTUNS_TEMP(N1,N2) FIXED_CONVERT_OP(satfractuns,N1,N2)
/* Define conversions from fixed-point to fixed-point. */ /* Define conversions from fixed-point to fixed-point. */
#if FROM_TYPE == 4 && TO_TYPE == 4 #if FROM_TYPE == 4 && TO_TYPE == 4

View File

@ -29,5 +29,5 @@ EXTRA_MULTILIB_PARTS =
CRTSTUFF_T_CFLAGS = -fPIC CRTSTUFF_T_CFLAGS = -fPIC
TARGET_LIBGCC2_CFLAGS = -fPIC TARGET_LIBGCC2_CFLAGS = -fPIC
SHLIB_MAPFILES = $(srcdir)/libgcc-std.ver \ SHLIB_MAPFILES = $$(libgcc_objdir)/libgcc-std.ver \
$(srcdir)/config/frv/libgcc-frv.ver $(srcdir)/config/frv/libgcc-frv.ver

View File

@ -113,4 +113,4 @@ SHLIB_MKMAP = $(srcdir)/mkmap-flat.awk
# We'd like to use SHLIB_SONAME here too, but shlib_base_name # We'd like to use SHLIB_SONAME here too, but shlib_base_name
# does not get substituted before mkmap-flat.awk is run. # does not get substituted before mkmap-flat.awk is run.
SHLIB_MKMAP_OPTS = -v pe_dll=libgcc_s_$(EH_MODEL)-$(SHLIB_SOVERSION)$(SHLIB_EXT) SHLIB_MKMAP_OPTS = -v pe_dll=libgcc_s_$(EH_MODEL)-$(SHLIB_SOVERSION)$(SHLIB_EXT)
SHLIB_MAPFILES = $(srcdir)/libgcc-std.ver SHLIB_MAPFILES = $$(libgcc_objdir)/libgcc-std.ver

View File

@ -1,5 +1,5 @@
# On 64bit we do not need any exports for glibc for 64-bit libgcc_s. # On 64bit we do not need any exports for glibc for 64-bit libgcc_s.
# Need to support TImode for x86. Override the settings from # Need to support TImode for x86. Override the settings from
# t-slibgcc-elf-ver and t-linux # t-slibgcc-elf-ver and t-linux
SHLIB_MAPFILES = $(srcdir)/libgcc-std.ver \ SHLIB_MAPFILES = $$(libgcc_objdir)/libgcc-std.ver \
$(srcdir)/config/i386/libgcc-glibc.ver $(srcdir)/config/i386/libgcc-glibc.ver

View File

@ -49,4 +49,4 @@ SHLIB_INSTALL = \
$(LN_S) $(SHLIB_SONAME) \ $(LN_S) $(SHLIB_SONAME) \
$$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK) $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK)
SHLIB_MKMAP = $(srcdir)/mkmap-flat.awk SHLIB_MKMAP = $(srcdir)/mkmap-flat.awk
SHLIB_MAPFILES = $(srcdir)/libgcc-std.ver SHLIB_MAPFILES = $$(libgcc_objdir)/libgcc-std.ver

View File

@ -82,7 +82,7 @@ SHLIB_INSTALL = \
$$(DESTDIR)$$(slibdir)@shlib_slibdir_qual@/ $$(DESTDIR)$$(slibdir)@shlib_slibdir_qual@/
SHLIB_LIBS = -lc `case @multilib_dir@ in *pthread*) echo -lpthread ;; esac` SHLIB_LIBS = -lc `case @multilib_dir@ in *pthread*) echo -lpthread ;; esac`
SHLIB_MKMAP = $(srcdir)/mkmap-flat.awk SHLIB_MKMAP = $(srcdir)/mkmap-flat.awk
SHLIB_MAPFILES = $(srcdir)/libgcc-std.ver $(srcdir)/config/rs6000/libgcc-ppc64.ver SHLIB_MAPFILES = $$(libgcc_objdir)/libgcc-std.ver $(srcdir)/config/rs6000/libgcc-ppc64.ver
SHLIB_NM_FLAGS = -Bpg -X32_64 SHLIB_NM_FLAGS = -Bpg -X32_64
# GCC 128-bit long double support routines. # GCC 128-bit long double support routines.

View File

@ -63,7 +63,7 @@ SHLIB_INSTALL = \
$$(DESTDIR)$$(slibdir)@shlib_slibdir_qual@/ $$(DESTDIR)$$(slibdir)@shlib_slibdir_qual@/
SHLIB_LIBS = -lc `case @multilib_dir@ in *pthread*) echo -lpthread ;; esac` SHLIB_LIBS = -lc `case @multilib_dir@ in *pthread*) echo -lpthread ;; esac`
SHLIB_MKMAP = $(srcdir)/mkmap-flat.awk SHLIB_MKMAP = $(srcdir)/mkmap-flat.awk
SHLIB_MAPFILES = $(srcdir)/libgcc-std.ver $(srcdir)/config/rs6000/libgcc-ppc64.ver SHLIB_MAPFILES = $$(libgcc_objdir)/libgcc-std.ver $(srcdir)/config/rs6000/libgcc-ppc64.ver
SHLIB_NM_FLAGS = -Bpg -X32_64 SHLIB_NM_FLAGS = -Bpg -X32_64
# GCC 128-bit long double support routines. # GCC 128-bit long double support routines.

View File

@ -1,5 +1,5 @@
# Override t-slibgcc-elf-ver to export some libgcc symbols with # Override t-slibgcc-elf-ver to export some libgcc symbols with
# the symbol versions that glibc used. # the symbol versions that glibc used.
# Avoid the t-linux version file. # Avoid the t-linux version file.
SHLIB_MAPFILES = $(srcdir)/libgcc-std.ver \ SHLIB_MAPFILES = $$(libgcc_objdir)/libgcc-std.ver \
$(srcdir)/config/sparc/libgcc-sparc-glibc.ver $(srcdir)/config/sparc/libgcc-sparc-glibc.ver

View File

@ -53,4 +53,4 @@ SHLIB_INSTALL = \
rm -f $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK); \ rm -f $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK); \
$(SHLIB_INSTALL_SOLINK) $(SHLIB_INSTALL_SOLINK)
SHLIB_MKMAP = $(srcdir)/mkmap-symver.awk SHLIB_MKMAP = $(srcdir)/mkmap-symver.awk
SHLIB_MAPFILES = $(srcdir)/libgcc-std.ver SHLIB_MAPFILES = $$(libgcc_objdir)/libgcc-std.ver

View File

@ -47,4 +47,4 @@ SHLIB_INSTALL = \
$(LN_S) $(SHLIB_SONAME) \ $(LN_S) $(SHLIB_SONAME) \
$$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK) $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK)
SHLIB_MKMAP = $(srcdir)/mkmap-symver.awk SHLIB_MKMAP = $(srcdir)/mkmap-symver.awk
SHLIB_MAPFILES = $(srcdir)/libgcc-std.ver SHLIB_MAPFILES = $$(libgcc_objdir)/libgcc-std.ver

View File

@ -1581,6 +1581,15 @@ anyway. If you don't define this and @code{LIBGCC2_LONG_DOUBLE_TYPE_SIZE}
is 128 then the default is 1, otherwise it is 0. is 128 then the default is 1, otherwise it is 0.
@end defmac @end defmac
@defmac LIBGCC2_GNU_PREFIX
This macro corresponds to the @code{TARGET_LIBFUNC_GNU_PREFIX} target
hook and should be defined if that 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
@defmac SF_SIZE @defmac SF_SIZE
@defmacx DF_SIZE @defmacx DF_SIZE
@defmacx XF_SIZE @defmacx XF_SIZE
@ -5245,6 +5254,15 @@ library routines.
The default is to do nothing. Most ports don't need to define this hook. The default is to do nothing. Most ports don't need to define this hook.
@end deftypefn @end deftypefn
@deftypevr {Target Hook} bool TARGET_LIBFUNC_GNU_PREFIX
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}.
@end deftypevr
@defmac FLOAT_LIB_COMPARE_RETURNS_BOOL (@var{mode}, @var{comparison}) @defmac FLOAT_LIB_COMPARE_RETURNS_BOOL (@var{mode}, @var{comparison})
This macro should return @code{true} if the library routine that This macro should return @code{true} if the library routine that
implements the floating point comparison operator @var{comparison} in implements the floating point comparison operator @var{comparison} in

View File

@ -1571,6 +1571,15 @@ anyway. If you don't define this and @code{LIBGCC2_LONG_DOUBLE_TYPE_SIZE}
is 128 then the default is 1, otherwise it is 0. is 128 then the default is 1, otherwise it is 0.
@end defmac @end defmac
@defmac LIBGCC2_GNU_PREFIX
This macro corresponds to the @code{TARGET_LIBFUNC_GNU_PREFIX} target
hook and should be defined if that 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
@defmac SF_SIZE @defmac SF_SIZE
@defmacx DF_SIZE @defmacx DF_SIZE
@defmacx XF_SIZE @defmacx XF_SIZE
@ -5197,6 +5206,8 @@ library routines.
The default is to do nothing. Most ports don't need to define this hook. The default is to do nothing. Most ports don't need to define this hook.
@end deftypefn @end deftypefn
@hook TARGET_LIBFUNC_GNU_PREFIX
@defmac FLOAT_LIB_COMPARE_RETURNS_BOOL (@var{mode}, @var{comparison}) @defmac FLOAT_LIB_COMPARE_RETURNS_BOOL (@var{mode}, @var{comparison})
This macro should return @code{true} if the library routine that This macro should return @code{true} if the library routine that
implements the floating point comparison operator @var{comparison} in implements the floating point comparison operator @var{comparison} in

View File

@ -193,8 +193,13 @@ typedef int shift_count_type __attribute__((mode (__libgcc_shift_count__)));
#define UHWtype UDItype #define UHWtype UDItype
#define DWtype TItype #define DWtype TItype
#define UDWtype UTItype #define UDWtype UTItype
#ifdef LIBGCC2_GNU_PREFIX
#define __NW(a,b) __gnu_ ## a ## di ## b
#define __NDW(a,b) __gnu_ ## a ## ti ## b
#else
#define __NW(a,b) __ ## a ## di ## b #define __NW(a,b) __ ## a ## di ## b
#define __NDW(a,b) __ ## a ## ti ## b #define __NDW(a,b) __ ## a ## ti ## b
#endif
#define COMPAT_SIMODE_TRAPPING_ARITHMETIC #define COMPAT_SIMODE_TRAPPING_ARITHMETIC
#elif LIBGCC2_UNITS_PER_WORD == 4 #elif LIBGCC2_UNITS_PER_WORD == 4
#define W_TYPE_SIZE (4 * BITS_PER_UNIT) #define W_TYPE_SIZE (4 * BITS_PER_UNIT)
@ -204,8 +209,13 @@ typedef int shift_count_type __attribute__((mode (__libgcc_shift_count__)));
#define UHWtype USItype #define UHWtype USItype
#define DWtype DItype #define DWtype DItype
#define UDWtype UDItype #define UDWtype UDItype
#ifdef LIBGCC2_GNU_PREFIX
#define __NW(a,b) __gnu_ ## a ## si ## b
#define __NDW(a,b) __gnu_ ## a ## di ## b
#else
#define __NW(a,b) __ ## a ## si ## b #define __NW(a,b) __ ## a ## si ## b
#define __NDW(a,b) __ ## a ## di ## b #define __NDW(a,b) __ ## a ## di ## b
#endif
#elif LIBGCC2_UNITS_PER_WORD == 2 #elif LIBGCC2_UNITS_PER_WORD == 2
#define W_TYPE_SIZE (2 * BITS_PER_UNIT) #define W_TYPE_SIZE (2 * BITS_PER_UNIT)
#define Wtype HItype #define Wtype HItype
@ -214,8 +224,13 @@ typedef int shift_count_type __attribute__((mode (__libgcc_shift_count__)));
#define UHWtype UHItype #define UHWtype UHItype
#define DWtype SItype #define DWtype SItype
#define UDWtype USItype #define UDWtype USItype
#ifdef LIBGCC2_GNU_PREFIX
#define __NW(a,b) __gnu_ ## a ## hi ## b
#define __NDW(a,b) __gnu_ ## a ## si ## b
#else
#define __NW(a,b) __ ## a ## hi ## b #define __NW(a,b) __ ## a ## hi ## b
#define __NDW(a,b) __ ## a ## si ## b #define __NDW(a,b) __ ## a ## si ## b
#endif
#else #else
#define W_TYPE_SIZE BITS_PER_UNIT #define W_TYPE_SIZE BITS_PER_UNIT
#define Wtype QItype #define Wtype QItype
@ -224,10 +239,20 @@ typedef int shift_count_type __attribute__((mode (__libgcc_shift_count__)));
#define UHWtype UQItype #define UHWtype UQItype
#define DWtype HItype #define DWtype HItype
#define UDWtype UHItype #define UDWtype UHItype
#ifdef LIBGCC2_GNU_PREFIX
#define __NW(a,b) __gnu_ ## a ## qi ## b
#define __NDW(a,b) __gnu_ ## a ## hi ## b
#else
#define __NW(a,b) __ ## a ## qi ## b #define __NW(a,b) __ ## a ## qi ## b
#define __NDW(a,b) __ ## a ## hi ## b #define __NDW(a,b) __ ## a ## hi ## b
#endif #endif
#endif
#ifdef LIBGCC2_GNU_PREFIX
#define __N(a) __gnu_ ## a
#else
#define __N(a) __ ## a
#endif
#define Wtype_MAX ((Wtype)(((UWtype)1 << (W_TYPE_SIZE - 1)) - 1)) #define Wtype_MAX ((Wtype)(((UWtype)1 << (W_TYPE_SIZE - 1)) - 1))
#define Wtype_MIN (- Wtype_MAX - 1) #define Wtype_MIN (- Wtype_MAX - 1)
@ -298,6 +323,25 @@ typedef int shift_count_type __attribute__((mode (__libgcc_shift_count__)));
#define __popcountDI2 __NDW(popcount,2) #define __popcountDI2 __NDW(popcount,2)
#define __parityDI2 __NDW(parity,2) #define __parityDI2 __NDW(parity,2)
#define __clz_tab __N(clz_tab)
#define __powisf2 __N(powisf2)
#define __powidf2 __N(powidf2)
#define __powitf2 __N(powitf2)
#define __powixf2 __N(powixf2)
#define __bswapsi2 __N(bswapsi2)
#define __bswapdi2 __N(bswapdi2)
#define __mulsc3 __N(mulsc3)
#define __muldc3 __N(muldc3)
#define __mulxc3 __N(mulxc3)
#define __multc3 __N(multc3)
#define __divsc3 __N(divsc3)
#define __divdc3 __N(divdc3)
#define __divxc3 __N(divxc3)
#define __divtc3 __N(divtc3)
#define __udiv_w_sdiv __N(udiv_w_sdiv)
#define __clear_cache __N(clear_cache)
#define __enable_execute_stack __N(enable_execute_stack)
extern DWtype __muldi3 (DWtype, DWtype); extern DWtype __muldi3 (DWtype, DWtype);
extern DWtype __divdi3 (DWtype, DWtype); extern DWtype __divdi3 (DWtype, DWtype);
extern UDWtype __udivdi3 (UDWtype, UDWtype); extern UDWtype __udivdi3 (UDWtype, UDWtype);
@ -347,6 +391,12 @@ extern DWtype __mulvDI3 (DWtype, DWtype);
extern DWtype __negvDI2 (DWtype); extern DWtype __negvDI2 (DWtype);
#ifdef COMPAT_SIMODE_TRAPPING_ARITHMETIC #ifdef COMPAT_SIMODE_TRAPPING_ARITHMETIC
#define __absvsi2 __N(absvsi2)
#define __negvsi2 __N(negvsi2)
#define __addvsi3 __N(addvsi3)
#define __subvsi3 __N(subvsi3)
#define __mulvsi3 __N(mulvsi3)
extern SItype __absvsi2 (SItype); extern SItype __absvsi2 (SItype);
extern SItype __addvsi3 (SItype, SItype); extern SItype __addvsi3 (SItype, SItype);
extern SItype __subvsi3 (SItype, SItype); extern SItype __subvsi3 (SItype, SItype);

View File

@ -5152,13 +5152,22 @@ gen_libfunc (optab optable, const char *opname, int suffix, enum machine_mode mo
unsigned opname_len = strlen (opname); unsigned opname_len = strlen (opname);
const char *mname = GET_MODE_NAME (mode); const char *mname = GET_MODE_NAME (mode);
unsigned mname_len = strlen (mname); unsigned mname_len = strlen (mname);
char *libfunc_name = XALLOCAVEC (char, 2 + opname_len + mname_len + 1 + 1); int prefix_len = targetm.libfunc_gnu_prefix ? 6 : 2;
int len = prefix_len + opname_len + mname_len + 1 + 1;
char *libfunc_name = XALLOCAVEC (char, len);
char *p; char *p;
const char *q; const char *q;
p = libfunc_name; p = libfunc_name;
*p++ = '_'; *p++ = '_';
*p++ = '_'; *p++ = '_';
if (targetm.libfunc_gnu_prefix)
{
*p++ = 'g';
*p++ = 'n';
*p++ = 'u';
*p++ = '_';
}
for (q = opname; *q; ) for (q = opname; *q; )
*p++ = *q++; *p++ = *q++;
for (q = mname; *q; q++) for (q = mname; *q; q++)
@ -5362,6 +5371,7 @@ gen_interclass_conv_libfunc (convert_optab tab,
const char *fname, *tname; const char *fname, *tname;
const char *q; const char *q;
int prefix_len = targetm.libfunc_gnu_prefix ? 6 : 2;
char *libfunc_name, *suffix; char *libfunc_name, *suffix;
char *nondec_name, *dec_name, *nondec_suffix, *dec_suffix; char *nondec_name, *dec_name, *nondec_suffix, *dec_suffix;
char *p; char *p;
@ -5372,11 +5382,19 @@ gen_interclass_conv_libfunc (convert_optab tab,
mname_len = strlen (GET_MODE_NAME (tmode)) + strlen (GET_MODE_NAME (fmode)); mname_len = strlen (GET_MODE_NAME (tmode)) + strlen (GET_MODE_NAME (fmode));
nondec_name = XALLOCAVEC (char, 2 + opname_len + mname_len + 1 + 1); nondec_name = XALLOCAVEC (char, prefix_len + opname_len + mname_len + 1 + 1);
nondec_name[0] = '_'; nondec_name[0] = '_';
nondec_name[1] = '_'; nondec_name[1] = '_';
memcpy (&nondec_name[2], opname, opname_len); if (targetm.libfunc_gnu_prefix)
nondec_suffix = nondec_name + opname_len + 2; {
nondec_name[2] = 'g';
nondec_name[3] = 'n';
nondec_name[4] = 'u';
nondec_name[5] = '_';
}
memcpy (&nondec_name[prefix_len], opname, opname_len);
nondec_suffix = nondec_name + opname_len + prefix_len;
dec_name = XALLOCAVEC (char, 2 + dec_len + opname_len + mname_len + 1 + 1); dec_name = XALLOCAVEC (char, 2 + dec_len + opname_len + mname_len + 1 + 1);
dec_name[0] = '_'; dec_name[0] = '_';
@ -5487,6 +5505,7 @@ gen_intraclass_conv_libfunc (convert_optab tab, const char *opname,
const char *fname, *tname; const char *fname, *tname;
const char *q; const char *q;
int prefix_len = targetm.libfunc_gnu_prefix ? 6 : 2;
char *nondec_name, *dec_name, *nondec_suffix, *dec_suffix; char *nondec_name, *dec_name, *nondec_suffix, *dec_suffix;
char *libfunc_name, *suffix; char *libfunc_name, *suffix;
char *p; char *p;
@ -5500,8 +5519,15 @@ gen_intraclass_conv_libfunc (convert_optab tab, const char *opname,
nondec_name = XALLOCAVEC (char, 2 + opname_len + mname_len + 1 + 1); nondec_name = XALLOCAVEC (char, 2 + opname_len + mname_len + 1 + 1);
nondec_name[0] = '_'; nondec_name[0] = '_';
nondec_name[1] = '_'; nondec_name[1] = '_';
memcpy (&nondec_name[2], opname, opname_len); if (targetm.libfunc_gnu_prefix)
nondec_suffix = nondec_name + opname_len + 2; {
nondec_name[2] = 'g';
nondec_name[3] = 'n';
nondec_name[4] = 'u';
nondec_name[5] = '_';
}
memcpy (&nondec_name[prefix_len], opname, opname_len);
nondec_suffix = nondec_name + opname_len + prefix_len;
dec_name = XALLOCAVEC (char, 2 + dec_len + opname_len + mname_len + 1 + 1); dec_name = XALLOCAVEC (char, 2 + dec_len + opname_len + mname_len + 1 + 1);
dec_name[0] = '_'; dec_name[0] = '_';
@ -6231,8 +6257,16 @@ init_optabs (void)
/* Explicitly initialize the bswap libfuncs since we need them to be /* Explicitly initialize the bswap libfuncs since we need them to be
valid for things other than word_mode. */ valid for things other than word_mode. */
set_optab_libfunc (bswap_optab, SImode, "__bswapsi2"); if (targetm.libfunc_gnu_prefix)
set_optab_libfunc (bswap_optab, DImode, "__bswapdi2"); {
set_optab_libfunc (bswap_optab, SImode, "__gnu_bswapsi2");
set_optab_libfunc (bswap_optab, DImode, "__gnu_bswapdi2");
}
else
{
set_optab_libfunc (bswap_optab, SImode, "__bswapsi2");
set_optab_libfunc (bswap_optab, DImode, "__bswapdi2");
}
/* Use cabs for double complex abs, since systems generally have cabs. /* Use cabs for double complex abs, since systems generally have cabs.
Don't define any libcall for float complex, so that cabs will be used. */ Don't define any libcall for float complex, so that cabs will be used. */

View File

@ -762,8 +762,8 @@ extern void fancy_abort (const char *, int, const char *) ATTRIBUTE_NORETURN;
HOT_TEXT_SECTION_NAME LEGITIMATE_CONSTANT_P HOT_TEXT_SECTION_NAME LEGITIMATE_CONSTANT_P
/* Target macros only used for code built for the target, that have /* Target macros only used for code built for the target, that have
moved to libgcc-tm.h. */ moved to libgcc-tm.h or have never been present elsewhere. */
#pragma GCC poison DECLARE_LIBRARY_RENAMES #pragma GCC poison DECLARE_LIBRARY_RENAMES LIBGCC2_GNU_PREFIX
/* Other obsolete target macros, or macros that used to be in target /* Other obsolete target macros, or macros that used to be in target
headers and were not used, and may be obsolete or may never have headers and were not used, and may be obsolete or may never have

View File

@ -1242,6 +1242,17 @@ DEFHOOK
void, (void), void, (void),
hook_void_void) hook_void_void)
/* Add a __gnu_ prefix to library functions rather than just __. */
DEFHOOKPOD
(libfunc_gnu_prefix,
"If false (the default), internal library routines start with two\n\
underscores. If set to true, these routines start with @code{__gnu_}\n\
instead. E.g., @code{__muldi3} changes to @code{__gnu_muldi3}. This\n\
currently only affects functions defined in @file{libgcc2.c}. If this\n\
is set to true, the @file{tm.h} file must also\n\
@code{#define LIBGCC2_GNU_PREFIX}.",
bool, false)
/* Given a decl, a section name, and whether the decl initializer /* Given a decl, a section name, and whether the decl initializer
has relocs, choose attributes for the section. */ has relocs, choose attributes for the section. */
/* ??? Should be merged with SELECT_SECTION and UNIQUE_SECTION. */ /* ??? Should be merged with SELECT_SECTION and UNIQUE_SECTION. */

View File

@ -9525,6 +9525,10 @@ build_common_builtin_nodes (void)
const char *p; const char *p;
enum built_in_function mcode, dcode; enum built_in_function mcode, dcode;
tree type, inner_type; tree type, inner_type;
const char *prefix = "__";
if (targetm.libfunc_gnu_prefix)
prefix = "__gnu_";
type = lang_hooks.types.type_for_mode ((enum machine_mode) mode, 0); type = lang_hooks.types.type_for_mode ((enum machine_mode) mode, 0);
if (type == NULL) if (type == NULL)
@ -9543,13 +9547,17 @@ build_common_builtin_nodes (void)
*q = TOLOWER (*p); *q = TOLOWER (*p);
*q = '\0'; *q = '\0';
built_in_names[mcode] = concat ("__mul", mode_name_buf, "3", NULL); built_in_names[mcode] = concat (prefix, "mul", mode_name_buf, "3",
NULL);
local_define_builtin (built_in_names[mcode], ftype, mcode, local_define_builtin (built_in_names[mcode], ftype, mcode,
built_in_names[mcode], ECF_CONST | ECF_NOTHROW | ECF_LEAF); built_in_names[mcode],
ECF_CONST | ECF_NOTHROW | ECF_LEAF);
built_in_names[dcode] = concat ("__div", mode_name_buf, "3", NULL); built_in_names[dcode] = concat (prefix, "div", mode_name_buf, "3",
NULL);
local_define_builtin (built_in_names[dcode], ftype, dcode, local_define_builtin (built_in_names[dcode], ftype, dcode,
built_in_names[dcode], ECF_CONST | ECF_NOTHROW | ECF_LEAF); built_in_names[dcode],
ECF_CONST | ECF_NOTHROW | ECF_LEAF);
} }
} }
} }

View File

@ -1,3 +1,11 @@
2011-05-25 Bernd Schmidt <bernds@codesourcery.com>
* 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.
2011-05-23 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> 2011-05-23 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* config/s390/t-tpf (LIB2ADDEH): Remove $(gcc_srcdir)/gthr-gnat.c. * config/s390/t-tpf (LIB2ADDEH): Remove $(gcc_srcdir)/gthr-gnat.c.

View File

@ -250,6 +250,10 @@ gcc_s_compile = $(gcc_compile) -DSHARED
objects = $(filter %$(objext),$^) objects = $(filter %$(objext),$^)
# Collect any host-specific information from Makefile fragments. # Collect any host-specific information from Makefile fragments.
LIBGCC_VER_GNU_PREFIX = __
LIBGCC_VER_SYMBOLS_PREFIX =
tmake_file = @tmake_file@ tmake_file = @tmake_file@
include $(srcdir)/empty.mk $(tmake_file) include $(srcdir)/empty.mk $(tmake_file)
@ -795,6 +799,9 @@ libgcc_s$(SHLIB_EXT): libgcc.map
mapfile = libgcc.map mapfile = libgcc.map
endif endif
libgcc-std.ver: $(srcdir)/libgcc-std.ver.in
sed -e 's/__PFX__/$(LIBGCC_VER_GNU_PREFIX)/g' < $< > $@
libgcc_s$(SHLIB_EXT): $(libgcc-s-objects) $(extra-parts) libgcc_s$(SHLIB_EXT): $(libgcc-s-objects) $(extra-parts)
# @multilib_flags@ is still needed because this may use # @multilib_flags@ is still needed because this may use
# $(GCC_FOR_TARGET) and $(LIBGCC2_CFLAGS) directly. # $(GCC_FOR_TARGET) and $(LIBGCC2_CFLAGS) directly.

View File

@ -0,0 +1 @@
LIBGCC_VER_GNU_PREFIX = __gnu_

1922
libgcc/libgcc-std.ver.in Normal file

File diff suppressed because it is too large Load Diff