gcc/libgcc/config
Joseph Myers e610393ca7 Make soft-fp symbols into compat symbols for powerpc*-*-linux*.
Continuing preparations for implementing
TARGET_ATOMIC_ASSIGN_EXPAND_FENV for powerpc*-*-linux* soft-float and
e500, this patch makes soft-fp symbols used for those targets into
compat symbols when building with glibc >= 2.19, so that they are only
in shared libgcc for existing binaries requiring them, not in static
libgcc and not available for new links using shared libgcc.  Instead,
new links will get the symbols from libc, which has exported all of
them since 2.19.  (Actually all the symbols were exported from glibc
since 2.4, but some of them were exported by glibc as compat symbols
only - because of a confusion between deliberately present soft-fp
symbols and old accidental reexports of libgcc functions from glibc
2.0 - until 2.19.)

This allows user floating-point arithmetic to interoperate properly
with the state handled by <fenv.h> functions, whether software state
(for soft-float; TLS variables that don't form a public part of
glibc's ABI, so can only be accessed directly by functions within
glibc) or hardware state (for e500 - the copies of the soft-fp
functions in glibc being built to interoperate with the hardware state
whereas those in libgcc aren't).  Previously only glibc's own
functions, and those operations done in hardware on e500, properly
worked with that state, not direct floating-point arithmetic
operations that were implemented in software.

The intended next step is the actual TARGET_ATOMIC_ASSIGN_EXPAND_FENV
implementation.

The test of glibc >= 2.19 uses the same --with-glibc-version configure
option as in the gcc/ directory (but differently implemented; in gcc/
the fallback is to examine headers to find the version, while in
libgcc/ we can use compile for the target and so use AC_COMPUTE_INT).
The TARGET_ATOMIC_ASSIGN_EXPAND_FENV implementation will also only do
anything for glibc >= 2.19, as it will depend on generating calls to
functions __atomic_feholdexcept __atomic_feclearexcept
__atomic_feupdateenv that were added in 2.19 for that purpose (even
for e500, inline code is not readily possible because of the need to
make prctl syscalls from the implementation of these functions).

In order to make symbols compat symbols, the soft-fp files need
wrapping with generated wrappers including asm .symver directives,
which need to name the symbol version in question.  This is extracted
by an awk script from an intermediate stage of generating the .map
file for linking libgcc (that .map itself depends on the objects that
go into the library, so can't be used for this purpose as that would
mean a circular dependency); the extraction is not fully general
regarding the features available in .map generation, but suffices for
the present purpose.

It would make sense for hardfp.c symbols to be compat symbols as well
(in the cases where hardfp.c gets used, the functions in question
should not be used for new links), but this isn't required for the
present purpose, which is only concerned with ensuring that where
functions that should be affected by rounding modes or exceptions get
used, those functions are actually affected by those rounding modes or
exceptions.

Tested with no regressions with cross to powerpc-linux-gnu
(soft-float); c11-atomic-exec-5.c moves from UNSUPPORTED to FAIL, as
expected, now that floating-point arithmetic in user programs uses the
same state as <fenv.h> functions, so the fenv_exceptions test passes,
but TARGET_ATOMIC_ASSIGN_EXPAND_FENV isn't yet implemented.  (For
e500, c11-atomic-exec-5.c was already FAILing, as enough operations
worked with the hardware state for the fenv_exceptions effective
target test to pass.)  Also verified that the exported symbols and
versions are unchanged, with the expected symbols becoming compat
symbols at the same versions, and that with --with-glibc-version=2.18
the symbols remain normal rather than compat symbols.

	* Makefile.in (libgcc.map.in): New target.
	(libgcc.map): Use libgcc.map.in.
	* config/t-softfp (softfp_compat): New variable to be set by
	users.
	[$(softfp_compat) = y] (softfp_map_dep, softfp_set_symver): New
	variables.
	[$(softfp_compat) = y] (softfp_file_list): Use files in the build
	directory.
	[$(softfp_compat) = y] ($(softfp_file_list)): Generate wrappers
	that use compat symbols and disable all code unless [SHARED].
	* config/t-softfp-compat: New file.
	* find-symver.awk: New file.
	* configure.ac (--with-glibc-version): New configure option.
	(ppc_fp_compat): New variable set for powerpc*-*-linux*.
	* configure: Regenerate.
	* config.host (powerpc*-*-linux*): Use ${ppc_fp_compat} for
	soft-float and e500.

From-SVN: r216942
2014-10-30 17:28:30 +00:00
..
aarch64 Add crtfastmath for AArch64. 2014-09-09 15:53:01 +00:00
alpha Use -fbuilding-libgcc for more target macros used in libgcc. 2014-09-05 13:03:46 +01:00
arc
arm bpabi.c (__gnu_uldivmod_helper): Remove. 2014-06-18 15:44:45 +00:00
avr lib1funcs.S (__do_global_dtors): Fix wrong code introduced with 2014-10-21 trunk r216525. 2014-10-22 10:40:30 +00:00
bfin
c6x Update soft-fp from glibc. 2014-10-09 19:21:30 +01:00
cr16 Use -fbuilding-libgcc for more target macros used in libgcc. 2014-09-05 13:03:46 +01:00
cris float128-mul-underflow.c, [...]: New tests. 2014-02-12 23:24:49 +00:00
epiphany
fr30
frv
h8300
i386 Fix i386 FP_TRAPPING_EXCEPTIONS. 2014-09-18 13:00:21 +01:00
ia64 re PR target/63312 (FAIL: gcc.dg/torture/float128-exact-underflow.c -O0 execution test) 2014-09-22 12:08:03 +01:00
iq2000
libbid Remove LIBGCC2_HAS_?F_MODE target macros. 2014-09-12 13:05:18 +01:00
lm32 float128-mul-underflow.c, [...]: New tests. 2014-02-12 23:24:49 +00:00
m32c
m32r
m68k
mcore
mep
microblaze
mips Use -fbuilding-libgcc for more target macros used in libgcc. 2014-09-05 13:03:46 +01:00
mmix
moxie float128-mul-underflow.c, [...]: New tests. 2014-02-12 23:24:49 +00:00
msp430 t-msp430 (HOST_LIBGCC2_CFLAGS): Add -mhwmult=none. 2014-05-22 15:15:36 +00:00
nds32 float128-mul-underflow.c, [...]: New tests. 2014-02-12 23:24:49 +00:00
nios2 Use -fbuilding-libgcc for more target macros used in libgcc. 2014-09-05 13:03:46 +01:00
pa linux-unwind.h (pa32_read_access_ok): New function. 2014-10-26 14:46:14 +00:00
pdp11
rl78
rs6000 Optimize powerpc*-*-linux* e500 hardfp/soft-fp use. 2014-10-29 12:59:16 +00:00
rx
s390 s390.c (s390_emit_tpf_eh_return): Pass original return address as second parameter to __tpf_eh_return routine. 2014-07-30 16:26:15 +00:00
score float128-mul-underflow.c, [...]: New tests. 2014-02-12 23:24:49 +00:00
sh
sparc Use -fbuilding-libgcc for more target macros used in libgcc. 2014-09-05 13:03:46 +01:00
spu
stormy16
tilegx TILE-Gx big endian support. 2014-02-24 15:08:00 +00:00
tilepro Use -fbuilding-libgcc for more target macros used in libgcc. 2014-09-05 13:03:46 +01:00
v850
vax
vms
xtensa Use -fbuilding-libgcc for more target macros used in libgcc. 2014-09-05 13:03:46 +01:00
darwin-64.c
darwin-crt3.c
darwin-crt-tm.c
gmon-sol2.c
gthr-lynx.h
gthr-rtems.h
gthr-vxworks.h
hardfp.c configure.ac (libgcc_cv_mips_hard_float): New. 2014-02-07 07:46:34 +00:00
libgcc-glibc.ver
libgcc-libsystem.ver
no-sfp-machine.h
no-unwind.h
t-crtfm
t-crtstuff-pic
t-darwin
t-dfprules
t-eh-dw2-dip
t-fdpbit
t-fixedpoint-gnu-prefix
t-fpbit
t-freebsd-thread
t-gnu-prefix
t-hardfp Optimize powerpc*-*-linux* e500 hardfp/soft-fp use. 2014-10-29 12:59:16 +00:00
t-hardfp-sfdf configure.ac (libgcc_cv_mips_hard_float): New. 2014-02-07 07:46:34 +00:00
t-libgcc-pic
t-libunwind
t-libunwind-elf
t-linux
t-openbsd-thread
t-rtems
t-slibgcc
t-slibgcc-darwin
t-slibgcc-elf-ver
t-slibgcc-gld
t-slibgcc-gld-nover
t-slibgcc-hpux
t-slibgcc-libgcc
t-slibgcc-nolc-override
t-slibgcc-sld Don't build libgcc-unwind.map with --disable-shared (PR libgcc/61097) 2014-05-08 12:11:14 +00:00
t-slibgcc-vms
t-softfp Make soft-fp symbols into compat symbols for powerpc*-*-linux*. 2014-10-30 17:28:30 +00:00
t-softfp-compat Make soft-fp symbols into compat symbols for powerpc*-*-linux*. 2014-10-30 17:28:30 +00:00
t-softfp-excl
t-softfp-sfdf
t-softfp-tf
t-sol2
t-stack
t-tls
t-vxworks
unwind-dw2-fde-darwin.c
vxlib-tls.c
vxlib.c