From 88e508f9f112acd07d0c49c53589160db8c85fcd Mon Sep 17 00:00:00 2001 From: Robin Dapp Date: Tue, 7 Apr 2020 21:05:38 +0200 Subject: S/390: Fix PR91628 With this patch we get rid of the usage of the glibc-internal symbol __tls_get_addr_internal. If build with multilib, the file gcc/libphobos/libdruntime/config/systemz/get_tls_offset.S is used for both configurations: systemz and s390. Therefore both implementations are now in the systemz file which uses an "#ifdef __s390x__" in order to distinguish both cases. The s390 file is just including the systemz one. libphobos/ChangeLog: 2020-04-07 Robin Dapp Stefan Liebler * configure: Regenerate. * libdruntime/Makefile.am: Add s390x and s390. * libdruntime/Makefile.in: Regenerate. * libdruntime/config/s390/get_tls_offset.S: New file. * libdruntime/config/systemz/get_tls_offset.S: New file. * libdruntime/gcc/sections/elf_shared.d: Use ibmz_get_tls_offset. * m4/druntime/cpu.m4: Add s390x and s390. --- libphobos/ChangeLog | 11 +++ libphobos/configure | 38 ++++++++++- libphobos/libdruntime/Makefile.am | 6 ++ libphobos/libdruntime/Makefile.in | 43 ++++++++++-- libphobos/libdruntime/config/s390/get_tls_offset.S | 25 +++++++ .../libdruntime/config/systemz/get_tls_offset.S | 79 ++++++++++++++++++++++ libphobos/libdruntime/gcc/sections/elf_shared.d | 10 +-- libphobos/m4/druntime/cpu.m4 | 10 +++ 8 files changed, 209 insertions(+), 13 deletions(-) create mode 100644 libphobos/libdruntime/config/s390/get_tls_offset.S create mode 100644 libphobos/libdruntime/config/systemz/get_tls_offset.S (limited to 'libphobos') diff --git a/libphobos/ChangeLog b/libphobos/ChangeLog index 3791d4a..86468e1 100644 --- a/libphobos/ChangeLog +++ b/libphobos/ChangeLog @@ -1,3 +1,14 @@ +2020-04-07 Robin Dapp + Stefan Liebler + + * configure: Regenerate. + * libdruntime/Makefile.am: Add s390x and s390. + * libdruntime/Makefile.in: Regenerate. + * libdruntime/config/s390/get_tls_offset.S: New file. + * libdruntime/config/systemz/get_tls_offset.S: New file. + * libdruntime/gcc/sections/elf_shared.d: Use ibmz_get_tls_offset. + * m4/druntime/cpu.m4: Add s390x and s390. + 2020-04-07 Stefan Liebler * libdruntime/core/sys/posix/signal.d: diff --git a/libphobos/configure b/libphobos/configure index 9cad270..04a6e6a 100755 --- a/libphobos/configure +++ b/libphobos/configure @@ -683,6 +683,10 @@ DRUNTIME_OS_AIX_FALSE DRUNTIME_OS_AIX_TRUE DRUNTIME_OS_UNIX_FALSE DRUNTIME_OS_UNIX_TRUE +DRUNTIME_CPU_S390_FALSE +DRUNTIME_CPU_S390_TRUE +DRUNTIME_CPU_SYSTEMZ_FALSE +DRUNTIME_CPU_SYSTEMZ_TRUE DRUNTIME_CPU_X86_FALSE DRUNTIME_CPU_X86_TRUE DRUNTIME_CPU_POWERPC64_FALSE @@ -11644,7 +11648,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11647 "configure" +#line 11651 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11750,7 +11754,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11753 "configure" +#line 11757 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -14012,6 +14016,12 @@ fi i[34567]86|x86_64) druntime_target_cpu_parsed="x86" ;; + s390x) + druntime_target_cpu_parsed="s390x" + ;; + s390) + druntime_target_cpu_parsed="s390" + ;; esac if test "$druntime_target_cpu_parsed" = "aarch64"; then DRUNTIME_CPU_AARCH64_TRUE= @@ -14061,6 +14071,22 @@ else DRUNTIME_CPU_X86_FALSE= fi + if test "$druntime_target_cpu_parsed" = "s390x"; then + DRUNTIME_CPU_SYSTEMZ_TRUE= + DRUNTIME_CPU_SYSTEMZ_FALSE='#' +else + DRUNTIME_CPU_SYSTEMZ_TRUE='#' + DRUNTIME_CPU_SYSTEMZ_FALSE= +fi + + if test "$druntime_target_cpu_parsed" = "s390"; then + DRUNTIME_CPU_S390_TRUE= + DRUNTIME_CPU_S390_FALSE='#' +else + DRUNTIME_CPU_S390_TRUE='#' + DRUNTIME_CPU_S390_FALSE= +fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for target OS" >&5 @@ -15561,6 +15587,14 @@ if test -z "${DRUNTIME_CPU_X86_TRUE}" && test -z "${DRUNTIME_CPU_X86_FALSE}"; th as_fn_error $? "conditional \"DRUNTIME_CPU_X86\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${DRUNTIME_CPU_SYSTEMZ_TRUE}" && test -z "${DRUNTIME_CPU_SYSTEMZ_FALSE}"; then + as_fn_error $? "conditional \"DRUNTIME_CPU_SYSTEMZ\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DRUNTIME_CPU_S390_TRUE}" && test -z "${DRUNTIME_CPU_S390_FALSE}"; then + as_fn_error $? "conditional \"DRUNTIME_CPU_S390\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${DRUNTIME_OS_UNIX_TRUE}" && test -z "${DRUNTIME_OS_UNIX_FALSE}"; then as_fn_error $? "conditional \"DRUNTIME_OS_UNIX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 diff --git a/libphobos/libdruntime/Makefile.am b/libphobos/libdruntime/Makefile.am index ef18fb1..b6f4329 100644 --- a/libphobos/libdruntime/Makefile.am +++ b/libphobos/libdruntime/Makefile.am @@ -98,6 +98,12 @@ else DRUNTIME_SOURCES_CONFIGURED += config/x86/switchcontext.S endif endif +if DRUNTIME_CPU_SYSTEMZ + DRUNTIME_SOURCES_CONFIGURED += config/systemz/get_tls_offset.S +endif +if DRUNTIME_CPU_S390 + DRUNTIME_SOURCES_CONFIGURED += config/s390/get_tls_offset.S +endif # Provide __start_minfo, __stop_minfo if linker doesn't. if !DRUNTIME_OS_MINFO_BRACKETING diff --git a/libphobos/libdruntime/Makefile.in b/libphobos/libdruntime/Makefile.in index 44361f9..cbbe629 100644 --- a/libphobos/libdruntime/Makefile.in +++ b/libphobos/libdruntime/Makefile.in @@ -130,6 +130,8 @@ target_triplet = @target@ @DRUNTIME_CPU_POWERPC64_TRUE@am__append_17 = config/powerpc64/callwithstack.S @DRUNTIME_CPU_X86_TRUE@@DRUNTIME_OS_MINGW_TRUE@am__append_18 = config/mingw/switchcontext.S @DRUNTIME_CPU_X86_TRUE@@DRUNTIME_OS_MINGW_FALSE@am__append_19 = config/x86/switchcontext.S +@DRUNTIME_CPU_SYSTEMZ_TRUE@am__append_20 = config/systemz/get_tls_offset.S +@DRUNTIME_CPU_S390_TRUE@am__append_21 = config/s390/get_tls_offset.S subdir = libdruntime ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \ @@ -450,17 +452,19 @@ am__objects_25 = core/sys/solaris/dlfcn.lo core/sys/solaris/elf.lo \ @DRUNTIME_CPU_POWERPC64_TRUE@am__objects_31 = config/powerpc64/libgdruntime_la-callwithstack.lo @DRUNTIME_CPU_X86_TRUE@@DRUNTIME_OS_MINGW_TRUE@am__objects_32 = config/mingw/libgdruntime_la-switchcontext.lo @DRUNTIME_CPU_X86_TRUE@@DRUNTIME_OS_MINGW_FALSE@am__objects_33 = config/x86/libgdruntime_la-switchcontext.lo -am__objects_34 = $(am__objects_4) $(am__objects_6) $(am__objects_8) \ +@DRUNTIME_CPU_SYSTEMZ_TRUE@am__objects_34 = config/systemz/libgdruntime_la-get_tls_offset.lo +@DRUNTIME_CPU_S390_TRUE@am__objects_35 = config/s390/libgdruntime_la-get_tls_offset.lo +am__objects_36 = $(am__objects_4) $(am__objects_6) $(am__objects_8) \ $(am__objects_10) $(am__objects_12) $(am__objects_14) \ $(am__objects_16) $(am__objects_18) $(am__objects_20) \ $(am__objects_22) $(am__objects_24) $(am__objects_26) \ $(am__objects_27) $(am__objects_28) $(am__objects_29) \ $(am__objects_30) $(am__objects_31) $(am__objects_32) \ - $(am__objects_33) -am__objects_35 = gcc/config.lo gcc/libbacktrace.lo -am__objects_36 = $(am__objects_1) $(am__objects_2) $(am__objects_34) \ - $(am__objects_35) -am_libgdruntime_la_OBJECTS = $(am__objects_36) + $(am__objects_33) $(am__objects_34) $(am__objects_35) +am__objects_37 = gcc/config.lo gcc/libbacktrace.lo +am__objects_38 = $(am__objects_1) $(am__objects_2) $(am__objects_36) \ + $(am__objects_37) +am_libgdruntime_la_OBJECTS = $(am__objects_38) libgdruntime_la_OBJECTS = $(am_libgdruntime_la_OBJECTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) @@ -729,7 +733,8 @@ DRUNTIME_SOURCES_CONFIGURED = $(am__append_1) $(am__append_2) \ $(am__append_9) $(am__append_10) $(am__append_11) \ $(am__append_12) $(am__append_13) $(am__append_14) \ $(am__append_15) $(am__append_16) $(am__append_17) \ - $(am__append_18) $(am__append_19) + $(am__append_18) $(am__append_19) $(am__append_20) \ + $(am__append_21) # Provide __start_minfo, __stop_minfo if linker doesn't. @DRUNTIME_OS_MINFO_BRACKETING_FALSE@DRTSTUFF = gcc/drtbegin.o gcc/drtend.o @@ -1736,6 +1741,16 @@ config/x86/$(am__dirstamp): @: > config/x86/$(am__dirstamp) config/x86/libgdruntime_la-switchcontext.lo: \ config/x86/$(am__dirstamp) +config/systemz/$(am__dirstamp): + @$(MKDIR_P) config/systemz + @: > config/systemz/$(am__dirstamp) +config/systemz/libgdruntime_la-get_tls_offset.lo: \ + config/systemz/$(am__dirstamp) +config/s390/$(am__dirstamp): + @$(MKDIR_P) config/s390 + @: > config/s390/$(am__dirstamp) +config/s390/libgdruntime_la-get_tls_offset.lo: \ + config/s390/$(am__dirstamp) gcc/config.lo: gcc/$(am__dirstamp) gcc/libbacktrace.lo: gcc/$(am__dirstamp) @@ -1756,6 +1771,10 @@ mostlyclean-compile: -rm -f config/powerpc/*.lo -rm -f config/powerpc64/*.$(OBJEXT) -rm -f config/powerpc64/*.lo + -rm -f config/s390/*.$(OBJEXT) + -rm -f config/s390/*.lo + -rm -f config/systemz/*.$(OBJEXT) + -rm -f config/systemz/*.lo -rm -f config/x86/*.$(OBJEXT) -rm -f config/x86/*.lo -rm -f core/*.$(OBJEXT) @@ -1876,6 +1895,12 @@ config/mingw/libgdruntime_la-switchcontext.lo: config/mingw/switchcontext.S config/x86/libgdruntime_la-switchcontext.lo: config/x86/switchcontext.S $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(libgdruntime_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o config/x86/libgdruntime_la-switchcontext.lo `test -f 'config/x86/switchcontext.S' || echo '$(srcdir)/'`config/x86/switchcontext.S +config/systemz/libgdruntime_la-get_tls_offset.lo: config/systemz/get_tls_offset.S + $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(libgdruntime_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o config/systemz/libgdruntime_la-get_tls_offset.lo `test -f 'config/systemz/get_tls_offset.S' || echo '$(srcdir)/'`config/systemz/get_tls_offset.S + +config/s390/libgdruntime_la-get_tls_offset.lo: config/s390/get_tls_offset.S + $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(libgdruntime_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o config/s390/libgdruntime_la-get_tls_offset.lo `test -f 'config/s390/get_tls_offset.S' || echo '$(srcdir)/'`config/s390/get_tls_offset.S + .c.o: $(AM_V_CC)$(COMPILE) -c -o $@ $< @@ -1899,6 +1924,8 @@ clean-libtool: -rm -rf config/mips/.libs config/mips/_libs -rm -rf config/powerpc/.libs config/powerpc/_libs -rm -rf config/powerpc64/.libs config/powerpc64/_libs + -rm -rf config/s390/.libs config/s390/_libs + -rm -rf config/systemz/.libs config/systemz/_libs -rm -rf config/x86/.libs config/x86/_libs -rm -rf core/.libs core/_libs -rm -rf core/internal/.libs core/internal/_libs @@ -2054,6 +2081,8 @@ distclean-generic: -rm -f config/mips/$(am__dirstamp) -rm -f config/powerpc/$(am__dirstamp) -rm -f config/powerpc64/$(am__dirstamp) + -rm -f config/s390/$(am__dirstamp) + -rm -f config/systemz/$(am__dirstamp) -rm -f config/x86/$(am__dirstamp) -rm -f core/$(am__dirstamp) -rm -f core/internal/$(am__dirstamp) diff --git a/libphobos/libdruntime/config/s390/get_tls_offset.S b/libphobos/libdruntime/config/s390/get_tls_offset.S new file mode 100644 index 0000000..aaca05c --- /dev/null +++ b/libphobos/libdruntime/config/s390/get_tls_offset.S @@ -0,0 +1,25 @@ +/* IBM Z support code for TLS offsets. + Copyright (C) 2020 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 3, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +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 +. */ + +#include "../systemz/get_tls_offset.S" diff --git a/libphobos/libdruntime/config/systemz/get_tls_offset.S b/libphobos/libdruntime/config/systemz/get_tls_offset.S new file mode 100644 index 0000000..e9e6dc7 --- /dev/null +++ b/libphobos/libdruntime/config/systemz/get_tls_offset.S @@ -0,0 +1,79 @@ +/* IBM Z support code for TLS offsets. + Copyright (C) 2020 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 3, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +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 +. */ + +/* __tls_get_offset expects the GOT pointer in %r12 and adds + it to its argument in %r2. In order to get the offset of + ti, we load it into %r2, subtract the current %r12 from %r2 + so the addition will result in a nop (%r2 - %r12 + %r12). + + Note: This file is shared between systemz and s390 as the + same file is used in multilib case for s390x and s390. */ + +#include "../common/threadasm.S" + + .text + .globl CSYM(__ibmz_get_tls_offset) + .type CSYM(__ibmz_get_tls_offset), @function + .align 8 +CSYM(__ibmz_get_tls_offset): + .cfi_startproc + +#ifdef __s390x__ + .machinemode zarch + stmg %r14,%r15,112(%r15) + .cfi_offset 14, -48 + .cfi_offset 15, -40 + aghi %r15,-160 + .cfi_def_cfa_offset 320 + sgr %r2,%r12 + brasl %r14,__tls_get_offset@PLT + lg %r4,272(%r15) + lmg %r14,%r15,272(%r15) + .cfi_restore 15 + .cfi_restore 14 + .cfi_def_cfa_offset 160 + br %r4 +#else + .machinemode esa + stm %r12,%r15,48(%r15) + .cfi_offset 12, -48 + .cfi_offset 13, -44 + .cfi_offset 14, -40 + .cfi_offset 15, -36 + ahi %r15,-96 + .cfi_def_cfa_offset 192 + larl %r12,_GLOBAL_OFFSET_TABLE_ + sr %r2,%r12 + brasl %r14,__tls_get_offset@PLT + l %r4,152(%r15) + lm %r12,%r15,144(%r15) + .cfi_restore 15 + .cfi_restore 14 + .cfi_restore 13 + .cfi_restore 12 + .cfi_def_cfa_offset 96 + br %r4 +#endif + .cfi_endproc + .size __ibmz_get_tls_offset, .-__ibmz_get_tls_offset diff --git a/libphobos/libdruntime/gcc/sections/elf_shared.d b/libphobos/libdruntime/gcc/sections/elf_shared.d index b28c8dc..7ff87a8 100644 --- a/libphobos/libdruntime/gcc/sections/elf_shared.d +++ b/libphobos/libdruntime/gcc/sections/elf_shared.d @@ -1028,7 +1028,7 @@ struct tls_index } extern(C) void* __tls_get_addr(tls_index* ti) nothrow @nogc; -extern(C) void* __tls_get_addr_internal(tls_index* ti) nothrow @nogc; +extern(C) void* __ibmz_get_tls_offset(tls_index *ti) nothrow @nogc; /* The dynamic thread vector (DTV) pointers may point 0x8000 past the start of * each TLS block. This is at least true for PowerPC and Mips platforms. @@ -1086,9 +1086,11 @@ void[] getTLSRange(size_t mod, size_t sz) nothrow @nogc auto ti = tls_index(mod, 0); version (IBMZ_Any) { - auto idx = cast(void *)__tls_get_addr_internal(&ti) - + cast(ulong)__builtin_thread_pointer(); - return idx[0 .. sz]; + // IBM Z only provides __tls_get_offset instead of __tls_get_addr + // which returns an offset relative to the thread pointer. + auto addr = __ibmz_get_tls_offset(&ti); + addr = addr + cast(c_ulong)__builtin_thread_pointer(); + return addr[0 .. sz]; } else return (__tls_get_addr(&ti)-TLS_DTV_OFFSET)[0 .. sz]; diff --git a/libphobos/m4/druntime/cpu.m4 b/libphobos/m4/druntime/cpu.m4 index aa5b5ea..4887248 100644 --- a/libphobos/m4/druntime/cpu.m4 +++ b/libphobos/m4/druntime/cpu.m4 @@ -25,6 +25,12 @@ AC_DEFUN([DRUNTIME_CPU_SOURCES], i[[34567]]86|x86_64) druntime_target_cpu_parsed="x86" ;; + s390x) + druntime_target_cpu_parsed="s390x" + ;; + s390) + druntime_target_cpu_parsed="s390" + ;; esac AM_CONDITIONAL([DRUNTIME_CPU_AARCH64], [test "$druntime_target_cpu_parsed" = "aarch64"]) @@ -38,6 +44,10 @@ AC_DEFUN([DRUNTIME_CPU_SOURCES], [test "$druntime_target_cpu_parsed" = "powerpc64"]) AM_CONDITIONAL([DRUNTIME_CPU_X86], [test "$druntime_target_cpu_parsed" = "x86"]) + AM_CONDITIONAL([DRUNTIME_CPU_SYSTEMZ], + [test "$druntime_target_cpu_parsed" = "s390x"]) + AM_CONDITIONAL([DRUNTIME_CPU_S390], + [test "$druntime_target_cpu_parsed" = "s390"]) ]) -- cgit v1.1 From f1a6150ecb7b17f068150e98bc107d730604f5b6 Mon Sep 17 00:00:00 2001 From: Iain Buclaw Date: Tue, 7 Apr 2020 16:14:30 +0200 Subject: libphobos: Merge upstream phobos fb4f6a713 Improves the versioning of IeeeFlags and FloatingPointControl code and unit-tests, making it clearer which targets can and cannot support it. Reviewed-on: https://github.com/dlang/phobos/pull/7435 --- libphobos/libdruntime/MERGE | 2 +- libphobos/src/MERGE | 2 +- libphobos/src/std/math.d | 292 +++++++++++++++++++++++--------------------- 3 files changed, 152 insertions(+), 144 deletions(-) (limited to 'libphobos') diff --git a/libphobos/libdruntime/MERGE b/libphobos/libdruntime/MERGE index 54ae72f..18d479d 100644 --- a/libphobos/libdruntime/MERGE +++ b/libphobos/libdruntime/MERGE @@ -1,4 +1,4 @@ -6c45dd3a6523a21887cb9a883eeb3abd40375dc1 +c9c209e2c62ce43a2c08ddd61d647730716b2d0f The first line of this file holds the git revision number of the last merge done from the dlang/druntime repository. diff --git a/libphobos/src/MERGE b/libphobos/src/MERGE index c7e4878..7570cd9 100644 --- a/libphobos/src/MERGE +++ b/libphobos/src/MERGE @@ -1,4 +1,4 @@ -68cc18adbcdbf2a62cb85a5cb2a34236af2ab05a +fb4f6a713f5b78742f93e072cff6a6c4ecf9323d The first line of this file holds the git revision number of the last merge done from the dlang/phobos repository. diff --git a/libphobos/src/std/math.d b/libphobos/src/std/math.d index dedfa20..5cc3a85 100644 --- a/libphobos/src/std/math.d +++ b/libphobos/src/std/math.d @@ -195,6 +195,38 @@ else version (X86) private alias haveSSE = core.cpuid.sse; } +version (D_SoftFloat) +{ + // Some soft float implementations may support IEEE floating flags. + // The implementation here supports hardware flags only and is so currently + // only available for supported targets. +} +else version (X86_Any) version = IeeeFlagsSupport; +else version (PPC_Any) version = IeeeFlagsSupport; +else version (RISCV_Any) version = IeeeFlagsSupport; +else version (MIPS_Any) version = IeeeFlagsSupport; +else version (ARM_Any) version = IeeeFlagsSupport; + +// Struct FloatingPointControl is only available if hardware FP units are available. +version (D_HardFloat) +{ + // FloatingPointControl.clearExceptions() depends on version IeeeFlagsSupport + version (IeeeFlagsSupport) version = FloatingPointControlSupport; +} + +version (GNU) +{ + // The compiler can unexpectedly rearrange floating point operations and + // access to the floating point status flags when optimizing. This means + // ieeeFlags tests cannot be reliably checked in optimized code. + // See https://github.com/ldc-developers/ldc/issues/888 +} +else +{ + version = IeeeFlagsUnittest; + version = FloatingPointControlUnittest; +} + version (unittest) { import core.stdc.stdio; // : sprintf; @@ -1817,19 +1849,9 @@ real exp(real x) @trusted pure nothrow @nogc if (isNaN(x)) return x; if (x > OF) - { - if (__ctfe) - return real.infinity; - else - return real.max * copysign(real.max, real.infinity); - } + return real.infinity; if (x < UF) - { - if (__ctfe) - return 0.0; - else - return real.min_normal * copysign(real.min_normal, 0.0); - } + return 0.0; // Express: e^^x = e^^g * 2^^n // = e^^g * e^^(n * LOG2E) @@ -2102,12 +2124,7 @@ L_largenegative: // Special cases. Raises an overflow flag, except in the case // for CTFE, where there are no hardware controls. if (x > OF) - { - if (__ctfe) - return real.infinity; - else - return real.max * copysign(real.max, real.infinity); - } + return real.infinity; if (x == 0.0) return x; if (x < UF) @@ -2402,19 +2419,9 @@ private real exp2Impl(real x) @nogc @trusted pure nothrow if (isNaN(x)) return x; if (x > OF) - { - if (__ctfe) - return real.infinity; - else - return real.max * copysign(real.max, real.infinity); - } + return real.infinity; if (x < UF) - { - if (__ctfe) - return 0.0; - else - return real.min_normal * copysign(real.min_normal, 0.0); - } + return 0.0; // Separate into integer and fractional parts. int n = cast(int) floor(x + 0.5); @@ -2453,10 +2460,13 @@ private real exp2Impl(real x) @nogc @trusted pure nothrow @system unittest { - FloatingPointControl ctrl; - if (FloatingPointControl.hasExceptionTraps) - ctrl.disableExceptions(FloatingPointControl.allExceptions); - ctrl.rounding = FloatingPointControl.roundToNearest; + version (FloatingPointControlSupport) + { + FloatingPointControl ctrl; + if (FloatingPointControl.hasExceptionTraps) + ctrl.disableExceptions(FloatingPointControl.allExceptions); + ctrl.rounding = FloatingPointControl.roundToNearest; + } static if (real.mant_dig == 113) { @@ -2519,49 +2529,42 @@ private real exp2Impl(real x) @nogc @trusted pure nothrow const minEqualDecimalDigits = real.dig - 3; real x; - IeeeFlags f; + version (IeeeFlagsSupport) IeeeFlags f; foreach (ref pair; exptestpoints) { - resetIeeeFlags(); + version (IeeeFlagsSupport) resetIeeeFlags(); x = exp(pair[0]); - f = ieeeFlags; assert(equalsDigit(x, pair[1], minEqualDecimalDigits)); - - version (IeeeFlagsSupport) - { - // Check the overflow bit - if (x == real.infinity) - { - // don't care about the overflow bit if input was inf - // (e.g., the LLVM intrinsic doesn't set it on Linux x86_64) - assert(pair[0] == real.infinity || f.overflow); - } - else - assert(!f.overflow); - // Check the underflow bit - assert(f.underflow == (fabs(x) < real.min_normal)); - // Invalid and div by zero shouldn't be affected. - assert(!f.invalid); - assert(!f.divByZero); - } } + // Ideally, exp(0) would not set the inexact flag. // Unfortunately, fldl2e sets it! // So it's not realistic to avoid setting it. assert(exp(0.0L) == 1.0); // NaN propagation. Doesn't set flags, bcos was already NaN. - resetIeeeFlags(); - x = exp(real.nan); - f = ieeeFlags; - assert(isIdentical(abs(x), real.nan)); - assert(f.flags == 0); + version (IeeeFlagsSupport) + { + resetIeeeFlags(); + x = exp(real.nan); + f = ieeeFlags; + assert(isIdentical(abs(x), real.nan)); + assert(f.flags == 0); - resetIeeeFlags(); - x = exp(-real.nan); - f = ieeeFlags; - assert(isIdentical(abs(x), real.nan)); - assert(f.flags == 0); + resetIeeeFlags(); + x = exp(-real.nan); + f = ieeeFlags; + assert(isIdentical(abs(x), real.nan)); + assert(f.flags == 0); + } + else + { + x = exp(real.nan); + assert(isIdentical(abs(x), real.nan)); + + x = exp(-real.nan); + assert(isIdentical(abs(x), real.nan)); + } x = exp(NaN(0x123)); assert(isIdentical(x, NaN(0x123))); @@ -4678,6 +4681,10 @@ real remquo(real x, real y, out int n) @trusted nothrow @nogc /// ditto assert(0, "remquo not implemented"); } + +version (IeeeFlagsSupport) +{ + /** IEEE exception status flags ('sticky bits') These flags indicate that an exceptional floating-point condition has occurred. @@ -4813,13 +4820,14 @@ private: else assert(0, "Not yet supported"); } + static void resetIeeeFlags() @nogc { version (GNU) { version (X86_Any) { - asm pure nothrow @nogc + asm nothrow @nogc { "fnclex"; } @@ -4828,12 +4836,12 @@ private: if (haveSSE) { uint mxcsr; - asm pure nothrow @nogc + asm nothrow @nogc { "stmxcsr %0" : "=m" (mxcsr); } mxcsr &= ~EXCEPTIONS_MASK; - asm pure nothrow @nogc + asm nothrow @nogc { "ldmxcsr %0" : : "m" (mxcsr); } @@ -4847,7 +4855,7 @@ private: { uint old = FloatingPointControl.getControlState(); old &= ~0b11111; // http://infocenter.arm.com/help/topic/com.arm.doc.ddi0408i/Chdfifdc.html - asm pure nothrow @nogc + asm nothrow @nogc { "vmsr FPSCR, %0" : : "r" (old); } @@ -4860,7 +4868,7 @@ private: else { uint newValues = 0x0; - asm pure nothrow @nogc + asm nothrow @nogc { "fsflags %0" : : "r" (newValues); } @@ -4872,7 +4880,7 @@ private: else version (InlineAsm_X86_Any) { - asm pure nothrow @nogc + asm nothrow @nogc { fnclex; } @@ -4935,27 +4943,25 @@ public: } /// -version (GNU) -{ - // ieeeFlags test disabled, see LDC Issue #888. -} -else +version (IeeeFlagsUnittest) @system unittest { static void func() { int a = 10 * 10; } - - real a=3.5; + pragma(inline, false) static void blockopt(ref real x) {} + real a = 3.5; // Set all the flags to zero resetIeeeFlags(); assert(!ieeeFlags.divByZero); + blockopt(a); // avoid constant propagation by the optimizer // Perform a division by zero. - a/=0.0L; + a /= 0.0L; assert(a == real.infinity); assert(ieeeFlags.divByZero); + blockopt(a); // avoid constant propagation by the optimizer // Create a NaN - a*=0.0L; + a *= 0.0L; assert(ieeeFlags.invalid); assert(isNaN(a)); @@ -4966,11 +4972,7 @@ else assert(ieeeFlags == f); } -version (GNU) -{ - // ieeeFlags test disabled, see LDC Issue #888. -} -else +version (IeeeFlagsUnittest) @system unittest { import std.meta : AliasSeq; @@ -5017,27 +5019,6 @@ else } } -version (X86_Any) -{ - version = IeeeFlagsSupport; -} -else version (PPC_Any) -{ - version = IeeeFlagsSupport; -} -else version (RISCV_Any) -{ - version = IeeeFlagsSupport; -} -else version (MIPS_Any) -{ - version = IeeeFlagsSupport; -} -else version (ARM_Any) -{ - version = IeeeFlagsSupport; -} - /// Set all of the floating-point status flags to false. void resetIeeeFlags() @nogc { IeeeFlags.resetIeeeFlags(); } @@ -5047,6 +5028,12 @@ void resetIeeeFlags() @nogc { IeeeFlags.resetIeeeFlags(); } return IeeeFlags(IeeeFlags.getIeeeFlags()); } +} // IeeeFlagsSupport + + +version (FloatingPointControlSupport) +{ + /** Control the Floating point hardware Change the IEEE754 floating-point rounding mode and the floating-point @@ -5418,7 +5405,10 @@ private: // Clear all pending exceptions static void clearExceptions() @nogc { - resetIeeeFlags(); + version (IeeeFlagsSupport) + resetIeeeFlags(); + else + static assert(false, "Not implemented for this architecture"); } // Read from the control register @@ -5479,7 +5469,7 @@ private: version (D_InlineAsm_X86) { short cont; - asm nothrow @nogc + asm pure nothrow @nogc { xor EAX, EAX; fstcw cont; @@ -5490,7 +5480,7 @@ private: version (D_InlineAsm_X86_64) { short cont; - asm nothrow @nogc + asm pure nothrow @nogc { xor RAX, RAX; fstcw cont; @@ -5508,7 +5498,7 @@ private: { version (X86_Any) { - asm pure nothrow @nogc + asm nothrow @nogc { "fclex; fldcw %0" : : "m" (newState); } @@ -5517,7 +5507,7 @@ private: if (haveSSE) { uint mxcsr; - asm pure nothrow @nogc + asm nothrow @nogc { "stmxcsr %0" : "=m" (mxcsr); } @@ -5532,7 +5522,7 @@ private: mxcsr &= ~(allExceptions << 7); // delete old masks mxcsr |= (newState & allExceptions) << 7; // write new exception masks - asm pure nothrow @nogc + asm nothrow @nogc { "ldmxcsr %0" : : "m" (mxcsr); } @@ -5540,7 +5530,7 @@ private: } else version (AArch64) { - asm pure nothrow @nogc + asm nothrow @nogc { "msr FPCR, %0;" : : "r" (newState); } @@ -5551,7 +5541,7 @@ private: return; else { - asm pure nothrow @nogc + asm nothrow @nogc { "vmsr FPSCR, %0" : : "r" (newState); } @@ -5563,7 +5553,7 @@ private: return; else { - asm pure nothrow @nogc + asm nothrow @nogc { "fscsr %0" : : "r" (newState); } @@ -5605,7 +5595,7 @@ private: } } -version (D_HardFloat) @system unittest +@system unittest { void ensureDefaults() { @@ -5642,46 +5632,64 @@ version (D_HardFloat) @system unittest ensureDefaults(); } -version (D_HardFloat) @system unittest // rounding +version (FloatingPointControlUnittest) +@system unittest // rounding { import std.meta : AliasSeq; foreach (T; AliasSeq!(float, double, real)) { - FloatingPointControl fpctrl; - - fpctrl.rounding = FloatingPointControl.roundUp; - T u = 1; - u += 0.1; - - fpctrl.rounding = FloatingPointControl.roundDown; - T d = 1; - d += 0.1; + /* Be careful with changing the rounding mode, it interferes + * with common subexpressions. Changing rounding modes should + * be done with separate functions that are not inlined. + */ - fpctrl.rounding = FloatingPointControl.roundToZero; - T z = 1; - z += 0.1; + { + static T addRound(T)(uint rm) + { + pragma(inline, false) static void blockopt(ref T x) {} + pragma(inline, false); + FloatingPointControl fpctrl; + fpctrl.rounding = rm; + T x = 1; + blockopt(x); // avoid constant propagation by the optimizer + x += 0.1; + return x; + } - assert(u > d); - assert(z == d); + T u = addRound!(T)(FloatingPointControl.roundUp); + T d = addRound!(T)(FloatingPointControl.roundDown); + T z = addRound!(T)(FloatingPointControl.roundToZero); - fpctrl.rounding = FloatingPointControl.roundUp; - u = -1; - u -= 0.1; + assert(u > d); + assert(z == d); + } - fpctrl.rounding = FloatingPointControl.roundDown; - d = -1; - d -= 0.1; + { + static T subRound(T)(uint rm) + { + pragma(inline, false) static void blockopt(ref T x) {} + pragma(inline, false); + FloatingPointControl fpctrl; + fpctrl.rounding = rm; + T x = -1; + blockopt(x); // avoid constant propagation by the optimizer + x -= 0.1; + return x; + } - fpctrl.rounding = FloatingPointControl.roundToZero; - z = -1; - z -= 0.1; + T u = subRound!(T)(FloatingPointControl.roundUp); + T d = subRound!(T)(FloatingPointControl.roundDown); + T z = subRound!(T)(FloatingPointControl.roundToZero); - assert(u > d); - assert(z == u); + assert(u > d); + assert(z == u); + } } } +} // FloatingPointControlSupport + /********************************* * Determines if $(D_PARAM x) is NaN. -- cgit v1.1 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/ChangeLog | 12 ++++++++++++ libphobos/Makefile.in | 1 + libphobos/configure | 12 ++++++++---- libphobos/configure.ac | 7 +++++-- libphobos/libdruntime/Makefile.am | 4 +++- libphobos/libdruntime/Makefile.in | 6 +++++- libphobos/src/Makefile.am | 4 +++- libphobos/src/Makefile.in | 6 +++++- libphobos/testsuite/Makefile.in | 1 + libphobos/testsuite/testsuite_flags.in | 2 +- 10 files changed, 44 insertions(+), 11 deletions(-) (limited to 'libphobos') diff --git a/libphobos/ChangeLog b/libphobos/ChangeLog index 86468e1..a67f228 100644 --- a/libphobos/ChangeLog +++ b/libphobos/ChangeLog @@ -1,3 +1,15 @@ +2020-04-08 Iain Buclaw + + * 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. + 2020-04-07 Robin Dapp Stefan Liebler diff --git a/libphobos/Makefile.in b/libphobos/Makefile.in index 6a774e9..98d3564 100644 --- a/libphobos/Makefile.in +++ b/libphobos/Makefile.in @@ -272,6 +272,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/configure b/libphobos/configure index 04a6e6a..65e32d8 100755 --- a/libphobos/configure +++ b/libphobos/configure @@ -633,6 +633,7 @@ ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS +WARN_DFLAGS GDCFLAGSX libtool_VERSION SPEC_PHOBOS_DEPS @@ -11648,7 +11649,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11651 "configure" +#line 11652 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11754,7 +11755,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11757 "configure" +#line 11758 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -15390,15 +15391,18 @@ libtool_VERSION=1:0:0 # Set default flags (after DRUNTIME_WERROR!) if test -z "$GDCFLAGS"; then - GDCFLAGS="-Wall $WERROR_FLAG -g -frelease -O2" + GDCFLAGS="-g -frelease -O2" fi if test -z "$GDCFLAGSX"; then - GDCFLAGSX="-Wall $WERROR_FLAG -g -fno-release -funittest" + GDCFLAGSX="-g -fno-release -funittest" fi +WARN_DFLAGS="-Wall $WERROR_FLAG" + + # Sanity check for the cross-compilation case: ac_fn_c_check_header_mongrel "$LINENO" "stdio.h" "ac_cv_header_stdio_h" "$ac_includes_default" if test "x$ac_cv_header_stdio_h" = xyes; then : diff --git a/libphobos/configure.ac b/libphobos/configure.ac index 69c635f..09e334d 100644 --- a/libphobos/configure.ac +++ b/libphobos/configure.ac @@ -206,15 +206,18 @@ AC_SUBST(libtool_VERSION) # Set default flags (after DRUNTIME_WERROR!) if test -z "$GDCFLAGS"; then - GDCFLAGS="-Wall $WERROR_FLAG -g -frelease -O2" + GDCFLAGS="-g -frelease -O2" fi AC_SUBST(GDCFLAGS) if test -z "$GDCFLAGSX"; then - GDCFLAGSX="-Wall $WERROR_FLAG -g -fno-release -funittest" + GDCFLAGSX="-g -fno-release -funittest" fi AC_SUBST(GDCFLAGSX) +WARN_DFLAGS="-Wall $WERROR_FLAG" +AC_SUBST(WARN_DFLAGS) + # Sanity check for the cross-compilation case: AC_CHECK_HEADER(stdio.h,:, [AC_MSG_ERROR([cannot find stdio.h.])]) diff --git a/libphobos/libdruntime/Makefile.am b/libphobos/libdruntime/Makefile.am index b6f4329..b7e4575 100644 --- a/libphobos/libdruntime/Makefile.am +++ b/libphobos/libdruntime/Makefile.am @@ -22,7 +22,9 @@ include $(top_srcdir)/d_rules.am D_EXTRA_DFLAGS=-nostdinc -I $(srcdir) -I . # D flags for compilation -AM_DFLAGS=$(phobos_compiler_pic_flag) +AM_DFLAGS= \ + $(phobos_compiler_pic_flag) \ + $(WARN_DFLAGS) # Install all D and DI files ALL_DRUNTIME_INSTALL_DSOURCES = $(DRUNTIME_DSOURCES) \ diff --git a/libphobos/libdruntime/Makefile.in b/libphobos/libdruntime/Makefile.in index cbbe629..61dd0d4 100644 --- a/libphobos/libdruntime/Makefile.in +++ b/libphobos/libdruntime/Makefile.in @@ -620,6 +620,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@ @@ -712,7 +713,10 @@ libgphobos_la_LINK = $(LIBTOOL) --tag=D $(libgphobos_la_LIBTOOLFLAGS) \ D_EXTRA_DFLAGS = -nostdinc -I $(srcdir) -I . # D flags for compilation -AM_DFLAGS = $(phobos_compiler_pic_flag) +AM_DFLAGS = \ + $(phobos_compiler_pic_flag) \ + $(WARN_DFLAGS) + # Install all D and DI files ALL_DRUNTIME_INSTALL_DSOURCES = $(DRUNTIME_DSOURCES) \ diff --git a/libphobos/src/Makefile.am b/libphobos/src/Makefile.am index 764e225..5c17538 100644 --- a/libphobos/src/Makefile.am +++ b/libphobos/src/Makefile.am @@ -23,7 +23,9 @@ D_EXTRA_DFLAGS=-nostdinc -I $(srcdir) \ -I $(top_srcdir)/libdruntime -I ../libdruntime -I . # D flags for compilation -AM_DFLAGS=$(phobos_compiler_pic_flag) +AM_DFLAGS= \ + $(phobos_compiler_pic_flag) \ + $(WARN_DFLAGS) # Install all D files ALL_PHOBOS_INSTALL_DSOURCES = $(PHOBOS_DSOURCES) diff --git a/libphobos/src/Makefile.in b/libphobos/src/Makefile.in index c30b66d..e58dafb 100644 --- a/libphobos/src/Makefile.in +++ b/libphobos/src/Makefile.in @@ -343,6 +343,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@ @@ -437,7 +438,10 @@ D_EXTRA_DFLAGS = -nostdinc -I $(srcdir) \ # D flags for compilation -AM_DFLAGS = $(phobos_compiler_pic_flag) +AM_DFLAGS = \ + $(phobos_compiler_pic_flag) \ + $(WARN_DFLAGS) + # Install all D files ALL_PHOBOS_INSTALL_DSOURCES = $(PHOBOS_DSOURCES) 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 72c136c9007e37b76426b847e8b239c0708b8da7 Mon Sep 17 00:00:00 2001 From: Iain Buclaw Date: Wed, 8 Apr 2020 22:52:05 +0200 Subject: libphobos: Remove --enable-unix configure option. This option is not useful on its own as all posix modules require the compiler to predefine version(Posix) anyway. So the option has been removed, and logic moved into DRUNTIME_OS_SOURCES, where the conditional DRUNTIME_OS_POSIX is set instead. libphobos/ChangeLog: * configure: Regenerate. * configure.ac: Remove DRUNTIME_OS_UNIX. * libdruntime/Makefile.am: Add DRUNTIME_DSOURCES_POSIX if DRUNTIME_OS_POSIX is true. * libdruntime/Makefile.in: Regenerate. * m4/druntime/os.m4 (DRUNTIME_OS_UNIX): Remove, move AM_CONDITIONAL logic to... (DRUNTIME_OS_SOURCES): ...here. Rename conditional to DRUNTIME_OS_POSIX. --- libphobos/ChangeLog | 12 ++++++++ libphobos/configure | 59 +++++++++++++++------------------------ libphobos/configure.ac | 1 - libphobos/libdruntime/Makefile.am | 2 +- libphobos/libdruntime/Makefile.in | 4 +-- libphobos/m4/druntime/os.m4 | 31 ++++++-------------- 6 files changed, 47 insertions(+), 62 deletions(-) (limited to 'libphobos') diff --git a/libphobos/ChangeLog b/libphobos/ChangeLog index a67f228..216cd61 100644 --- a/libphobos/ChangeLog +++ b/libphobos/ChangeLog @@ -1,5 +1,17 @@ 2020-04-08 Iain Buclaw + * configure: Regenerate. + * configure.ac: Remove DRUNTIME_OS_UNIX. + * libdruntime/Makefile.am: Add DRUNTIME_DSOURCES_POSIX if + DRUNTIME_OS_POSIX is true. + * libdruntime/Makefile.in: Regenerate. + * m4/druntime/os.m4 (DRUNTIME_OS_UNIX): Remove, move AM_CONDITIONAL + logic to... + (DRUNTIME_OS_SOURCES): ...here. Rename conditional to + DRUNTIME_OS_POSIX. + +2020-04-08 Iain Buclaw + * Makefile.in: Regenerate. * configure: Regenerate. * configure.ac: Substite WARN_DFLAGS independently of GDCFLAGS. diff --git a/libphobos/configure b/libphobos/configure index 65e32d8..108518d 100755 --- a/libphobos/configure +++ b/libphobos/configure @@ -662,6 +662,8 @@ DRUNTIME_OS_ARM_EABI_UNWINDER_FALSE DRUNTIME_OS_ARM_EABI_UNWINDER_TRUE DCFG_ARM_EABI_UNWINDER DCFG_THREAD_MODEL +DRUNTIME_OS_POSIX_FALSE +DRUNTIME_OS_POSIX_TRUE DRUNTIME_OS_SOLARIS_FALSE DRUNTIME_OS_SOLARIS_TRUE DRUNTIME_OS_MINGW_FALSE @@ -682,8 +684,6 @@ DRUNTIME_OS_ANDROID_FALSE DRUNTIME_OS_ANDROID_TRUE DRUNTIME_OS_AIX_FALSE DRUNTIME_OS_AIX_TRUE -DRUNTIME_OS_UNIX_FALSE -DRUNTIME_OS_UNIX_TRUE DRUNTIME_CPU_S390_FALSE DRUNTIME_CPU_S390_TRUE DRUNTIME_CPU_SYSTEMZ_FALSE @@ -835,7 +835,6 @@ enable_libtool_lock with_gcc_major_version_only enable_werror enable_druntime_gc -enable_unix enable_thread_lib with_libatomic with_libbacktrace @@ -1486,8 +1485,6 @@ Optional Features: --disable-libtool-lock avoid locking (might break parallel builds) --enable-werror turns on -Werror [default=no] --enable-druntime-gc enable D runtime garbage collector (default: yes) - --enable-unix enables Unix runtime (default: yes, for Unix - targets) --enable-thread-lib= specify linker option for the system thread library (default: autodetect) @@ -11649,7 +11646,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11652 "configure" +#line 11649 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11755,7 +11752,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11758 "configure" +#line 11755 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -14105,31 +14102,6 @@ fi - # Check whether --enable-unix was given. -if test "${enable_unix+set}" = set; then : - enableval=$enable_unix; : -else - enable_unix=auto -fi - - - case "$druntime_cv_target_os" in - aix*|*bsd*|cygwin*|darwin*|gnu*|linux*|skyos*|*solaris*|sysv*) d_have_unix=1 ;; - esac - if test -n "$d_have_unix" && test "$enable_unix" = auto ; then - enable_unix=yes - fi - if test "$enable_unix" = "yes"; then - DRUNTIME_OS_UNIX_TRUE= - DRUNTIME_OS_UNIX_FALSE='#' -else - DRUNTIME_OS_UNIX_TRUE='#' - DRUNTIME_OS_UNIX_FALSE= -fi - - - - druntime_target_os_parsed="" case "$druntime_cv_target_os" in @@ -14239,6 +14211,21 @@ else fi + druntime_target_posix="no" + case "$druntime_cv_target_os" in + aix*|*bsd*|cygwin*|darwin*|gnu*|linux*|skyos*|*solaris*|sysv*) + druntime_target_posix="yes" + ;; + esac + if test "$druntime_target_posix" = "yes"; then + DRUNTIME_OS_POSIX_TRUE= + DRUNTIME_OS_POSIX_FALSE='#' +else + DRUNTIME_OS_POSIX_TRUE='#' + DRUNTIME_OS_POSIX_FALSE= +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for thread model used by GDC" >&5 @@ -15599,10 +15586,6 @@ if test -z "${DRUNTIME_CPU_S390_TRUE}" && test -z "${DRUNTIME_CPU_S390_FALSE}"; as_fn_error $? "conditional \"DRUNTIME_CPU_S390\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${DRUNTIME_OS_UNIX_TRUE}" && test -z "${DRUNTIME_OS_UNIX_FALSE}"; then - as_fn_error $? "conditional \"DRUNTIME_OS_UNIX\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${DRUNTIME_OS_AIX_TRUE}" && test -z "${DRUNTIME_OS_AIX_FALSE}"; then as_fn_error $? "conditional \"DRUNTIME_OS_AIX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -15643,6 +15626,10 @@ if test -z "${DRUNTIME_OS_SOLARIS_TRUE}" && test -z "${DRUNTIME_OS_SOLARIS_FALSE as_fn_error $? "conditional \"DRUNTIME_OS_SOLARIS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${DRUNTIME_OS_POSIX_TRUE}" && test -z "${DRUNTIME_OS_POSIX_FALSE}"; then + as_fn_error $? "conditional \"DRUNTIME_OS_POSIX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${DRUNTIME_OS_ARM_EABI_UNWINDER_TRUE}" && test -z "${DRUNTIME_OS_ARM_EABI_UNWINDER_FALSE}"; then as_fn_error $? "conditional \"DRUNTIME_OS_ARM_EABI_UNWINDER\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 diff --git a/libphobos/configure.ac b/libphobos/configure.ac index 09e334d..594d200 100644 --- a/libphobos/configure.ac +++ b/libphobos/configure.ac @@ -122,7 +122,6 @@ DRUNTIME_MULTILIB DRUNTIME_WERROR DRUNTIME_GC DRUNTIME_CPU_SOURCES -DRUNTIME_OS_UNIX DRUNTIME_OS_SOURCES DRUNTIME_OS_THREAD_MODEL DRUNTIME_OS_ARM_EABI_UNWINDER diff --git a/libphobos/libdruntime/Makefile.am b/libphobos/libdruntime/Makefile.am index b7e4575..41ccfaa 100644 --- a/libphobos/libdruntime/Makefile.am +++ b/libphobos/libdruntime/Makefile.am @@ -47,7 +47,7 @@ else DRUNTIME_SOURCES_CONFIGURED += $(DRUNTIME_DSOURCES_GCSTUB) endif # OS specific sources -if DRUNTIME_OS_UNIX +if DRUNTIME_OS_POSIX DRUNTIME_SOURCES_CONFIGURED += $(DRUNTIME_DSOURCES_POSIX) endif if DRUNTIME_OS_DARWIN diff --git a/libphobos/libdruntime/Makefile.in b/libphobos/libdruntime/Makefile.in index 61dd0d4..9277e0a 100644 --- a/libphobos/libdruntime/Makefile.in +++ b/libphobos/libdruntime/Makefile.in @@ -112,7 +112,7 @@ target_triplet = @target@ @DRUNTIME_GC_ENABLE_TRUE@am__append_1 = $(DRUNTIME_DSOURCES_GC) @DRUNTIME_GC_ENABLE_FALSE@am__append_2 = $(DRUNTIME_DSOURCES_GCSTUB) # OS specific sources -@DRUNTIME_OS_UNIX_TRUE@am__append_3 = $(DRUNTIME_DSOURCES_POSIX) +@DRUNTIME_OS_POSIX_TRUE@am__append_3 = $(DRUNTIME_DSOURCES_POSIX) @DRUNTIME_OS_DARWIN_TRUE@am__append_4 = $(DRUNTIME_DSOURCES_DARWIN) @DRUNTIME_OS_DRAGONFLYBSD_TRUE@am__append_5 = $(DRUNTIME_DSOURCES_DRAGONFLYBSD) @DRUNTIME_OS_ANDROID_TRUE@am__append_6 = $(DRUNTIME_DSOURCES_BIONIC) @@ -272,7 +272,7 @@ am__objects_7 = core/sys/posix/aio.lo core/sys/posix/arpa/inet.lo \ core/sys/posix/syslog.lo core/sys/posix/termios.lo \ core/sys/posix/time.lo core/sys/posix/ucontext.lo \ core/sys/posix/unistd.lo core/sys/posix/utime.lo -@DRUNTIME_OS_UNIX_TRUE@am__objects_8 = $(am__objects_7) +@DRUNTIME_OS_POSIX_TRUE@am__objects_8 = $(am__objects_7) am__objects_9 = core/sys/darwin/crt_externs.lo \ core/sys/darwin/dlfcn.lo core/sys/darwin/execinfo.lo \ core/sys/darwin/mach/dyld.lo core/sys/darwin/mach/getsect.lo \ diff --git a/libphobos/m4/druntime/os.m4 b/libphobos/m4/druntime/os.m4 index 74167aa..47d4c6a 100644 --- a/libphobos/m4/druntime/os.m4 +++ b/libphobos/m4/druntime/os.m4 @@ -52,33 +52,12 @@ AC_DEFUN([DRUNTIME_OS_DETECT], ]) -# DRUNTIME_OS_UNIX -# ---------------- -# Add --enable-unix option or autodetects if system is unix -# and create the DRUNTIME_OS_UNIX conditional. -AC_DEFUN([DRUNTIME_OS_UNIX], -[ - AC_REQUIRE([DRUNTIME_OS_DETECT]) - AC_ARG_ENABLE(unix, - AC_HELP_STRING([--enable-unix], - [enables Unix runtime (default: yes, for Unix targets)]), - :,[enable_unix=auto]) - - case "$druntime_cv_target_os" in - aix*|*bsd*|cygwin*|darwin*|gnu*|linux*|skyos*|*solaris*|sysv*) d_have_unix=1 ;; - esac - if test -n "$d_have_unix" && test "$enable_unix" = auto ; then - enable_unix=yes - fi - AM_CONDITIONAL([DRUNTIME_OS_UNIX], [test "$enable_unix" = "yes"]) -]) - - # DRUNTIME_OS_SOURCES # ------------------- # Detect target OS and add DRUNTIME_OS_AIX DRUNTIME_OS_DARWIN # DRUNTIME_OS_FREEBSD DRUNTIME_OS_LINUX DRUNTIME_OS_MINGW # DRUNTIME_OS_SOLARIS DRUNTIME_OS_OPENBSD conditionals. +# If the system is posix, add DRUNTIME_OS_POSIX conditional. AC_DEFUN([DRUNTIME_OS_SOURCES], [ AC_REQUIRE([DRUNTIME_OS_DETECT]) @@ -130,6 +109,14 @@ AC_DEFUN([DRUNTIME_OS_SOURCES], [test "$druntime_target_os_parsed" = "mingw"]) AM_CONDITIONAL([DRUNTIME_OS_SOLARIS], [test "$druntime_target_os_parsed" = "solaris"]) + + druntime_target_posix="no" + case "$druntime_cv_target_os" in + aix*|*bsd*|cygwin*|darwin*|gnu*|linux*|skyos*|*solaris*|sysv*) + druntime_target_posix="yes" + ;; + esac + AM_CONDITIONAL([DRUNTIME_OS_POSIX], [test "$druntime_target_posix" = "yes"]) ]) -- cgit v1.1 From 6e286c8df452787fffe4fb4bd3dbba4d80bc6c12 Mon Sep 17 00:00:00 2001 From: Iain Buclaw Date: Thu, 9 Apr 2020 00:16:57 +0200 Subject: libphobos: Remove --enable-thread-lib configure option. This is another old option that doesn't make sense as a configurable. So the option has been removed, and the check for AC_SEARCH_LIBS moved into the main configure.ac file. libphobos/ChangeLog: * configure: Regenerate. * configure.ac: Use AC_SEARCH_LIBS for pthread_create. * m4/druntime/libraries.m4: Remove DRUNTIME_LIBRARIES_THREAD. --- libphobos/ChangeLog | 6 +++ libphobos/configure | 78 ++------------------------------------ libphobos/configure.ac | 2 +- libphobos/m4/druntime/libraries.m4 | 26 ------------- 4 files changed, 10 insertions(+), 102 deletions(-) (limited to 'libphobos') diff --git a/libphobos/ChangeLog b/libphobos/ChangeLog index 216cd61..d8d37ef 100644 --- a/libphobos/ChangeLog +++ b/libphobos/ChangeLog @@ -1,3 +1,9 @@ +2020-04-09 Iain Buclaw + + * configure: Regenerate. + * configure.ac: Use AC_SEARCH_LIBS for pthread_create. + * m4/druntime/libraries.m4: Remove DRUNTIME_LIBRARIES_THREAD. + 2020-04-08 Iain Buclaw * configure: Regenerate. diff --git a/libphobos/configure b/libphobos/configure index 108518d..f458ad3 100755 --- a/libphobos/configure +++ b/libphobos/configure @@ -835,7 +835,6 @@ enable_libtool_lock with_gcc_major_version_only enable_werror enable_druntime_gc -enable_thread_lib with_libatomic with_libbacktrace with_target_system_zlib @@ -1485,9 +1484,6 @@ Optional Features: --disable-libtool-lock avoid locking (might break parallel builds) --enable-werror turns on -Werror [default=no] --enable-druntime-gc enable D runtime garbage collector (default: yes) - --enable-thread-lib= - specify linker option for the system thread library - (default: autodetect) --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory @@ -11646,7 +11642,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11649 "configure" +#line 11645 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11752,7 +11748,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11755 "configure" +#line 11751 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -14480,17 +14476,7 @@ if test "$ac_res" != no; then : fi - - enable_thread_lib=yes - # Check whether --enable-thread-lib was given. -if test "${enable_thread_lib+set}" = set; then : - enableval=$enable_thread_lib; -fi - - - if test "x$enable_thread_lib" = "xyes"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_create" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_create" >&5 $as_echo_n "checking for library containing pthread_create... " >&6; } if ${ac_cv_search_pthread_create+:} false; then : $as_echo_n "(cached) " >&6 @@ -14536,64 +14522,6 @@ if test "$ac_res" != no; then : fi - -else - - if test "x$enable_thread_lib" = "xno"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for thread library" >&5 -$as_echo_n "checking for thread library... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - -else - - as_ac_Lib=`$as_echo "ac_cv_lib_$enable_thread_lib''_pthread_create" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -l$enable_thread_lib" >&5 -$as_echo_n "checking for pthread_create in -l$enable_thread_lib... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$enable_thread_lib $LIBS" -cat > conftest.$ac_ext <<_ACEOF -module mod; - extern(C) int pthread_create(); - -extern(C) int main() { - pthread_create(); return 0; -} -_ACEOF -if ac_fn_d_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_LIB$enable_thread_lib" | $as_tr_cpp` 1 -_ACEOF - - LIBS="-l$enable_thread_lib $LIBS" - -else - - as_fn_error $? "Thread library not found" "$LINENO" 5 - -fi - - -fi - -fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing cosf" >&5 $as_echo_n "checking for library containing cosf... " >&6; } if ${ac_cv_search_cosf+:} false; then : diff --git a/libphobos/configure.ac b/libphobos/configure.ac index 594d200..e6148f0 100644 --- a/libphobos/configure.ac +++ b/libphobos/configure.ac @@ -133,7 +133,7 @@ DRUNTIME_LIBRARIES_CLIB WITH_LOCAL_DRUNTIME([ AC_LANG_PUSH([D]) AC_SEARCH_LIBS([malloc], [c]) - DRUNTIME_LIBRARIES_THREAD + AC_SEARCH_LIBS([pthread_create], [pthread]) AC_SEARCH_LIBS([cosf], [m]) AC_SEARCH_LIBS([clock_gettime], [rt]) DRUNTIME_ENABLE_ATOMIC_BUILTINS diff --git a/libphobos/m4/druntime/libraries.m4 b/libphobos/m4/druntime/libraries.m4 index a7aab4d..9e8e210 100644 --- a/libphobos/m4/druntime/libraries.m4 +++ b/libphobos/m4/druntime/libraries.m4 @@ -3,32 +3,6 @@ # -# DRUNTIME_LIBRARIES_THREAD -# ------------------------- -# Allow specifying the thread library to link with or autodetect -# Add thread library to LIBS if necessary. -AC_DEFUN([DRUNTIME_LIBRARIES_THREAD], -[ - enable_thread_lib=yes - AC_ARG_ENABLE(thread-lib, - AC_HELP_STRING([--enable-thread-lib=], - [specify linker option for the system thread library (default: autodetect)])) - - AS_IF([test "x$enable_thread_lib" = "xyes"], [ - AC_SEARCH_LIBS([pthread_create], [pthread]) - ], [ - AS_IF([test "x$enable_thread_lib" = "xno"], [ - AC_MSG_CHECKING([for thread library]) - AC_MSG_RESULT([disabled]) - ], [ - AC_CHECK_LIB([$enable_thread_lib], [pthread_create], [], [ - AC_MSG_ERROR([Thread library not found]) - ]) - ]) - ]) -]) - - # DRUNTIME_LIBRARIES_DLOPEN # ----------------------- # Autodetect and add dl library to LIBS if necessary. -- 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/ChangeLog | 15 +++++++++++++ libphobos/Makefile.in | 1 + libphobos/configure | 40 ++++++++++++++++++++++++++++++---- libphobos/configure.ac | 29 ++++++++++++++++++++++-- libphobos/libdruntime/Makefile.am | 2 +- libphobos/libdruntime/Makefile.in | 3 ++- libphobos/src/Makefile.am | 2 +- libphobos/src/Makefile.in | 3 ++- libphobos/testsuite/Makefile.in | 1 + libphobos/testsuite/testsuite_flags.in | 2 +- 10 files changed, 87 insertions(+), 11 deletions(-) (limited to 'libphobos') diff --git a/libphobos/ChangeLog b/libphobos/ChangeLog index d8d37ef..5b9fe43 100644 --- a/libphobos/ChangeLog +++ b/libphobos/ChangeLog @@ -1,5 +1,20 @@ 2020-04-09 Iain Buclaw + 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. + +2020-04-09 Iain Buclaw + * configure: Regenerate. * configure.ac: Use AC_SEARCH_LIBS for pthread_create. * m4/druntime/libraries.m4: Remove DRUNTIME_LIBRARIES_THREAD. diff --git a/libphobos/Makefile.in b/libphobos/Makefile.in index 98d3564..b464d60 100644 --- a/libphobos/Makefile.in +++ b/libphobos/Makefile.in @@ -207,6 +207,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/configure b/libphobos/configure index f458ad3..af597b2 100755 --- a/libphobos/configure +++ b/libphobos/configure @@ -637,6 +637,7 @@ WARN_DFLAGS GDCFLAGSX libtool_VERSION SPEC_PHOBOS_DEPS +CHECKING_DFLAGS ENABLE_LIBPHOBOS_FALSE ENABLE_LIBPHOBOS_TRUE gdc_include_dir @@ -842,6 +843,7 @@ with_cross_host enable_version_specific_runtime_libs with_toolexeclibdir enable_libphobos +enable_libphobos_checking ' ac_precious_vars='build_alias host_alias @@ -1488,6 +1490,11 @@ Optional Features: Specify that runtime libraries should be installed in a compiler-specific directory --enable-libphobos Enable libphobos + --enable-libphobos-checking[=LIST] + enable expensive run-time checks. With LIST, enable + only specific categories of checks. Categories are: + yes,no,all,none,release. Flags are: assert or other + strings Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -11642,7 +11649,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11645 "configure" +#line 11652 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11748,7 +11755,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11751 "configure" +#line 11758 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -15288,6 +15295,31 @@ else fi +# Enable expensive internal checks +# Check whether --enable-libphobos-checking was given. +if test "${enable_libphobos_checking+set}" = set; then : + enableval=$enable_libphobos_checking; ac_checking_flags="${enableval}" +else + ac_checking_flags=release +fi + +IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="$IFS," +for check in release $ac_checking_flags +do + case $check in + # These set all the flags to specific states + yes|all) RELEASE_FLAG="-fno-release" ; ASSERT_FLAG= ;; + no|none|release) RELEASE_FLAG="-frelease" ; ASSERT_FLAG= ;; + # These enable particular checks + assert) ASSERT_FLAG="-fassert" ;; + # Accept + *) ;; + esac +done +IFS="$ac_save_IFS" +CHECKING_DFLAGS="$RELEASE_FLAG $ASSERT_FLAG" + + # Add drtbegin.o/drtend.o to startfile/endfile specs in libgphobos.spec if test "$DCFG_MINFO_BRACKETING" = "false"; then DRTSTUFF_SPEC=$srcdir/src/drtstuff.spec @@ -15306,12 +15338,12 @@ libtool_VERSION=1:0:0 # Set default flags (after DRUNTIME_WERROR!) if test -z "$GDCFLAGS"; then - GDCFLAGS="-g -frelease -O2" + GDCFLAGS="-g -O2" fi if test -z "$GDCFLAGSX"; then - GDCFLAGSX="-g -fno-release -funittest" + GDCFLAGSX="-g" fi diff --git a/libphobos/configure.ac b/libphobos/configure.ac index e6148f0..ffd1298 100644 --- a/libphobos/configure.ac +++ b/libphobos/configure.ac @@ -187,6 +187,31 @@ yes:*) use_libphobos=yes ;; esac AM_CONDITIONAL(ENABLE_LIBPHOBOS, test x$use_libphobos = xyes) +# Enable expensive internal checks +AC_ARG_ENABLE(libphobos-checking, +[AS_HELP_STRING([[--enable-libphobos-checking[=LIST]]], + [enable expensive run-time checks. With LIST, + enable only specific categories of checks. + Categories are: yes,no,all,none,release. + Flags are: assert or other strings])], +[ac_checking_flags="${enableval}"],[ac_checking_flags=release]) +IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="$IFS," +for check in release $ac_checking_flags +do + case $check in + # These set all the flags to specific states + yes|all) RELEASE_FLAG="-fno-release" ; ASSERT_FLAG= ;; + no|none|release) RELEASE_FLAG="-frelease" ; ASSERT_FLAG= ;; + # These enable particular checks + assert) ASSERT_FLAG="-fassert" ;; + # Accept + *) ;; + esac +done +IFS="$ac_save_IFS" +CHECKING_DFLAGS="$RELEASE_FLAG $ASSERT_FLAG" +AC_SUBST(CHECKING_DFLAGS) + # Add drtbegin.o/drtend.o to startfile/endfile specs in libgphobos.spec if test "$DCFG_MINFO_BRACKETING" = "false"; then DRTSTUFF_SPEC=$srcdir/src/drtstuff.spec @@ -205,12 +230,12 @@ AC_SUBST(libtool_VERSION) # Set default flags (after DRUNTIME_WERROR!) if test -z "$GDCFLAGS"; then - GDCFLAGS="-g -frelease -O2" + GDCFLAGS="-g -O2" fi AC_SUBST(GDCFLAGS) if test -z "$GDCFLAGSX"; then - GDCFLAGSX="-g -fno-release -funittest" + GDCFLAGSX="-g" fi AC_SUBST(GDCFLAGSX) diff --git a/libphobos/libdruntime/Makefile.am b/libphobos/libdruntime/Makefile.am index 41ccfaa..c7b03a5 100644 --- a/libphobos/libdruntime/Makefile.am +++ b/libphobos/libdruntime/Makefile.am @@ -24,7 +24,7 @@ D_EXTRA_DFLAGS=-nostdinc -I $(srcdir) -I . # D flags for compilation AM_DFLAGS= \ $(phobos_compiler_pic_flag) \ - $(WARN_DFLAGS) + $(WARN_DFLAGS) $(CHECKING_DFLAGS) # Install all D and DI files ALL_DRUNTIME_INSTALL_DSOURCES = $(DRUNTIME_DSOURCES) \ diff --git a/libphobos/libdruntime/Makefile.in b/libphobos/libdruntime/Makefile.in index 9277e0a..e0688e2 100644 --- a/libphobos/libdruntime/Makefile.in +++ b/libphobos/libdruntime/Makefile.in @@ -555,6 +555,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@ @@ -715,7 +716,7 @@ D_EXTRA_DFLAGS = -nostdinc -I $(srcdir) -I . # D flags for compilation AM_DFLAGS = \ $(phobos_compiler_pic_flag) \ - $(WARN_DFLAGS) + $(WARN_DFLAGS) $(CHECKING_DFLAGS) # Install all D and DI files diff --git a/libphobos/src/Makefile.am b/libphobos/src/Makefile.am index 5c17538..d2418a8 100644 --- a/libphobos/src/Makefile.am +++ b/libphobos/src/Makefile.am @@ -25,7 +25,7 @@ D_EXTRA_DFLAGS=-nostdinc -I $(srcdir) \ # D flags for compilation AM_DFLAGS= \ $(phobos_compiler_pic_flag) \ - $(WARN_DFLAGS) + $(WARN_DFLAGS) $(CHECKING_DFLAGS) # Install all D files ALL_PHOBOS_INSTALL_DSOURCES = $(PHOBOS_DSOURCES) diff --git a/libphobos/src/Makefile.in b/libphobos/src/Makefile.in index e58dafb..4565167 100644 --- a/libphobos/src/Makefile.in +++ b/libphobos/src/Makefile.in @@ -278,6 +278,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@ @@ -440,7 +441,7 @@ D_EXTRA_DFLAGS = -nostdinc -I $(srcdir) \ # D flags for compilation AM_DFLAGS = \ $(phobos_compiler_pic_flag) \ - $(WARN_DFLAGS) + $(WARN_DFLAGS) $(CHECKING_DFLAGS) # Install all D files 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 bbb0de4a4ac9d6b6b6ca6be4755913bf4379d51a Mon Sep 17 00:00:00 2001 From: Iain Buclaw Date: Thu, 9 Apr 2020 17:07:43 +0200 Subject: libphobos: Remove --enable-druntime-gc configure option. This is yet another old option that would have been somewhat useful back before the D front-end implementation was able to support compiling without the Druntime library. Now however, -fno-druntime makes the gcstub package redundant, so the option has been removed, along with the package itself. libphobos/ChangeLog: * configure: Regenerate. * libdruntime/Makefile.am (ALL_DRUNTIME_INSTALL_DSOURCES): Remove DRUNTIME_DSOURCES_GC and DRUNTIME_DSOURCES_GCSTUB. (DRUNTIME_DSOURCES): Add gc/*.d sources. (DRUNTIME_DSOURCES_GC): Remove. (DRUNTIME_DSOURCES_GCSTUB): Remove. * libdruntime/Makefile.in: Regenerate. * libdruntime/gcstub/gc.d: Remove. * m4/druntime.m4 (DRUNTIME_GC): Remove. --- libphobos/ChangeLog | 12 ++ libphobos/configure | 31 +-- libphobos/libdruntime/Makefile.am | 17 +- libphobos/libdruntime/Makefile.in | 182 ++++++++---------- libphobos/libdruntime/gcstub/gc.d | 388 -------------------------------------- libphobos/m4/druntime.m4 | 16 -- 6 files changed, 99 insertions(+), 547 deletions(-) delete mode 100644 libphobos/libdruntime/gcstub/gc.d (limited to 'libphobos') diff --git a/libphobos/ChangeLog b/libphobos/ChangeLog index 5b9fe43..dc19a19 100644 --- a/libphobos/ChangeLog +++ b/libphobos/ChangeLog @@ -1,5 +1,17 @@ 2020-04-09 Iain Buclaw + * configure: Regenerate. + * libdruntime/Makefile.am (ALL_DRUNTIME_INSTALL_DSOURCES): Remove + DRUNTIME_DSOURCES_GC and DRUNTIME_DSOURCES_GCSTUB. + (DRUNTIME_DSOURCES): Add gc/*.d sources. + (DRUNTIME_DSOURCES_GC): Remove. + (DRUNTIME_DSOURCES_GCSTUB): Remove. + * libdruntime/Makefile.in: Regenerate. + * libdruntime/gcstub/gc.d: Remove. + * m4/druntime.m4 (DRUNTIME_GC): Remove. + +2020-04-09 Iain Buclaw + PR d/94305 * Makefile.in: Regenerate. * configure: Regenerate. diff --git a/libphobos/configure b/libphobos/configure index af597b2..a6f5aec 100755 --- a/libphobos/configure +++ b/libphobos/configure @@ -701,8 +701,6 @@ DRUNTIME_CPU_ARM_FALSE DRUNTIME_CPU_ARM_TRUE DRUNTIME_CPU_AARCH64_FALSE DRUNTIME_CPU_AARCH64_TRUE -DRUNTIME_GC_ENABLE_FALSE -DRUNTIME_GC_ENABLE_TRUE libphobos_srcdir libphobos_builddir get_gcc_base_ver @@ -835,7 +833,6 @@ with_gnu_ld enable_libtool_lock with_gcc_major_version_only enable_werror -enable_druntime_gc with_libatomic with_libbacktrace with_target_system_zlib @@ -1485,7 +1482,6 @@ Optional Features: optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --enable-werror turns on -Werror [default=no] - --enable-druntime-gc enable D runtime garbage collector (default: yes) --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory @@ -11649,7 +11645,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11652 "configure" +#line 11648 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11755,7 +11751,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11758 "configure" +#line 11754 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -13981,24 +13977,7 @@ fi WERROR_FLAG="-Werror" fi - - # Check whether --enable-druntime-gc was given. -if test "${enable_druntime_gc+set}" = set; then : - enableval=$enable_druntime_gc; enable_druntime_gc=no -else - enable_druntime_gc=yes -fi - - - if test "$enable_druntime_gc" = "yes"; then - DRUNTIME_GC_ENABLE_TRUE= - DRUNTIME_GC_ENABLE_FALSE='#' -else - DRUNTIME_GC_ENABLE_TRUE='#' - DRUNTIME_GC_ENABLE_FALSE= -fi - - +DRUNTIME_GC druntime_target_cpu_parsed="" case "$target_cpu" in @@ -15510,10 +15489,6 @@ if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${DRUNTIME_GC_ENABLE_TRUE}" && test -z "${DRUNTIME_GC_ENABLE_FALSE}"; then - as_fn_error $? "conditional \"DRUNTIME_GC_ENABLE\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${DRUNTIME_CPU_AARCH64_TRUE}" && test -z "${DRUNTIME_CPU_AARCH64_FALSE}"; then as_fn_error $? "conditional \"DRUNTIME_CPU_AARCH64\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 diff --git a/libphobos/libdruntime/Makefile.am b/libphobos/libdruntime/Makefile.am index c7b03a5..c1c446d 100644 --- a/libphobos/libdruntime/Makefile.am +++ b/libphobos/libdruntime/Makefile.am @@ -28,7 +28,6 @@ AM_DFLAGS= \ # Install all D and DI files ALL_DRUNTIME_INSTALL_DSOURCES = $(DRUNTIME_DSOURCES) \ - $(DRUNTIME_DSOURCES_GC) $(DRUNTIME_DSOURCES_GCSTUB) \ $(DRUNTIME_DSOURCES_BIONIC) $(DRUNTIME_DSOURCES_DARWIN) \ $(DRUNTIME_DSOURCES_DRAGONFLYBSD) $(DRUNTIME_DSOURCES_FREEBSD) \ $(DRUNTIME_DSOURCES_LINUX) $(DRUNTIME_DSOURCES_NETBSD) \ @@ -40,12 +39,6 @@ ALL_DRUNTIME_INSTALL_DSOURCES = $(DRUNTIME_DSOURCES) \ # Setup source files depending on configure DRUNTIME_SOURCES_CONFIGURED = -# GC sources -if DRUNTIME_GC_ENABLE - DRUNTIME_SOURCES_CONFIGURED += $(DRUNTIME_DSOURCES_GC) -else - DRUNTIME_SOURCES_CONFIGURED += $(DRUNTIME_DSOURCES_GCSTUB) -endif # OS specific sources if DRUNTIME_OS_POSIX DRUNTIME_SOURCES_CONFIGURED += $(DRUNTIME_DSOURCES_POSIX) @@ -168,7 +161,9 @@ DRUNTIME_DSOURCES = core/atomic.d core/attribute.d core/bitop.d \ core/stdc/wctype.d core/sync/barrier.d core/sync/condition.d \ core/sync/config.d core/sync/exception.d core/sync/mutex.d \ core/sync/rwmutex.d core/sync/semaphore.d core/thread.d core/time.d \ - core/vararg.d gcc/attribute.d gcc/backtrace.d gcc/builtins.d gcc/deh.d \ + core/vararg.d gc/bits.d gc/config.d gc/gcinterface.d \ + gc/impl/conservative/gc.d gc/impl/manual/gc.d gc/os.d gc/pooltable.d \ + gc/proxy.d gcc/attribute.d gcc/backtrace.d gcc/builtins.d gcc/deh.d \ gcc/emutls.d gcc/gthread.d gcc/sections/android.d \ gcc/sections/elf_shared.d gcc/sections/osx.d gcc/sections/package.d \ gcc/sections/win32.d gcc/sections/win64.d gcc/unwind/arm.d \ @@ -199,12 +194,6 @@ DRUNTIME_DSOURCES = core/atomic.d core/attribute.d core/bitop.d \ DRUNTIME_DSOURCES_STDCXX = core/stdcpp/exception.d \ core/stdcpp/typeinfo.d -DRUNTIME_DSOURCES_GC = gc/bits.d gc/config.d gc/gcinterface.d \ - gc/impl/conservative/gc.d gc/impl/manual/gc.d gc/os.d gc/pooltable.d \ - gc/proxy.d - -DRUNTIME_DSOURCES_GCSTUB = gcstub/gc.d - DRUNTIME_DSOURCES_BIONIC = core/sys/bionic/fcntl.d \ core/sys/bionic/string.d core/sys/bionic/unistd.d diff --git a/libphobos/libdruntime/Makefile.in b/libphobos/libdruntime/Makefile.in index e0688e2..9cb3b60 100644 --- a/libphobos/libdruntime/Makefile.in +++ b/libphobos/libdruntime/Makefile.in @@ -108,30 +108,27 @@ build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ -# GC sources -@DRUNTIME_GC_ENABLE_TRUE@am__append_1 = $(DRUNTIME_DSOURCES_GC) -@DRUNTIME_GC_ENABLE_FALSE@am__append_2 = $(DRUNTIME_DSOURCES_GCSTUB) # OS specific sources -@DRUNTIME_OS_POSIX_TRUE@am__append_3 = $(DRUNTIME_DSOURCES_POSIX) -@DRUNTIME_OS_DARWIN_TRUE@am__append_4 = $(DRUNTIME_DSOURCES_DARWIN) -@DRUNTIME_OS_DRAGONFLYBSD_TRUE@am__append_5 = $(DRUNTIME_DSOURCES_DRAGONFLYBSD) -@DRUNTIME_OS_ANDROID_TRUE@am__append_6 = $(DRUNTIME_DSOURCES_BIONIC) -@DRUNTIME_OS_FREEBSD_TRUE@am__append_7 = $(DRUNTIME_DSOURCES_FREEBSD) -@DRUNTIME_OS_NETBSD_TRUE@am__append_8 = $(DRUNTIME_DSOURCES_NETBSD) -@DRUNTIME_OS_OPENBSD_TRUE@am__append_9 = $(DRUNTIME_DSOURCES_OPENBSD) -@DRUNTIME_OS_LINUX_TRUE@am__append_10 = $(DRUNTIME_DSOURCES_LINUX) -@DRUNTIME_OS_MINGW_TRUE@am__append_11 = $(DRUNTIME_DSOURCES_WINDOWS) -@DRUNTIME_OS_SOLARIS_TRUE@am__append_12 = $(DRUNTIME_DSOURCES_SOLARIS) +@DRUNTIME_OS_POSIX_TRUE@am__append_1 = $(DRUNTIME_DSOURCES_POSIX) +@DRUNTIME_OS_DARWIN_TRUE@am__append_2 = $(DRUNTIME_DSOURCES_DARWIN) +@DRUNTIME_OS_DRAGONFLYBSD_TRUE@am__append_3 = $(DRUNTIME_DSOURCES_DRAGONFLYBSD) +@DRUNTIME_OS_ANDROID_TRUE@am__append_4 = $(DRUNTIME_DSOURCES_BIONIC) +@DRUNTIME_OS_FREEBSD_TRUE@am__append_5 = $(DRUNTIME_DSOURCES_FREEBSD) +@DRUNTIME_OS_NETBSD_TRUE@am__append_6 = $(DRUNTIME_DSOURCES_NETBSD) +@DRUNTIME_OS_OPENBSD_TRUE@am__append_7 = $(DRUNTIME_DSOURCES_OPENBSD) +@DRUNTIME_OS_LINUX_TRUE@am__append_8 = $(DRUNTIME_DSOURCES_LINUX) +@DRUNTIME_OS_MINGW_TRUE@am__append_9 = $(DRUNTIME_DSOURCES_WINDOWS) +@DRUNTIME_OS_SOLARIS_TRUE@am__append_10 = $(DRUNTIME_DSOURCES_SOLARIS) # CPU specific sources -@DRUNTIME_CPU_AARCH64_TRUE@am__append_13 = config/aarch64/switchcontext.S -@DRUNTIME_CPU_ARM_TRUE@am__append_14 = config/arm/switchcontext.S -@DRUNTIME_CPU_MIPS_TRUE@am__append_15 = config/mips/switchcontext.S -@DRUNTIME_CPU_POWERPC_TRUE@am__append_16 = config/powerpc/switchcontext.S -@DRUNTIME_CPU_POWERPC64_TRUE@am__append_17 = config/powerpc64/callwithstack.S -@DRUNTIME_CPU_X86_TRUE@@DRUNTIME_OS_MINGW_TRUE@am__append_18 = config/mingw/switchcontext.S -@DRUNTIME_CPU_X86_TRUE@@DRUNTIME_OS_MINGW_FALSE@am__append_19 = config/x86/switchcontext.S -@DRUNTIME_CPU_SYSTEMZ_TRUE@am__append_20 = config/systemz/get_tls_offset.S -@DRUNTIME_CPU_S390_TRUE@am__append_21 = config/s390/get_tls_offset.S +@DRUNTIME_CPU_AARCH64_TRUE@am__append_11 = config/aarch64/switchcontext.S +@DRUNTIME_CPU_ARM_TRUE@am__append_12 = config/arm/switchcontext.S +@DRUNTIME_CPU_MIPS_TRUE@am__append_13 = config/mips/switchcontext.S +@DRUNTIME_CPU_POWERPC_TRUE@am__append_14 = config/powerpc/switchcontext.S +@DRUNTIME_CPU_POWERPC64_TRUE@am__append_15 = config/powerpc64/callwithstack.S +@DRUNTIME_CPU_X86_TRUE@@DRUNTIME_OS_MINGW_TRUE@am__append_16 = config/mingw/switchcontext.S +@DRUNTIME_CPU_X86_TRUE@@DRUNTIME_OS_MINGW_FALSE@am__append_17 = config/x86/switchcontext.S +@DRUNTIME_CPU_SYSTEMZ_TRUE@am__append_18 = config/systemz/get_tls_offset.S +@DRUNTIME_CPU_S390_TRUE@am__append_19 = config/s390/get_tls_offset.S subdir = libdruntime ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \ @@ -205,7 +202,9 @@ am__objects_1 = core/atomic.lo core/attribute.lo core/bitop.lo \ core/sync/condition.lo core/sync/config.lo \ core/sync/exception.lo core/sync/mutex.lo core/sync/rwmutex.lo \ core/sync/semaphore.lo core/thread.lo core/time.lo \ - core/vararg.lo gcc/attribute.lo gcc/backtrace.lo \ + core/vararg.lo gc/bits.lo gc/config.lo gc/gcinterface.lo \ + gc/impl/conservative/gc.lo gc/impl/manual/gc.lo gc/os.lo \ + gc/pooltable.lo gc/proxy.lo gcc/attribute.lo gcc/backtrace.lo \ gcc/builtins.lo gcc/deh.lo gcc/emutls.lo gcc/gthread.lo \ gcc/sections/android.lo gcc/sections/elf_shared.lo \ gcc/sections/osx.lo gcc/sections/package.lo \ @@ -241,13 +240,7 @@ am__objects_1 = core/atomic.lo core/attribute.lo core/bitop.lo \ rt/util/container/treap.lo rt/util/random.lo \ rt/util/typeinfo.lo rt/util/utf.lo am__objects_2 = core/stdc/libgdruntime_la-errno_.lo -am__objects_3 = gc/bits.lo gc/config.lo gc/gcinterface.lo \ - gc/impl/conservative/gc.lo gc/impl/manual/gc.lo gc/os.lo \ - gc/pooltable.lo gc/proxy.lo -@DRUNTIME_GC_ENABLE_TRUE@am__objects_4 = $(am__objects_3) -am__objects_5 = gcstub/gc.lo -@DRUNTIME_GC_ENABLE_FALSE@am__objects_6 = $(am__objects_5) -am__objects_7 = core/sys/posix/aio.lo core/sys/posix/arpa/inet.lo \ +am__objects_3 = core/sys/posix/aio.lo core/sys/posix/arpa/inet.lo \ core/sys/posix/config.lo core/sys/posix/dirent.lo \ core/sys/posix/dlfcn.lo core/sys/posix/fcntl.lo \ core/sys/posix/grp.lo core/sys/posix/iconv.lo \ @@ -272,8 +265,8 @@ am__objects_7 = core/sys/posix/aio.lo core/sys/posix/arpa/inet.lo \ core/sys/posix/syslog.lo core/sys/posix/termios.lo \ core/sys/posix/time.lo core/sys/posix/ucontext.lo \ core/sys/posix/unistd.lo core/sys/posix/utime.lo -@DRUNTIME_OS_POSIX_TRUE@am__objects_8 = $(am__objects_7) -am__objects_9 = core/sys/darwin/crt_externs.lo \ +@DRUNTIME_OS_POSIX_TRUE@am__objects_4 = $(am__objects_3) +am__objects_5 = core/sys/darwin/crt_externs.lo \ core/sys/darwin/dlfcn.lo core/sys/darwin/execinfo.lo \ core/sys/darwin/mach/dyld.lo core/sys/darwin/mach/getsect.lo \ core/sys/darwin/mach/kern_return.lo \ @@ -283,8 +276,8 @@ am__objects_9 = core/sys/darwin/crt_externs.lo \ core/sys/darwin/netinet/in_.lo core/sys/darwin/pthread.lo \ core/sys/darwin/string.lo core/sys/darwin/sys/cdefs.lo \ core/sys/darwin/sys/event.lo core/sys/darwin/sys/mman.lo -@DRUNTIME_OS_DARWIN_TRUE@am__objects_10 = $(am__objects_9) -am__objects_11 = core/sys/dragonflybsd/dlfcn.lo \ +@DRUNTIME_OS_DARWIN_TRUE@am__objects_6 = $(am__objects_5) +am__objects_7 = core/sys/dragonflybsd/dlfcn.lo \ core/sys/dragonflybsd/execinfo.lo \ core/sys/dragonflybsd/netinet/in_.lo \ core/sys/dragonflybsd/pthread_np.lo \ @@ -301,11 +294,11 @@ am__objects_11 = core/sys/dragonflybsd/dlfcn.lo \ core/sys/dragonflybsd/sys/mman.lo \ core/sys/dragonflybsd/sys/socket.lo \ core/sys/dragonflybsd/time.lo -@DRUNTIME_OS_DRAGONFLYBSD_TRUE@am__objects_12 = $(am__objects_11) -am__objects_13 = core/sys/bionic/fcntl.lo core/sys/bionic/string.lo \ +@DRUNTIME_OS_DRAGONFLYBSD_TRUE@am__objects_8 = $(am__objects_7) +am__objects_9 = core/sys/bionic/fcntl.lo core/sys/bionic/string.lo \ core/sys/bionic/unistd.lo -@DRUNTIME_OS_ANDROID_TRUE@am__objects_14 = $(am__objects_13) -am__objects_15 = core/sys/freebsd/dlfcn.lo \ +@DRUNTIME_OS_ANDROID_TRUE@am__objects_10 = $(am__objects_9) +am__objects_11 = core/sys/freebsd/dlfcn.lo \ core/sys/freebsd/execinfo.lo core/sys/freebsd/netinet/in_.lo \ core/sys/freebsd/pthread_np.lo core/sys/freebsd/string.lo \ core/sys/freebsd/sys/_bitset.lo \ @@ -316,23 +309,23 @@ am__objects_15 = core/sys/freebsd/dlfcn.lo \ core/sys/freebsd/sys/event.lo core/sys/freebsd/sys/link_elf.lo \ core/sys/freebsd/sys/mman.lo core/sys/freebsd/sys/mount.lo \ core/sys/freebsd/time.lo core/sys/freebsd/unistd.lo -@DRUNTIME_OS_FREEBSD_TRUE@am__objects_16 = $(am__objects_15) -am__objects_17 = core/sys/netbsd/dlfcn.lo core/sys/netbsd/execinfo.lo \ +@DRUNTIME_OS_FREEBSD_TRUE@am__objects_12 = $(am__objects_11) +am__objects_13 = core/sys/netbsd/dlfcn.lo core/sys/netbsd/execinfo.lo \ core/sys/netbsd/string.lo core/sys/netbsd/sys/elf.lo \ core/sys/netbsd/sys/elf32.lo core/sys/netbsd/sys/elf64.lo \ core/sys/netbsd/sys/elf_common.lo core/sys/netbsd/sys/event.lo \ core/sys/netbsd/sys/featuretest.lo \ core/sys/netbsd/sys/link_elf.lo core/sys/netbsd/sys/mman.lo \ core/sys/netbsd/time.lo -@DRUNTIME_OS_NETBSD_TRUE@am__objects_18 = $(am__objects_17) -am__objects_19 = core/sys/openbsd/dlfcn.lo core/sys/openbsd/string.lo \ +@DRUNTIME_OS_NETBSD_TRUE@am__objects_14 = $(am__objects_13) +am__objects_15 = core/sys/openbsd/dlfcn.lo core/sys/openbsd/string.lo \ core/sys/openbsd/sys/cdefs.lo core/sys/openbsd/sys/elf.lo \ core/sys/openbsd/sys/elf32.lo core/sys/openbsd/sys/elf64.lo \ core/sys/openbsd/sys/elf_common.lo \ core/sys/openbsd/sys/link_elf.lo core/sys/openbsd/sys/mman.lo \ core/sys/openbsd/time.lo -@DRUNTIME_OS_OPENBSD_TRUE@am__objects_20 = $(am__objects_19) -am__objects_21 = core/sys/linux/config.lo core/sys/linux/dlfcn.lo \ +@DRUNTIME_OS_OPENBSD_TRUE@am__objects_16 = $(am__objects_15) +am__objects_17 = core/sys/linux/config.lo core/sys/linux/dlfcn.lo \ core/sys/linux/elf.lo core/sys/linux/epoll.lo \ core/sys/linux/errno.lo core/sys/linux/execinfo.lo \ core/sys/linux/fcntl.lo core/sys/linux/ifaddrs.lo \ @@ -348,8 +341,8 @@ am__objects_21 = core/sys/linux/config.lo core/sys/linux/dlfcn.lo \ core/sys/linux/termios.lo core/sys/linux/time.lo \ core/sys/linux/timerfd.lo core/sys/linux/tipc.lo \ core/sys/linux/unistd.lo -@DRUNTIME_OS_LINUX_TRUE@am__objects_22 = $(am__objects_21) -am__objects_23 = core/sys/windows/accctrl.lo \ +@DRUNTIME_OS_LINUX_TRUE@am__objects_18 = $(am__objects_17) +am__objects_19 = core/sys/windows/accctrl.lo \ core/sys/windows/aclapi.lo core/sys/windows/aclui.lo \ core/sys/windows/basetsd.lo core/sys/windows/basetyps.lo \ core/sys/windows/cderr.lo core/sys/windows/cguid.lo \ @@ -432,8 +425,8 @@ am__objects_23 = core/sys/windows/accctrl.lo \ core/sys/windows/winspool.lo core/sys/windows/winsvc.lo \ core/sys/windows/winuser.lo core/sys/windows/winver.lo \ core/sys/windows/wtsapi32.lo core/sys/windows/wtypes.lo -@DRUNTIME_OS_MINGW_TRUE@am__objects_24 = $(am__objects_23) -am__objects_25 = core/sys/solaris/dlfcn.lo core/sys/solaris/elf.lo \ +@DRUNTIME_OS_MINGW_TRUE@am__objects_20 = $(am__objects_19) +am__objects_21 = core/sys/solaris/dlfcn.lo core/sys/solaris/elf.lo \ core/sys/solaris/execinfo.lo core/sys/solaris/libelf.lo \ core/sys/solaris/link.lo core/sys/solaris/sys/elf.lo \ core/sys/solaris/sys/elf_386.lo \ @@ -444,27 +437,27 @@ am__objects_25 = core/sys/solaris/dlfcn.lo core/sys/solaris/elf.lo \ core/sys/solaris/sys/priocntl.lo \ core/sys/solaris/sys/procset.lo core/sys/solaris/sys/types.lo \ core/sys/solaris/time.lo -@DRUNTIME_OS_SOLARIS_TRUE@am__objects_26 = $(am__objects_25) -@DRUNTIME_CPU_AARCH64_TRUE@am__objects_27 = config/aarch64/libgdruntime_la-switchcontext.lo -@DRUNTIME_CPU_ARM_TRUE@am__objects_28 = config/arm/libgdruntime_la-switchcontext.lo -@DRUNTIME_CPU_MIPS_TRUE@am__objects_29 = config/mips/libgdruntime_la-switchcontext.lo -@DRUNTIME_CPU_POWERPC_TRUE@am__objects_30 = config/powerpc/libgdruntime_la-switchcontext.lo -@DRUNTIME_CPU_POWERPC64_TRUE@am__objects_31 = config/powerpc64/libgdruntime_la-callwithstack.lo -@DRUNTIME_CPU_X86_TRUE@@DRUNTIME_OS_MINGW_TRUE@am__objects_32 = config/mingw/libgdruntime_la-switchcontext.lo -@DRUNTIME_CPU_X86_TRUE@@DRUNTIME_OS_MINGW_FALSE@am__objects_33 = config/x86/libgdruntime_la-switchcontext.lo -@DRUNTIME_CPU_SYSTEMZ_TRUE@am__objects_34 = config/systemz/libgdruntime_la-get_tls_offset.lo -@DRUNTIME_CPU_S390_TRUE@am__objects_35 = config/s390/libgdruntime_la-get_tls_offset.lo -am__objects_36 = $(am__objects_4) $(am__objects_6) $(am__objects_8) \ +@DRUNTIME_OS_SOLARIS_TRUE@am__objects_22 = $(am__objects_21) +@DRUNTIME_CPU_AARCH64_TRUE@am__objects_23 = config/aarch64/libgdruntime_la-switchcontext.lo +@DRUNTIME_CPU_ARM_TRUE@am__objects_24 = config/arm/libgdruntime_la-switchcontext.lo +@DRUNTIME_CPU_MIPS_TRUE@am__objects_25 = config/mips/libgdruntime_la-switchcontext.lo +@DRUNTIME_CPU_POWERPC_TRUE@am__objects_26 = config/powerpc/libgdruntime_la-switchcontext.lo +@DRUNTIME_CPU_POWERPC64_TRUE@am__objects_27 = config/powerpc64/libgdruntime_la-callwithstack.lo +@DRUNTIME_CPU_X86_TRUE@@DRUNTIME_OS_MINGW_TRUE@am__objects_28 = config/mingw/libgdruntime_la-switchcontext.lo +@DRUNTIME_CPU_X86_TRUE@@DRUNTIME_OS_MINGW_FALSE@am__objects_29 = config/x86/libgdruntime_la-switchcontext.lo +@DRUNTIME_CPU_SYSTEMZ_TRUE@am__objects_30 = config/systemz/libgdruntime_la-get_tls_offset.lo +@DRUNTIME_CPU_S390_TRUE@am__objects_31 = config/s390/libgdruntime_la-get_tls_offset.lo +am__objects_32 = $(am__objects_4) $(am__objects_6) $(am__objects_8) \ $(am__objects_10) $(am__objects_12) $(am__objects_14) \ $(am__objects_16) $(am__objects_18) $(am__objects_20) \ - $(am__objects_22) $(am__objects_24) $(am__objects_26) \ - $(am__objects_27) $(am__objects_28) $(am__objects_29) \ - $(am__objects_30) $(am__objects_31) $(am__objects_32) \ - $(am__objects_33) $(am__objects_34) $(am__objects_35) -am__objects_37 = gcc/config.lo gcc/libbacktrace.lo -am__objects_38 = $(am__objects_1) $(am__objects_2) $(am__objects_36) \ - $(am__objects_37) -am_libgdruntime_la_OBJECTS = $(am__objects_38) + $(am__objects_22) $(am__objects_23) $(am__objects_24) \ + $(am__objects_25) $(am__objects_26) $(am__objects_27) \ + $(am__objects_28) $(am__objects_29) $(am__objects_30) \ + $(am__objects_31) +am__objects_33 = gcc/config.lo gcc/libbacktrace.lo +am__objects_34 = $(am__objects_1) $(am__objects_2) $(am__objects_32) \ + $(am__objects_33) +am_libgdruntime_la_OBJECTS = $(am__objects_34) libgdruntime_la_OBJECTS = $(am_libgdruntime_la_OBJECTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) @@ -721,7 +714,6 @@ AM_DFLAGS = \ # Install all D and DI files ALL_DRUNTIME_INSTALL_DSOURCES = $(DRUNTIME_DSOURCES) \ - $(DRUNTIME_DSOURCES_GC) $(DRUNTIME_DSOURCES_GCSTUB) \ $(DRUNTIME_DSOURCES_BIONIC) $(DRUNTIME_DSOURCES_DARWIN) \ $(DRUNTIME_DSOURCES_DRAGONFLYBSD) $(DRUNTIME_DSOURCES_FREEBSD) \ $(DRUNTIME_DSOURCES_LINUX) $(DRUNTIME_DSOURCES_NETBSD) \ @@ -738,8 +730,7 @@ DRUNTIME_SOURCES_CONFIGURED = $(am__append_1) $(am__append_2) \ $(am__append_9) $(am__append_10) $(am__append_11) \ $(am__append_12) $(am__append_13) $(am__append_14) \ $(am__append_15) $(am__append_16) $(am__append_17) \ - $(am__append_18) $(am__append_19) $(am__append_20) \ - $(am__append_21) + $(am__append_18) $(am__append_19) # Provide __start_minfo, __stop_minfo if linker doesn't. @DRUNTIME_OS_MINFO_BRACKETING_FALSE@DRTSTUFF = gcc/drtbegin.o gcc/drtend.o @@ -779,7 +770,9 @@ DRUNTIME_DSOURCES = core/atomic.d core/attribute.d core/bitop.d \ core/stdc/wctype.d core/sync/barrier.d core/sync/condition.d \ core/sync/config.d core/sync/exception.d core/sync/mutex.d \ core/sync/rwmutex.d core/sync/semaphore.d core/thread.d core/time.d \ - core/vararg.d gcc/attribute.d gcc/backtrace.d gcc/builtins.d gcc/deh.d \ + core/vararg.d gc/bits.d gc/config.d gc/gcinterface.d \ + gc/impl/conservative/gc.d gc/impl/manual/gc.d gc/os.d gc/pooltable.d \ + gc/proxy.d gcc/attribute.d gcc/backtrace.d gcc/builtins.d gcc/deh.d \ gcc/emutls.d gcc/gthread.d gcc/sections/android.d \ gcc/sections/elf_shared.d gcc/sections/osx.d gcc/sections/package.d \ gcc/sections/win32.d gcc/sections/win64.d gcc/unwind/arm.d \ @@ -810,11 +803,6 @@ DRUNTIME_DSOURCES = core/atomic.d core/attribute.d core/bitop.d \ DRUNTIME_DSOURCES_STDCXX = core/stdcpp/exception.d \ core/stdcpp/typeinfo.d -DRUNTIME_DSOURCES_GC = gc/bits.d gc/config.d gc/gcinterface.d \ - gc/impl/conservative/gc.d gc/impl/manual/gc.d gc/os.d gc/pooltable.d \ - gc/proxy.d - -DRUNTIME_DSOURCES_GCSTUB = gcstub/gc.d DRUNTIME_DSOURCES_BIONIC = core/sys/bionic/fcntl.d \ core/sys/bionic/string.d core/sys/bionic/unistd.d @@ -1132,6 +1120,23 @@ core/sync/semaphore.lo: core/sync/$(am__dirstamp) core/thread.lo: core/$(am__dirstamp) core/time.lo: core/$(am__dirstamp) core/vararg.lo: core/$(am__dirstamp) +gc/$(am__dirstamp): + @$(MKDIR_P) gc + @: > gc/$(am__dirstamp) +gc/bits.lo: gc/$(am__dirstamp) +gc/config.lo: gc/$(am__dirstamp) +gc/gcinterface.lo: gc/$(am__dirstamp) +gc/impl/conservative/$(am__dirstamp): + @$(MKDIR_P) gc/impl/conservative + @: > gc/impl/conservative/$(am__dirstamp) +gc/impl/conservative/gc.lo: gc/impl/conservative/$(am__dirstamp) +gc/impl/manual/$(am__dirstamp): + @$(MKDIR_P) gc/impl/manual + @: > gc/impl/manual/$(am__dirstamp) +gc/impl/manual/gc.lo: gc/impl/manual/$(am__dirstamp) +gc/os.lo: gc/$(am__dirstamp) +gc/pooltable.lo: gc/$(am__dirstamp) +gc/proxy.lo: gc/$(am__dirstamp) gcc/$(am__dirstamp): @$(MKDIR_P) gcc @: > gcc/$(am__dirstamp) @@ -1239,27 +1244,6 @@ rt/util/random.lo: rt/util/$(am__dirstamp) rt/util/typeinfo.lo: rt/util/$(am__dirstamp) rt/util/utf.lo: rt/util/$(am__dirstamp) core/stdc/libgdruntime_la-errno_.lo: core/stdc/$(am__dirstamp) -gc/$(am__dirstamp): - @$(MKDIR_P) gc - @: > gc/$(am__dirstamp) -gc/bits.lo: gc/$(am__dirstamp) -gc/config.lo: gc/$(am__dirstamp) -gc/gcinterface.lo: gc/$(am__dirstamp) -gc/impl/conservative/$(am__dirstamp): - @$(MKDIR_P) gc/impl/conservative - @: > gc/impl/conservative/$(am__dirstamp) -gc/impl/conservative/gc.lo: gc/impl/conservative/$(am__dirstamp) -gc/impl/manual/$(am__dirstamp): - @$(MKDIR_P) gc/impl/manual - @: > gc/impl/manual/$(am__dirstamp) -gc/impl/manual/gc.lo: gc/impl/manual/$(am__dirstamp) -gc/os.lo: gc/$(am__dirstamp) -gc/pooltable.lo: gc/$(am__dirstamp) -gc/proxy.lo: gc/$(am__dirstamp) -gcstub/$(am__dirstamp): - @$(MKDIR_P) gcstub - @: > gcstub/$(am__dirstamp) -gcstub/gc.lo: gcstub/$(am__dirstamp) core/sys/posix/$(am__dirstamp): @$(MKDIR_P) core/sys/posix @: > core/sys/posix/$(am__dirstamp) @@ -1856,8 +1840,6 @@ mostlyclean-compile: -rm -f gcc/sections/*.lo -rm -f gcc/unwind/*.$(OBJEXT) -rm -f gcc/unwind/*.lo - -rm -f gcstub/*.$(OBJEXT) - -rm -f gcstub/*.lo -rm -f rt/*.$(OBJEXT) -rm -f rt/*.lo -rm -f rt/typeinfo/*.$(OBJEXT) @@ -1969,7 +1951,6 @@ clean-libtool: -rm -rf gcc/.libs gcc/_libs -rm -rf gcc/sections/.libs gcc/sections/_libs -rm -rf gcc/unwind/.libs gcc/unwind/_libs - -rm -rf gcstub/.libs gcstub/_libs -rm -rf rt/.libs rt/_libs -rm -rf rt/typeinfo/.libs rt/typeinfo/_libs -rm -rf rt/util/.libs rt/util/_libs @@ -2126,7 +2107,6 @@ distclean-generic: -rm -f gcc/$(am__dirstamp) -rm -f gcc/sections/$(am__dirstamp) -rm -f gcc/unwind/$(am__dirstamp) - -rm -f gcstub/$(am__dirstamp) -rm -f rt/$(am__dirstamp) -rm -f rt/typeinfo/$(am__dirstamp) -rm -f rt/util/$(am__dirstamp) diff --git a/libphobos/libdruntime/gcstub/gc.d b/libphobos/libdruntime/gcstub/gc.d deleted file mode 100644 index 9124a78..0000000 --- a/libphobos/libdruntime/gcstub/gc.d +++ /dev/null @@ -1,388 +0,0 @@ -/** - * This module contains a minimal garbage collector implementation according to - * published requirements. This library is mostly intended to serve as an - * example, but it is usable in applications which do not rely on a garbage - * collector to clean up memory (ie. when dynamic array resizing is not used, - * and all memory allocated with 'new' is freed deterministically with - * 'delete'). - * - * Please note that block attribute data must be tracked, or at a minimum, the - * FINALIZE bit must be tracked for any allocated memory block because calling - * rt_finalize on a non-object block can result in an access violation. In the - * allocator below, this tracking is done via a leading uint bitmask. A real - * allocator may do better to store this data separately, similar to the basic - * GC. - * - * Copyright: Copyright Sean Kelly 2005 - 2009. - * License: $(WEB www.boost.org/LICENSE_1_0.txt, Boost License 1.0). - * Authors: Sean Kelly - */ - -/* Copyright Sean Kelly 2005 - 2009. - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE or copy at - * http://www.boost.org/LICENSE_1_0.txt) - */ -module gc.gc; - -private -{ - import core.stdc.stdlib; - import core.stdc.stdio; - - static import core.memory; - private alias BlkAttr = core.memory.GC.BlkAttr; - private alias BlkInfo = core.memory.GC.BlkInfo; - - extern (C) void thread_init(); - extern (C) void onOutOfMemoryError(void* pretend_sideffect = null) @trusted pure nothrow @nogc; /* dmd @@@BUG11461@@@ */ - - struct Proxy - { - extern (C) void function() gc_enable; - extern (C) void function() gc_disable; - extern (C) void function() gc_collect; - extern (C) void function() gc_minimize; - - extern (C) uint function(void*) gc_getAttr; - extern (C) uint function(void*, uint) gc_setAttr; - extern (C) uint function(void*, uint) gc_clrAttr; - - extern (C) void* function(size_t, uint, const TypeInfo) gc_malloc; - extern (C) BlkInfo function(size_t, uint, const TypeInfo) gc_qalloc; - extern (C) void* function(size_t, uint, const TypeInfo) gc_calloc; - extern (C) void* function(void*, size_t, uint ba, const TypeInfo) gc_realloc; - extern (C) size_t function(void*, size_t, size_t, const TypeInfo) gc_extend; - extern (C) size_t function(size_t) gc_reserve; - extern (C) void function(void*) gc_free; - - extern (C) void* function(void*) gc_addrOf; - extern (C) size_t function(void*) gc_sizeOf; - - extern (C) BlkInfo function(void*) gc_query; - - extern (C) void function(void*) gc_addRoot; - extern (C) void function(void*, size_t, const TypeInfo ti) gc_addRange; - - extern (C) void function(void*) gc_removeRoot; - extern (C) void function(void*) gc_removeRange; - extern (C) void function(in void[]) gc_runFinalizers; - - extern (C) bool function() gc_inFinalizer; - } - - __gshared Proxy pthis; - __gshared Proxy* proxy; - - void initProxy() - { - pthis.gc_enable = &gc_enable; - pthis.gc_disable = &gc_disable; - pthis.gc_collect = &gc_collect; - pthis.gc_minimize = &gc_minimize; - - pthis.gc_getAttr = &gc_getAttr; - pthis.gc_setAttr = &gc_setAttr; - pthis.gc_clrAttr = &gc_clrAttr; - - pthis.gc_malloc = &gc_malloc; - pthis.gc_qalloc = &gc_qalloc; - pthis.gc_calloc = &gc_calloc; - pthis.gc_realloc = &gc_realloc; - pthis.gc_extend = &gc_extend; - pthis.gc_reserve = &gc_reserve; - pthis.gc_free = &gc_free; - - pthis.gc_addrOf = &gc_addrOf; - pthis.gc_sizeOf = &gc_sizeOf; - - pthis.gc_query = &gc_query; - - pthis.gc_addRoot = &gc_addRoot; - pthis.gc_addRange = &gc_addRange; - - pthis.gc_removeRoot = &gc_removeRoot; - pthis.gc_removeRange = &gc_removeRange; - pthis.gc_runFinalizers = &gc_runFinalizers; - - pthis.gc_inFinalizer = &gc_inFinalizer; - } - - __gshared void** roots = null; - __gshared size_t nroots = 0; - - struct Range - { - void* pos; - size_t len; - TypeInfo ti; // should be tail const, but doesn't exist for references - } - - __gshared Range* ranges = null; - __gshared size_t nranges = 0; -} - -extern (C) void gc_init() -{ - // NOTE: The GC must initialize the thread library before its first - // collection, and always before returning from gc_init(). - thread_init(); - initProxy(); -} - -extern (C) void gc_term() -{ - free( roots ); - free( ranges ); -} - -extern (C) void gc_enable() -{ - if ( proxy is null ) - return; - return proxy.gc_enable(); -} - -extern (C) void gc_disable() -{ - if ( proxy is null ) - return; - return proxy.gc_disable(); -} - -extern (C) void gc_collect() -{ - if ( proxy is null ) - return; - return proxy.gc_collect(); -} - -extern (C) void gc_minimize() -{ - if ( proxy is null ) - return; - return proxy.gc_minimize(); -} - -extern (C) uint gc_getAttr( void* p ) -{ - if ( proxy is null ) - return 0; - return proxy.gc_getAttr( p ); -} - -extern (C) uint gc_setAttr( void* p, uint a ) -{ - if ( proxy is null ) - return 0; - return proxy.gc_setAttr( p, a ); -} - -extern (C) uint gc_clrAttr( void* p, uint a ) -{ - if ( proxy is null ) - return 0; - return proxy.gc_clrAttr( p, a ); -} - -extern (C) void* gc_malloc( size_t sz, uint ba = 0, const TypeInfo ti = null ) -{ - if ( proxy is null ) - { - void* p = malloc( sz ); - - if ( sz && p is null ) - onOutOfMemoryError(); - return p; - } - return proxy.gc_malloc( sz, ba, ti ); -} - -extern (C) BlkInfo gc_qalloc( size_t sz, uint ba = 0, const TypeInfo ti = null ) -{ - if ( proxy is null ) - { - BlkInfo retval; - retval.base = gc_malloc(sz, ba); - retval.size = sz; - retval.attr = ba; - return retval; - } - return proxy.gc_qalloc( sz, ba, ti ); -} - -extern (C) void* gc_calloc( size_t sz, uint ba = 0, const TypeInfo ti = null ) -{ - if ( proxy is null ) - { - void* p = calloc( 1, sz ); - - if ( sz && p is null ) - onOutOfMemoryError(); - return p; - } - return proxy.gc_calloc( sz, ba, ti ); -} - -extern (C) void* gc_realloc( void* p, size_t sz, uint ba = 0, const TypeInfo ti = null ) -{ - if ( proxy is null ) - { - p = realloc( p, sz ); - - if ( sz && p is null ) - onOutOfMemoryError(); - return p; - } - return proxy.gc_realloc( p, sz, ba, ti ); -} - -extern (C) size_t gc_extend( void* p, size_t mx, size_t sz, const TypeInfo ti = null ) -{ - if ( proxy is null ) - return 0; - return proxy.gc_extend( p, mx, sz, ti ); -} - -extern (C) size_t gc_reserve( size_t sz ) -{ - if ( proxy is null ) - return 0; - return proxy.gc_reserve( sz ); -} - -extern (C) void gc_free( void* p ) -{ - if ( proxy is null ) - return free( p ); - return proxy.gc_free( p ); -} - -extern (C) void* gc_addrOf( void* p ) -{ - if ( proxy is null ) - return null; - return proxy.gc_addrOf( p ); -} - -extern (C) size_t gc_sizeOf( void* p ) -{ - if ( proxy is null ) - return 0; - return proxy.gc_sizeOf( p ); -} - -extern (C) BlkInfo gc_query( void* p ) -{ - if ( proxy is null ) - return BlkInfo.init; - return proxy.gc_query( p ); -} - -extern (C) void gc_addRoot( void* p ) -{ - if ( proxy is null ) - { - void** r = cast(void**) realloc( roots, - (nroots+1) * roots[0].sizeof ); - if ( r is null ) - onOutOfMemoryError(); - r[nroots++] = p; - roots = r; - return; - } - return proxy.gc_addRoot( p ); -} - -extern (C) void gc_addRange( void* p, size_t sz, const TypeInfo ti = null ) -{ - //printf("gcstub::gc_addRange() proxy = %p\n", proxy); - if ( proxy is null ) - { - Range* r = cast(Range*) realloc( ranges, - (nranges+1) * ranges[0].sizeof ); - if ( r is null ) - onOutOfMemoryError(); - r[nranges].pos = p; - r[nranges].len = sz; - r[nranges].ti = cast()ti; - ranges = r; - ++nranges; - return; - } - return proxy.gc_addRange( p, sz, ti ); -} - -extern (C) void gc_removeRoot( void *p ) -{ - if ( proxy is null ) - { - for ( size_t i = 0; i < nroots; ++i ) - { - if ( roots[i] is p ) - { - roots[i] = roots[--nroots]; - return; - } - } - assert( false ); - } - return proxy.gc_removeRoot( p ); -} - -extern (C) void gc_removeRange( void *p ) -{ - if ( proxy is null ) - { - for ( size_t i = 0; i < nranges; ++i ) - { - if ( ranges[i].pos is p ) - { - ranges[i] = ranges[--nranges]; - return; - } - } - assert( false ); - } - return proxy.gc_removeRange( p ); -} - -extern (C) void gc_runFinalizers( in void[] segment ) -{ - if ( proxy !is null ) - proxy.gc_runFinalizers( segment ); -} - -extern (C) bool gc_inFinalizer() -{ - if ( proxy !is null ) - return proxy.gc_inFinalizer(); - return false; -} - -extern (C) Proxy* gc_getProxy() -{ - return &pthis; -} - -export extern (C) void gc_setProxy( Proxy* p ) -{ - if ( proxy !is null ) - { - // TODO: Decide if this is an error condition. - } - proxy = p; - foreach ( r; roots[0 .. nroots] ) - proxy.gc_addRoot( r ); - foreach ( r; ranges[0 .. nranges] ) - proxy.gc_addRange( r.pos, r.len, r.ti ); -} - -export extern (C) void gc_clrProxy() -{ - foreach ( r; ranges[0 .. nranges] ) - proxy.gc_removeRange( r.pos ); - foreach ( r; roots[0 .. nroots] ) - proxy.gc_removeRoot( r ); - proxy = null; -} diff --git a/libphobos/m4/druntime.m4 b/libphobos/m4/druntime.m4 index 3b6e474..7221712 100644 --- a/libphobos/m4/druntime.m4 +++ b/libphobos/m4/druntime.m4 @@ -116,19 +116,3 @@ AC_DEFUN([DRUNTIME_INSTALL_DIRECTORIES], gdc_include_dir='$(libdir)/gcc/${target_alias}/${gcc_version}/include/d' AC_SUBST(gdc_include_dir) ]) - - -# DRUNTIME_GC -# ----------- -# Add the --enable-druntime-gc option and create the -# DRUNTIME_GC_ENABLE conditional -AC_DEFUN([DRUNTIME_GC], -[ - dnl switch between gc and gcstub - AC_ARG_ENABLE(druntime-gc, - AC_HELP_STRING([--enable-druntime-gc], - [enable D runtime garbage collector (default: yes)]), - [enable_druntime_gc=no],[enable_druntime_gc=yes]) - - AM_CONDITIONAL([DRUNTIME_GC_ENABLE], [test "$enable_druntime_gc" = "yes"]) -]) -- 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/ChangeLog | 13 ++++ libphobos/d_rules.am | 11 --- libphobos/libdruntime/Makefile.am | 17 +++++ libphobos/libdruntime/Makefile.in | 133 ++++++++++++++++++++++++++++----- libphobos/src/Makefile.am | 13 +++- libphobos/src/Makefile.in | 28 +++---- libphobos/testsuite/lib/libphobos.exp | 4 - libphobos/testsuite/testsuite_flags.in | 1 - 8 files changed, 170 insertions(+), 50 deletions(-) (limited to 'libphobos') diff --git a/libphobos/ChangeLog b/libphobos/ChangeLog index dc19a19..653f481 100644 --- a/libphobos/ChangeLog +++ b/libphobos/ChangeLog @@ -1,3 +1,16 @@ +2020-04-10 Iain Buclaw + + * 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. + 2020-04-09 Iain Buclaw * configure: Regenerate. diff --git a/libphobos/d_rules.am b/libphobos/d_rules.am index 979142b..c05c8e8 100644 --- a/libphobos/d_rules.am +++ b/libphobos/d_rules.am @@ -32,14 +32,3 @@ toolexeclibdir = $(libphobos_toolexeclibdir) LTDCOMPILE = $(LIBTOOL) --tag=D $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(GDC) $(AM_DFLAGS) - -# Also override library link commands: This is not strictly -# required, but we want to record additional dependencies such -# as pthread in the library -libgdruntime_la_LINK = $(LIBTOOL) --tag=D $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(GDC) $(AM_CFLAGS) $(CFLAGS) \ - $(libgdruntime_la_LDFLAGS) $(LDFLAGS) -o $@ - -libgphobos_la_LINK = $(LIBTOOL) --tag=D $(libgphobos_la_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(GDC) $(AM_CFLAGS) $(CFLAGS) \ - $(libgphobos_la_LDFLAGS) $(LDFLAGS) -o $@ diff --git a/libphobos/libdruntime/Makefile.am b/libphobos/libdruntime/Makefile.am index c1c446d..e1a3815 100644 --- a/libphobos/libdruntime/Makefile.am +++ b/libphobos/libdruntime/Makefile.am @@ -119,6 +119,8 @@ DRUNTIME_DSOURCES_GENERATED = gcc/config.d gcc/libbacktrace.d ALL_DRUNTIME_SOURCES = $(DRUNTIME_DSOURCES) $(DRUNTIME_CSOURCES) \ $(DRUNTIME_SOURCES_CONFIGURED) $(DRUNTIME_DSOURCES_GENERATED) +# Need this library to both be part of libgphobos.a, and installed separately. +# 1) separate libgdruntime.la toolexeclib_LTLIBRARIES = libgdruntime.la libgdruntime_la_SOURCES = $(ALL_DRUNTIME_SOURCES) libgdruntime_la_LIBTOOLFLAGS = @@ -126,6 +128,21 @@ libgdruntime_la_LDFLAGS = -Wc,-nophoboslib,-dstartfiles,-B../src,-Bgcc \ -version-info $(libtool_VERSION) libgdruntime_la_LIBADD = $(LIBATOMIC) $(LIBBACKTRACE) libgdruntime_la_DEPENDENCIES = $(DRTSTUFF) +# Also override library link commands: This is not strictly +# required, but we want to record additional dependencies such +# as pthread in the library +libgdruntime_la_LINK = $(LIBTOOL) --tag=D $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(GDC) $(AM_CFLAGS) $(CFLAGS) \ + $(libgdruntime_la_LDFLAGS) $(LDFLAGS) -o $@ + +# 2) integrated libgdruntime_convenience.la that is to be part of libgphobos.a +noinst_LTLIBRARIES = libgdruntime_convenience.la +libgdruntime_convenience_la_SOURCES = $(libgdruntime_la_SOURCES) +libgdruntime_convenience_la_LIBTOOLFLAGS = $(libgdruntime_la_LIBTOOLFLAGS) +libgdruntime_convenience_la_LDFLAGS = $(libgdruntime_la_LDFLAGS) +libgdruntime_convenience_la_LIBADD = $(libgdruntime_la_LIBADD) +libgdruntime_convenience_la_DEPENDENCIES = $(libgdruntime_la_DEPENDENCIES) +libgdruntime_convenience_la_LINK = $(libgdruntime_la_LINK) # Handles generated files as well install-data-local: diff --git a/libphobos/libdruntime/Makefile.in b/libphobos/libdruntime/Makefile.in index 9cb3b60..3bb023f 100644 --- a/libphobos/libdruntime/Makefile.in +++ b/libphobos/libdruntime/Makefile.in @@ -181,7 +181,7 @@ am__uninstall_files_from_dir = { \ } am__installdirs = "$(DESTDIR)$(toolexeclibdir)" \ "$(DESTDIR)$(toolexeclibdir)" -LTLIBRARIES = $(toolexeclib_LTLIBRARIES) +LTLIBRARIES = $(noinst_LTLIBRARIES) $(toolexeclib_LTLIBRARIES) am__DEPENDENCIES_1 = am__dirstamp = $(am__leading_dot)dirstamp am__objects_1 = core/atomic.lo core/attribute.lo core/bitop.lo \ @@ -459,6 +459,30 @@ am__objects_34 = $(am__objects_1) $(am__objects_2) $(am__objects_32) \ $(am__objects_33) am_libgdruntime_la_OBJECTS = $(am__objects_34) libgdruntime_la_OBJECTS = $(am_libgdruntime_la_OBJECTS) +am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +am__objects_35 = core/stdc/libgdruntime_convenience_la-errno_.lo +@DRUNTIME_CPU_AARCH64_TRUE@am__objects_36 = config/aarch64/libgdruntime_convenience_la-switchcontext.lo +@DRUNTIME_CPU_ARM_TRUE@am__objects_37 = config/arm/libgdruntime_convenience_la-switchcontext.lo +@DRUNTIME_CPU_MIPS_TRUE@am__objects_38 = config/mips/libgdruntime_convenience_la-switchcontext.lo +@DRUNTIME_CPU_POWERPC_TRUE@am__objects_39 = config/powerpc/libgdruntime_convenience_la-switchcontext.lo +@DRUNTIME_CPU_POWERPC64_TRUE@am__objects_40 = config/powerpc64/libgdruntime_convenience_la-callwithstack.lo +@DRUNTIME_CPU_X86_TRUE@@DRUNTIME_OS_MINGW_TRUE@am__objects_41 = config/mingw/libgdruntime_convenience_la-switchcontext.lo +@DRUNTIME_CPU_X86_TRUE@@DRUNTIME_OS_MINGW_FALSE@am__objects_42 = config/x86/libgdruntime_convenience_la-switchcontext.lo +@DRUNTIME_CPU_SYSTEMZ_TRUE@am__objects_43 = config/systemz/libgdruntime_convenience_la-get_tls_offset.lo +@DRUNTIME_CPU_S390_TRUE@am__objects_44 = config/s390/libgdruntime_convenience_la-get_tls_offset.lo +am__objects_45 = $(am__objects_4) $(am__objects_6) $(am__objects_8) \ + $(am__objects_10) $(am__objects_12) $(am__objects_14) \ + $(am__objects_16) $(am__objects_18) $(am__objects_20) \ + $(am__objects_22) $(am__objects_36) $(am__objects_37) \ + $(am__objects_38) $(am__objects_39) $(am__objects_40) \ + $(am__objects_41) $(am__objects_42) $(am__objects_43) \ + $(am__objects_44) +am__objects_46 = $(am__objects_1) $(am__objects_35) $(am__objects_45) \ + $(am__objects_33) +am__objects_47 = $(am__objects_46) +am_libgdruntime_convenience_la_OBJECTS = $(am__objects_47) +libgdruntime_convenience_la_OBJECTS = \ + $(am_libgdruntime_convenience_la_OBJECTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -505,7 +529,8 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -SOURCES = $(libgdruntime_la_SOURCES) +SOURCES = $(libgdruntime_la_SOURCES) \ + $(libgdruntime_convenience_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -689,18 +714,6 @@ LTDCOMPILE = $(LIBTOOL) --tag=D $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(GDC) $(AM_DFLAGS) -# Also override library link commands: This is not strictly -# required, but we want to record additional dependencies such -# as pthread in the library -libgdruntime_la_LINK = $(LIBTOOL) --tag=D $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(GDC) $(AM_CFLAGS) $(CFLAGS) \ - $(libgdruntime_la_LDFLAGS) $(LDFLAGS) -o $@ - -libgphobos_la_LINK = $(LIBTOOL) --tag=D $(libgphobos_la_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(GDC) $(AM_CFLAGS) $(CFLAGS) \ - $(libgphobos_la_LDFLAGS) $(LDFLAGS) -o $@ - - # Include D build rules # Make sure GDC can find libdruntime include files @@ -741,6 +754,9 @@ DRUNTIME_DSOURCES_GENERATED = gcc/config.d gcc/libbacktrace.d ALL_DRUNTIME_SOURCES = $(DRUNTIME_DSOURCES) $(DRUNTIME_CSOURCES) \ $(DRUNTIME_SOURCES_CONFIGURED) $(DRUNTIME_DSOURCES_GENERATED) + +# Need this library to both be part of libgphobos.a, and installed separately. +# 1) separate libgdruntime.la toolexeclib_LTLIBRARIES = libgdruntime.la libgdruntime_la_SOURCES = $(ALL_DRUNTIME_SOURCES) libgdruntime_la_LIBTOOLFLAGS = @@ -749,6 +765,22 @@ libgdruntime_la_LDFLAGS = -Wc,-nophoboslib,-dstartfiles,-B../src,-Bgcc \ libgdruntime_la_LIBADD = $(LIBATOMIC) $(LIBBACKTRACE) libgdruntime_la_DEPENDENCIES = $(DRTSTUFF) +# Also override library link commands: This is not strictly +# required, but we want to record additional dependencies such +# as pthread in the library +libgdruntime_la_LINK = $(LIBTOOL) --tag=D $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(GDC) $(AM_CFLAGS) $(CFLAGS) \ + $(libgdruntime_la_LDFLAGS) $(LDFLAGS) -o $@ + + +# 2) integrated libgdruntime_convenience.la that is to be part of libgphobos.a +noinst_LTLIBRARIES = libgdruntime_convenience.la +libgdruntime_convenience_la_SOURCES = $(libgdruntime_la_SOURCES) +libgdruntime_convenience_la_LIBTOOLFLAGS = $(libgdruntime_la_LIBTOOLFLAGS) +libgdruntime_convenience_la_LDFLAGS = $(libgdruntime_la_LDFLAGS) +libgdruntime_convenience_la_LIBADD = $(libgdruntime_la_LIBADD) +libgdruntime_convenience_la_DEPENDENCIES = $(libgdruntime_la_DEPENDENCIES) +libgdruntime_convenience_la_LINK = $(libgdruntime_la_LINK) # Source file definitions. Boring stuff, auto-generated with # https://gist.github.com/jpf91/8ad1dbc9902d6ad876313f134c6527d1 @@ -1024,6 +1056,17 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + install-toolexeclibLTLIBRARIES: $(toolexeclib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(toolexeclib_LTLIBRARIES)'; test -n "$(toolexeclibdir)" || list=; \ @@ -1745,6 +1788,29 @@ gcc/libbacktrace.lo: gcc/$(am__dirstamp) libgdruntime.la: $(libgdruntime_la_OBJECTS) $(libgdruntime_la_DEPENDENCIES) $(EXTRA_libgdruntime_la_DEPENDENCIES) $(AM_V_GEN)$(libgdruntime_la_LINK) -rpath $(toolexeclibdir) $(libgdruntime_la_OBJECTS) $(libgdruntime_la_LIBADD) $(LIBS) +core/stdc/libgdruntime_convenience_la-errno_.lo: \ + core/stdc/$(am__dirstamp) +config/aarch64/libgdruntime_convenience_la-switchcontext.lo: \ + config/aarch64/$(am__dirstamp) +config/arm/libgdruntime_convenience_la-switchcontext.lo: \ + config/arm/$(am__dirstamp) +config/mips/libgdruntime_convenience_la-switchcontext.lo: \ + config/mips/$(am__dirstamp) +config/powerpc/libgdruntime_convenience_la-switchcontext.lo: \ + config/powerpc/$(am__dirstamp) +config/powerpc64/libgdruntime_convenience_la-callwithstack.lo: \ + config/powerpc64/$(am__dirstamp) +config/mingw/libgdruntime_convenience_la-switchcontext.lo: \ + config/mingw/$(am__dirstamp) +config/x86/libgdruntime_convenience_la-switchcontext.lo: \ + config/x86/$(am__dirstamp) +config/systemz/libgdruntime_convenience_la-get_tls_offset.lo: \ + config/systemz/$(am__dirstamp) +config/s390/libgdruntime_convenience_la-get_tls_offset.lo: \ + config/s390/$(am__dirstamp) + +libgdruntime_convenience.la: $(libgdruntime_convenience_la_OBJECTS) $(libgdruntime_convenience_la_DEPENDENCIES) $(EXTRA_libgdruntime_convenience_la_DEPENDENCIES) + $(AM_V_GEN)$(libgdruntime_convenience_la_LINK) $(libgdruntime_convenience_la_OBJECTS) $(libgdruntime_convenience_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -1888,6 +1954,33 @@ config/systemz/libgdruntime_la-get_tls_offset.lo: config/systemz/get_tls_offset. config/s390/libgdruntime_la-get_tls_offset.lo: config/s390/get_tls_offset.S $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(libgdruntime_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o config/s390/libgdruntime_la-get_tls_offset.lo `test -f 'config/s390/get_tls_offset.S' || echo '$(srcdir)/'`config/s390/get_tls_offset.S +config/aarch64/libgdruntime_convenience_la-switchcontext.lo: config/aarch64/switchcontext.S + $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(libgdruntime_convenience_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o config/aarch64/libgdruntime_convenience_la-switchcontext.lo `test -f 'config/aarch64/switchcontext.S' || echo '$(srcdir)/'`config/aarch64/switchcontext.S + +config/arm/libgdruntime_convenience_la-switchcontext.lo: config/arm/switchcontext.S + $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(libgdruntime_convenience_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o config/arm/libgdruntime_convenience_la-switchcontext.lo `test -f 'config/arm/switchcontext.S' || echo '$(srcdir)/'`config/arm/switchcontext.S + +config/mips/libgdruntime_convenience_la-switchcontext.lo: config/mips/switchcontext.S + $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(libgdruntime_convenience_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o config/mips/libgdruntime_convenience_la-switchcontext.lo `test -f 'config/mips/switchcontext.S' || echo '$(srcdir)/'`config/mips/switchcontext.S + +config/powerpc/libgdruntime_convenience_la-switchcontext.lo: config/powerpc/switchcontext.S + $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(libgdruntime_convenience_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o config/powerpc/libgdruntime_convenience_la-switchcontext.lo `test -f 'config/powerpc/switchcontext.S' || echo '$(srcdir)/'`config/powerpc/switchcontext.S + +config/powerpc64/libgdruntime_convenience_la-callwithstack.lo: config/powerpc64/callwithstack.S + $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(libgdruntime_convenience_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o config/powerpc64/libgdruntime_convenience_la-callwithstack.lo `test -f 'config/powerpc64/callwithstack.S' || echo '$(srcdir)/'`config/powerpc64/callwithstack.S + +config/mingw/libgdruntime_convenience_la-switchcontext.lo: config/mingw/switchcontext.S + $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(libgdruntime_convenience_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o config/mingw/libgdruntime_convenience_la-switchcontext.lo `test -f 'config/mingw/switchcontext.S' || echo '$(srcdir)/'`config/mingw/switchcontext.S + +config/x86/libgdruntime_convenience_la-switchcontext.lo: config/x86/switchcontext.S + $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(libgdruntime_convenience_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o config/x86/libgdruntime_convenience_la-switchcontext.lo `test -f 'config/x86/switchcontext.S' || echo '$(srcdir)/'`config/x86/switchcontext.S + +config/systemz/libgdruntime_convenience_la-get_tls_offset.lo: config/systemz/get_tls_offset.S + $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(libgdruntime_convenience_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o config/systemz/libgdruntime_convenience_la-get_tls_offset.lo `test -f 'config/systemz/get_tls_offset.S' || echo '$(srcdir)/'`config/systemz/get_tls_offset.S + +config/s390/libgdruntime_convenience_la-get_tls_offset.lo: config/s390/get_tls_offset.S + $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(libgdruntime_convenience_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o config/s390/libgdruntime_convenience_la-get_tls_offset.lo `test -f 'config/s390/get_tls_offset.S' || echo '$(srcdir)/'`config/s390/get_tls_offset.S + .c.o: $(AM_V_CC)$(COMPILE) -c -o $@ $< @@ -1900,6 +1993,9 @@ config/s390/libgdruntime_la-get_tls_offset.lo: config/s390/get_tls_offset.S core/stdc/libgdruntime_la-errno_.lo: core/stdc/errno_.c $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgdruntime_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o core/stdc/libgdruntime_la-errno_.lo `test -f 'core/stdc/errno_.c' || echo '$(srcdir)/'`core/stdc/errno_.c +core/stdc/libgdruntime_convenience_la-errno_.lo: core/stdc/errno_.c + $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgdruntime_convenience_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o core/stdc/libgdruntime_convenience_la-errno_.lo `test -f 'core/stdc/errno_.c' || echo '$(srcdir)/'`core/stdc/errno_.c + mostlyclean-libtool: -rm -f *.lo @@ -2117,8 +2213,8 @@ maintainer-clean-generic: @echo "it deletes files that may require special tools to rebuild." clean: clean-am -clean-am: clean-generic clean-libtool clean-toolexeclibLTLIBRARIES \ - mostlyclean-am +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + clean-toolexeclibLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -f Makefile @@ -2189,8 +2285,9 @@ uninstall-am: uninstall-toolexeclibDATA \ .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-toolexeclibLTLIBRARIES cscopelist-am ctags \ - ctags-am distclean distclean-compile distclean-generic \ + clean-libtool clean-noinstLTLIBRARIES \ + clean-toolexeclibLTLIBRARIES cscopelist-am ctags ctags-am \ + distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi dvi-am html html-am info \ info-am install install-am install-data install-data-am \ install-data-local install-dvi install-dvi-am install-exec \ diff --git a/libphobos/src/Makefile.am b/libphobos/src/Makefile.am index d2418a8..51e3f50 100644 --- a/libphobos/src/Makefile.am +++ b/libphobos/src/Makefile.am @@ -42,8 +42,17 @@ libgphobos_la_SOURCES = $(ALL_PHOBOS_SOURCES) libgphobos_la_LIBTOOLFLAGS = libgphobos_la_LDFLAGS = -Wc,-nophoboslib,-dstartfiles,-B../libdruntime/gcc \ -version-info $(libtool_VERSION) -libgphobos_la_LIBADD = ../libdruntime/libgdruntime.la $(LIBZ) -libgphobos_la_DEPENDENCIES = libgphobos.spec +libgphobos_la_LIBADD = \ + ../libdruntime/libgdruntime_convenience.la $(LIBZ) +libgphobos_la_DEPENDENCIES = \ + ../libdruntime/libgdruntime_convenience.la libgphobos.spec + +# Also override library link commands: This is not strictly +# required, but we want to record additional dependencies such +# as pthread in the library +libgphobos_la_LINK = $(LIBTOOL) --tag=D $(libgphobos_la_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(GDC) $(AM_CFLAGS) $(CFLAGS) \ + $(libgphobos_la_LDFLAGS) $(LDFLAGS) -o $@ # Handles generated files as well install-data-local: diff --git a/libphobos/src/Makefile.in b/libphobos/src/Makefile.in index 4565167..da9ba83 100644 --- a/libphobos/src/Makefile.in +++ b/libphobos/src/Makefile.in @@ -419,18 +419,6 @@ LTDCOMPILE = $(LIBTOOL) --tag=D $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(GDC) $(AM_DFLAGS) -# Also override library link commands: This is not strictly -# required, but we want to record additional dependencies such -# as pthread in the library -libgdruntime_la_LINK = $(LIBTOOL) --tag=D $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(GDC) $(AM_CFLAGS) $(CFLAGS) \ - $(libgdruntime_la_LDFLAGS) $(LDFLAGS) -o $@ - -libgphobos_la_LINK = $(LIBTOOL) --tag=D $(libgphobos_la_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(GDC) $(AM_CFLAGS) $(CFLAGS) \ - $(libgphobos_la_LDFLAGS) $(LDFLAGS) -o $@ - - # Include D build rules # Make sure GDC can find libdruntime and libphobos include files @@ -459,8 +447,20 @@ libgphobos_la_LIBTOOLFLAGS = libgphobos_la_LDFLAGS = -Wc,-nophoboslib,-dstartfiles,-B../libdruntime/gcc \ -version-info $(libtool_VERSION) -libgphobos_la_LIBADD = ../libdruntime/libgdruntime.la $(LIBZ) -libgphobos_la_DEPENDENCIES = libgphobos.spec +libgphobos_la_LIBADD = \ + ../libdruntime/libgdruntime_convenience.la $(LIBZ) + +libgphobos_la_DEPENDENCIES = \ + ../libdruntime/libgdruntime_convenience.la libgphobos.spec + + +# Also override library link commands: This is not strictly +# required, but we want to record additional dependencies such +# as pthread in the library +libgphobos_la_LINK = $(LIBTOOL) --tag=D $(libgphobos_la_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(GDC) $(AM_CFLAGS) $(CFLAGS) \ + $(libgphobos_la_LDFLAGS) $(LDFLAGS) -o $@ + # Source file definitions. Boring stuff, auto-generated with # https://gist.github.com/jpf91/8744acebc9dcf1e9d1a35cdff20afbb2 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