diff options
author | Vincent Celier <celier@adacore.com> | 2005-07-04 15:26:18 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2005-07-04 15:26:18 +0200 |
commit | b87520cd051656e14f59112793d66c259ffd4f52 (patch) | |
tree | d05fc3ff905800886f21e31cfce3310be6ebf1a9 /gcc/ada/adaint.c | |
parent | 0556b702920f8de9acfdff66e27c2e0155c41365 (diff) | |
download | gcc-b87520cd051656e14f59112793d66c259ffd4f52.zip gcc-b87520cd051656e14f59112793d66c259ffd4f52.tar.gz gcc-b87520cd051656e14f59112793d66c259ffd4f52.tar.bz2 |
mlib-tgt-tru64.adb, [...] (Build_Dynamic_Library): Remove all auto-initialization code...
2005-07-04 Vincent Celier <celier@adacore.com>
* mlib-tgt-tru64.adb, mlib-tgt-aix.adb, mlib-tgt-irix.adb,
mlib-tgt-hpux.adb, mlib-tgt-linux.adb, mlib-tgt-solaris.adb,
mlib-tgt-mingw.adb, mlib-tgt-darwin.adb (Build_Dynamic_Library):
Remove all auto-initialization code, as this is now done through the
constructor mechanism.
* adaint.h, adaint.c (__gnat_binder_supports_auto_init,
__gnat_sals_init_using_constructors): New functions.
* bindgen.adb (Gen_Output_File_Ada): Generate pragmas
Linker_Constructor and Linker_Destructor when switch -a is used.
* bindusg.adb: Add line for new switch -a
* gnatbind.adb (Gnatbind_Supports_Auto_Init): New Boolean function
(Gnatbind): When switch -a is used, check if it is allowed
* switch-b.adb (Scan_Binder_Switches): Process new switch -a
From-SVN: r101573
Diffstat (limited to 'gcc/ada/adaint.c')
-rw-r--r-- | gcc/ada/adaint.c | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c index 1632b3d..e1453f7 100644 --- a/gcc/ada/adaint.c +++ b/gcc/ada/adaint.c @@ -2028,6 +2028,7 @@ __gnat_locate_regular_file (char *file_name, char *path_val) char * __gnat_locate_exec (char *exec_name, char *path_val) { + char *ptr; if (!strstr (exec_name, HOST_EXECUTABLE_SUFFIX)) { char *full_exec_name @@ -2035,7 +2036,11 @@ __gnat_locate_exec (char *exec_name, char *path_val) strcpy (full_exec_name, exec_name); strcat (full_exec_name, HOST_EXECUTABLE_SUFFIX); - return __gnat_locate_regular_file (full_exec_name, path_val); + ptr = __gnat_locate_regular_file (full_exec_name, path_val); + + if (ptr == 0) + return __gnat_locate_regular_file (exec_name, path_val); + return ptr; } else return __gnat_locate_regular_file (exec_name, path_val); @@ -2668,3 +2673,27 @@ __gnat_set_close_on_exec (int fd ATTRIBUTE_UNUSED, as by default handles are *not* inherited. */ #endif } + +/* Indicates if platforms supports automatic initialization through the + constructor mechanism */ +int +__gnat_binder_supports_auto_init () +{ +#ifdef VMS + return 0; +#else + return 1; +#endif +} + +/* Indicates that Stand-Alone Libraries are automatically initialized through + the constructor mechanism */ +int +__gnat_sals_init_using_constructors () +{ +#if defined (__vxworks) || defined (__Lynx__) || defined (VMS) + return 0; +#else + return 1; +#endif +} |