This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Introduce TARGET_VXWORKS_HAVE_CTORS_DTORS


Hello,

The support for constructors/destructors on VxWorks evolves and the
current distinction between RTP vs kernel mode isn't precise enough
any more.

The attached patch, originally contributed by Jerome Lambourg for gcc-7,
introduces a TARGET_VXWORKS_HAVE_CTORS_DTORS internal macro which allows
target ports to state their own setting, propagated to both
targetm.have_ctors_dtors and SUPPORTS_INIT_PRIORITY in a synchronized
fashion.

This helps fix problems we observed on the aarch64 port we're working on
without introducing any visible regression in our nightly testing of other
ports based on gcc-7.

I adapted the patch to mainline, verified that I could build a
powerpc-wrs-vxworks compiler and that a constructor attribute still
operates as expected for this target, producing a .ctors entry with
-mrtp and a specially named (GLOBAL_I) wrapper function otherwise.

Olivier

2018-11-16  Jerome Lambourg  <lambourg@adacore.com>
            Olivier Hainque  <hainque@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.

Attachment: vxworks_ctor_dtors.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]