Commit Graph

343 Commits

Author SHA1 Message Date
Jakub Jelinek 7adcbafe45 Update copyright years. 2022-01-03 10:42:10 +01:00
Iain Sandoe 574c09da48 libgcc, Darwin: Add missing build dependencies.
There was a race condition where the link for the new shared EH library
(only used on earlier Darwin) could fail because the new crts had not been
copied to the gcc directory.  This can cause a build failure (although
currently only seen on powerpc-darwin).

Fixed by adding specific dependency on the crts and on the multi target.
We also add the declaration header for the Darwin10 unwinder shim to the
powerpc cases, since we build that there for Rosetta use.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>

libgcc/ChangeLog:

	* config.host: Add shim declaration header to powerpc*-darwin builds.
	* config/rs6000/t-darwin-ehs: Remove dependency on the powerpc end
	file.
	* config/t-darwin-ehs: Add dependencies to the shared unwinder
	objects.
	* config/t-slibgcc-darwin: Add extra_parts to the dependencies for
	the shared EH lib.  Add all-multi to the dependencies for the
	libgcc_s.1.dylib redirections.
2021-12-17 10:12:53 +00:00
Olivier Hainque 04577ac084 Remove ppc*-vxworks7* inadequate libgcc Makefile fragments
t-linux assigns .so version numbers to a set of
symbols, some of which aren't included the VxWorks libgcc
on powerpc (from ibm-ldouble.c, in particular).

t-slibgcc-libgcc yields a kind of .so file that the default
loader can't handle. This sort of extension to tmake_file for
shared libs will be better handled in a grouped fashion for
all targets anyway.

2021-12-13  Olivier Hainque  <hainque@adacore.com>

	* config.host (powerpc*-*-vxworks7*): Remove
	rs6000/t-linux and t-slibgcc-libgcc from tmake_file.
2021-12-13 18:03:21 +00:00
Olivier Hainque 20a0e2721a Remove special case for arm-vxworks on the use of vxcrtstuff
Not needed any more after the recent cleanups issued for the
support of shared libraries.

2021-12-13  Olivier Hainque  <hainque@adacore.com>

libgcc/
	* config.host (*vxworks*): Remove special case for
	arm on the use of vxcrtstuff.
2021-12-13 18:03:17 +00:00
Olivier Hainque 0ecb48d753 Preserve cpu specific CRTSTUFF_T_CFLAGS on powerpc-vxworks7
The unconditional assignment performed in t-vxworks to handle
include flags currently overrides what specific cpu ports had
for the regular (!vxworks) crtstuff objects.

This was not done on purpose and the proposed change adjusts the
configuration bits to apply the vxworks specific flags on top of
the cpu ones instead.

2021-12-07  Olivier Hainque  <hainque@adacore.com>

	* config.host (powerpc*-wrs-vxworks7*): Place t-crtstuff
	ahead of the other files in tmake_files.
	* config/t-vxworks: Add to CRTSTUFF_T_CFLAGS instead of
	overriding it.
2021-12-13 17:59:54 +00:00
Olivier Hainque f3f923e513 Leverage sysroot for VxWorks
The build of a VxWorks toolchain relies a lot on system headers
and VxWorks has a few very specific features that require special
processing. For example, different sets of headers for the kernel
vs the rtp modes, which the compiler knows about by way of -mrtp
on the command line.

If we manage to avoid the need for fixincludes on recent versions
of VxWorks (>= 7), we still need to handle at least VxWorks 6.9 at
this stage.

We sort of get away with locating the correct headers at
run-time thanks to environment variables and various tests for
-mrtp in cpp specs, but getting fixincludes to work for old
configurations has always been tricky and getting a toolchain
to build with c++/libstdc++ support gets trickier with every
move to a more recent release.

sysroot_headers_suffix_spec is a pretty powerful device to help
address such issues, and this patch introduces changes that let
us get advantage of it.

The general idea is to leverage the assumption that compilations
occur with --sysroot=$VSB_DIR on vx7 or --sysroot=$WIND_BASE/target
prior to that.

For the toolchains we build, this is achieved with a few
configure options like:

  --with-sysroot
  --with-build-sysroot=${WIND_BASE}/target
  --with-specs=%{!sysroot=*:--sysroot=%:getenv(WIND_BASE /target)}

This also allows simplifying the libgcc compilation flags control
and we take the opportunity to merge t-vxworks7 into t-vxworks as
the two files were differing only on the libgcc2 flags part.

2021-12-09  Olivier Hainque  <hainque@adacore.com>

gcc/
	* config/t-vxworks: Clear NATIVE_SYSTEM_HEADER_DIR.
	* config/vxworks.h (SYSROOT_HEADERS_SUFFIX_SPEC): Define, for
	VxWorks 7 and earlier.
	(VXWORKS_ADDITIONAL_CPP_SPEC): Simplify accordingly.
	(STARTFILE_PREFIX_SPEC): Adjust accordingly.
	* config/rs6000/vxworks.h (STARTFILE_PREFIX_SPEC): Adjust.

libgcc/
	* config/t-vxworks (LIBGCC2_INCLUDES): Simplify and handle
	both VxWorks7 and earlier.
	* config/t-vxworks7: Remove.
	* config.host: Remove special case for vxworks7.
2021-12-13 13:54:01 +00:00
Rasmus Villemoes 68fd247e15 Replace t-ppccomm by t-vxworks in libgcc/config/rs6000
This removes ibm-ldouble.c and a few eabi crt files from the build
closure, which were producing objects we don't use anyway.

2021-12-07  Rasmus Villemoes  <rv@rasmusvillemoes.dk>

libgcc/
	* config/rs6000/t-vxworks: New file.
	* config.host (powerpc*-*-vxworks*): Use it instead of
	t-ppccomm.
2021-12-10 13:17:22 +00:00
Frederic Konrad a2c12cb708 Fix path to t-ppc64-fp for ppc*-vxworks7* libgcc tmake_file
This fixes a basic mistake in the relative path used to reference
a rs6000 specific Makefile fragment in the libgcc configuration bits
for powerpc*-vxworks7.

2021-01-14  Fred Konrad  <konrad@adacore.com>

libgcc/
	* config.host (powerpc*-wrs-vxworks7*): Fix path to
	rs6000/t-ppc64-fp, relative to config/ not libgcc/.
2021-12-09 17:50:36 +00:00
Iain Sandoe 7add7f7bb3 libgcc, Darwin: Build a libgcc_s.1 for backwards compatibility.
In order to reslve a long-standing issue with inter-operation
with libSystem, we have bumped the SO name for libgcc_s.

Distributions might wish to install this new version into a
structure where exisiting code is already linked with the
compiler-local libgcc_s.1 (providing symbols exported by the
now-retired libgcc_ext.10.x shims).

The replacement libgcc_s.1 forwards the symbols from the new SO.
In order to support DYLD_LIBRARY_PATH on systems (where it works)
we forward the libSystem unwinder symbols from 10.7+ and a
compiler-local version of the libgcc unwinder on earlier.

For macOS 10.4 to 10.6 this is 'bug-compatible' with existing uses.
For 10.7+ the behaviour will now actually be correct.

This should be squashed with the initial libgcc changes for PR80556
in any backport (r12-5418-gd4943ce939d)

libgcc/ChangeLog:

	* config.host (*-*-darwin*): Add logic to build a shared
	unwinder library for Darwin8-10.
	* config/i386/t-darwin: Build legacy libgcc_s.1.
	* config/rs6000/t-darwin: Likewise.
	* config/t-darwin: Reorganise the EH fragments to place
	them for inclusion in a shared EH lib.
	* config/t-slibgcc-darwin: Build a legacy libgcc_s.1 and
	the supporting pieces (all FAT libs).
	* config/t-darwin-noeh: Removed.
	* config/darwin-unwind.ver: New file.
	* config/rs6000/t-darwin-ehs: New file.
	* config/t-darwin-ehs: New file.
2021-12-08 19:53:28 +00:00
Rasmus Villemoes 3e15df63ca libgcc: remove crt{begin,end}.o from powerpc-wrs-vxworks target
Since commit 78e49fb1bc (Introduce vxworks specific crtstuff support),
the generic crtbegin.o/crtend.o have been unnecessary to build. So
remove them from extra_parts.

This is effectively a revert of commit 9a5b8df70 (libgcc: add
crt{begin,end} for powerpc-wrs-vxworks target).

libgcc/
	* config.host (powerpc-wrs-vxworks): Do not add crtbegin.o and
	crtend.o to extra_parts.
2021-11-29 08:41:33 +01:00
Iain Sandoe d4943ce939 Darwin: Rework handling for unwinder code in libgcc_s and specs [PR80556].
This addresses a long-standing problem where a work-around for an unwinder
issue (also a regression) regresses other functionality.  The patch replaces
several work-arounds with a fix for PR80556 and a work-around for PR88590.

* The fix for PR80556 requires a bump to the SO name for libgcc_s, since we
need to remove the unwinder symbols from it.  This would trigger PR88590
hence the work-around for that.

* We weaken the symbols for emulated TLS support so that it is possible
for a DSO linked with static-libgcc to interoperate with a DSO linked with
libgcc_s.  Likewise main exes.

* We remove all the gcc-4.2.1 era stubs machinery and workarounds.

* libgcc is always now linked ahead of libc, which avoids fails where the
libc (libSystem) builtins implementations are not up to date.

* The unwinder now always comes from the system
 - for Darwin9 from /usr/lib/libgcc_s.1.dylib
 - for Darwin10 from /usr/lib/libSystem.dylib
 - for Darwin11+ from /usr/lib/system/libunwind.dylib.

 We still insert a shim on Darwin10 to fix an omitted unwind function, but
 the underlying unwinder remains the system one.

* The work-around for PR88590 has two parts (1) we always link libgcc from
its convenience lib on affected system versions (avoiding the need to find
the DSO path); (2) we add and export the emutls functions from DSOs - this
makes a relatively small (20k) addition to a DSO.  These can be backed out
when a proper fix for PR88590 is committed.

For distributions that wish to install a libgcc_s.1.dylib to satisfy linkage
from exes that linked against the stubs can use a reexported libgcc_s.1.1
(since that contains all the symbols that were previously exported via the
 stubs).

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>

gcc/ChangeLog:

	PR target/80556
	* config/darwin-driver.c (darwin_driver_init): Handle exported
	symbols and symbol lists (suppress automatic export of the TLS
	symbols).
	* config/darwin.c (darwin_rename_builtins): Remove workaround.
	* config/darwin.h (LINK_GCC_C_SEQUENCE_SPEC): Likewise.
	(REAL_LIBGCC_SPEC): Handle revised library uses.
	* config/darwin.opt (nodefaultexport): New.
	* config/i386/darwin.h (PR80556_WORKAROUND): Remove.
	* config/i386/darwin32-biarch.h (PR80556_WORKAROUND): Likewise.
	* config/i386/darwin64-biarch.h (PR80556_WORKAROUND): Likewise.

libgcc/ChangeLog:

	* config.host: Add weak emutls crt to the extra_parts.
	* config/i386/darwin-lib.h (DECLARE_LIBRARY_RENAMES): Remove
	workaround.
	* config/libgcc-libsystem.ver: Add exclude list for the system-
	provided unwinder.
	* config/t-slibgcc-darwin: Bump SO version, remove stubs code.
	* config/i386/libgcc-darwin.10.4.ver: Removed.
	* config/i386/libgcc-darwin.10.5.ver: Removed.
	* config/rs6000/libgcc-darwin.10.4.ver: Removed.
	* config/rs6000/libgcc-darwin.10.5.ver: Removed.
	* config/t-darwin-noeh: New file.

gcc/testsuite/ChangeLog:

	* gcc.dg/torture/fp-int-convert-timode-3.c: Remove XFAIL.
	* gcc.dg/torture/fp-int-convert-timode-4.c: Likewise.
2021-11-19 19:58:11 +00:00
John David Anglin db89d474ad Support TI mode and soft float on PA64
This change implements TI mode on PA64.  Various new patterns are
added to pa.md.  The libgcc build needed modification to build both
DI and TI routines.  We also need various softfp routines to
convert to and from TImode.

I added full softfp for the -msoft-float option.  At the moment,
this doesn't completely eliminate all use of the floating-point
co-processor.  For this, libgcc needs to be built with -msoft-mult.
The floating-point exception support also needs a soft option.

2021-11-05  John David Anglin  <danglin@gcc.gnu.org>

	PR libgomp/96661

gcc/ChangeLog:

	* config/pa/pa-modes.def: Add OImode integer type.
	* config/pa/pa.c (pa_scalar_mode_supported_p): Allow TImode
	for TARGET_64BIT.
	* config/pa/pa.h (MIN_UNITS_PER_WORD) Define to MIN_UNITS_PER_WORD
	to UNITS_PER_WORD if IN_LIBGCC2.
	* config/pa/pa.md (addti3, addvti3, subti3, subvti3, negti2,
	negvti2, ashlti3, shrpd_internal): New patterns.
	Change some multi instruction types to multi.

libgcc/ChangeLog:

	* config.host (hppa*64*-*-linux*): Revise tmake_file.
	(hppa*64*-*-hpux11*): Likewise.
	* config/pa/sfp-exceptions.c: New.
	* config/pa/sfp-machine.h: New.
	* config/pa/t-dimode: New.
	* config/pa/t-softfp-sfdftf: New.
2021-11-05 16:07:35 +00:00
John David Anglin a1957c9755 Fix warnings building linux-atomic.c and fptr.c on hppa64-linux
The file fptr.c is specific to 32-bit hppa-linux and should not be
included in LIB2ADD on hppa64-linux.

There is a builtin type mismatch in linux-atomic.c using the type
long long unsigned int for 64-bit atomic operations on hppa64-linux.

2021-10-27  John David Anglin  <danglin@gcc.gnu.org>

libgcc/ChangeLog:

	* config.host (hppa*64*-*-linux*): Don't add pa/t-linux to
	tmake_file.
	* config/pa/linux-atomic.c: Define u8, u16 and u64 types.
	Use them in FETCH_AND_OP_2, OP_AND_FETCH_2, COMPARE_AND_SWAP_2,
	SYNC_LOCK_TEST_AND_SET_2 and SYNC_LOCK_RELEASE_1 macros.
	* config/pa/t-linux64 (LIB1ASMSRC): New define.
	(LIB1ASMFUNCS): Revise.
	(HOST_LIBGCC2_CFLAGS): Add "-DLINUX=1".
2021-10-27 18:00:36 +00:00
Iain Sandoe 8738543878 Darwin, crts: Build Darwin10 unwinder shim as a library.
We have a small unwinder shim that is only used for Darwin10
(and only then in quite specific cases).  To avoid linking
this code for every executable or DSO, we can present the crt
as a convenience library (rather than a .o file).

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>

gcc/ChangeLog:

	* config/darwin.h (LINK_COMMAND_SPEC_A): Use Darwin10
	unwinder shim as a convenience library.

libgcc/ChangeLog:

	* config.host: Use convenience library for Darwin10
	unwinder shim.
	* config/t-darwin: Build Darwin10 unwinder shim as a
	convenience library.
2021-09-19 19:35:00 +01:00
Andrew Pinski 20f3c16820 Remove m32r{,le}-*-linux* support from GCC
m32r support never made it to glibc and the support for the Linux kernel
was removed with 4.18. It does not remove much but no reason to keep
around a port which never worked or one which the support in other
projects is gone.

OK? Checked to make sure m32r-linux and m32rle-linux were rejected
when building.

contrib/ChangeLog:

	* config-list.mk: Remove m32r-linux and m32rle-linux
	from the list.

gcc/ChangeLog:

	* config.gcc: Add m32r-*-linux* and m32rle-*-linux*
	to the Unsupported targets list.
	Remove support for m32r-*-linux* and m32rle-*-linux*.
	* config/m32r/linux.h: Removed.
	* config/m32r/t-linux: Removed.

libgcc/ChangeLog:

	* config.host: Remove m32r-*-linux* and m32rle-*-linux*.
	* config/m32r/libgcc-glibc.ver: Removed.
	* config/m32r/t-linux: Removed.
2021-09-13 15:16:56 +00:00
liuhongt b387e664cf libgcc: Enable hfmode soft-sf/df/xf/tf extensions and truncations.
libgcc/ChangeLog:

	* config/i386/32/sfp-machine.h (_FP_NANFRAC_H): New macro.
	* config/i386/64/sfp-machine.h (_FP_NANFRAC_H): Ditto.
	* config/i386/sfp-machine.h (_FP_NANSIGN_H): Ditto.
	* config/i386/t-softfp: Add hf soft-fp.
	* config.host: Add i386/64/t-softfp.
	* config/i386/64/t-softfp: New file.
2021-09-02 14:11:59 +08:00
John David Anglin 776bd8a4e0 Don't build libgcc_stub.a on hppa[12]*-*-hpux11*.
2021-08-21  John David Anglin  <danglin@gcc.gnu.org>

libgcc/ChangeLog:
	* config.host: Remove extra_parts from hppa[12]*-*-hpux11* case.
2021-08-21 18:53:44 +00:00
Stafford Horne da8a9d695b or1k: Use cmodel=large when building crtstuff
When linking gcc runtime objects into large binaries the link may fail
with the below errors.  This will happen even if we are building with
-mcmodel=large.

    /home/shorne/work/openrisc/output/host/lib/gcc/or1k-buildroot-linux-uclibc/10.3.0/crtbeginS.o: in function `deregister_tm_clones':
    crtstuff.c:(.text+0x3c): relocation truncated to fit: R_OR1K_GOT16 against undefined symbol `_ITM_deregisterTMCloneTable'
    /home/shorne/work/openrisc/output/host/lib/gcc/or1k-buildroot-linux-uclibc/10.3.0/crtbeginS.o: in function `register_tm_clones':
    crtstuff.c:(.text+0xc0): relocation truncated to fit: R_OR1K_GOT16 against undefined symbol `_ITM_registerTMCloneTable'

This patch builds the gcc crtstuff binaries always with the
-mcmodel=large option to ensure they can be linked into large binaries.

libgcc/ChangeLog:

	PR target/99783
	* config.host (or1k-*, tmake_file): Add or1k/t-crtstuff.
	* config/or1k/t-crtstuff: New file.
2021-08-15 07:23:12 +09:00
Carl Love 9090f48071 Conversions between 128-bit integer and floating point values.
The files fixkfti-sw.c and fixunskfti-sw.c are renamed versions of
fixkfti.c and fixunskfti.c respectively to do the conversions in software.
The function names in the files were updated with the rename as well as
some white spaces fixes. The file float128-p10.c contains the functions
for using the ISA 3.1 hardware instructions to perform the conversions.

2021-06-08  Carl Love  <cel@us.ibm.com>

gcc/ChangeLog

	* config/rs6000/rs6000.c (__fixkfti, __fixunskfti, __floattikf,
	__floatuntikf): Names changed to __fixkfti_sw, __fixunskfti_sw,
	__floattikf_sw, __floatuntikf_sw respectively.
	* config/rs6000/rs6000.md (floatti<mode>2, floatunsti<mode>2,
	fix_trunc<mode>ti2, fixuns_trunc<mode>ti2): Add
	define_insn for mode IEEE 128.

gcc/testsuite/ChangeLog

	* gcc.target/powerpc/fp128_conversions.c: New file.
	* gcc.target/powerpc/int_128bit-runnable.c(vextsd2q,
	vcmpuq, vcmpsq, vcmpequq, vcmpequq., vcmpgtsq, vcmpgtsq.
	vcmpgtuq, vcmpgtuq.): Update scan-assembler-times.
	(ppc_native_128bit): Remove dg-require-effective-target.

libgcc/ChangeLog

	* config.host: Add if test and set for
	libgcc_cv_powerpc_3_1_float128_hw.
	* config/rs6000/fixkfti.c: Renamed to fixkfti-sw.c.
	Change calls of __fixkfti to __fixkfti_sw.
	* config/rs6000/fixunskfti.c: Renamed to fixunskfti-sw.c.
	Change calls of __fixunskfti to __fixunskfti_sw.
	* config/rs6000/float128-p10.c (__floattikf_hw,
	__floatuntikf_hw, __fixkfti_hw, __fixunskfti_hw): New file.
	* config/rs6000/float128-ifunc.c (SW_OR_HW_ISA3_1): New macro.
	(__floattikf_resolve, __floatuntikf_resolve, __fixkfti_resolve,
	__fixunskfti_resolve): Add resolve functions.
	(__floattikf, __floatuntikf, __fixkfti, __fixunskfti): New functions.
	* config/rs6000/float128-sed (floattitf, __floatuntitf,
	__fixtfti, __fixunstfti): Add editor commands to change names.
	* config/rs6000/float128-sed-hw (__floattitf,
	__floatuntitf, __fixtfti, __fixunstfti): Add editor commands to
	change names.
	* config/rs6000/floattikf.c: Renamed to floattikf-sw.c.
	* config/rs6000/floatuntikf.c: Renamed to floatuntikf-sw.c.
	* config/rs6000/quad-float128.h (__floattikf_sw,
	__floatuntikf_sw, __fixkfti_sw, __fixunskfti_sw, __floattikf_hw,
	__floatuntikf_hw, __fixkfti_hw, __fixunskfti_hw, __floattikf,
	__floatuntikf, __fixkfti, __fixunskfti): New extern declarations.
	* config/rs6000/t-float128 (floattikf, floatuntikf,
	fixkfti, fixunskfti): Remove file names from fp128_ppc_funcs.
	(floattikf-sw, floatuntikf-sw, fixkfti-sw, fixunskfti-sw): Add
	file names to fp128_ppc_funcs.
	* config/rs6000/t-float128-hw(fp128_3_1_hw_funcs,
	fp128_3_1_hw_src, fp128_3_1_hw_static_obj, fp128_3_1_hw_shared_obj,
	fp128_3_1_hw_obj): Add variables for ISA 3.1 support.
	* config/rs6000/t-float128-p10-hw: New file.
	* configure: Update script for isa 3.1 128-bit float support.
	* configure.ac: Add check for 128-bit float hardware support.
2021-06-09 11:20:07 -05:00
Jakub Jelinek 99dee82307 Update copyright years. 2021-01-04 10:26:59 +01:00
Pat Bernardi ec4d374ece Sync the aarch64-vx7r2 libgcc config with that of Linux
This adds ${cpu_type}/t-lse and t-slibgcc-libgcc to the tmake_file
list for aarch64-vxworks7* configurations, as the Linux port does.

t-lse is needed by all triplets now anyway and the standard setting
for slibgcc makes sense as we are working on reintroducing PIC support
for RTPs on various targets. The VxWorks7 system environments are leaning
towards more and more similarilties with Linux in general, so the
closer configurations the better.

2020-11-02  Pat Bernardi  <bernardi@adacore.com>

libgcc/
	* config.host (aarch64-vxworks7*, tmake_file): Add
	${cpu_type}/t-lse and t-slibgcc-libgcc.

Co-authored-by: Olivier Hainque  <hainque@adacore.com>
2020-11-03 17:33:17 +00:00
Olivier Hainque 9a835ba4c0 Introduce support for vxworks7r2 on x86 and x86_64
This change extends the VxWorks support on intel CPUs to
VxWorks7r2 for x86_64 as well as x86, with a "mcmodel=large"
additional multilib for the 64bit configuration.

The support for fPIC is not functional yet for this model,
so we just don't add the corresponding multilib.

We extend the range of CPU families handled by TARGET_OS_CPP_BUILTINS,
accounting for the fact that archs older than PENTIUM4 are
not supported (any more) by VxWorks 7.

As we did for powerpc, we leverage VX_CPU_PREFIX to emit different
forms of definitions for different families of VxWorks as the system
headers's expectations has evolved between Vx 5, 6 and 7.

2020-10-27  Olivier Hainque  <hainque@adacore.com>

gcc/
	* config.gcc: Adjust the ix86/x86_64-wrs-vxworks filters
	to apply to VxWorks 7 as well.
	* config/i386/t-vxworks (MULTILIB_OPTIONS, MULTILIB_DIRNAMES):
	Remove the fPIC multilib and add one for the large code model
	on x86_64.
	* config/i386/vxworks.h: Separate sections for TARGET_VXWORKS7,
	other variants and common bits.
	(TARGET_OS_CPP_BUILTINS): Augment to support a range of CPU
	families. Leverage VX_CPU_PREFIX.
	(CC1_SPEC): Add definition.
	(STACK_CHECK_PROTECT): Use conditional expression instead of
	heavier to read conditioned macro definitions.

libgcc/
	* config.host: Adjust the ix86/x86_64-wrs-vxworks filters
	to apply to VxWorks 7 as well.

Co-authored-by: Douglas Rupp <rupp@adacore.com>
Co-authored-by: Pat Bernardi <bernardi@adacore.com>
2020-10-30 08:25:26 +00:00
Douglas Rupp 1786798090 Introduce vxworks7r2 support for ppc and ppc64
This change introduces support for the most recent versions
of VxWorks on PowerPC targets, for both 32 and 64 bit thanks
to a bi-arch setup.

The system compilers are essentially configured as Linux
toolchains with only a few specificities and we replicate
that model here.

The most visible specificities are the use of secureplt by
default, the pre-definition of some macros that the system
headers still rely on (_VX_CPU and _VX_CPU_FAMILY, for example),
and of course some variations related to the so VxWorks typical
kernel vs RTP mode distinction.

In addition to the introduction of config.gcc and libgcc
configuration chunks, much inspired by the linux ones, the
change

- Reworks rs6000/vxworks.h file to feature bits common to the
  Vx6 and Vx7 port then a separate section for each, where the
  Vx7 part is very short as we rely on the Linux definitions
  for most things.

- Adjusts the CPU macro predefinitions in CPP_SPEC to resort
  to "_VX_CPU" instead of "CPU" for Vx7, to better match the
  more recent system headers expectations,

- Adds a cpu definition case for e6500.

- Changes to the use SUB3TARGET_OVERRIDE_OPTIONS instead of
  SUBSUBTARGET_OVERRIDE_OPTIONS for specifics, so we don't
  override the Linux's version of the latter for vx7.

2020-10-20  Douglas Rupp  <rupp@adacore.com>

gcc/
	* config.gcc (powerpc*-wrs-vxworks7r*): New case.
	* config/rs6000/vxworks.h: Rework to handle VxWorks7.
	Refactor as common bits + vx6 vs vx7 ones. For the
	latter, rely essentially on the Linux configuration
	and adjust CPU to _VX_CPU in CPP_SPEC. Add a case
	for e6500. Use SUB3TARGET_OVERRIDE_OPTIONS for specifics
	to preserve the Linux SUBSUBTARGET_OVERRIDE_OPTIONS
	for vx7.

libgcc/
	* config.host (powerpc*-wrs-vxworks7*): New case.
	* configure.ac: Handle powerpc*-*-vxworks7* as
	powerpc*-*-linux* for ppc-fp_type.
	* configure: Regenerate.

Co-authored-by: Olivier Hainque <hainque@adacore.com>
2020-10-21 16:26:37 +00:00
Jojo R 03380ecc38 C-SKY: Enable crtbegin/crtend.o of libgcc for elf target
libgcc/ChangeLog:

	* config.host (C-SKY): Enable crtbegin/crtend.o of libgcc for elf target.
2020-09-16 19:34:02 +08:00
David Edelsohn 47ddb895df aix: Add GCC64 configuration and FAT target libraries.
This patch adds the ability to configure GCC on AIX to build as a
64 bit application and to build target libraries "FAT" libraries in both
32 bit and 64 bit mode.

The patch adds makefile fragment hooks to target libraries that allows
them to include target-specific rules.  The target specific rules for
AIX place both 32 bit and 64 bit objects and shared objects
in archives at the top-level, not multilib subdirectories.  The
multilibs are built in subdirectories, but must be combined during the
last parts of the target library build process.  Because of the way
that GCC bootstrap works, the libraries must be combined during the
multiple stages of GCC bootstrap, not solely when installed in the
final destination, so the libraries are correct at the end of
each target library build stage, not solely an install recipe.

gcc/ChangeLog

2020-06-21  David Edelsohn  <dje.gcc@gmail.com>

	* config.gcc: Use t-aix64, biarch64 and default64 for cpu_is_64bit.
	* config/rs6000/aix72.h (ASM_SPEC): Remove aix64 option.
	(ASM_SPEC32): New.
	(ASM_SPEC64): New.
	(ASM_CPU_SPEC): Remove vsx and altivec options.
	(CPP_SPEC_COMMON): Rename from CPP_SPEC.
	(CPP_SPEC32): New.
	(CPP_SPEC64): New.
	(CPLUSPLUS_CPP_SPEC): Rename to CPLUSPLUS_CPP_SPEC_COMMON..
	(TARGET_DEFAULT): Only define if not BIARCH.
	(LIB_SPEC_COMMON): Rename from LIB_SPEC.
	(LIB_SPEC32): New.
	(LIB_SPEC64): New.
	(LINK_SPEC_COMMON): Rename from LINK_SPEC.
	(LINK_SPEC32): New.
	(LINK_SPEC64): New.
	(STARTFILE_SPEC): Add 64 bit version of crtcxa and crtdbase.
	(ASM_SPEC): Define 32 and 64 bit alternatives using DEFAULT_ARCH64_P.
	(CPP_SPEC): Same.
	(CPLUSPLUS_CPP_SPEC): Same.
	(LIB_SPEC): Same.
	(LINK_SPEC): Same.
	(SUBTARGET_EXTRA_SPECS): Add new 32/64 specs.
	* config/rs6000/defaultaix64.h: New file.
	* config/rs6000/t-aix64: New file.

libgcc/ChangeLog

2020-06-21  David Edelsohn  <dje.gcc@gmail.com>

	* config.host (extra_parts): Add crtcxa_64 and crtdbase_64.
	* config/rs6000/t-aix-cxa: Explicitly compile 32 bit with -maix32
	and 64 bit with -maix64.
	* config/rs6000/t-slibgcc-aix: Remove extra @multilib_dir@ level.
	Build and install AIX-style FAT libraries.

libgomp/ChangeLog

2020-06-21  David Edelsohn  <dje.gcc@gmail.com>

	* Makefile.am (tmake_file): Build and install AIX-style FAT libraries.
	* Makefile.in: Regenerate
	* configure.ac (tmake_file): Substitute.
	* configure: Regenerate.
	* configure.tgt (powerpc-ibm-aix*): Define tmake_file.
	* config/t-aix: New file.

libstdc++-v3/ChangeLog

2020-06-21  David Edelsohn  <dje.gcc@gmail.com>

	* Makefile.am (tmake_file): Build and install AIX-style FAT libraries.
	* Makefile.in: Regenerate.
	* configure.ac (tmake_file): Substitute.
	* configure: Regenerate.
	* configure.host (aix*): Define tmake_file.
	* config/os/aix/t-aix: New file.

libatomic/ChangeLog

2020-06-21  David Edelsohn  <dje.gcc@gmail.com>

	* Makefile.am (tmake_file): Build and install AIX-style FAT libraries.
	* Makefile.in: Regenerate.
	* configure.ac (tmake_file): Substitute.
	* configure: Regenerate.
	* configure.tgt (powerpc-ibm-aix*): Define tmake_file.
	* config/t-aix: New file.

libgfortran/ChangeLog

2020-06-21  David Edelsohn  <dje.gcc@gmail.com>

	* Makefile.am (tmake_file): Build and install AIX-style FAT libraries.
	* Makefile.in: Regenerate.
	* configure.ac (tmake_file): Substitute.
	* configure: Regenerate.
	* configure.host: Add system configury stanza. Define tmake_file.
	* config/t-aix: New file.
2020-06-21 14:14:46 -04:00
Samuel Thibault 5e2eebc80d hurd: libgcc unwinding support over signal trampolines
libgcc/
	* config.host (md_unwind_header) <i[34567]86-*-gnu*>: Set to
	'i386/gnu-unwind.h'
	* config/i386/gnu-unwind.h: New file.

Signed-off-by: Thomas Schwinge <thomas@codesourcery.com>
2020-06-18 00:01:27 +02:00
Hans-Peter Nilsson 39748a8997 libgcc: cris: Remove support for crisv32-*-* and cris*-*-linux
Part of the removal of crisv32-* and cris-*-linux* (cris-elf remains).

libgcc:
	* config.host: Remove support for crisv32-*-* and cris*-*-linux.
	* config/cris/libgcc-glibc.ver, config/cris/t-linux: Remove.
2020-05-09 03:00:38 +02:00
Michael Meissner ef836167f5 Delete changes meant for a private branch.
2020-05-05  Michael Meissner  <meissner@linux.ibm.com>

	* config/rs6000/rs6000-builtin.def: Delete changes meant for a
	private branch.
	* config/rs6000/rs6000-c.c: Likewise.
	* config/rs6000/rs6000-call.c: Likewise.
	* gcc/config/rs6000/rs6000.c: Likewise.

2020-05-05  Michael Meissner  <meissner@linux.ibm.com>

	* gcc.dg/nextafter-2.c: Delete changes meant for a private branch.
	* gcc.target/powerpc/pr70117.c: Likewise.

2020-05-05  Michael Meissner  <meissner@linux.ibm.com>

	* config.host: Delete changes meant for a private branch.
	* config/rs6000/t-float128: Likewise.
	* configure.ac: Likewise.
	* configure: Likewise.
2020-05-05 14:03:30 -04:00
Michael Meissner 3338afa4a3 Patch ieee128-lib-patch010b 2020-05-05 14:03:30 -04:00
Andreas Krebbel 0993851dc1 IBM Z: zTPF: Build libgcc with -mtpf-trace-skip
libgcc is supposed to be built with the trace skip flags and branch
targets.  Add a zTPF header file fragment and add the -mtpf-trace-skip
option.

libgcc/ChangeLog:

2020-03-04  Andreas Krebbel  <krebbel@linux.ibm.com>

	* config.host: Include the new makefile fragment.
	* config/s390/t-tpf: New file.
2020-03-04 13:50:02 +01:00
Sandra Loosemore 2d33dcfe9f nios2: Support for GOT-relative DW_EH_PE_datarel encoding.
On nios2-linux-gnu, there has been a long-standing bug in C++ exception
handling that sometimes resulted in link errors like

../nios2-linux-gnu/bin/ld: FDE encoding in /tmp/cccfpQ2l.o(.eh_frame) prevents .eh_frame_hdr table being created

when building some shared libraries or PIE executables.  The root of
the problem is that GCC was incorrectly emitting an absolute encoding
in EH tables for PIC.  This patch changes it to use either
DW_EH_PE_indirect (for global) or DW_EH_PE_datarel (for local), and
fixes libgcc so it can find the address of the GOT as the base address
for DW_EH_PE_datarel.

Complicating matters somewhat, GAS was missing support for
%gotoff(symbol) relocation syntax.  I have just pushed a fix for that,
but I've added a configure check to test for presence of the binutils
support and fall back to the current absolute encoding (which works
most of the time) if it is not available.  Once the fix makes it into
an official binutils release it might be appropriate to make this
error out instead.

Since this is a wrong-code bug and affects only nios2 target, I think
this is appropriate for Stage 4.  I regression-tested on both
nios2-linux-gnu and nios2-elf, with and without the binutils support
present, before committing this.

2020-01-31  Sandra Loosemore  <sandra@codesourcery.com>

	gcc/
	* configure.ac [nios2-*-*]: Check HAVE_AS_NIOS2_GOTOFF_RELOCATION.
	* config.in: Regenerated.
	* configure: Regenerated.
	* config/nios2/nios2.h (ASM_PREFERRED_EH_DATA_FORMAT): Fix handling
	for PIC when HAVE_AS_NIOS2_GOTOFF_RELOCATION.
	(ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): New.

	gcc/testsuite/
	* g++.target/nios2/hello-pie.C: New.
	* g++.target/nios2/nios2.exp: New.

	libgcc/
	* config.host [nios2-*-linux*] (tmake_file, tm_file): Adjust.
	* config/nios2-elf-lib.h: New.
	* unwind-dw2-fde-dip.c (_Unwind_IteratePhdrCallback): Use existing
	code for finding GOT base for nios2.
2020-01-31 16:46:50 -08:00
Georg-Johann Lay f30dd60766 Implement 64-bit double functions.
gcc/
	PR target/92055
	* config.gcc (tm_defines) [target=avr]: Support --with-libf7,
	--with-double-comparison.
	* doc/install.texi: Document them.
	* config/avr/avr-c.c (avr_cpu_cpp_builtins)
	<WITH_LIBF7_LIBGCC, WITH_LIBF7_MATH, WITH_LIBF7_MATH_SYMBOLS>
	<WITH_DOUBLE_COMPARISON>: New built-in defines.
	* doc/invoke.texi (AVR Built-in Macros): Document them.
	* config/avr/avr-protos.h (avr_float_lib_compare_returns_bool): New.
	* config/avr/avr.c (avr_float_lib_compare_returns_bool): New function.
	* config/avr/avr.h (FLOAT_LIB_COMPARE_RETURNS_BOOL): New macro.
libgcc/
	PR target/92055
	* config.host (tmake_file) [target=avr]: Add t-libf7,
	t-libf7-math, t-libf7-math-symbols as specified by --with-libf7=.
	* config/avr/t-avrlibc: Don't copy libgcc.a if there are modules
	depending on sizeof (double) or sizeof (long double).
	* config/avr/libf7: New folder.
libgcc/config/avr/libf7/
	PR target/92055
	* t-libf7: New file.
	* t-libf7-math: New file.
	* t-libf7-math-symbols: New file.
	* libf7-common.mk: New file.
	* libf7-asm-object.mk: New file.
	* libf7-c-object.mk: New file.
	* asm-defs.h: New file.
	* libf7.h: New file.
	* libf7.c: New file.
	* libf7-asm.sx: New file.
	* libf7-array.def: New file.
	* libf7-const.def: New file.
	* libf7-constdef.h: New file.
	* f7renames.sh: New script.
	* f7wraps.sh: New script.
	* f7-renames.h: New generated file.
	* f7-wraps.h: New generated file.

From-SVN: r279994
2020-01-08 09:31:07 +00:00
Jakub Jelinek 8d9254fc8a Update copyright years.
From-SVN: r279813
2020-01-01 12:51:42 +01:00
Jozef Lawrynowicz e8aa9f55f6 MSP430: Add new msp430-elfbare target
contrib/ChangeLog:

2019-12-16  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	* config-list.mk: Add msp430-elfbare.

gcc/ChangeLog:

2019-12-16  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	* config.gcc: s/msp430*-*-*/msp430-*-*.
	Handle msp430-*-elfbare.
	* config/msp430/msp430-devices.c (TARGET_SUBDIR): Define.
	(_MSPMKSTR): Define.
	(__MSPMKSTR): Define.
	(rest_of_devices_path): Use TARGET_SUBDIR value in string.
	* config/msp430/msp430.c (msp430_option_override): Error if
	-fuse-cxa-atexit is used when it has been disabled at configure time.
	* config/msp430/t-msp430: Define TARGET_SUBDIR when building
	msp430-devices.o.
	* doc/install.texi: Document msp430-*-elf and msp430-*-elfbare.
	* doc/invoke.texi: Update documentation about which path devices.csv is
	searched for.

gcc/testsuite/ChangeLog:

2019-12-16  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	* g++.dg/init/dso_handle1.C: Require cxa_atexit support.
	* g++.dg/init/dso_handle2.C: Likewise.
	* g++.dg/other/cxa-atexit1.C: Likewise.
	* gcc.target/msp430/msp430.exp: Update csv-using-installed.c test to
	handle msp430-elfbare configuration.

libgcc/ChangeLog:

2019-12-16  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	* config.host: s/msp430*-*-elf/msp430-*-elf*.
	Override default "extra_parts" variable.
	* configure: Regenerate.
	* configure.ac: Disable TM clone registry by default for
	msp430-elfbare.

From-SVN: r279442
2019-12-16 11:02:10 +00:00
Jozef Lawrynowicz a9046e9853 MSP430: Add -fno-exceptions multilib
ChangeLog:

2019-12-11  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	* config-ml.in (msp430-*-*): Support --disable-no-exceptions configure
	flag.

gcc/ChangeLog:

2019-12-11  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	* config/msp430/msp430.h (STARTFILE_SPEC) [!fexceptions]: Use
	crtbegin_no_eh.o if building for the C language.
	[fno-exceptions]: Use crtbegin_no_eh.o if building for any language
	except C.
	(ENDFILE_SPEC) [!fexceptions]: Use crtend_no_eh.o if building for 
	the C language.
	[fno-exceptions]: Use crtend_no_eh.o if building for any language
	except C.
	* config/msp430/t-msp430: Add -fno-exceptions multilib.
	* doc/install.texi: Document --disable-no-exceptions multilib configure
	option.
	* doc/sourcebuild.texi: Document exceptions_enabled effective target.

gcc/testsuite/ChangeLog:

2019-12-11  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	* lib/gcc-dg.exp: Add dg-prune messages for when exception handling is
	disabled.
	* lib/target-supports.exp (check_effective_target_exceptions_enabled):
	New.

libgcc/ChangeLog:

2019-12-11  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	* config.host: Add crt{begin,end}_no_eh.o to "extra_parts".
	* config.host (msp430*-*-elf): Add crt{begin,end}_no_eh.o to
	"extra_parts".

From-SVN: r279246
2019-12-11 19:19:50 +00:00
Szabolcs Nagy 3d3a96a26e musl: Don't use gthr weak refs in libgcc PR91737
The gthr weak reference based single thread detection is unsafe with
static linking and in case of dynamic linking it's ineffective on musl
since pthread symbols are defined in libc.so.

(Ideally this should be fixed for all targets, since glibc plans to move
libpthread.so into libc.so too and users want to static link to pthread
without --whole-archive: PR87189.)

For now we have to explicitly opt out from the broken behaviour in the
config machinery of each target lib and libgcc was previously missed.

libgcc/ChangeLog:

2019-11-18  Szabolcs Nagy  <szabolcs.nagy@arm.com>

	* config.host: Add t-gthr-noweak on *-*-musl*.
	* config/t-gthr-noweak: New file.

From-SVN: r278399
2019-11-18 12:08:18 +00:00
Jerome Lambourg 27204060db Update the arm-*-vxworks* support
2019-11-13  Jerome Lambourg  <lambourg@adacore.com>
            Doug Rupp <rupp@adacore.com>
            Olivier Hainque  <hainque@adacore.com>

	gcc/
	* config.gcc: Collapse the arm-vxworks entries into
	a single arm-wrs-vxworks7* one, bpabi based.  Update
	the default cpu from arm8 to armv7-a
	* config/arm/vxworks.h (CC1_SPEC): Simplify, knowing that
	we always use ARM_UNWIND_INFO.
	(DWARF2_UNWIND_INFO): Remove redefinition.
	(ARM_TARGET2_DWARF_FORMAT): Likewise.
	(VXWORKS_PERSONALITY): Define, to "llvm".
	(VXWORKS_EXTRA_LIBS_RTP): Define, to "-lllvm".

	libgcc/
	* config.host: Collapse the arm-vxworks entries into
	a single arm-wrs-vxworks7* one.
	* config/arm/unwind-arm-vxworks.c: Update comments.  Provide
	__gnu_Unwind_Find_exidx and a weak dummy __cxa_type_match for
	kernel modules, to be overriden by libstdc++ when we link with
	it.  Rely on externally provided __exidx_start/end.

Co-Authored-By: Doug Rupp <rupp@adacore.com>
Co-Authored-By: Olivier Hainque <hainque@adacore.com>

From-SVN: r278253
2019-11-14 16:11:30 +00:00
Doug Rupp 3004f893b4 Base support for vxworks 7 on aarch64
2019-11-14  Doug Rupp  <rupp@adacore.com>
           Olivier Hainque  <hainque@adacore.com>
           Jerome Lambourg  <lambourg@adacore.com>

       gcc/
       * config.gcc: Handle aarch64*-wrs-vxworks7*.
       * config/aarch64/aarch64-vxworks.h: New file.
       * config/aarch64/t-aarch64-vxworks: New file.

       libgcc/
       * config.host: Handle aarch64*-wrs-vxworks7*.

Co-Authored-By: Jerome Lambourg <lambourg@adacore.com>
Co-Authored-By: Olivier Hainque <hainque@adacore.com>

From-SVN: r278251
2019-11-14 16:05:08 +00:00
Olivier Hainque 36e5f4d4f3 Update the libgcc support for VxWorks AE/653
2019-11-12  Olivier Hainque  <hainque@adacore.com>

	libgcc/

        * config/t-gthr-vxworksae: New file, add all the gthr-vxworks
        sources except the cxx0x support to LIB2ADDEH.  We don't support
        cxx0x on AE/653.
        * config/t-vxworksae: New file.

        * config.host: Handle *-*-vxworksae: Add the two aforementioned
	Makefile fragment files at their expected position in the tmake_file
	list, in accordance with what is done for other VxWorks variants.

From-SVN: r278250
2019-11-14 16:00:55 +00:00
Corentin Gay 806dd0472f Improve the thread support for VxWorks
2019-11-12  Corentin Gay  <gay@adacore.com>
	    Jerome Lambourg  <lambourg@adacore.com>
	    Olivier Hainque  <hainque@adacore.com>

	libgcc/

	* config/t-gthr-vxworks: New file, add all the gthr-vxworks
	sources to LIB2ADDEH.
	* config/t-vxworks: Remove adjustments to LIB2ADDEH.
	* config/t-vxworks7: Likewise.

	* config.host: Append a block at the end of the file to add the
	t-gthr files to the tmake_file list for VxWorks after everything
	else.

	* config/vxlib.c: Rename as gthr-vxworks.c.
	* config/vxlib-tls.c: Rename as gthr-vxworks-tls.c.

	* config/gthr-vxworks.h: Simplify a few comments.  Expose a TAS
	API and a basic error checking API, both internal.  Simplify the
	__gthread_once_t type definition and initializers.  Add sections
	for condition variables support and for the C++0x thread support,
	conditioned against Vx653 for the latter.

	* config/gthr-vxworks.c (__gthread_once): Simplify comments and
	implementation, leveraging the TAS internal API.
	* config/gthr-vxworks-tls.c: Introduce an internal TLS data access
	API, leveraging the general availability of TLS services in VxWorks7
	post SR6xxx.
	(__gthread_setspecific, __gthread_setspecific): Use it.
	(tls_delete_hook): Likewise, and simplify the enter/leave dtor logic.
	* config/gthr-vxworks-cond.c: New file.  GTHREAD_COND variable
	support based on VxWorks primitives.
	* config/gthr-vxworks-thread.c: New file.  GTHREAD_CXX0X support
	based on VxWorks primitives.

Co-Authored-By: Jerome Lambourg <lambourg@adacore.com>
Co-Authored-By: Olivier Hainque <hainque@adacore.com>

From-SVN: r278249
2019-11-14 15:58:31 +00:00
Jerome Lambourg 78e49fb1bc Introduce vxworks specific crtstuff support
2019-11-06  Jerome Lambourg  <lambourg@adacore.com>
            Olivier Hainque  <hainque@adacore.com>

	libgcc/
	* config/vxcrtstuff.c: New file.
	* config/t-vxcrtstuff: New Makefile fragment.
	* config.host: Append t-vxcrtstuff to the tmake_file list
	on all VxWorks ports using dwarf for table based EH.

	gcc/
	* config/vx-common.h (USE_TM_CLONE_REGISTRY): Remove
	definition, pointless with a VxWorks specific version
	of crtstuff.
	(DWARF2_UNWIND_INFO): Conditionalize on !ARM_UNWIND_INFO.
	* config/vxworks.h (VX_CRTBEGIN_SPEC, VX_CRTEND_SPEC):
	New local macros, controlling the addition of vxworks specific
	crtstuff objects depending on the EH mechanism and kind of
	module being linked.
	(VXWORKS_STARTFILE_SPEC, VXWORKS_ENDFILE_SPEC): Use them.

Co-Authored-By: Olivier Hainque <hainque@adacore.com>

From-SVN: r278248
2019-11-14 15:53:23 +00:00
Georg-Johann Lay 29f3def308 Support 64-bit double and 64-bit long double configurations.
gcc/
	Support 64-bit double and 64-bit long double configurations.

	PR target/92055
	* config.gcc (tm_defines) [avr]: Set from --with-double=,
	--with-long-double=.
	* config/avr/t-multilib: Remove.
	* config/avr/t-avr: Output of genmultilib.awk is now fully
	dynamically generated and no more part of the repo.
	(HAVE_DOUBLE_MULTILIB, HAVE_LONG_DOUBLE_MULTILIB): New variables.
	Pass them down to...
	* config/avr/genmultilib.awk: ...here and handle them.
	* gcc/config/avr/avr.opt (-mdouble=, avr_double). New option and var.
	(-mlong-double=, avr_long_double). New option and var.
	* common/config/avr/avr-common.c (opts.h, diagnostic.h): Include.
	(TARGET_OPTION_OPTIMIZATION_TABLE) <-mdouble=, -mlong-double=>:
	Set default as requested by --with-double=
	(TARGET_HANDLE_OPTION): Define to this...
	(avr_handle_option): ...new hook worker.
	* config/avr/avr.h (DOUBLE_TYPE_SIZE): Define to avr_double.
	(LONG_DOUBLE_TYPE_SIZE): Define to avr_long_double.
	(avr_double_lib): New proto for spec function.
	(EXTRA_SPEC_FUNCTIONS) <double-lib>: Add.
	(DRIVER_SELF_SPECS): Call %:double-lib.
	* config/avr/avr.c (avr_option_override): Assert
	sizeof(long double) >= sizeof(double) for the target.
	* config/avr/avr-c.c (avr_cpu_cpp_builtins)
	[__HAVE_DOUBLE_MULTILIB__, __HAVE_LONG_DOUBLE_MULTILIB__]
	[__HAVE_DOUBLE64__, __HAVE_DOUBLE32__, __DEFAULT_DOUBLE__=]
	[__HAVE_LONG_DOUBLE64__, __HAVE_LONG_DOUBLE32__]
	[__HAVE_LONG_DOUBLE_IS_DOUBLE__, __DEFAULT_LONG_DOUBLE__=]:
	New built-in define depending on --with-double=, --with-long-double=.
	* config/avr/driver-avr.c (avr_double_lib): New spec function.
	* doc/invoke.tex (AVR Options) <-mdouble=,-mlong-double=>: Doc.
	* doc/install.texi (Cross-Compiler-Specific Options)
	<--with-double=, --with-long-double=>: Doc.

libgcc/
	Support 64-bit double and 64-bit long double configurations.

	PR target/92055
	* config/avr/t-avr (HOST_LIBGCC2_CFLAGS): Only add -DF=SF if
	long double is a 32-bit type.
	* config/avr/t-avrlibc: Copy double64 and long-double64
	multilib(s) from the vanilla one.
	* config/avr/t-copy-libgcc: New Makefile snip.

From-SVN: r277908
2019-11-07 09:19:31 +00:00
Richard Henderson 33befddcb8 aarch64: Add out-of-line functions for LSE atomics
This is the libgcc part of the interface -- providing the functions.
Rationale is provided at the top of libgcc/config/aarch64/lse.S.

	* config/aarch64/lse-init.c: New file.
	* config/aarch64/lse.S: New file.
	* config/aarch64/t-lse: New file.
	* config.host: Add t-lse to all aarch64 tuples.

From-SVN: r275967
2019-09-19 07:36:38 -07:00
Christophe Lyon b1e21e5a5d [ARM/FDPIC v6 02/24] [ARM] FDPIC: Handle arm*-*-uclinuxfdpiceabi in configure scripts
The new arm-uclinuxfdpiceabi target behaves pretty much like
arm-linux-gnueabi. In order to enable the same set of features, we
have to update several configure scripts that generally match targets
like *-*-linux*: in most places, we add *-uclinux* where there is
already *-linux*, or uclinux* when there is already linux*.

In gcc/config.gcc and libgcc/config.host we use *-*-uclinuxfdpiceabi
because there is already a different behaviour for *-*uclinux* target.

In libtool.m4, we use uclinuxfdpiceabi in cases where ELF shared
libraries support is required, as uclinux does not guarantee that.

2019-09-10  Christophe Lyon  <christophe.lyon@st.com>

	config/
	* futex.m4: Handle *-uclinux*.
	* tls.m4 (GCC_CHECK_TLS): Likewise.

	gcc/
	* config.gcc: Handle *-*-uclinuxfdpiceabi.

	libatomic/
	* configure.tgt: Handle arm*-*-uclinux*.
	* configure: Regenerate.

	libgcc/
	* config.host: Handle *-*-uclinuxfdpiceabi.

	libitm/
	* configure.tgt: Handle *-*-uclinux*.
	* configure: Regenerate.

	* libtool.m4: Handle uclinuxfdpiceabi.

From-SVN: r275564
2019-09-10 09:37:00 +02:00
Jose E. Marchesi 91dfef9610 GCC port for eBPF
This patch series introduces a port of GCC to eBPF, which is a virtual
machine that resides in the Linux kernel.  Initially intended for
user-level packet capture and filtering, eBPF is nowadays generalized
to serve as a general-purpose infrastructure also for non-networking
purposes.

The binutils support is already upstream.  See
https://sourceware.org/ml/binutils/2019-05/msg00306.html.

ChangeLog:

	* MAINTAINERS: Add myself as the maintainer of the eBPF port.
	Remove myself from Write After Approval section.
	* configure.ac: Support for bpf-*-* targets.
	* configure: Regenerate.

contrib/ChangeLog:

	* config-list.mk (LIST): Disable go in bpf-*-* targets.

gcc/ChangeLog:

	* doc/invoke.texi (Option Summary): Cover eBPF.
	(eBPF Options): New section.
	* doc/extend.texi (BPF Built-in Functions): Likewise.
	(BPF Kernel Helpers): Likewise.
	* config.gcc: Support for bpf-*-* targets.
	* common/config/bpf/bpf-common.c: New file.
	* config/bpf/t-bpf: Likewise.
	* config/bpf/predicates.md: Likewise.
	* config/bpf/constraints.md: Likewise.
	* config/bpf/bpf.opt: Likewise.
	* config/bpf/bpf.md: Likewise.
	* config/bpf/bpf.h: Likewise.
	* config/bpf/bpf.c: Likewise.
	* config/bpf/bpf-protos.h: Likewise.
	* config/bpf/bpf-opts.h: Likewise.
	* config/bpf/bpf-helpers.h: Likewise.
	* config/bpf/bpf-helpers.def: Likewise.

gcc/testsuite/ChangeLog:

	* gcc.dg/builtins-config.h: eBPF doesn't support C99 standard
	functions.
	* gcc.c-torture/compile/20101217-1.c: Add a function prototype for
	printf.
	* gcc.c-torture/compile/20000211-1.c: Skip if target bpf-*-*.
	* gcc.c-torture/compile/poor.c: Likewise.
	* gcc.c-torture/compile/pr25311.c: Likewise.
	* gcc.c-torture/compile/pr39928-1.c: Likewise.
	* gcc.c-torture/compile/pr70061.c: Likewise.
	* gcc.c-torture/compile/920501-7.c: Likewise.
	* gcc.c-torture/compile/20000403-1.c: Likewise.
	* gcc.c-torture/compile/20001226-1.c: Likewise.
	* gcc.c-torture/compile/20030903-1.c: Likewise.
	* gcc.c-torture/compile/20031125-1.c: Likewise.
	* gcc.c-torture/compile/20040101-1.c: Likewise.
	* gcc.c-torture/compile/20040317-2.c: Likewise.
	* gcc.c-torture/compile/20040726-1.c: Likewise.
	* gcc.c-torture/compile/20051216-1.c: Likewise.
	* gcc.c-torture/compile/900313-1.c: Likewise.
	* gcc.c-torture/compile/920625-1.c: Likewise.
	* gcc.c-torture/compile/930421-1.c: Likewise.
	* gcc.c-torture/compile/930623-1.c: Likewise.
	* gcc.c-torture/compile/961004-1.c: Likewise.
	* gcc.c-torture/compile/980504-1.c: Likewise.
	* gcc.c-torture/compile/980816-1.c: Likewise.
	* gcc.c-torture/compile/990625-1.c: Likewise.
	* gcc.c-torture/compile/DFcmp.c: Likewise.
	* gcc.c-torture/compile/HIcmp.c: Likewise.
	* gcc.c-torture/compile/HIset.c: Likewise.
	* gcc.c-torture/compile/QIcmp.c: Likewise.
	* gcc.c-torture/compile/QIset.c: Likewise.
	* gcc.c-torture/compile/SFset.c: Likewise.
	* gcc.c-torture/compile/SIcmp.c: Likewise.
	* gcc.c-torture/compile/SIset.c: Likewise.
	* gcc.c-torture/compile/UHIcmp.c: Likewise.
	* gcc.c-torture/compile/UQIcmp.c: Likewise.
	* gcc.c-torture/compile/USIcmp.c: Likewise.
	* gcc.c-torture/compile/consec.c: Likewise.
	* gcc.c-torture/compile/limits-fndefn.c: Likewise.
	* gcc.c-torture/compile/lll.c: Likewise.
	* gcc.c-torture/compile/parms.c: Likewise.
	* gcc.c-torture/compile/pass.c: Likewise.
	* gcc.c-torture/compile/pp.c: Likewise.
	* gcc.c-torture/compile/pr32399.c: Likewise.
	* gcc.c-torture/compile/pr34091.c: Likewise.
	* gcc.c-torture/compile/pr34688.c: Likewise.
	* gcc.c-torture/compile/pr37258.c: Likewise.
	* gcc.c-torture/compile/pr37327.c: Likewise.
	* gcc.c-torture/compile/pr37381.c: Likewise.
	* gcc.c-torture/compile/pr37669-2.c: Likewise.
	* gcc.c-torture/compile/pr37669.c: Likewise.
	* gcc.c-torture/compile/pr37742-3.c: Likewise.
	* gcc.c-torture/compile/pr44063.c: Likewise.
	* gcc.c-torture/compile/pr48596.c: Likewise.
	* gcc.c-torture/compile/pr51856.c: Likewise.
	* gcc.c-torture/compile/pr54428.c: Likewise.
	* gcc.c-torture/compile/pr54713-1.c: Likewise.
	* gcc.c-torture/compile/pr54713-2.c: Likewise.
	* gcc.c-torture/compile/pr54713-3.c: Likewise.
	* gcc.c-torture/compile/pr55921.c: Likewise.
	* gcc.c-torture/compile/pr70240.c: Likewise.
	* gcc.c-torture/compile/pr70355.c: Likewise.
	* gcc.c-torture/compile/pr82052.c: Likewise.
	* gcc.c-torture/compile/pr83487.c: Likewise.
	* gcc.c-torture/compile/pr86122.c: Likewise.
	* gcc.c-torture/compile/pret-arg.c: Likewise.
	* gcc.c-torture/compile/regs-arg-size.c: Likewise.
	* gcc.c-torture/compile/structret.c: Likewise.
	* gcc.c-torture/compile/uuarg.c: Likewise.
	* gcc.dg/20001009-1.c: Likewise.
	* gcc.dg/20020418-1.c: Likewise.
	* gcc.dg/20020426-2.c: Likewise.
	* gcc.dg/20020430-1.c: Likewise.
	* gcc.dg/20040306-1.c: Likewise.
	* gcc.dg/20040622-2.c: Likewise.
	* gcc.dg/20050603-2.c: Likewise.
	* gcc.dg/20050629-1.c: Likewise.
	* gcc.dg/20061026.c: Likewise.
	* gcc.dg/Warray-bounds-3.c: Likewise.
	* gcc.dg/Warray-bounds-30.c: Likewise.
	* gcc.dg/Wframe-larger-than-2.c: Likewise.
	* gcc.dg/Wframe-larger-than.c: Likewise.
	* gcc.dg/Wrestrict-11.c: Likewise.
	* gcc.c-torture/compile/20000804-1.c: Likewise.
	* lib/target-supports.exp (check_effective_target_trampolines):
	Adapt to eBPF.
	(check_effective_target_indirect_jumps): Likewise.
	(check_effective_target_nonlocal_goto): Likewise.
	(check_effective_target_global_constructor): Likewise.
	(check_effective_target_return_address): Likewise.
	* gcc.target/bpf/bpf.exp: New file.
	* gcc.target/bpf/builtin-load.c: Likewise.
	* cc.target/bpf/constant-calls.c: Likewise.
	* gcc.target/bpf/diag-funargs.c: Likewise.
	* gcc.target/bpf/diag-funargs-2.c: Likewise.
	* gcc.target/bpf/diag-funargs-3.c: Likewise.
	* gcc.target/bpf/diag-indcalls.c: Likewise.
	* gcc.target/bpf/helper-bind.c: Likewise.
	* gcc.target/bpf/helper-bpf-redirect.c: Likewise.
	* gcc.target/bpf/helper-clone-redirect.c: Likewise.
	* gcc.target/bpf/helper-csum-diff.c: Likewise.
	* gcc.target/bpf/helper-csum-update.c: Likewise.
	* gcc.target/bpf/helper-current-task-under-cgroup.c: Likewise.
	* gcc.target/bpf/helper-fib-lookup.c: Likewise.
	* gcc.target/bpf/helper-get-cgroup-classid.c: Likewise.
	* gcc.target/bpf/helper-get-current-cgroup-id.c: Likewise.
	* gcc.target/bpf/helper-get-current-comm.c: Likewise.
	* gcc.target/bpf/helper-get-current-pid-tgid.c: Likewise.
	* gcc.target/bpf/helper-get-current-task.c: Likewise.
	* gcc.target/bpf/helper-get-current-uid-gid.c: Likewise.
	* gcc.target/bpf/helper-get-hash-recalc.c: Likewise.
	* gcc.target/bpf/helper-get-listener-sock.c: Likewise.
	* gcc.target/bpf/helper-get-local-storage.c: Likewise.
	* gcc.target/bpf/helper-get-numa-node-id.c: Likewise.
	* gcc.target/bpf/helper-get-prandom-u32.c: Likewise.
	* gcc.target/bpf/helper-get-route-realm.c: Likewise.
	* gcc.target/bpf/helper-get-smp-processor-id.c: Likewise.
	* gcc.target/bpf/helper-get-socket-cookie.c: Likewise.
	* gcc.target/bpf/helper-get-socket-uid.c: Likewise.
	* gcc.target/bpf/helper-getsockopt.c: Likewise.
	* gcc.target/bpf/helper-get-stack.c: Likewise.
	* gcc.target/bpf/helper-get-stackid.c: Likewise.
	* gcc.target/bpf/helper-ktime-get-ns.c: Likewise.
	* gcc.target/bpf/helper-l3-csum-replace.c: Likewise.
	* gcc.target/bpf/helper-l4-csum-replace.c: Likewise.
	* gcc.target/bpf/helper-lwt-push-encap.c: Likewise.
	* gcc.target/bpf/helper-lwt-seg6-action.c: Likewise.
	* gcc.target/bpf/helper-lwt-seg6-adjust-srh.c: Likewise.
	* gcc.target/bpf/helper-lwt-seg6-store-bytes.c: Likewise.
	* gcc.target/bpf/helper-map-delete-elem.c: Likewise.
	* gcc.target/bpf/helper-map-lookup-elem.c: Likewise.
	* gcc.target/bpf/helper-map-peek-elem.c: Likewise.
	* gcc.target/bpf/helper-map-pop-elem.c: Likewise.
	* gcc.target/bpf/helper-map-push-elem.c: Likewise.
	* gcc.target/bpf/helper-map-update-elem.c: Likewise.
	* gcc.target/bpf/helper-msg-apply-bytes.c: Likewise.
	* gcc.target/bpf/helper-msg-cork-bytes.c: Likewise.
	* gcc.target/bpf/helper-msg-pop-data.c: Likewise.
	* gcc.target/bpf/helper-msg-pull-data.c: Likewise.
	* gcc.target/bpf/helper-msg-push-data.c: Likewise.
	* gcc.target/bpf/helper-msg-redirect-hash.c: Likewise.
	* gcc.target/bpf/helper-msg-redirect-map.c: Likewise.
	* gcc.target/bpf/helper-override-return.c: Likewise.
	* gcc.target/bpf/helper-perf-event-output.c: Likewise.
	* gcc.target/bpf/helper-perf-event-read.c: Likewise.
	* gcc.target/bpf/helper-perf-event-read-value.c: Likewise.
	* gcc.target/bpf/helper-perf-prog-read-value.c: Likewise.
	* gcc.target/bpf/helper-probe-read.c: Likewise.
	* gcc.target/bpf/helper-probe-read-str.c: Likewise.
	* gcc.target/bpf/helper-probe-write-user.c: Likewise.
	* gcc.target/bpf/helper-rc-keydown.c: Likewise.
	* gcc.target/bpf/helper-rc-pointer-rel.c: Likewise.
	* gcc.target/bpf/helper-rc-repeat.c: Likewise.
	* gcc.target/bpf/helper-redirect-map.c: Likewise.
	* gcc.target/bpf/helper-set-hash.c: Likewise.
	* gcc.target/bpf/helper-set-hash-invalid.c: Likewise.
	* gcc.target/bpf/helper-setsockopt.c: Likewise.
	* gcc.target/bpf/helper-skb-adjust-room.c: Likewise.
	* gcc.target/bpf/helper-skb-cgroup-id.c: Likewise.
	* gcc.target/bpf/helper-skb-change-head.c: Likewise.
	* gcc.target/bpf/helper-skb-change-proto.c: Likewise.
	* gcc.target/bpf/helper-skb-change-tail.c: Likewise.
	* gcc.target/bpf/helper-skb-change-type.c: Likewise.
	* gcc.target/bpf/helper-skb-ecn-set-ce.c: Likewise.
	* gcc.target/bpf/helper-skb-get-tunnel-key.c: Likewise.
	* gcc.target/bpf/helper-skb-get-tunnel-opt.c: Likewise.
	* gcc.target/bpf/helper-skb-get-xfrm-state.c: Likewise.
	* gcc.target/bpf/helper-skb-load-bytes.c: Likewise.
	* gcc.target/bpf/helper-skb-load-bytes-relative.c: Likewise.
	* gcc.target/bpf/helper-skb-pull-data.c: Likewise.
	* gcc.target/bpf/helper-skb-set-tunnel-key.c: Likewise.
	* gcc.target/bpf/helper-skb-set-tunnel-opt.c: Likewise.
	* gcc.target/bpf/helper-skb-store-bytes.c: Likewise.
	* gcc.target/bpf/helper-skb-under-cgroup.c: Likewise.
	* gcc.target/bpf/helper-skb-vlan-pop.c: Likewise.
	* gcc.target/bpf/helper-skb-vlan-push.c: Likewise.
	* gcc.target/bpf/helper-skc-lookup-tcp.c: Likewise.
	* gcc.target/bpf/helper-sk-fullsock.c: Likewise.
	* gcc.target/bpf/helper-sk-lookup-tcp.c: Likewise.
	* gcc.target/bpf/helper-sk-lookup-upd.c: Likewise.
	* gcc.target/bpf/helper-sk-redirect-hash.c: Likewise.
	* gcc.target/bpf/helper-sk-redirect-map.c: Likewise.
	* gcc.target/bpf/helper-sk-release.c: Likewise.
	* gcc.target/bpf/helper-sk-select-reuseport.c: Likewise.
	* gcc.target/bpf/helper-sk-storage-delete.c: Likewise.
	* gcc.target/bpf/helper-sk-storage-get.c: Likewise.
	* gcc.target/bpf/helper-sock-hash-update.c: Likewise.
	* gcc.target/bpf/helper-sock-map-update.c: Likewise.
	* gcc.target/bpf/helper-sock-ops-cb-flags-set.c: Likewise.
	* gcc.target/bpf/helper-spin-lock.c: Likewise.
	* gcc.target/bpf/helper-spin-unlock.c: Likewise.
	* gcc.target/bpf/helper-strtol.c: Likewise.
	* gcc.target/bpf/helper-strtoul.c: Likewise.
	* gcc.target/bpf/helper-sysctl-get-current-value.c: Likewise.
	* gcc.target/bpf/helper-sysctl-get-name.c: Likewise.
	* gcc.target/bpf/helper-sysctl-get-new-value.c: Likewise.
	* gcc.target/bpf/helper-sysctl-set-new-value.c: Likewise.
	* gcc.target/bpf/helper-tail-call.c: Likewise.
	* gcc.target/bpf/helper-tcp-check-syncookie.c: Likewise.
	* gcc.target/bpf/helper-tcp-sock.c: Likewise.
	* gcc.target/bpf/helper-trace-printk.c: Likewise.
	* gcc.target/bpf/helper-xdp-adjust-head.c: Likewise.
	* gcc.target/bpf/helper-xdp-adjust-meta.c: Likewise.
	* gcc.target/bpf/helper-xdp-adjust-tail.c: Likewise.
	* gcc.target/bpf/skb-ancestor-cgroup-id.c: Likewise.
	* gcc.target/bpf/sync-fetch-and-add.c: Likewise.

libgcc/ChangeLog:

	* config.host: Set cpu_type for bpf-*-* targets.
	* config/bpf/t-bpf: Likewise.
	* config/bpf/crtn.S: Likewise.
	* config/bpf/crti.S: New file.

From-SVN: r275506
2019-09-09 12:13:23 +02:00
Jim Wilson 2f4d895197 RISC-V: Re-enable -msave-restore for shared libraries.
This re-enables -msave-restore for shared libraries, and uses the
t-slibgcc-libgcc file to get the save-restore routines included directly
in shared libraries so that we don't need to indirect through the PLT
to reach them, which doesn't work.

	gcc/
	* config/riscv/riscv.c (riscv_option_override): Revert 2019-08-30
	change.

	libgcc/
	* config.host (riscv*-*-linux*): Add t-slibgcc-libgcc to tmake_file.
	(riscv*-*-freebsd*): Likewise.

From-SVN: r275478
2019-09-06 17:09:21 -07:00
Ulrich Weigand 2f2aeda98f Remove Cell Broadband Engine SPU targets
From-SVN: r275343
2019-09-03 15:08:28 +00:00
Matt Thomas 428642b132 config.gcc (hppa*-*-netbsd*): New target.
gcc/ChangeLog:
	* config.gcc (hppa*-*-netbsd*): New target.
	* config/pa/pa-netbsd.h: New file.
	* config/pa/pa32-netbsd.h: New file.

libgcc/ChangeLog:
	* config.host (hppa*-*-netbsd*): New case.
	* config/pa/t-netbsd: New file.


Co-Authored-By: Matthew Green <mrg@eterna.com.au>
Co-Authored-By: Maya Rashish <coypu@sdf.org>
Co-Authored-By: Nick Hudson <nick@nthcliff.demon.co.uk>

From-SVN: r273933
2019-07-31 14:11:16 +00:00
Iain Sandoe 61afc8f8f0 [Darwin] Revert one hunk from r273016 (TLC for older Darwin versions).
t-darwin8 is nolonger needed (or present) for pre-10.4 powerpc, so remove
the reference.

2019-07-04  Iain Sandoe  <iain@sandoe.co.uk>

	* config.host: Remove reference to t-darwin8.

From-SVN: r273091
2019-07-04 18:28:59 +00:00
Iain Sandoe 179c7ef523 [Darwin] Some TLC for older Darwin versions.
The library handling and some of the options for creating the crts for
the older PPC Darwin versions had bit-rotted somewhat.  This adjusts the
build criteria for the crts to avoid newer ld64 versions warnings about
mismatches in build and object versions.

Added to some of the comments that it's documented why the specs are as
they are.

2019-07-03  Iain Sandoe  <iain@sandoe.co.uk>

gcc/

	* config/darwin.h (REAL_LIBGCC_SPEC): Adjust for earlier Darwin.
	(STARTFILE_SPEC): Split crt3 into a separate spec.
	(DARWIN_EXTRA_SPECS): Add crt2 and crt3 spec.
	(DARWIN_CRT2_SPEC): New.
	(DARWIN_CRT3_SPEC): New.
	(MIN_LD64_OMIT_STUBS): Revise to 62.1.
	* config/rs6000/darwin.h (DARWIN_CRT2_SPEC): Revise conditions.
	(DARWIN_CRT3_SPEC): New.

libgcc/

2019-07-03  Iain Sandoe  <iain@sandoe.co.uk>

	* config.host (powerpc-*-darwin*,powerpc64-*-darwin*): Revise crt
	list.
	* config/rs6000/t-darwin: Build crt3_2 for older systems.  Revise
	mmacosx-version-min for crts to run across all system versions.
	* config/rs6000/t-darwin64 (LIB2ADD): Remove.
	* config/t-darwin: Revise mmacosx-version-min for crts to run across
	system versions >= 10.4.

From-SVN: r273016
2019-07-03 18:36:28 +00:00