Fixes std.path.expandTilde erroneously raising onOutOfMemory after
failed call to `getpwnam_r()'.
libphobos/ChangeLog:
* src/std/path.d (expandTilde): Handle more errno codes that could be
left set by getpwnam_r.
For interoperability with C++ EH, the alignment should match, otherwise
D may not be able to intercept exceptions thrown from C++.
libphobos/ChangeLog:
* libdruntime/gcc/unwind/generic.d (__aligned__): Define.
(_Unwind_Exception): Align struct to __aligned__.
(cherry picked from commit efa5449a09)
Fixes a segfault seen on Darwin when a GC scan is ran after a thread has
been destroyed. As the global emutlsArrays hash still has a reference
to the array itself, and tries to iterate all elements.
Setting the length to zero frees all allocated elements in the array,
and ensures that it is skipped when the _d_emutls_scan is called.
libphobos/ChangeLog:
* libdruntime/gcc/emutls.d (emutlsDestroyThread): Clear the per-thread
TLS array, don't call free().
(cherry picked from commit 796b7cbac3)
This is the library fix for PR103520 that also prevents the garbage
collector from releasing live memory. However this requires that the
host compiler has been patched with this fix, so the GC will remain
disabled in the D front-end for now until enough time has passed for
this to have trickled down into enough releases.
libphobos/ChangeLog:
* libdruntime/core/thread.d (callWithStackShell): Push all callee-save
registers on the stack using inline assembly.
(cherry picked from commit 2fb6a57f9ffa9ac964931b439b6d1600a698e377)
As of macOS 11, libunwind now requires more stack space than 16k, so
default to a larger stack size. This is only applied to X86 as the
PAGESIZE is still 4k, however on AArch64 it is 16k.
libphobos/ChangeLog:
* libdruntime/core/thread.d (defaultStackPages): New constant.
(Fiber.this): Set stack size to be a multiple of defaultStackPages.
(cherry picked from commit f316727e5f)
Fixes a EXC_BAD_ACCESS issue seen on Darwin when the libphobos DSO gets
unloaded. Based on reading libgcc's emutls implementation, as it
doesn't call __gthread_key_delete directly, neither should libphobos.
libphobos/ChangeLog:
* libdruntime/gcc/emutls.d (emutlsDestroyThread): Don't remove entry
from global array.
(_d_emutls_destroy): Don't call __gthread_key_delete.
(cherry picked from commit d686cb0d74)
Improves semantic passes in the front-end around the `foreach' and
`static foreach' statements to be more resilient to compiling in a
minimal D runtime environment. Checking of the index type has been
improved as well so now there won't be needless compiler errors when
using 8 or 16-bit integers as index types when the size fits the
expected loop range.
gcc/d/ChangeLog:
PR d/100999
* dmd/cond.c (lowerArrayAggregate): Run CTFE interpret on foreach
input range.
(createTupleType): Don't generate typeinfo when disabled.
(lowerNonArrayAggregate): Suppress errors when running type semantic.
(staticForeachPrepare): Don't run CTFE interpret from here.
* dmd/dinterpret.c (ctfeInterpret): Add more shortcut cases.
* dmd/expression.c (resolvePropertiesX): Remove early error.
(Expression::checkPostblit): Don't generate typeinfo when type is
missing from library.
* dmd/expressionsem.c (ExpressionSemanticVisitor): Set type of
DotTemplateExp as void.
* dmd/statementsem.c (StatementSemanticVisitor::declareVariable):
Don't override index type.
(StatementSemanticVisitor::makeTupleForeachBody): Check index type is
integral and index range fits type size.
(StatementSemanticVisitor::visit (ForeachStatement*)): Adjust index
range before testing.
libphobos/ChangeLog:
PR d/100999
* src/std/typecons.d (template Proxy): Check for field or property
functions as the else branch.
gcc/testsuite/ChangeLog:
PR d/100999
* gdc.test/compilable/staticforeach.d: Add new tests.
* gdc.test/fail_compilation/diag16976.d: Likewise.
* gdc.test/fail_compilation/fail117.d: Likewise.
* gdc.test/fail_compilation/fail238_m32.d: Likewise.
* gdc.test/fail_compilation/fail238_m64.d: Likewise.
* gdc.test/fail_compilation/fail7424b.d: Likewise.
* gdc.test/fail_compilation/fail7424c.d: Likewise.
* gdc.test/fail_compilation/fail7424d.d: Likewise.
* gdc.test/fail_compilation/fail7424e.d: Likewise.
* gdc.test/fail_compilation/fail7424f.d: Likewise.
* gdc.test/fail_compilation/fail7424g.d: Likewise.
* gdc.test/fail_compilation/fail7424h.d: Likewise.
* gdc.test/fail_compilation/fail7424i.d: Likewise.
* gdc.test/fail_compilation/fail9766.d: Likewise.
* gdc.test/fail_compilation/ice9406.d: Likewise.
* gdc.test/compilable/extra-files/minimal/object.d: New file.
* gdc.test/compilable/interpret5.d: New test.
* gdc.test/compilable/minimal3.d: New test.
* gdc.test/compilable/test21742.d: New test.
* gdc.test/compilable/test22006.d: New test.
* gdc.test/fail_compilation/b12504.d: New test.
* gdc.test/fail_compilation/fail22006.d: New test.
* gdc.test/fail_compilation/test21927.d: New test.
* gdc.test/fail_compilation/test21939.d: New test.
(cherry picked from commit 68f46862d3)
The dynamic section on MIPS is read-only, but this was not properly
handled in the runtime library. The segfault only occurred for programs
that linked to the shared libphobos library.
libphobos/ChangeLog:
PR d/98806
* libdruntime/gcc/sections/elf_shared.d (MIPS_Any): Declare version
for MIPS32 and MIPS64.
(getDependencies): Adjust dlpi_addr on MIPS_Any.
(cherry picked from commit 81f928ec8e)
The change in major version (and the increment from Darwin19 to 20)
caused libtool tests to fail which resulted in incorrect build settings
for shared libraries.
We take this opportunity to sort out the shared undefined symbols state
rather than propagating the current unsound behaviour into a new rev.
This change means that we default to the case that missing symbols are
considered an error, and if one wants to allow this intentionally, the
confiuration for that case should be set appropriately.
Three existing cases need undefined dynamic lookup:
libitm, where there is already a configuration mechanism to add the
flags.
libcc1, where we add simple configuration to add the flags for Darwin.
libsanitizer, where we can add to the existing extra flags.
Backported from 1352bc88a0 and 5dc998933e
libcc1/ChangeLog:
PR target/97865
* Makefile.am: Add dynamic_lookup to LD flags for Darwin.
* configure.ac: Test for Darwin host and set a flag.
* Makefile.in: Regenerate.
* configure: Regenerate.
libitm/ChangeLog:
PR target/97865
* configure.tgt: Add dynamic_lookup to XLDFLAGS for Darwin.
* configure: Regenerate.
libsanitizer/ChangeLog:
PR target/97865
* configure.tgt: Add dynamic_lookup to EXTRA_CXXFLAGS for
Darwin.
* configure: Regenerate.
ChangeLog:
PR target/97865
* libtool.m4: Update handling of Darwin platform link flags
for Darwin20.
gcc/ChangeLog:
PR target/97865
* configure: Regenerate.
libatomic/ChangeLog:
PR target/97865
* configure: Regenerate.
libbacktrace/ChangeLog:
PR target/97865
* configure: Regenerate.
libffi/ChangeLog:
PR target/97865
* configure: Regenerate.
libgfortran/ChangeLog:
PR target/97865
* configure: Regenerate.
libgomp/ChangeLog:
PR target/97865
* configure: Regenerate.
* Makefile.in: Update copyright years.
libhsail-rt/ChangeLog:
PR target/97865
* configure: Regenerate.
libobjc/ChangeLog:
PR target/97865
* configure: Regenerate.
libphobos/ChangeLog:
PR target/97865
* configure: Regenerate.
libquadmath/ChangeLog:
PR target/97865
* configure: Regenerate.
libssp/ChangeLog:
PR target/97865
* configure: Regenerate.
libstdc++-v3/ChangeLog:
PR target/97865
* configure: Regenerate.
libvtv/ChangeLog:
PR target/97865
* configure: Regenerate.
zlib/ChangeLog:
PR target/97865
* configure: Regenerate.
Co-Authored-By: Jakub Jelinek <jakub@redhat.com>
Correct MIPS I assembly build errors in switchcontext.S:
.../libphobos/libdruntime/config/mips/switchcontext.S: Assembler messages:
.../libphobos/libdruntime/config/mips/switchcontext.S:50: Error: opcode not supported on this processor: mips1 (mips1) `sdc1 $f20,(0*8-((6*8+4+(-6*8+4&7))))($sp)'
etc., due to the use of the MIPS II LDC1 and SDC1 hardware instructions
for FP register load and store operations. Instead use the L.D and S.D
generic assembly instructions, which are strict aliases for the LDC1 and
SDC1 instructions respectively and produce identical machine code where
the assembly for the MIPS II or a higher ISA has been requested, however
they become assembly macros and expand to compatible sequences of LWC1
and SWC1 hardware instructions where the assembly for the MIPS I ISA is
in effect.
libphobos/
* libdruntime/config/mips/switchcontext.S [__mips_hard_float]:
Use L.D and S.D generic assembly instructions rather than LDC1
and SDC1 MIPS II hardware instructions.
(cherry picked from commit 6f0a4ae127)
- core.cpuid has been fixed to not use i7 detection on AMD processors.
- std.net.curl has been fixed to correctly handle HTTP/2 status lines.
- std.zip has had a test fixed to not rely on unzip being installed.
libphobos/ChangeLog:
PR d/95166
* libdruntime/core/cpuid.d (cpuidX86): Do not use i7 detection on AMD
processors.
(hasCPUID): Fix deprecated asm syntax.
PR d/95167
* src/std/zip.d (unittest): Skip test if unzip is not installed.
PR d/95168
* src/std/net/curl.d (HTTP.onReceiveHeader): Move status line parsing
to ...
(HTTP.parseStatusLine): ... here. New function. Add support for
parsing HTTP/2 status lines.
Corrects a previous change made to the SPARC stdc bindings, and
backports PPC-related fixes. The library and language testsuite now
passes fully on powerpc64le-linux-gnu.
Fixes: PR d/90719
Fixes: PR d/94825
Reviewed-on: https://github.com/dlang/dmd/pull/11079https://github.com/dlang/druntime/pull/3078https://github.com/dlang/druntime/pull/3083
libphobos/ChangeLog:
PR d/94825
* libdruntime/Makefile.am (DRUNTIME_SOURCES_CONFIGURED): Remove
config/powerpc/switchcontext.S
* libdruntime/Makefile.in: Regenerate.
* libdruntime/config/powerpc/callwithstack.S: Remove.
* libdruntime/config/powerpc/switchcontext.S: Fix symbol name of
fiber_switchContext.
* libdruntime/core/thread.d: Disable fiber migration tests on PPC.
* testsuite/libphobos.thread/fiber_guard_page.d: Set guardPageSize
same as stackSize.
A typo in the macro call meant that the #error always triggered.
libphobos/ChangeLog:
* testsuite/lib/libphobos.exp (check_effective_target_linux_pre_2639):
Fix KERNEL_VERSION condition.
Multilibs should not have been split up as two logically different CPU,
so at configure time, powerpc64 was being detected, but none of the
32-bit support files were being compiled in.
libphobos/ChangeLog:
PR d/94825
* configure: Regenerate.
* libdruntime/Makefile.am (DRUNTIME_SOURCES_CONFIGURED): Add both
switchcontext.S and callwithstack.S if DRUNTIME_CPU_POWERPC.
* libdruntime/Makefile.in: Regenerate.
* libdruntime/config/powerpc/switchcontext.S: Add !__PPC64__ guards.
* libdruntime/config/powerpc64/callwithstack.S: Add __PPC64__ guards.
* m4/druntime/cpu.m4 (DRUNTIME_CPU_SOURCES): Define DRUNTIME_CPU_POWER
for all powerpc biarchs. Remove DRUNTIME_CPU_POWER64 conditional.
Adds a new test directive COMPILABLE_MATH_TEST, and support has been
added for it in gdc-convert-test so that they are skipped if phobos is
not present on the target.
Only change in D runtime is a small documentation fix.
Reviewed-on: https://github.com/dlang/druntime/pull/3067https://github.com/dlang/dmd/pull/11060
gcc/testsuite/ChangeLog:
PR d/89418
* lib/gdc-utils.exp (gdc-convert-test): Add dg-skip-if for compilable
tests that depend on the phobos standard library.
libphobos/ChangeLog:
* configure: Regenerate.
* configure.tgt: Add power*-*-linux* as a supported target, only
building libdruntime.
* m4/druntime/cpu.m4 (DRUNTIME_CPU_SOURCES): Add cases for powerpcle
and powerpc64le target cpus.
* New core.math.toPrec templates have been added as an intrinsic.
Some floating point algorithms, such as Kahan-Babuska-Neumaier
Summation, require rounding to specific precisions. Rounding to
precision after every operation, however, loses overall precision in
the general case and is a runtime performance problem.
Adding these functions guarantee the rounding at required points in
the code, and document where in the algorithm the requirement exists.
* Support IBM long double types in core.internal.convert.
* Add missing aliases for 64-bit vectors in core.simd.
* RUNNABLE_PHOBOS_TEST directive has been properly integrated into the
D2 language testsuite.
Reviewed-on: https://github.com/dlang/druntime/pull/3063https://github.com/dlang/dmd/pull/11054
gcc/d/ChangeLog:
* intrinsics.cc (expand_intrinsic_toprec): New function.
(maybe_expand_intrinsic): Handle toPrec intrinsics.
* intrinsics.def (TOPRECF, TOPREC, TOPRECL): Add toPrec intrinsics.
Always run testsuite with same GDCFLAGS as used in build.
libphobos/ChangeLog:
* Makefile.in: Regenerate.
* configure: Regenerate.
* configure.ac: Remove GDCFLAGSX.
* libdruntime/Makefile.in: Regenerate.
* src/Makefile.in: Regenerate.
* testsuite/Makefile.in: Regenerate.
* testsuite/testsuite_flags.in: Use GDCFLAGS in --gdcflags.
* testsuite/libphobos.thread/fiber_guard_page.d: Test using -O0.
std.array.Appender and RefAppender: use .opSlice() instead of data()
Previously, Appender.data() was used to extract a slice of the Appender's array.
Now use the [] slice operator instead. The same goes for RefAppender.
Fixes: PR d/94455
Reviewed-on: https://github.com/dlang/phobos/pull/7450
The intended purpose of the option is both for targets that don't
support phobos yet, and for gdc itself to support bootstrapping itself
as a self-hosted D compiler.
The libphobos testsuite has been updated to only add libphobos to the
search paths if it's being built. A new D2 testsuite directive
RUNNABLE_PHOBOS_TEST has also been patched in to disable some runnable
tests that have phobos dependencies, of which is a temporary measure
until upstream DMD fixes or removes these tests entirely.
gcc/testsuite/ChangeLog:
* lib/gdc-utils.exp (gdc-convert-test): Add dg-skip-if for tests that
depending on the phobos standard library.
libphobos/ChangeLog:
* configure: Regenerate.
* configure.ac: Add --with-libphobos-druntime-only option and the
conditional ENABLE_LIBDRUNTIME_ONLY.
* configure.tgt: Define LIBDRUNTIME_ONLY.
* src/Makefile.am: Add phobos sources if not ENABLE_LIBDRUNTIME_ONLY.
* src/Makefile.in: Regenerate.
* testsuite/testsuite_flags.in: Add phobos path if compiling phobos.
The current check_effective_target_d_runtime procedure returns false if
the target is built without any core runtime library for D being
available (--disable-libphobos). This additional procedure is for
targets where the core runtime library exists, but without the higher
level standard library.
gcc/ChangeLog:
* doc/sourcebuild.texi (Effective-Target Keywords, Environment
attributes): Document d_runtime_has_std_library.
gcc/testsuite/ChangeLog:
* gdc.dg/link.d: Use d_runtime_has_std_library effective target.
* gdc.dg/runnable.d: Move phobos tests to...
* gdc.dg/runnable2.d: ...here. New test.
* lib/target-supports.exp
(check_effective_target_d_runtime_has_std_library): New.
libphobos/ChangeLog:
* testsuite/libphobos.phobos/phobos.exp: Skip if effective target is
not d_runtime_has_std_library.
* testsuite/libphobos.phobos_shared/phobos_shared.exp: Likewise.
Removes the implementation of __traits(argTypes), which only supported
x86_64 targets. The only use of this trait is an unused va_arg()
function, this has been removed as well.
Reviewed-on: https://github.com/dlang/dmd/pull/11022
gcc/d/ChangeLog:
2020-04-13 Iain Buclaw <ibuclaw@gdcproject.org>
* Make-lang.in (D_FRONTEND_OBJS): Remove d/argtypes.o.
* d-target.cc (Target::toArgTypes): New function.
libphobos/ChangeLog:
2020-04-13 Iain Buclaw <ibuclaw@gdcproject.org>
* libdruntime/core/stdc/stdarg.d: Remove run-time va_list template.
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.
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.
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.
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.
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.