diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2012-05-25 09:24:08 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2012-05-25 09:24:08 +0000 |
commit | b993039f5bb3870d3c6fcb61f9554067e76141a9 (patch) | |
tree | 046da996c3e8398f97233d73b99d4888fb28c026 /gcc/ada/link.c | |
parent | 4aa820fec744198ccdd2d0c4680a1c95c3cdc518 (diff) | |
download | gcc-b993039f5bb3870d3c6fcb61f9554067e76141a9.zip gcc-b993039f5bb3870d3c6fcb61f9554067e76141a9.tar.gz gcc-b993039f5bb3870d3c6fcb61f9554067e76141a9.tar.bz2 |
re PR ada/52362 (gnat.dg/lto8.adb FAILs with gas/gld)
PR ada/52362
* config.gcc (i[34567]86-*-mingw* | x86_64-*-mingw*): Set gas and
gnu_ld variables to yes.
* configure.ac (HAVE_GNU_LD): Move to after config.gcc inclusion.
(HAVE_GNU_AS): Likewise.
* config.in: Regenerate.
* configure: Likewise.
ada/
* link.c (__gnat_object_file_option): Set to "-Wl,@" for GNU linker.
(__gnat_using_gnu_linker): Delete.
* gnatlink.adb (Gnatlink): Declare Object_File_Option_Ptr here...
Declare Object_File_Option string constant and Using_GNU_response_file
boolean constant.
(Process_Binder_File): ...instead of here. Delete Using_GNU_Linker,
Opening and Closing local variables. Do not handle the GNU linker
specially.
(Write_RF): New procedure to write into the response file. Escape some
characters if a GNU response file is used. Keep track of error status.
Invoke Write_RF to write into the response file. Delete the file only
if the link was successful.
* mlib-utl.adb: Do not `with' package System.
(Gcc): Likewise. Declare Object_File_Option string constant and
Using_GNU_response_file boolean constant.
(Write_RF): Take a string instead of address and length. Escape some
characters if a GNU response file is used.
Invoke Write_RF to write into the response file. Delete the file only
if the link was successful. Do not warn if it cannot be deleted.
From-SVN: r187874
Diffstat (limited to 'gcc/ada/link.c')
-rw-r--r-- | gcc/ada/link.c | 34 |
1 files changed, 4 insertions, 30 deletions
diff --git a/gcc/ada/link.c b/gcc/ada/link.c index 88c4846..8a8e120 100644 --- a/gcc/ada/link.c +++ b/gcc/ada/link.c @@ -72,38 +72,22 @@ extern "C" { /* shared_libgcc_default gives the system dependent link method that */ /* be used by default for linking libgcc (shared or static) */ -/* using_gnu_linker is set to 1 when the GNU linker is used under this */ -/* target. */ - /* separate_run_path_options is set to 1 when separate "rpath" arguments */ /* must be passed to the linker for each directory in the rpath. */ /* default_libgcc_subdir is the subdirectory name (from the installation */ /* root) where we may find a shared libgcc to use by default. */ -/* RESPONSE FILE & GNU LINKER */ -/* -------------------------- */ -/* objlist_file_supported and using_gnu_link used together tell gnatlink */ -/* to generate a GNU style response file. Note that object_file_option */ -/* must be set to "" in this case, since no option is required for a */ -/* response file to be passed to GNU ld. With a GNU linker we use the */ -/* linker script to implement the response file feature. Any file passed */ -/* in the GNU ld command line with an unknown extension is supposed to be */ -/* a linker script. Each linker script augment the current configuration. */ -/* The format of such response file is as follow : */ -/* INPUT (obj1.p obj2.o ...) */ - #define SHARED 'H' #define STATIC 'T' #if defined (__WIN32) -const char *__gnat_object_file_option = ""; +const char *__gnat_object_file_option = "-Wl,@"; const char *__gnat_run_path_option = ""; int __gnat_link_max = 30000; unsigned char __gnat_objlist_file_supported = 1; char __gnat_shared_libgnat_default = STATIC; char __gnat_shared_libgcc_default = STATIC; -unsigned char __gnat_using_gnu_linker = 1; const char *__gnat_object_library_extension = ".a"; unsigned char __gnat_separate_run_path_options = 0; const char *__gnat_default_libgcc_subdir = "lib"; @@ -115,19 +99,17 @@ int __gnat_link_max = 5000; unsigned char __gnat_objlist_file_supported = 1; char __gnat_shared_libgnat_default = STATIC; char __gnat_shared_libgcc_default = STATIC; -unsigned char __gnat_using_gnu_linker = 0; const char *__gnat_object_library_extension = ".a"; unsigned char __gnat_separate_run_path_options = 0; const char *__gnat_default_libgcc_subdir = "lib"; #elif defined (__FreeBSD__) -const char *__gnat_object_file_option = ""; +const char *__gnat_object_file_option = "-Wl,@"; const char *__gnat_run_path_option = "-Wl,-rpath,"; char __gnat_shared_libgnat_default = STATIC; char __gnat_shared_libgcc_default = STATIC; int __gnat_link_max = 8192; unsigned char __gnat_objlist_file_supported = 1; -unsigned char __gnat_using_gnu_linker = 1; const char *__gnat_object_library_extension = ".a"; unsigned char __gnat_separate_run_path_options = 0; const char *__gnat_default_libgcc_subdir = "lib"; @@ -139,19 +121,17 @@ char __gnat_shared_libgnat_default = STATIC; char __gnat_shared_libgcc_default = SHARED; int __gnat_link_max = 262144; unsigned char __gnat_objlist_file_supported = 1; -unsigned char __gnat_using_gnu_linker = 0; const char *__gnat_object_library_extension = ".a"; unsigned char __gnat_separate_run_path_options = 1; const char *__gnat_default_libgcc_subdir = "lib"; #elif defined (linux) || defined(__GLIBC__) -const char *__gnat_object_file_option = ""; +const char *__gnat_object_file_option = "-Wl,@"; const char *__gnat_run_path_option = "-Wl,-rpath,"; char __gnat_shared_libgnat_default = STATIC; char __gnat_shared_libgcc_default = STATIC; int __gnat_link_max = 8192; unsigned char __gnat_objlist_file_supported = 1; -unsigned char __gnat_using_gnu_linker = 1; const char *__gnat_object_library_extension = ".a"; unsigned char __gnat_separate_run_path_options = 0; #if defined (__x86_64) @@ -174,7 +154,6 @@ char __gnat_shared_libgnat_default = STATIC; char __gnat_shared_libgcc_default = STATIC; int __gnat_link_max = 15000; const unsigned char __gnat_objlist_file_supported = 1; -unsigned char __gnat_using_gnu_linker = 0; const char *__gnat_object_library_extension = ".a"; unsigned char __gnat_separate_run_path_options = 0; const char *__gnat_default_libgcc_subdir = "lib"; @@ -183,13 +162,12 @@ const char *__gnat_default_libgcc_subdir = "lib"; /* These are the settings for all systems that use gnu ld. GNU style response file is supported, the shared library default is STATIC. */ -const char *__gnat_object_file_option = ""; +const char *__gnat_object_file_option = "-Wl,@"; const char *__gnat_run_path_option = ""; char __gnat_shared_libgnat_default = STATIC; char __gnat_shared_libgcc_default = STATIC; int __gnat_link_max = 8192; unsigned char __gnat_objlist_file_supported = 1; -unsigned char __gnat_using_gnu_linker = 1; const char *__gnat_object_library_extension = ".a"; unsigned char __gnat_separate_run_path_options = 0; const char *__gnat_default_libgcc_subdir = "lib"; @@ -201,7 +179,6 @@ char __gnat_shared_libgnat_default = STATIC; char __gnat_shared_libgcc_default = STATIC; int __gnat_link_max = 2147483647; unsigned char __gnat_objlist_file_supported = 0; -unsigned char __gnat_using_gnu_linker = 0; const char *__gnat_object_library_extension = ".olb"; unsigned char __gnat_separate_run_path_options = 0; const char *__gnat_default_libgcc_subdir = "lib"; @@ -213,7 +190,6 @@ char __gnat_shared_libgnat_default = STATIC; char __gnat_shared_libgcc_default = STATIC; int __gnat_link_max = 2147483647; unsigned char __gnat_objlist_file_supported = 0; -unsigned char __gnat_using_gnu_linker = 0; const char *__gnat_object_library_extension = ".a"; unsigned char __gnat_separate_run_path_options = 0; #if defined (__sparc_v9__) || defined (__sparcv9) @@ -231,7 +207,6 @@ char __gnat_shared_libgnat_default = STATIC; char __gnat_shared_libgcc_default = STATIC; int __gnat_link_max = 2147483647; unsigned char __gnat_objlist_file_supported = 0; -unsigned char __gnat_using_gnu_linker = 0; const char *__gnat_object_library_extension = ".a"; unsigned char __gnat_separate_run_path_options = 0; const char *__gnat_default_libgcc_subdir = "lib"; @@ -246,7 +221,6 @@ char __gnat_shared_libgnat_default = STATIC; char __gnat_shared_libgcc_default = STATIC; int __gnat_link_max = 2147483647; unsigned char __gnat_objlist_file_supported = 0; -unsigned char __gnat_using_gnu_linker = 0; const char *__gnat_object_library_extension = ".a"; unsigned char __gnat_separate_run_path_options = 0; const char *__gnat_default_libgcc_subdir = "lib"; |