Commit Graph

30 Commits

Author SHA1 Message Date
Jakub Jelinek 0411ae7f08 libatomic, libgomp, libitc: Fix bootstrap [PR70454]
The recent changes to error on mixing -march=i386 and -fcf-protection broke
bootstrap.  This patch changes lib{atomic,gomp,itm} configury, so that it
only adds -march=i486 to flags if really needed (i.e. when 486 or later isn't
on by default already).  Similarly, it will not use ifuncs if -mcx16
(or -march=i686 for 32-bit) is on by default.

2021-01-15  Jakub Jelinek  <jakub@redhat.com>

	PR target/70454
libatomic/
	* configure.tgt: For i?86 and x86_64 determine if -march=i486 needs to
	be added through preprocessor check on
	__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4.  Determine if try_ifunc is needed
	based on preprocessor check on __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16
	or __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8.
libgomp/
	* configure.tgt: For i?86 and x86_64 determine if -march=i486 needs to
	be added through preprocessor check on
	__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4.
libitm/
	* configure.tgt: For i?86 and x86_64 determine if -march=i486 needs to
	be added through preprocessor check on
	__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4.
2021-01-15 13:16:42 +01:00
Jakub Jelinek 99dee82307 Update copyright years. 2021-01-04 10:26:59 +01:00
Tom de Vries 1554556312 [libatomic] Add nvptx support
Add nvptx support to libatomic.

Given that atomic_test_and_set is not implemented for nvptx (PR96964), the
compiler translates __atomic_test_and_set falling back onto the "Failing all
else, assume a single threaded environment and simply perform the operation"
case in expand_atomic_test_and_set, so it doesn't map onto an actual atomic
operation.

Still, that counts as supported for the configure test of libatomic, so we
end up with HAVE_ATOMIC_TAS_1/2/4/8/16 == 1, and the corresponding
__atomic_test_and_set_1/2/4/8/16 in libatomic all using that non-atomic
implementation.

Fix this by adding an atomic_test_and_set expansion for nvptx, that uses
libatomics __atomic_test_and_set_1.

This again makes the configure tests for HAVE_ATOMIC_TAS_1/2/4/8/16 fail, so
instead we use this case in tas_n.c:
...
/* If this type is smaller than word-sized, fall back to a word-sized
   compare-and-swap loop.  */
bool
SIZE(libat_test_and_set) (UTYPE *mptr, int smodel)
...
which for __atomic_test_and_set_8 uses INVERT_MASK_8.

Add INVERT_MASK_8 in libatomic_i.h, as well as MASK_8.

Tested libatomic testsuite on nvptx.

gcc/ChangeLog:

	PR target/96964
	* config/nvptx/nvptx.md (define_expand "atomic_test_and_set"): New
	expansion.

libatomic/ChangeLog:

	PR target/96898
	* configure.tgt: Add nvptx.
	* libatomic_i.h (MASK_8, INVERT_MASK_8): New macro definition.
	* config/nvptx/host-config.h: New file.
	* config/nvptx/lock.c: New file.
2020-09-11 12:06:15 +02: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
Jakub Jelinek 8d9254fc8a Update copyright years.
From-SVN: r279813
2020-01-01 12:51:42 +01: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
Matt Thomas b27c108234 [NetBSD] Add support for the Arm EABI.
This is a roll-up of a set of changes needed to support the Arm EABI on NetBSD.

2019-06-14  Matt Thomas  <matt@3am-software.com>
	    Matthew Green  <mrg@eterna.com.au>
	    Nick Hudson  <skrll@netbsd.org>
	    Maya Rashish  <coypu@sdf.org>
	    Richard Earnshaw  <rearnsha@arm.com>

gcc:

	* config.gcc (arm*-*-netbsdelf*) Add support for EABI configuration.
	* config.host (arm*-*-netbsd*): Use driver-arm.o on native NetBSD.
	* config/arm/netbsd-eabi.h: New file.
	* config/arm/netbsd-elf.h (TARGET_OS_CPP_BUILTINS): Undefine before
	redefining.
	(SUBTARGET_EXTRA_ASM_SPEC): Don't pass -matpcs to the assembler.
	* config/netbsd-elf.h (NETBSD_LINK_LD_ELF_SO_SPEC): New define.
	(NETBSD_SUBTARGET_EXTRA_SPECS): New define.
	(SUBTARGET_EXTRA_SPECS): Define to NETBSD_SUBTARGET_EXTRA_SPECS.

libatomic:
	* configure.tgt (arm*): Handle NetBSD in the same way as FreeBSD.

libgcc:
	* config.host (arm*-*-netbsdelf*): Add support for EABI configurations.
	* config/arm/t-netbsd (LIB1ASMFUNCS): Add some additional assembler
	functions to build.
	* config/arm/t-netbsd-eabi: New file.


Co-Authored-By: Matthew Green <mrg@eterna.com.au>
Co-Authored-By: Maya Rashish <coypu@sdf.org>
Co-Authored-By: Nick Hudson <skrll@netbsd.org>
Co-Authored-By: Richard Earnshaw <rearnsha@arm.com>

From-SVN: r272290
2019-06-14 14:04:20 +00:00
Jakub Jelinek a554497024 Update copyright years.
From-SVN: r267494
2019-01-01 13:31:55 +01:00
Andreas Krebbel a4c6bd0821 S/390: libatomic: Fix 16 byte atomic exchange
The compiler builtin will use the hardware instruction cdsg if the
memory operand is properly aligned and will fall back to the
library call otherwise.
In case the compiler for one part is able to detect that the
location is aligned and fails to do so for another usage of the hw
instruction and the sw fall back would be mixed on the same memory
location.  To avoid this the library fall back also has to use the
hardware instruction if possible.

libatomic/ChangeLog:

2018-03-09  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* config/s390/exch_n.c: New file.
	* configure.tgt: Add the config directory for s390.

From-SVN: r258384
2018-03-09 12:32:22 +00:00
Jakub Jelinek 85ec4feb11 Update copyright years.
From-SVN: r256169
2018-01-03 11:03:58 +01:00
Steve Ellcey 9d0e85af87 Makefile.am (IFUNC_OPTIONS): Change aarch64 option from -march=armv8.1-a to -march=armv8-a+lse.
2017-12-14  Steve Ellcey  <sellcey@cavium.com>

	* Makefile.am (IFUNC_OPTIONS): Change aarch64
	option from -march=armv8.1-a to -march=armv8-a+lse.
	* configure.ac (*aarch64*): Check to see if
	compiler understands -march=armv8-a+lse option.
	* configure.tgt (*aarch64*): Only set try_ifunc
	if compiler understands -march=armv8-a+lse option.
	* Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.
	* configure: Regenerate.
	* aclocal.m4: Regenerate.

From-SVN: r255659
2017-12-14 18:30:38 +00:00
Steve Ellcey 141abc6f1e Makefile.am (ARCH_AARCH64_LINUX): Add IFUNC_OPTIONS and libatomic_la_LIBADD.
2017-12-04  Steve Ellcey  <sellcey@cavium.com>

	* Makefile.am (ARCH_AARCH64_LINUX): Add IFUNC_OPTIONS and
	libatomic_la_LIBADD.
	* config/linux/aarch64/host-config.h: New file.
	* configure.ac (IFUNC_RESOLVER_ARGS): Define.
	(ARCH_AARCH64_LINUX): New conditional for IFUNC builds.
	* configure.tgt (aarch64): Set ARCH and try_ifunc.
	(aarch64*-*-linux*) Update config_path.
	(aarch64*-*-linux*) Set IFUNC_RESOLVER_ARGS.
	* libatomic_i.h (GEN_SELECTOR): Add IFUNC_RESOLVER_ARGS argument.
	* Makefile.in: Regenerate.
	* auto-config.h.in: Regenerate.
	* configure: Regenerate.

From-SVN: r255399
2017-12-05 00:49:09 +00:00
Palmer Dabbelt b906c007fe RISC-V Port: libatomic
2017-02-06  Palmer Dabbelt <palmer@dabbelt.com>

        * configure.tgt: Add RISC-V tuple.

From-SVN: r245227
2017-02-06 21:38:57 +00:00
Jakub Jelinek cbe34bb5ed Update copyright years.
From-SVN: r243994
2017-01-01 13:07:43 +01:00
Sebastian Huber c47194d2ab [libatomic] Add RTEMS support
gcc/

	* config/rtems.h (LIB_SPEC): Add -latomic.

libatomic/

	* configure.tgt (configure_tgt_pre_target_cpu_XCFLAGS): New variable.
	(*-*-rtems*): New supported target.
	* config/rtems/host-config.h: New file.
	* config/rtems/lock.c: Likewise.

From-SVN: r235466
2016-04-27 07:14:42 +00:00
H.J. Lu 3dd7e09253 Revert the last change in libatomic
Need to properly check if -march=i486 is really needed for -m32 build
of libatomic on Linux/x86 and Linux/x86-64.

	PR target/70454
	* configure.tgt (XCFLAGS): Revert the last change.

From-SVN: r235411
2016-04-25 05:41:43 -07:00
H.J. Lu 9023fd9ea0 Don't build 32-bit libatomic with -march=i486 on x86-64
Gcc uses the same -march= for both -m32 and -m64 on x86-64 unless
--with-arch-32= is used.  There is no need for -march=i486 to compile
32-bit libatomic on x86-64.

	PR target/70454
	* configure.tgt (XCFLAGS): Don't add -march=i486 to compile
	32-bit x86 target library on x86-64.

From-SVN: r235287
2016-04-20 07:41:55 -07:00
Jakub Jelinek 818ab71a41 Update copyright years.
From-SVN: r232055
2016-01-04 15:30:50 +01:00
John Marino b6735e769f configure.tgt: Add *-*-dragonfly to supported targets.
2015-07-14  John Marino  <gnugcc@marino.st>

	* configure.tgt: Add *-*-dragonfly to supported targets.

From-SVN: r225779
2015-07-14 16:36:51 +01:00
Andreas Tobler 82a19768cb configure.ac: Don't add ${libgcj} for arm*-*-freebsd*.
toplevel:

    * configure.ac: Don't add ${libgcj} for arm*-*-freebsd*.
    * configure: Regenerate.
gcc:
    * config.gcc (arm*-*-freebsd*): New configuration.
    * config/arm/freebsd.h: New file.
    * config.host: Add extra components for arm*-*-freebsd*.
    * config/arm/arm.h: Introduce MAX_SYNC_LIBFUNC_SIZE.
    * config/arm/arm.c (arm_init_libfuncs): Use MAX_SYNC_LIBFUNC_SIZE.

libgcc:

    * config.host (arm*-*-freebsd*): Add new configuration for
    arm*-*-freebsd*.
    * config/arm/freebsd-atomic.c: New file.
    * config/arm/t-freebsd: Likewise.
    * config/arm/unwind-arm.h: Add __FreeBSD__ to the list of
    'PC-relative indirect' OS's.

libatomic:

    * configure.tgt: Exclude arm*-*-freebsd* from try_ifunc.

libstdc++-v3:

    * configure.host: Add arm*-*-freebsd* port_specific_symbol_files.

From-SVN: r219388
2015-01-09 15:06:02 +01:00
Jakub Jelinek 5624e564d2 Update copyright years.
From-SVN: r219188
2015-01-05 13:33:28 +01:00
Kai Tietz 6fe8c024aa configure.tgt: Add cygwin to supported targets.
2014-08-19  Yaakov Selkowitz  <yselkowi@redhat.com>

        * configure.tgt: Add cygwin to supported targets.

From-SVN: r214154
2014-08-19 16:55:37 +02:00
Uros Bizjak 537b531270 configure.tgt (alpha*): Add -mfp-trap-mode=sui to XCFLAGS.
* configure.tgt (alpha*): Add -mfp-trap-mode=sui to XCFLAGS.

From-SVN: r212778
2014-07-18 08:34:20 +02:00
Kai Tietz dc3368d0f5 Makefile.am (libatomic_la_LDFLAGS): Add lt_host_flags.
* Makefile.am (libatomic_la_LDFLAGS): Add lt_host_flags.
	* configure.ac (ACX_LT_HOST_FLAGS): New.
	(target_thread_file): New.
	* configure.tgt (mingw): Add mingw support.
	* config/mingw/host-config.h: New file.
	* config/mingw/lock.c: Likewise.
	* Makefile.in: Regenerated.
	* configure: Likewise.
	* aclocal.m4: Likewise.
	* testsuite/Makefile.in: Likewise.

From-SVN: r211747
2014-06-17 22:43:18 +02:00
Richard Sandiford 3e6a2e378c Update copyright years in libatomic/
From-SVN: r206291
2014-01-02 22:24:30 +00:00
Michael Hudson-Doyle a115cf9c95 [AArch64] Enable building libatomic on AArch64.
From-SVN: r203774
2013-10-17 15:49:27 +00:00
Richard Sandiford 69b2c4233b Update copyright years in libatomic.
From-SVN: r195164
2013-01-14 18:16:23 +00:00
Matthias Klose 5eb4cb4768 configure.tgt (i[3456]86): Handle -mx32 like -m64.
2012-11-21  Matthias Klose  <doko@ubuntu.com>

        * configure.tgt (i[3456]86): Handle -mx32 like -m64.

From-SVN: r193720
2012-11-22 00:47:58 +00:00
Sofiane Naci 34f8442ee2 AArch64 [6/10]
2012-10-23  Sofiane Naci <sofiane.naci@arm.com>

	Mark libatomic unsupported in AArch64.

	* configure.tgt: Mark libatomic unsupported.

From-SVN: r192727
2012-10-23 17:22:48 +00:00
Richard Henderson 483104922a Add libatomic as a target library.
From-SVN: r187018
2012-05-01 08:48:28 -07:00