diff options
author | Iain Buclaw <ibuclaw@gdcproject.org> | 2020-04-10 09:35:09 +0200 |
---|---|---|
committer | Iain Buclaw <ibuclaw@gdcproject.org> | 2020-04-10 12:46:12 +0200 |
commit | 7478addd84ab6808307f4f285ab05f3a76bbb257 (patch) | |
tree | a02427985f419db2885fb3a43c254876a39a8baf /gcc | |
parent | 6c4a05f251ae8a39fa896524defaf4228328c259 (diff) | |
download | gcc-7478addd84ab6808307f4f285ab05f3a76bbb257.zip gcc-7478addd84ab6808307f4f285ab05f3a76bbb257.tar.gz gcc-7478addd84ab6808307f4f285ab05f3a76bbb257.tar.bz2 |
libphobos: Use libdruntime as a convenience library for libphobos.
As a prerequesite for PR94304, it becomes easier to manage selectively
compiling sublibraries when there's only one library to link to.
So a druntime convenience library is built to be part of phobos, however
separate druntime library is still built and installed, to allow linking
only to the core runtime explicitly, rather than pulling in the entire
standard library with it.
The gdc driver no longer generates an '-lgdruntime' option, and the
inclusion of the libdruntime library path has been removed from the
testsuite.
gcc/d/ChangeLog:
* d-spec.cc (LIBDRUNTIME): Remove.
(LIBDRUNTIME_PROFILE): Remove.
(lang_specific_driver): Don't link in libgdruntime.
gcc/testsuite/ChangeLog:
* lib/gdc.exp (gdc_link_flags): Remove libdruntime library path.
libphobos/ChangeLog:
* d_rules.am (libdgruntime_la_LINK): Move to libdruntime/Makefile.am.
(libgphobos_la_LINK): Move to src/Makefile.am
* libdruntime/Makefile.am: Add libgdruntime_convenience library.
* libdruntime/Makefile.in: Regenerate.
* src/Makefile.am (libgphobos_la_LIBADD): Add libgdruntime_convenience
library.
(libgphobos_la_DEPENDENCIES): Likewise.
* src/Makefile.in: Regenerate.
* testsuite/lib/libphobos.exp: Remove libdruntime library paths.
* testsuite/testsuite_flags.in: Likewise.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/d/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/d/d-spec.cc | 14 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/lib/gdc.exp | 14 |
4 files changed, 13 insertions, 25 deletions
diff --git a/gcc/d/ChangeLog b/gcc/d/ChangeLog index 73fd184..5f7e967 100644 --- a/gcc/d/ChangeLog +++ b/gcc/d/ChangeLog @@ -1,3 +1,9 @@ +2020-04-10 Iain Buclaw <ibuclaw@gdcproject.org> + + * d-spec.cc (LIBDRUNTIME): Remove. + (LIBDRUNTIME_PROFILE): Remove. + (lang_specific_driver): Don't link in libgdruntime. + 2020-04-07 Iain Buclaw <ibuclaw@gdcproject.org> PR d/94425 diff --git a/gcc/d/d-spec.cc b/gcc/d/d-spec.cc index 8a0c7ca..e084422 100644 --- a/gcc/d/d-spec.cc +++ b/gcc/d/d-spec.cc @@ -44,13 +44,6 @@ along with GCC; see the file COPYING3. If not see #define LIBPHOBOS_PROFILE LIBPHOBOS #endif -#ifndef LIBDRUNTIME -#define LIBDRUNTIME "gdruntime" -#endif -#ifndef LIBDRUNTIME_PROFILE -#define LIBDRUNTIME_PROFILE LIBDRUNTIME -#endif - /* What do with libgphobos. */ enum phobos_action { @@ -322,7 +315,7 @@ lang_specific_driver (cl_decoded_option **in_decoded_options, /* Make sure to have room for the trailing NULL argument. - needstdcxx might add `-lstdcxx' - - libphobos adds `-Bstatic -lphobos -ldruntime -Bdynamic' + - libphobos adds `-Bstatic -lphobos -Bdynamic' - only_source adds 1 more arg, also maybe add `-o'. */ num_args = argc + need_stdcxx + shared_libgcc + need_phobos * 4 + 2; new_decoded_options = XNEWVEC (cl_decoded_option, num_args); @@ -442,11 +435,6 @@ lang_specific_driver (cl_decoded_option **in_decoded_options, CL_DRIVER, &new_decoded_options[j]); added_libraries++; j++; - generate_option (OPT_l, - saw_profile_flag ? LIBDRUNTIME_PROFILE : LIBDRUNTIME, 1, - CL_DRIVER, &new_decoded_options[j]); - added_libraries++; - j++; #ifdef HAVE_LD_STATIC_DYNAMIC if (phobos_library == PHOBOS_DYNAMIC && static_link) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 72e0d51..bced3e2 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2020-04-10 Iain Buclaw <ibuclaw@gdcproject.org> + + * lib/gdc.exp (gdc_link_flags): Remove libdruntime library paths. + 2020-04-10 Bin Cheng <bin.cheng@linux.alibaba.com> * g++.dg/coroutines/co-await-syntax-10.C: New test. diff --git a/gcc/testsuite/lib/gdc.exp b/gcc/testsuite/lib/gdc.exp index ddc6d90..3912d9c 100644 --- a/gcc/testsuite/lib/gdc.exp +++ b/gcc/testsuite/lib/gdc.exp @@ -146,16 +146,11 @@ proc gdc_link_flags { paths } { append flags "-L${gccpath}/libphobos/src/.libs " append ld_library_path ":${gccpath}/libphobos/src/.libs" } - if { [file exists "${gccpath}/libphobos/libdruntime/.libs/libgdruntime.a"] \ - || [file exists "${gccpath}/libphobos/libdruntime/.libs/libgdruntime.${shlib_ext}"] } { - append flags "-L${gccpath}/libphobos/libdruntime/.libs " - append ld_library_path ":${gccpath}/libphobos/libdruntime/.libs" - } # Static linking is default. If only the shared lib is available adjust # flags to always use it. If both are available, set SHARED_OPTION which # will be added to PERMUTE_ARGS - if { [file exists "${gccpath}/libphobos/libdruntime/.libs/libgdruntime.${shlib_ext}"] } { - if { [file exists "${gccpath}/libphobos/libdruntime/.libs/libgdruntime.a"] } { + if { [file exists "${gccpath}/libphobos/src/.libs/libgphobos.${shlib_ext}"] } { + if { [file exists "${gccpath}/libphobos/src/.libs/libgphobos.a"] } { set SHARED_OPTION "-shared-libphobos" } else { append flags "-shared-libphobos " @@ -181,11 +176,6 @@ proc gdc_link_flags { paths } { append flags "-B${libphobos} -L${libphobos} " append ld_library_path ":${libphobos}" } - set libdruntime [lookfor_file ${tool_root_dir} libgdruntime] - if { $libdruntime != "" } { - append flags "-L${libdruntime} " - append ld_library_path ":${libdruntime}" - } set libiberty [lookfor_file ${tool_root_dir} libiberty] if { $libiberty != "" } { append flags "-L${libiberty} " |