public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* add VxWorks specific crtstuff implementation files for Ada runtimes
@ 2017-06-02 15:58 Olivier Hainque
  2017-06-05 10:58 ` Nathan Sidwell
  0 siblings, 1 reply; 4+ messages in thread
From: Olivier Hainque @ 2017-06-02 15:58 UTC (permalink / raw)
  To: GCC Patches

[-- Attachment #1: Type: text/plain, Size: 514 bytes --]

Hello,

These are needed and used when building standalone Ada Downloadble Kernel
Modules for VxWorks.

They are referenced by the current Makefiles, so the Ada runtime builds for
VxWorks just fail without them currently.

Tested by verifying that an Ada runtime build for powerpc-wrs-vxworks
proceeds through after the change.

Olivier

2017-06-02  Olivier Hainque  <hainque@adacore.com>

	ada/
	* vx_crtbegin_auto.c: New file.
	* vx_crtbegin.c: New file.
	* vx_crtbegin.inc: New file.
	* vx_crtend.c: New file.


[-- Attachment #2: ada-vxcrt.diff --]
[-- Type: application/octet-stream, Size: 12994 bytes --]

Index: vx_crtbegin.c
===================================================================
--- vx_crtbegin.c	(revision 0)
+++ vx_crtbegin.c	(revision 0)
@@ -0,0 +1,39 @@
+/****************************************************************************
+ *                                                                          *
+ *                         GNAT COMPILER COMPONENTS                         *
+ *                                                                          *
+ *                          V X _ C R T B E G I N                           *
+ *                                                                          *
+ *                          C Implementation File                           *
+ *                                                                          *
+ *              Copyright (C) 2016, Free Software Foundation, Inc.          *
+ *                                                                          *
+ * GNAT is free software;  you can  redistribute it  and/or modify it under *
+ * terms of the  GNU General Public License as published  by the Free Soft- *
+ * ware  Foundation;  either version 3,  or (at your option) any later ver- *
+ * sion.  GNAT is distributed in the hope that it will be useful, but WITH- *
+ * OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY *
+ * or FITNESS FOR A PARTICULAR PURPOSE.                                     *
+ *                                                                          *
+ * As a special exception under Section 7 of GPL version 3, you are granted *
+ * additional permissions described in the GCC Runtime Library Exception,   *
+ * version 3.1, as published by the Free Software Foundation.               *
+ *                                                                          *
+ * You should have received a copy of the GNU General Public License and    *
+ * a copy of the GCC Runtime Library Exception along with this program;     *
+ * see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    *
+ * <http://www.gnu.org/licenses/>.                                          *
+ *                                                                          *
+ * GNAT was originally developed  by the GNAT team at  New York University. *
+ * Extensive contributions were provided by Ada Core Technologies Inc.      *
+ *                                                                          *
+ ****************************************************************************/
+
+/* crtbegin kind of file for ehframe registration/deregistration
+   purposes on VxWorks.  This variant exposes the ctor/dtor functions
+   as visible entities so they're picked by the WRS muncher.  */
+
+#define CDTOR_VISIBILITY
+#include "vx_crtbegin.inc"
+
+
Index: vx_crtend.c
===================================================================
--- vx_crtend.c	(revision 0)
+++ vx_crtend.c	(revision 0)
@@ -0,0 +1,53 @@
+/****************************************************************************
+ *                                                                          *
+ *                         GNAT COMPILER COMPONENTS                         *
+ *                                                                          *
+ *                            V X _ C R T E N D                             *
+ *                                                                          *
+ *                          C Implementation File                           *
+ *                                                                          *
+ *              Copyright (C) 2016, Free Software Foundation, Inc.          *
+ *                                                                          *
+ * GNAT is free software;  you can  redistribute it  and/or modify it under *
+ * terms of the  GNU General Public License as published  by the Free Soft- *
+ * ware  Foundation;  either version 3,  or (at your option) any later ver- *
+ * sion.  GNAT is distributed in the hope that it will be useful, but WITH- *
+ * OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY *
+ * or FITNESS FOR A PARTICULAR PURPOSE.                                     *
+ *                                                                          *
+ * As a special exception under Section 7 of GPL version 3, you are granted *
+ * additional permissions described in the GCC Runtime Library Exception,   *
+ * version 3.1, as published by the Free Software Foundation.               *
+ *                                                                          *
+ * You should have received a copy of the GNU General Public License and    *
+ * a copy of the GCC Runtime Library Exception along with this program;     *
+ * see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    *
+ * <http://www.gnu.org/licenses/>.                                          *
+ *                                                                          *
+ * GNAT was originally developed  by the GNAT team at  New York University. *
+ * Extensive contributions were provided by Ada Core Technologies Inc.      *
+ *                                                                          *
+ ****************************************************************************/
+
+/* crtend kind of file for ehframe registration/deregistration
+   purposes on VxWorks.  */
+
+#include "tconfig.h"
+#include "tsystem.h"
+#include "coretypes.h"
+#include "tm.h"
+
+# if __INT_MAX__ == 2147483647
+typedef int int32;
+# elif __LONG_MAX__ == 2147483647
+typedef long int32;
+# elif __SHRT_MAX__ == 2147483647
+typedef short int32;
+# else
+#  error "Missing a 4 byte integer"
+# endif
+
+static const int32 __FRAME_END__[]
+     __attribute__ ((used, section(EH_FRAME_SECTION_NAME),
+		     aligned(sizeof(int32))))
+     = { 0 };
Index: vx_crtbegin_auto.c
===================================================================
--- vx_crtbegin_auto.c	(revision 0)
+++ vx_crtbegin_auto.c	(revision 0)
@@ -0,0 +1,44 @@
+/****************************************************************************
+ *                                                                          *
+ *                         GNAT COMPILER COMPONENTS                         *
+ *                                                                          *
+ *                          V X _ C R T B E G I N                           *
+ *                                                                          *
+ *                          C Implementation File                           *
+ *                                                                          *
+ *              Copyright (C) 2016, Free Software Foundation, Inc.          *
+ *                                                                          *
+ * GNAT is free software;  you can  redistribute it  and/or modify it under *
+ * terms of the  GNU General Public License as published  by the Free Soft- *
+ * ware  Foundation;  either version 3,  or (at your option) any later ver- *
+ * sion.  GNAT is distributed in the hope that it will be useful, but WITH- *
+ * OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY *
+ * or FITNESS FOR A PARTICULAR PURPOSE.                                     *
+ *                                                                          *
+ * As a special exception under Section 7 of GPL version 3, you are granted *
+ * additional permissions described in the GCC Runtime Library Exception,   *
+ * version 3.1, as published by the Free Software Foundation.               *
+ *                                                                          *
+ * You should have received a copy of the GNU General Public License and    *
+ * a copy of the GCC Runtime Library Exception along with this program;     *
+ * see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    *
+ * <http://www.gnu.org/licenses/>.                                          *
+ *                                                                          *
+ * GNAT was originally developed  by the GNAT team at  New York University. *
+ * Extensive contributions were provided by Ada Core Technologies Inc.      *
+ *                                                                          *
+ ****************************************************************************/
+
+/* crtbegin kind of file for ehframe registration/deregistration
+   purposes on VxWorks.  This variant provides _ctors and _dtors
+   arrays that the kernel module loader knows to process when it has
+   been configured for this purpose (c++ constructor strategy set to
+   automatic).  The ctor/dtor functions need not be visible in this
+   case.  */
+
+#define CDTOR_VISIBILITY static
+#include "vx_crtbegin.inc"
+
+typedef void (*func_ptr) (void);
+func_ptr _dtors [] = {DTOR_NAME, 0};
+func_ptr _ctors [] = {CTOR_NAME, 0};
Index: vx_crtbegin.inc
===================================================================
--- vx_crtbegin.inc	(revision 0)
+++ vx_crtbegin.inc	(revision 0)
@@ -0,0 +1,76 @@
+/****************************************************************************
+ *                                                                          *
+ *                         GNAT COMPILER COMPONENTS                         *
+ *                                                                          *
+ *                          V X _ C R T B E G I N                           *
+ *                                                                          *
+ *                          C Implementation File                           *
+ *                                                                          *
+ *              Copyright (C) 2016, Free Software Foundation, Inc.          *
+ *                                                                          *
+ * GNAT is free software;  you can  redistribute it  and/or modify it under *
+ * terms of the  GNU General Public License as published  by the Free Soft- *
+ * ware  Foundation;  either version 3,  or (at your option) any later ver- *
+ * sion.  GNAT is distributed in the hope that it will be useful, but WITH- *
+ * OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY *
+ * or FITNESS FOR A PARTICULAR PURPOSE.                                     *
+ *                                                                          *
+ * As a special exception under Section 7 of GPL version 3, you are granted *
+ * additional permissions described in the GCC Runtime Library Exception,   *
+ * version 3.1, as published by the Free Software Foundation.               *
+ *                                                                          *
+ * You should have received a copy of the GNU General Public License and    *
+ * a copy of the GCC Runtime Library Exception along with this program;     *
+ * see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    *
+ * <http://www.gnu.org/licenses/>.                                          *
+ *                                                                          *
+ * GNAT was originally developed  by the GNAT team at  New York University. *
+ * Extensive contributions were provided by Ada Core Technologies Inc.      *
+ *                                                                          *
+ ****************************************************************************/
+
+/* Common body for the various flavors of vx_crtbegin C sources we need
+   to perform eh frame registration/deregistration in various
+   circumstances.  #includers should define CDTOR_VISIBILITY. */
+
+#include "tconfig.h"
+#include "tsystem.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "unwind-dw2-fde.h"
+
+/* Pick names that the VxWorks muncher will get if involved.
+   Note: ppc64-vx7 diab uses "_STI_15..." for C++ in kernel mode,
+   not "_GLOBAL__{I,D}...". ???  */
+
+#ifdef __RTP__
+/* 101 is the highest user level priority allowed by VxWorks.  */
+#define CTOR_NAME _STI__101____crtbe_register_frame
+#define DTOR_NAME _STI__101____crtbe_deregister_frame
+#define CTOR_ATTRIBUTE __attribute__((constructor(101)))
+#define DTOR_ATTRIBUTE __attribute__((destructor(101)))
+#else
+#define CTOR_NAME _GLOBAL__I___crtbe_register_frame
+#define DTOR_NAME _GLOBAL__D___crtbe_deregister_frame
+#define CTOR_ATTRIBUTE __attribute__((unused))
+#define DTOR_ATTRIBUTE __attribute__((unused))
+#endif
+
+CDTOR_VISIBILITY void CTOR_NAME (void) CTOR_ATTRIBUTE;
+CDTOR_VISIBILITY void DTOR_NAME (void) DTOR_ATTRIBUTE;
+
+static const char __EH_FRAME_BEGIN__[]
+__attribute__((section(EH_FRAME_SECTION_NAME), aligned(4)))
+  = { };
+
+CDTOR_VISIBILITY void CTOR_NAME (void)
+{
+  static struct object object;
+  __register_frame_info (__EH_FRAME_BEGIN__, &object);
+}
+
+CDTOR_VISIBILITY void DTOR_NAME (void)
+{
+  __deregister_frame_info (__EH_FRAME_BEGIN__);
+}
+

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: add VxWorks specific crtstuff implementation files for Ada runtimes
  2017-06-02 15:58 add VxWorks specific crtstuff implementation files for Ada runtimes Olivier Hainque
@ 2017-06-05 10:58 ` Nathan Sidwell
  2017-06-06 21:02   ` Olivier Hainque
  0 siblings, 1 reply; 4+ messages in thread
From: Nathan Sidwell @ 2017-06-05 10:58 UTC (permalink / raw)
  To: gcc-patches

On 06/02/2017 11:58 AM, Olivier Hainque wrote:
> Hello,

> 2017-06-02  Olivier Hainque  <hainque@adacore.com>
> 
> 	ada/
> 	* vx_crtbegin_auto.c: New file.
> 	* vx_crtbegin.c: New file.
> 	* vx_crtbegin.inc: New file.
> 	* vx_crtend.c: New file.

+ *              Copyright (C) 2016, Free Software Foundation, Inc. 


Date update?

-- 
Nathan Sidwell

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: add VxWorks specific crtstuff implementation files for Ada runtimes
  2017-06-05 10:58 ` Nathan Sidwell
@ 2017-06-06 21:02   ` Olivier Hainque
  2017-06-08  8:18     ` Olivier Hainque
  0 siblings, 1 reply; 4+ messages in thread
From: Olivier Hainque @ 2017-06-06 21:02 UTC (permalink / raw)
  To: Nathan Sidwell; +Cc: Olivier Hainque, gcc-patches

Hi Nathan,

> On Jun 5, 2017, at 12:58 , Nathan Sidwell <nathan@acm.org> wrote:
> 
> On 06/02/2017 11:58 AM, Olivier Hainque wrote:
>> Hello,
> 
>> 2017-06-02  Olivier Hainque  <hainque@adacore.com>
>> 	ada/
>> 	* vx_crtbegin_auto.c: New file.
>> 	* vx_crtbegin.c: New file.
>> 	* vx_crtbegin.inc: New file.
>> 	* vx_crtend.c: New file.
> 
> + *              Copyright (C) 2016, Free Software Foundation, Inc. 
> 
> Date update?

Yes, I can do that. For a moment I thought that keeping
the date of the latest change to the source contents was
correct. I understand that committing upstream represents
an event of interest as well.

Regards,

Olivier



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: add VxWorks specific crtstuff implementation files for Ada runtimes
  2017-06-06 21:02   ` Olivier Hainque
@ 2017-06-08  8:18     ` Olivier Hainque
  0 siblings, 0 replies; 4+ messages in thread
From: Olivier Hainque @ 2017-06-08  8:18 UTC (permalink / raw)
  To: Nathan Sidwell; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 556 bytes --]


> On 06 Jun 2017, at 23:02, Olivier Hainque <hainque@adacore.com> wrote:
>> + *              Copyright (C) 2016, Free Software Foundation, Inc. 
>> 
>> Date update?

About to commit the attached patch, to convey the year during
which the sources entered the tree.

Thanks for the suggestion.

With Kind Regards,

Olivier

--

2017-06-08  Olivier Hainque  <hainque@adacore.com>

	ada/
        * vx_crtbegin_auto.c: Update year in copyright notice.
        * vx_crtbegin.c: Likewise.
        * vx_crtbegin.inc: Likewise. 
        * vx_crtend.c:  Likewise.


[-- Attachment #2: vxcrt-copy.diff --]
[-- Type: application/octet-stream, Size: 3239 bytes --]

Index: vx_crtbegin_auto.c
===================================================================
--- vx_crtbegin_auto.c	(revision 249006)
+++ vx_crtbegin_auto.c	(working copy)
@@ -6,7 +6,7 @@
  *                                                                          *
  *                          C Implementation File                           *
  *                                                                          *
- *              Copyright (C) 2016, Free Software Foundation, Inc.          *
+ *              Copyright (C) 2017, Free Software Foundation, Inc.          *
  *                                                                          *
  * GNAT is free software;  you can  redistribute it  and/or modify it under *
  * terms of the  GNU General Public License as published  by the Free Soft- *
Index: vx_crtbegin.inc
===================================================================
--- vx_crtbegin.inc	(revision 249006)
+++ vx_crtbegin.inc	(working copy)
@@ -6,7 +6,7 @@
  *                                                                          *
  *                          C Implementation File                           *
  *                                                                          *
- *              Copyright (C) 2016, Free Software Foundation, Inc.          *
+ *              Copyright (C) 2017, Free Software Foundation, Inc.          *
  *                                                                          *
  * GNAT is free software;  you can  redistribute it  and/or modify it under *
  * terms of the  GNU General Public License as published  by the Free Soft- *
Index: vx_crtbegin.c
===================================================================
--- vx_crtbegin.c	(revision 249006)
+++ vx_crtbegin.c	(working copy)
@@ -6,7 +6,7 @@
  *                                                                          *
  *                          C Implementation File                           *
  *                                                                          *
- *              Copyright (C) 2016, Free Software Foundation, Inc.          *
+ *              Copyright (C) 2017, Free Software Foundation, Inc.          *
  *                                                                          *
  * GNAT is free software;  you can  redistribute it  and/or modify it under *
  * terms of the  GNU General Public License as published  by the Free Soft- *
Index: vx_crtend.c
===================================================================
--- vx_crtend.c	(revision 249006)
+++ vx_crtend.c	(working copy)
@@ -6,7 +6,7 @@
  *                                                                          *
  *                          C Implementation File                           *
  *                                                                          *
- *              Copyright (C) 2016, Free Software Foundation, Inc.          *
+ *              Copyright (C) 2017, Free Software Foundation, Inc.          *
  *                                                                          *
  * GNAT is free software;  you can  redistribute it  and/or modify it under *
  * terms of the  GNU General Public License as published  by the Free Soft- *

[-- Attachment #3: Type: text/plain, Size: 2 bytes --]




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-06-08  8:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-02 15:58 add VxWorks specific crtstuff implementation files for Ada runtimes Olivier Hainque
2017-06-05 10:58 ` Nathan Sidwell
2017-06-06 21:02   ` Olivier Hainque
2017-06-08  8:18     ` Olivier Hainque

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).