aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/vxworks.h
AgeCommit message (Collapse)AuthorFilesLines
2024-01-03Update copyright years.Jakub Jelinek1-1/+1
2023-01-02Update copyright years.Jakub Jelinek1-1/+1
2022-10-11Tigthen the addition of -lgcc_eh to vxworks_libgcc_specOlivier Hainque1-4/+44
This change refines VXWORKS_LIBGCC_SPEC wrt the inclusion of -lgcc_eh. Unless the compiler features support for dual sjlj and table based eh, libgcc_eh.a is available only with multilib variants for which we build a shared lib (mrtp on VxWorks). Rework logic to handle absence of libgcc_s for -mrtp -mcmodel=large, using a conditional expr kind of spec. The gthread support in libgcc_eh might resort to libgcc functions on some targets, e.g. cas synchronisation routines on aarch64. Arrange to append -lgcc also after -lgcc_eh in VXWORKS_LIBGCC_SPEC. 2022-10-09 Olivier Hainque <hainque@adacore.com> gcc/ * config/vxworks.h (VX_LGCC_EH_SO0, VX_LGCC_EH_SO1): New internal macros. (VXWORKS_LIBGCC_SPEC): Use them and document.
2022-10-07Downgrade DWARF_VERSION_DEFAULT to 3 for VxWorks >= 7Olivier Hainque1-1/+1
Using 4 as the DWARF_VERSION_DEFAULT value for VxWorks observably still hangs recent system debuggers on tbreak for some contructs, and downgrading to 3 improves the situation. 2022-03-06 Olivier Hainque <hainque@adacore.com> gcc/ * config/vxworks.h (DWARF_VERSION_DEFAULT): Adjust from 4 to 3 for VxWorks >= 7.
2022-10-07Introduce DWARF_VERSION_DEFAULT and redefine for VxWorksOlivier Hainque1-4/+4
This change introduces a target overridable macro to replace the hardcoded value used to initialize dwarf_version from common.opt. The main advantage compared to special code in a target override_options hook is that redefinitions by target config files are visible by both the compiler proper and by the driver, which might refer to dwarf_version in ASM_DEBUG_SPECs and friends. This is useful at least on VxWorks, where we usually need to default to dwarf 4 or even 2 to accommodate non-gdb debuggers provided by the environment, including for assembly sources used in libgcc for some ports (witnessed with lse.S on aarch64). 2022-02-28 Olivier Hainque <hainque@adacore.com> gcc/ * defaults.h (DWARF_DEFAULT_VERSION): Define if not defined already. * common.opt (gdwarf-): Use it. * doc/tm.texi.in (DWARF_DEFAULT_VERSION): Document. * doc/tm.texi: Update accordingly. * config/vxworks.h (DWARF_DEFAULT_VERSION): Redefine. * config/vxworks.cc: Remove code setting dwarf_version, now handled by the DWARF_DEFAULT_VERSION redefinition.
2022-10-02Define GCC_DRIVER_HOST_INITIALIZATION for VxWorks targetsMarc Poulhiès1-0/+10
We need to perform static links by default on VxWorks, where the use of shared libraries involves unusual steps compared to standard native systems. This has to be conveyed before the lang_specific_driver code gets invoked (in particular for g++), so specs aren't available. This change defines the GCC_DRIVER_HOST_INITIALIZATION macro for VxWorks, to insert a -static option in case the user hasn't provided any explicit indication on the command line of the kind of link desired. While a HOST macro doesn't seem appropriate to control a target OS driven behavior, this matches other uses and won't conflict as VxWorks is not supported on any of the other configurations using this macro. gcc/ * config/vxworks-driver.cc: New. * config.gcc (*vxworks*): Add vxworks-driver.o in extra_gcc_objs. * config/t-vxworks: Add vxworks-driver.o. * config/vxworks.h (GCC_DRIVER_HOST_INITIALIZATION): New.
2022-10-02Refine guard for vxworks crtstuff specOlivier Hainque1-5/+4
Working on the reintroduction of shared libraries support (and of modules depending on shared libraries) exposed a few test failures of simple c++ constructor tests on arm-vxworks7r2. Investigation revealed that we were not linking the crtstuff objects as needed from a compiler configured not to have shared libs support, because of the ENABLE_SHARED_LIBGCC guard in this piece of vxworks.h: /* Setup the crtstuff begin/end we might need for dwarf EH registration and/or INITFINI_ARRAY support for shared libs. */ #if (HAVE_INITFINI_ARRAY_SUPPORT && defined(ENABLE_SHARED_LIBGCC)) \ || (DWARF2_UNWIND_INFO && !defined(CONFIG_SJLJ_EXCEPTIONS)) #define VX_CRTBEGIN_SPEC "%{!shared:vx_crtbegin.o%s;:vx_crtbeginS.o%s}" crtstuff initfini array support is meant to be leveraged for constructors regardless of whether the compiler also happens to be configured with shared library support, so the guard on ENABLE_SHARED_LIBGCC here is inappropriate. This change just removes it, 2022-09-30 Olivier Hainque <hainque@adacore.com> gcc/ * config/vxworks.h (VX_CRTBEGIN_SPEC, VX_CRTEND_SPEC): If HAVE_INITFINI_ARRAY_SUPPORT, pick crtstuff objects regardless of ENABLE_SHARED_LIBGCC.
2022-09-29Comment about HAVE_INITFINI_ARRAY_SUPPORT in vxworks.hOlivier Hainque1-0/+5
Explain that we rely on compiler .c files to include auto-host.h before target configuration headers. 2022-09-29 Olivier Hainque <hainque@adacore.com> gcc/ * config/vxworks.h: Add comment on our use of HAVE_INITFINI_ARRAY_SUPPORT.
2022-01-03Update copyright years.Jakub Jelinek1-1/+1
2021-12-13Rework VXWORKS_LINK_SPEC for shared objects supportDouglas B Rupp1-12/+23
Split LINK_SPEC as BASE_LINK_SPEC + EXTRA_LINK_SPEC, with an overridable LINK_OS component that cpu ports may redefine. Leverage the latter on powerpc for VxWorks 7, where we incorporate our specific bits in the linux os configuration as the system compiler is now very close to a standard linux one. The split allows supporting shared objects (shared libs and non-static rtps) on recent versions of VxWorks while retaining compatibility with older VxWorks targets which could link with shared libraries but not build them. 2021-12-07 Doug Rupp <rupp@adacore.com> Olivier Hainque <hainque@adacore.com> gcc/ * config/vxworks.h (VXWORKS_LINK_OS_SPEC): New spec. (VXWORKS_BASE_LINK_SPEC): New spec, using the former. (VXWORKS_EXTRA_LINK_SPEC): New spec for old and new VxWorks. (VXWORKS_LINK_SPEC): Combo of BASE and EXTRA specs. * config/rs6000/vxworks.h (VXWORKS_LINK_OS_SPEC): Empty. (LINK_OS_EXTRA_SPEC32): Use VXWORKS_LINK_SPEC. (LINK_OS_EXTRA_SPEC64): Likewise.
2021-12-13Tigthen libc_internal and crtstuff for VxWorks shared objectsFrederic Konrad1-14/+28
This change tightens and documents the use of libc_internal, then strengthens the VxWorks crtstuff objects for the support of shared libraries. In particular: - Define __dso_handle, which libstdc++.so requires, - Provide _init and _fini functions to run through the init/fini arrays for shared libs in configurations which HAVE_INITFINI_ARRAY_SUPPORT. The init/fini functions are provided by libc_internal.a for static links but with slightly different names and we don't want to risk dragging other libc_internal contents in the closure accidentally so make sure we don't link with it. As for the !vxworks crtstuff, the new shared libs specific bits are conditioned by a CRTSTUFFS_O macro, for which we provide new Makefile fragment. The bits to actually use the fragment and the shared objects will be added by a forthcoming change, as part of a more general configury update for shared libs. The change also adds guards the eh table registration code in vxcrtstuff so the objects can be used for either init/fini or eh tables independently. 2021-12-07 Fred Konrad <konrad@adacore.com> Olivier Hainque <hainque@adacore.com> gcc/ * config/vxworks.h (VXWORKS_BASE_LIBS_RTP): Guard -lc_internal on !shared+!non-static and document. (VXWORKS_LIB_SPEC): Remove the bits intended to drag the init/fini functions from libc_internal in the shared lib case. (VX_CRTBEGIN_SPEC/VX_CRTEND_SPEC): Use vxcrtstuff objects also in configurations with shared lib and INITFINI_ARRAY support. libgcc/ * config/t-vxcrtstuffS: New Makefile fragment. * config/vxcrtstuff.c: Provide __dso_handle. Provide _init/_fini functions for INITFINI_ARRAY support in shared libs and guard the definition of eh table registration functions on conditions indicating they are needed.
2021-12-13VxWorks config fixes for shared objectsFrederic Konrad1-1/+18
This strengthens the VxWorks configuration files for the support of shared objects, which encompasses a VxWorks specific "non-static" mode for RTPs (in addition to -static and -shared). 2020-11-06 Fred Konrad <konrad@adacore.com> Olivier Hainque <hainque@adacore.com> gcc/ * config/vx-common.h: Define REAL_LIBGCC_SPEC since the '-non-static' option is not standard. * config/vxworks.h (VXWORKS_LIBGCC_SPEC): Implement the LIBGCC_SPEC since REAL_LIBGCC_SPEC is used now. (STARTFILE_PREFIX_SPEC): Use the PIC VSB when building shared libraries or non-static binaries.
2021-12-13Ensure VxWorks headers expose C99 features for C++Olivier Hainque1-0/+6
C++ relies on C99 features since C++11 and libstdc++ down to c++98 checks for C99 features at configure time. Simpler is to request C99 features from system headers unconditionally. 2021-12-11 Olivier Hainque <hainque@adacore.com> * config/vxworks.h (VXWORKS_OS_CPP_BUILTINS): Define _C99 for C++.
2021-12-13Leverage sysroot for VxWorksOlivier Hainque1-25/+49
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-10Fix inaccuracies in VxWorks LINK_SPECDouglas B Rupp1-2/+2
-v needs to generate a -V not -v, as most/all other ports do. The latter causes collect2 to output exec'd collect-ld with same switches, which in turn causes a configure test which accumulates linker switches to contain duplicates, leading to a libstdc++ configure failure in some configurations. -V is typically used in such contexts to output the available emulations. The change also removes reference to %(link_target), long obsolete. 2021-12-07 Doug Rupp <rupp@adacore.com> * config/vxworks.h (LINK_SPEC): Remove %(link_target). Change %{v:-v} to %{v:-V}.
2021-12-02fix spelling of -linker-output-auto-nolto-relRasmus Villemoes1-1/+1
The transposition nolto -> notlo is confusing and it makes the long name even harder to read than it already is - I kept reading it as "not lo" until I realized it was a simple typo. Fixes: 5269b24605b1 (Silence warning in LTO mode on VxWorks) lto-plugin/ * lto-plugin.c: Fix -linker-output-auto-notlo-rel -> -linker-output-auto-nolto-rel typo. (process_option): Adjust accordingly, accepting both old and new spelling. gcc/ * config/vxworks.h (LTO_PLUGIN_SPEC): Adapt to corrected spelling of -linker-output-auto-nolto-rel.
2021-01-04Update copyright years.Jakub Jelinek1-1/+1
2020-12-02introduce overridable clear_cache emitterAlexandre Oliva1-4/+7
This patch introduces maybe_emit_call_builtin___clear_cache for the builtin expander machinery and the trampoline initializers to use to clear the instruction cache, removing a source of inconsistencies and subtle errors in low-level machinery. I've adjusted all trampoline_init implementations that used to issue explicit calls to __clear_cache or similar to use this new primitive. Specifically on vxworks targets, we needed to drop the __clear_cache symbol in libgcc, for reasons related with linking that I didn't need to understand, and we wanted to call cacheTextUpdate directly, despite the different calling conventions: the second argument is a length rather than the end address. So I introduced a target hook to enable target OS-level overriding of builtin __clear_cache call emission, retaining nearly (*) the same logic to govern the decision on whether to emit a call (or nothing, or a machine-dependent insn) but enabling a call to a target system-defined function with different calling conventions to be issued, without having to modify .md files of the various architectures supported by the target system to introduce or modify clear_cache insns. (*) I write "nearly" mainly because, when not optimizing, we'd issue a call regardless, but since the call may now be overridden, I added it to the set of builtins that are not directly turned into calls when not optimizing, following the normal expansion path instead. It wouldn't be hard to skip the emission of cache-clearing insns when not optimizing, but it didn't seem very important, especially for the new uses from trampoline init. Another difference that might be relevant is that now we expand the begin and end arguments unconditionally. This might make a difference if they have side effects. That's prettty much impossible at expand time, but I thought I'd mention it. I have NOT modified targets that did not issue cache-clearing calls in trampoline init to use the new clear_cache-calling infrastructure even if it would expand to nothing. I have considered doing so, to have __builtin___clear_cache and trampoline init call cacheTextUpdate on all vxworks targets, but decided not to, since on targets that don't do any cache clearing, cacheTextUpdate ought to be a no-op, even though rs6000 seems to use icbi and dcbf instructions in the function called to initialize a trampoline, but AFAICT not in the __clear_cache builtin. Hopefully target maintainers will have a look and take advantage of this new piece of infrastructure to remove such (apparent?) inconsistencies. Not rs6000 and other that call asm-coded trampoline setup instructions, for sure, but they might wish to introduce a CLEAR_INSN_CACHE macro or a clear_cache expander if they don't have one. for gcc/ChangeLog * builtins.c (default_emit_call_builtin___clear_cache): New. (maybe_emit_call_builtin___clear_cache): New. (expand_builtin___clear_cache): Split into the above. (expand_builtin): Do not issue clear_cache call any more. * builtins.h (maybe_emit_call_builtin___clear_cache): Declare. * config/aarch64/aarch64.c (aarch64_trampoline_init): Use maybe_emit_call_builtin___clear_cache. * config/arc/arc.c (arc_trampoline_init): Likewise. * config/arm/arm.c (arm_trampoline_init): Likewise. * config/c6x/c6x.c (c6x_initialize_trampoline): Likewise. * config/csky/csky.c (csky_trampoline_init): Likewise. * config/m68k/linux.h (FInALIZE_TRAMPOLINE): Likewise. * config/tilegx/tilegx.c (tilegx_trampoline_init): Likewise. * config/tilepro/tilepro.c (tilepro_trampoline_init): Ditto. * config/vxworks.c: Include rtl.h, memmodel.h, and optabs.h. (vxworks_emit_call_builtin___clear_cache): New. * config/vxworks.h (CLEAR_INSN_CACHE): Drop. (TARGET_EMIT_CALL_BUILTIN___CLEAR_CACHE): Define. * target.def (trampoline_init): In the documentation, refer to maybe_emit_call_builtin___clear_cache. (emit_call_builtin___clear_cache): New. * doc/tm.texi.in: Add new hook point. (CLEAR_CACHE_INSN): Remove duplicate 'both'. * doc/tm.texi: Rebuilt. * targhooks.h (default_meit_call_builtin___clear_cache): Declare. * tree.h (BUILTIN_ASM_NAME_PTR): New. for libgcc/ChangeLog * config/t-vxworks (LIB2ADD): Drop. * config/t-vxworks7 (LIB2ADD): Likewise. * config/vxcache.c: Remove.
2020-10-27Extract VX_CPU_PREFIX up into config/vxworks.hOlivier Hainque1-0/+12
Move VX_CPU_PREFIX to a place where it can be reused by multiple target ports. 2020-10-21 Olivier Hainque <hainque@adacore.com> gcc/ * config/vxworks.h (VX_CPU_PREFIX): #define here. * config/rs6000/vxworks.h: Remove #definition.
2020-10-23Link with the configured net lib on vxworks7Douglas Rupp1-1/+1
The net library is configurable on vxworks7. Pick the library to include in link closures in accordance with the availability of a revealing header file, using the recently introduced if-exist-then-else spec builtin function. 2021-10-23 Douglas Rupp <rupp@adacore.com> gcc/ * config/vxworks.h (VXWORKS_NET_LIBS_RTP): Use -lrtnet if rtnetStackLib.h is available,fallback to -lnet otherwise.
2020-10-16Fix the vxworks crtstuff handling of kernel/rtp variationsOlivier Hainque1-2/+1
The ports that support RTPs achieve the kernel/rtp compilation and link distinction through the multilib mechanism. This patch just removes the bogus explicit extraneous materialization of this distinction in the common VxWorks configuration files and leaves the rtp specialization all to the multilib machinery. 2020-10-15 Olivier Hainque <hainque@adacore.com> libgcc/ * config/t-vxcrtstuff: Remove the -kernel/-rtp specialization. gcc/ * config/vxworks.h (VX_CRTBEGIN_SPEC): Likewise.
2020-10-14Fallback to default CPP spec for C++ on VxWorksOlivier Hainque1-0/+6
Arrange to inhibit the effects of CPLUSPLUS_CPP_SPEC in gnu-user.h, which #defines _GNU_SOURCE, which is invalid for VxWorks (possibly not providing ::mkstemp, for example). 2020-10-14 Olivier Hainque <hainque@adacore.com> gcc/ * config/vxworks.h: #undef CPLUSPLUS_CPP_SPEC.
2020-08-20vxworks: Fix GCC selftests for *-wrs-vxworks7-* targetsIain Buclaw1-5/+11
Currently when building a cross-compiler targeting arm-wrs-vxworks7, the self-tests fail unless the VSB_DIR environment variable is set. This prevents attempts at designating the location of runtime header files, libraries or startfiles, which would fail on unset environment variables and aren't needed for such tests. gcc/ChangeLog: * config/vxworks.h (VXWORKS_ADDITIONAL_CPP_SPEC): Don't include VxWorks header files if -fself-test is used. (STARTFILE_PREFIX_SPEC): Avoid using VSB_DIR if -fself-test is used.
2020-05-05Silence warning in LTO mode on VxWorksEric Botcazou1-0/+8
The link phase is always partial (-r) for VxWorks in kernel mode, which means that it uses incremental LTO linking by default (-flinker-output=rel). But in this mode the LTO plugin outputs a warning if one of the object files involved in the link does not contain LTO bytecode, before switching to nolto-rel mode. We do not do repeated incremental linking for VxWorks so silence the warning. lto-plugin/ * lto-plugin.c: Document -linker-output-auto-notlo-rel option. (linker_output_set): Change type to bool. (linker_output_known): Likewise. (linker_output_auto_nolto_rel): New variable. (all_symbols_read_handler): Take it into account. <LDPO_REL>: Do not issue the warning if it is set. (process_option): Process -linker-output-auto-notlo-rel. (cleanup_handler): Remove unused variable. (onload) <LDPT_LINKER_OUTPUT>: Adjust to above type change. gcc/ * gcc.c (LTO_PLUGIN_SPEC): Define if not already. (LINK_PLUGIN_SPEC): Execute LTO_PLUGIN_SPEC. * config/vxworks.h (LTO_PLUGIN_SPEC): Define.
2020-01-01Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r279813
2019-11-14Introduce vxworks specific crtstuff supportJerome Lambourg1-2/+16
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-14Common ground work for vxworks7 ports updatesPat Bernardi1-5/+26
2019-11-06 Pat Bernardi <bernardi@adacore.com> Jerome Lambourg <lambourg@adacore.com> Olivier Hainque <hainque@adacore.com> gcc/ * config.gcc: Add comment to introduce the TARGET_VXWORKS commong macro definitions, conveying VXWORKS7 or 64bit general variations. Add a block to set gcc_cv_initfini_array unconditionally to "yes" for VxWorks7. config/vx-common.h (VXWORKS_CC1_SPEC): New macro, empty string by default. Update some comments. config/vxworks.h (VXWORKS_EXTRA_LIBS_RTP): New macro, empty by default, to be added the end of VXWORKS_LIBS_RTP. (VXWORKS_LIBS_RTP): Replace hardcoded part by VXWORKS_BASE_LIBS_RTP and append VXWORKS_EXTRA_LIBS_RTP, both of which specific ports may redefine. (VXWORKS_NET_LIBS_RTP): Account for VxWorks7 specificities. (VXWORKS_CC1_SPEC): Common base definition, with VxWorks7 variation to account for the now available TLS abilities. (TARGET_LIBC_HAS_FUNCTION): Account for VxWorks7 abilities. (VXWORKS_HAVE_TLS): Likewise. Co-Authored-By: Jerome Lambourg <lambourg@adacore.com> Co-Authored-By: Olivier Hainque <hainque@adacore.com> From-SVN: r278247
2019-01-01Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r267494
2018-11-16Allow target overrides of ctors/dtors support advertisement on VxWorksJerome Lambourg1-6/+11
2018-11-16 Jerome Lambourg <lambourg@adacore.com> * config/vxworks.h (TARGET_VXWORKS_HAVE_CTORS_DTORS): New macro. Default to TARGET_VXWORKS_RTP. (SUPPORTS_INIT_PRIORITY): Use TARGET_VXWORKS_HAVE_CTORS_DTORS instead of TARGET_VXWORKS_RTP. * config/vxworksae.h: Also define TARGET_VXWORKS_HAVE_CTORS_DTORS. * config/vxworks.c: Use TARGET_VXWORKS_HAVE_CTORS_DTORS instead of TARGET_VXWORKS_RTP to set targetm.have_ctors_dtors. From-SVN: r266201
2018-10-29Extract VXWORKS_NET_LIBS_RTP from VXWORKS_LIBS_RTPOlivier Hainque1-3/+9
2018-10-29 Olivier Hainque <hainque@adacore.com> * VXWORKS_NET_LIBS_RTP: New macro, network part of VXWORKS_LIBS_RTP. From-SVN: r265595
2018-10-29Introduce notion of VXWORKS_PERSONALITYOlivier Hainque1-2/+10
2018-10-29 Olivier Hainque <hainque@adacore.com> * config/vxworks.h (VXWORKS_PERSONALITY): New VxWorks ports configuration macro, defaults to "gnu". (VXWORKS_OS_CPP_BUILTINS): Use it. Feed TOOL and TOOL_FAMILY instead of _VX_TOOL/_VXTOOL_FAMILY. From-SVN: r265594
2018-09-21Leverage cacheTextUpdate for __clear_cache on VxWorksOlivier Hainque1-0/+4
2018-09-21 Alexandre Oliva <oliva@adacore.com> libgcc/ * config/vxcache.c: New file. Provide __clear_cache, based on the cacheTextUpdate VxWorks service. * config/t-vxworks (LIB2ADD): Add vxcache.c. (LIB2FUNCS_EXCLUDE): Add _clear_cache. * config/t-vxwoks7: Likewise. gcc/ * config/vxworks.h (CLEAR_INSN_CACHE): #define to 1. From-SVN: r264479
2018-09-21Cleanup handling of libgcc and libc_internal for VxWorksOlivier Hainque1-10/+8
2018-09-21 Olivier Hainque <hainque@adacore.com> * config/vxworks.h (VXWORKS_LIBGCC_SPEC): Remove -lc_internal. Merge block comment with the one ahead of VXWORKS_LIBS_RTP. Then: (VXWORKS_LIBS_RTP): Minor reordering. From-SVN: r264477
2018-09-21Leverage STARTFILE_PREFIX_SPEC for VxWorks7Olivier Hainque1-5/+6
2018-09-21 Olivier Hainque <hainque@adacore.com> * config/vxworks.h (STARTFILE_PREFIX_SPEC): Define. (VXWORKS_LIBS_DIR_RTP): Remove definition and use. From-SVN: r264476
2018-09-21Account for TARGET_VXWORKS64 in default SIZE/PTRDIFF_TYPE for vxworksOlivier Hainque1-2/+2
2018-09-21 Olivier Hainque <hainque@adacore.com> * config/vxworks.h (SIZE_TYPE): Account for TARGET_VXWORKS64. (PTRDIFF_TYPE): Likewise. From-SVN: r264475
2018-09-21Move default #define TARGET_VXWORKS7 to vxworks-dummy.hOlivier Hainque1-5/+0
2018-09-21 Olivier Hainque <hainque@adacore.com> * config/vxworks.h (TARGET_VXWORKS7): Move default definition ... * config/vxworks-dummy.h: here. From-SVN: r264472
2018-08-21vxworks: don't define vxworks_asm_out_constructor when using .init_arrayRasmus Villemoes1-0/+2
When the compiler is configured with --enable-initfini-array, config/initfini-array.h gets included after config/vxworks.h by tm.h, so the definitions of TARGET_ASM_CONSTRUTOR/TARGET_ASM_DESTRUCTOR in vxworks.h get undone in initfini-array.h. Hence, we might as well not define the vxworks_asm_out_* functions. From-SVN: r263692
2018-08-21vxworks: enable use of .init_array/.fini_array for cdtorsRasmus Villemoes1-3/+7
The target OS actually runs all function pointers found in the _ctors array when the module is loaded. So it is not that hard to make use of the "modern" .init_array/.fini_array mechanism - it mostly just requires a linker script adding the _ctors and _dtors symbols and terminating LONG(0) entries. Assume that if the user passed --enable-initfini-array when building gcc, the rest of the toolchain (including the link spec and linker script) is set up appropriately. Note that configuring with --enable-initfini-array may prevent the -mrtp mode from working, due to the (unconditional) use of .init_array.* sections instead of .ctors.* - however, that is the case regardless of this patch. From-SVN: r263691
2018-08-21vxworks: add target/h/wrn/coreip to the set of system include pathsRasmus Villemoes1-3/+6
In order to build crtstuff.c, I need to ensure the headers in target/h/wrn/coreip are also searched. Of course, that can be done similar to how wrn/coreip gets manually added for libgcc, e.g. by adding CRTSTUFF_T_CFLAGS += -I$(WIND_BASE)/target/h -I$(WIND_BASE)/target/h/wrn/coreip But without target/h/wrn/coreip in the default search path, all user-code that include <unistd.h> (crtstuff.c just being one such example) will have to manually add an -isystem flag adding the wrn/coreip directory: unistd.h include ioLib.h, which has #include "net/uio.h" and that header is found in target/h/wrn/coreip. In other words, the VxWorks system headers (at least for VxWorks 5.5) are written in a way that assumes wrn/coreip is in the search path, so I think it makes sense to have that by default. It will change the search order for existing setups that pass -I.../target/h/wrn/coreip (without -nostdinc), since that flag will now be ignored. I can't know whether that will break anything, but I do believe it makes sense to have the defaults actually usable without expecting all invocations to add -I/-isystem flags. From-SVN: r263689
2018-01-03Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r256169
2017-11-22vxworks.c (vxworks_override_options): Pick default dwarf version from macro ↵Olivier Hainque1-0/+10
value, VXWORKS_DWARF_VERSION_DEFAULT. 2017-11-22 Olivier Hainque <hainque@adacore.com> * config/vxworks.c (vxworks_override_options): Pick default dwarf version from macro value, VXWORKS_DWARF_VERSION_DEFAULT. * config/vxworks.h: Define VXWORKS_DWARF_VERSION_DEFAULT and DWARF_GNAT_ENCODINGS_DEFAULT. * config/vxworksae.h: Likewise. From-SVN: r255069
2017-07-04vxworks.h (PTRDIFF_TYPE, SIZE_TYPE): Restore unconditional basic definitions.Olivier Hainque1-8/+8
2017-07-04 Olivier Hainque <hainque@adacore.com> * config/vxworks.h (PTRDIFF_TYPE, SIZE_TYPE): Restore unconditional basic definitions. (VXWORKS_LIBS_RTP): Likewise, prefixed by VXWORKS_SYSCALL_LIBS_RTP, empty by default. * config/i386/vxworks.h (PTRDIFF_TYPE, SIZE_TYPE): Redefine, accounting for 64bit ABIs using cpu specific macros available for this purpose. (VXWORKS_SYSCALL_LIBS_RTP): Likewise. From-SVN: r249950
2017-06-27vxworks.h (VXWORKS_LIB_SPEC): Incorporate ...Jerome Lambourg1-0/+9
2017-06-27 Jerome Lambourg <lambourg@adacore.com> Olivier Hainque <hainque@adacore.com> * config/vxworks.h (VXWORKS_LIB_SPEC): Incorporate ... (TLS_SYM): New local macro, forcing reference to __tls__ on link command lines for VxWorks 7 RTPs, triggering initialization of tlsLib. (VXWORKS_HAVE_TLS): New macro. State whether the target VxWorks OS features TLS support, true for RTPs on VxWorks 7. * config/vxworks.c (vxworks_override_options): Setup emutls accordingly. Co-Authored-By: Olivier Hainque <hainque@adacore.com> From-SVN: r249684
2017-06-27vxworks.h (VXWORKS_LIBS_RTP): Alternative definition for 64bit configurations.Jerome Lambourg1-2/+6
2017-06-27 Jerome Lambourg <lambourg@adacore.com> * config/vxworks.h (VXWORKS_LIBS_RTP): Alternative definition for 64bit configurations. (PTR_DIFF_TYPE): Alternative definition for TARGET_LP64. (SIZE_TYPE): Likewise. * config/vxworks.c (vxworks_emutls_var_fields): Use long_unsigned_type_node instead of unsigned_type_node as the offset field type, which is "pointer" mode in emutls.c. From-SVN: r249681
2017-06-26config.gcc (*-*-vxworks*): Add TARGET_VXWORKS7=1 to tm_defines for all ↵Jerome Lambourg1-2/+51
vxworks7 targets. 2017-06-26 Jerome Lambourg <lambourg@adacore.com> Olivier Hainque <hainque@adacore.com> * config.gcc (*-*-vxworks*): Add TARGET_VXWORKS7=1 to tm_defines for all vxworks7 targets. * config/vxworks.h (TARGET_VXWORKS7): If not defined, define to 0. (VXWORKS_ADDITIONAL_CPP_SPEC): Alternative definition for VXWORKS7. (VXWORKS_LIBS_RTP, VXWORKS_LIBS_RTP_DIR): New macros, allowing variations for VX6/VX7 and 32/64bits later on in ... (VXWORKS_LIB_SPEC): Leverage new macros. (VXWORKS_OS_CPP_BUILTINS): Define _VSB_CONFIG_FILE for VXWORKS7, as well as _ALLOW_KEYWORD_MACROS when "inline" is not a keyword. Co-Authored-By: Olivier Hainque <hainque@adacore.com> From-SVN: r249659
2017-06-26vxworks.h (VXWORKS_OS_CPP_BUILTINS): builtin_define _VX_TOOL_FAMILY and ↵Jerome Lambourg1-0/+2
_VX_TOOL to gnu. 2017-06-26 Jerome Lambourg <lambourg@adacore.com> * config/vxworks.h (VXWORKS_OS_CPP_BUILTINS): builtin_define _VX_TOOL_FAMILY and _VX_TOOL to gnu. From-SVN: r249656
2017-01-01Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r243994
2016-01-08vxworks.h (VXWORKS_LIBGCC_SPEC): Don't link shared RTPs with libc_internal.Olivier Hainque1-5/+5
* config/vxworks.h (VXWORKS_LIBGCC_SPEC): Don't link shared RTPs with libc_internal. From-SVN: r232164
2016-01-04Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r232055
2015-01-05Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r219188