From 38c3017f257484a6739e2fba821d95794f7f175c Mon Sep 17 00:00:00 2001 From: Iain Buclaw Date: Sun, 29 Mar 2020 23:54:01 +0200 Subject: libphobos: Always build with warning flags enabled This moves WARN_DFLAGS from GDCFLAGS to AM_DFLAGS so it is always included in the build and testsuite of libphobos. Currently, this doesn't happen as GDCFLAGS is overriden by it being set at the top-level. libphobos/ChangeLog: * Makefile.in: Regenerate. * configure: Regenerate. * configure.ac: Substite WARN_DFLAGS independently of GDCFLAGS. * libdruntime/Makefile.am: Add WARN_DFLAGS to AM_DFLAGS. * libdruntime/Makefile.in: Regenerate. * src/Makefile.am: Add WARN_DFLAGS to AM_DFLAGS. * src/Makefile.in: Regenerate. * testsuite/Makefile.in: Regenerate. * testsuite/testsuite_flags.in: Add WARN_DFLAGS to --gdcflags. --- libphobos/testsuite/Makefile.in | 1 + libphobos/testsuite/testsuite_flags.in | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'libphobos/testsuite') diff --git a/libphobos/testsuite/Makefile.in b/libphobos/testsuite/Makefile.in index 72e6d04..b70a996 100644 --- a/libphobos/testsuite/Makefile.in +++ b/libphobos/testsuite/Makefile.in @@ -216,6 +216,7 @@ SHELL = @SHELL@ SPEC_PHOBOS_DEPS = @SPEC_PHOBOS_DEPS@ STRIP = @STRIP@ VERSION = @VERSION@ +WARN_DFLAGS = @WARN_DFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ diff --git a/libphobos/testsuite/testsuite_flags.in b/libphobos/testsuite/testsuite_flags.in index fa57de2..990221a 100755 --- a/libphobos/testsuite/testsuite_flags.in +++ b/libphobos/testsuite/testsuite_flags.in @@ -28,7 +28,7 @@ case ${query} in ;; --gdcflags) GDCFLAGS_default="-fmessage-length=0 -fno-show-column" - GDCFLAGS_config="@GDCFLAGSX@" + GDCFLAGS_config="@WARN_DFLAGS@ @GDCFLAGSX@" echo ${GDCFLAGS_default} ${GDCFLAGS_config} ;; --gdcpaths) -- cgit v1.1 From c0dbfbd763ad77d6beaa345ce94afc93e193236e Mon Sep 17 00:00:00 2001 From: Iain Buclaw Date: Thu, 9 Apr 2020 00:41:14 +0200 Subject: libphobos: Add --enable-libphobos-checking configure option As GDCFLAGS is overriden by the top-level make file with '-O2 -g', libphobos ends up always being built with all contracts, invariants, and asserts compiled in. This adds a new configurable that defaults to omit compiling any run-time checks into the library using '-frelease'. Other choices either set the flags '-fno-release', enabling all run-time checks, or '-fassert', which only compiles in asserts. The omission of compiling in contracts results in a smaller library size, with faster build times. libphobos/ChangeLog: PR d/94305 * Makefile.in: Regenerate. * configure: Regenerate. * configure.ac: Add --enable-libphobos-checking and substitute CHECKING_DFLAGS. Remove -frelease from GDCFLAGS. * libdruntime/Makefile.am: Add CHECKING_DFLAGS to AM_DFLAGS. * libdruntime/Makefile.in: Regenerate. * src/Makefile.am: Add CHECKING_DFLAGS to AM_DFLAGS. * src/Makefile.in: Regenerate. * testsuite/Makefile.in: Regenerate. * testsuite/testsuite_flags.in: Add -fno-release -funittest to --gdcflags. --- libphobos/testsuite/Makefile.in | 1 + libphobos/testsuite/testsuite_flags.in | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'libphobos/testsuite') diff --git a/libphobos/testsuite/Makefile.in b/libphobos/testsuite/Makefile.in index b70a996..6f0eaf8 100644 --- a/libphobos/testsuite/Makefile.in +++ b/libphobos/testsuite/Makefile.in @@ -151,6 +151,7 @@ CCASFLAGS = @CCASFLAGS@ CC_FOR_BUILD = @CC_FOR_BUILD@ CFLAGS = @CFLAGS@ CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ +CHECKING_DFLAGS = @CHECKING_DFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ diff --git a/libphobos/testsuite/testsuite_flags.in b/libphobos/testsuite/testsuite_flags.in index 990221a..808dde3 100755 --- a/libphobos/testsuite/testsuite_flags.in +++ b/libphobos/testsuite/testsuite_flags.in @@ -28,7 +28,7 @@ case ${query} in ;; --gdcflags) GDCFLAGS_default="-fmessage-length=0 -fno-show-column" - GDCFLAGS_config="@WARN_DFLAGS@ @GDCFLAGSX@" + GDCFLAGS_config="@WARN_DFLAGS@ @GDCFLAGSX@ -fno-release -funittest" echo ${GDCFLAGS_default} ${GDCFLAGS_config} ;; --gdcpaths) -- cgit v1.1 From 7478addd84ab6808307f4f285ab05f3a76bbb257 Mon Sep 17 00:00:00 2001 From: Iain Buclaw Date: Fri, 10 Apr 2020 09:35:09 +0200 Subject: 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. --- libphobos/testsuite/lib/libphobos.exp | 4 ---- libphobos/testsuite/testsuite_flags.in | 1 - 2 files changed, 5 deletions(-) (limited to 'libphobos/testsuite') diff --git a/libphobos/testsuite/lib/libphobos.exp b/libphobos/testsuite/lib/libphobos.exp index 3ac0ccb..7e6e53e 100644 --- a/libphobos/testsuite/lib/libphobos.exp +++ b/libphobos/testsuite/lib/libphobos.exp @@ -162,10 +162,6 @@ proc libphobos_init { args } { append ld_library_path ":${gccdir}" } - if { [file exists "${blddir}/libdruntime/.libs/libgdruntime.${shlib_ext}"] } { - append ld_library_path ":${blddir}/libdruntime/.libs" - } - if { [file exists "${blddir}/src/.libs/libgphobos.${shlib_ext}"] } { append ld_library_path ":${blddir}/src/.libs" } diff --git a/libphobos/testsuite/testsuite_flags.in b/libphobos/testsuite/testsuite_flags.in index 808dde3..c5dcac2 100755 --- a/libphobos/testsuite/testsuite_flags.in +++ b/libphobos/testsuite/testsuite_flags.in @@ -42,7 +42,6 @@ case ${query} in --gdcldflags) GDCLDFLAGS="-B${BUILD_DIR}/src -B${BUILD_DIR}/libdruntime/gcc - -L${BUILD_DIR}/libdruntime/.libs -L${BUILD_DIR}/src/.libs" echo ${GDCLDFLAGS} ;; -- cgit v1.1