This has been tested on powerpc64-freebsd13 and powerpc64le-freebsd13,
and used to build dub, along with some D tools from ports.
libphobos/ChangeLog:
* configure.tgt: Add power*-*-freebsd* as a supported target.
D front-end changes:
- Import dmd v2.098.0
- New ImportC module for compiling preprocessed C11 code into D.
- New -ftransition=in switch.
- Improved handling of new 'noreturn' type.
Druntime changes:
- Import druntime v2.098.0
- Fix broken import in core.sys.linux.perf_event module (PR103558).
Phobos changes:
- Import phobos v2.098.0
- All sources are now compiled with -fpreview=fieldwise.
gcc/d/ChangeLog:
* dmd/MERGE: Merge upstream dmd 568496d5b.
* Make-lang.in (D_FRONTEND_OBJS): Add d/common-file.o,
d/common-outbuffer.o, d/common-string.o, d/file_manager.o,
d/importc.o. Remove d/root-outbuffer.o.
(d/common-%.o): New recipe.
* d-builtins.cc (build_frontend_type): Update for new front-end
interface.
(d_build_d_type_nodes): Set noreturn_type_node.
* d-codegen.cc (d_build_call): Don't call function if one of the
arguments is type 'noreturn'.
(build_vthis_function): Propagate TYPE_QUAL_VOLATILE from original
function type.
* d-frontend.cc (eval_builtin): Update signature.
(getTypeInfoType): Likewise.
(toObjFile): New function.
* d-gimplify.cc (d_gimplify_call_expr): Always evaluate arguments from
left to right.
* d-lang.cc (d_handle_option): Handle OPT_ftransition_in.
(d_parse_file): Don't generate D main if it is declared in user code.
* d-tree.h (CALL_EXPR_ARGS_ORDERED): Remove.
(enum d_tree_index): Add DTI_BOTTOM_TYPE.
(noreturn_type_node): New.
* decl.cc (apply_pragma_crt): Remove.
(DeclVisitor::visit): Update for new front-end interface.
(DeclVisitor::visit (PragmaDeclaration *)): Don't handle
crt_constructor and crt_destructor pragmas.
(DeclVisitor::visit (VarDeclaration *)): Don't generate declarations
of type 'noreturn'.
(DeclVisitor::visit (FuncDeclaration *)): Stop adding parameters when
'noreturn' type has been encountered.
(get_symbol_decl): Set DECL_STATIC_CONSTRUCTOR and
DECL_STATIC_DESTRUCTOR on decl node if requested.
(aggregate_initializer_decl): Update for new front-end interface.
* expr.cc (ExprVisitor::visit (CallExp *)): Always use the 'this'
object as the result of calling any constructor function.
(ExprVisitor::visit): Update for new front-end interface.
* gdc.texi (Runtime Options): Document -fmain and -ftransition=in.
* lang.opt (ftransition=in): New option.
* modules.cc (get_internal_fn): Update for new front-end interface.
* types.cc (TypeVisitor::visit): Likewise.
(TypeVisitor::visit (TypeNoreturn *)): Return noreturn_type_node.
(TypeVisitor::visit (TypeFunction *)): Stop adding parameters when
'notreturn' type has been encountered. Qualify function types that
return 'noreturn' as TYPE_QUAL_VOLATILE.
libphobos/ChangeLog:
PR d/103558
* libdruntime/MERGE: Merge upstream druntime 178c44ff.
* libdruntime/Makefile.am (DRUNTIME_DSOURCES_LINUX): Add
core/sys/linux/syscalls.d.
(DRUNTIME_DSOURCES_OPENBSD): Add core/sys/openbsd/pthread_np.d.
* libdruntime/Makefile.in: Regenerate.
* src/MERGE: Merge upstream phobos 574bf883b.
* src/Makefile.am (D_EXTRA_DFLAGS): Add -fpreview=fieldwise.
* src/Makefile.in: Regenerate.
* testsuite/libphobos.exceptions/assert_fail.d: Update test.
* testsuite/libphobos.betterc/test22336.d: New test.
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/osthread.d (callWithStackShell): Push all
callee-save registers on the stack for AArch64 and ARM.
Fixes a typo that occurred during the splitting of the std.math module
into a package.
libphobos/ChangeLog:
* src/std/math/hardware.d (FloatingPointControl.getControlState): Add
missing ControlState variable for AArch64.
In the gdc driver, this takes the previous fix for the Darwin D
bootstrap, and extends it to the -static-libphobos option as well.
Rather than pushing the -static-libphobos option back onto the command
line, the setting of SKIPOPT is instead conditionally removed. The same
change has been repeated for -static-libstdc++ so there is now no need
to call generate_option to re-add it.
In the gcc driver, -static-libphobos has been added as a common option,
validated, and a new outfile substition added to config/darwin.h to
correctly replace -lgphobos with libgphobos.a.
gcc/ChangeLog:
* common.opt (static-libphobos): Add option.
* config/darwin.h (LINK_SPEC): Substitute -lgphobos with libgphobos.a
when linking statically.
* gcc.c (driver_handle_option): Set -static-libphobos as always valid.
gcc/d/ChangeLog:
* d-spec.cc (lang_specific_driver): Set SKIPOPT on -static-libstdc++
and -static-libphobos only when target supports LD_STATIC_DYNAMIC.
Remove generate_option to re-add -static-libstdc++.
libphobos/ChangeLog:
* testsuite/testsuite_flags.in: Add libphobos library directory as
search path to --gdcldflags.
Depending on the permutation of CPU, OS version and shared/non-
shared library inclusion, we get can get two warnings from the
external tools (ld64, dsymutil) which are not actually GCC issues
but relate to the external tools. These are alrrady pruned in
the main testsuite, this adds them to the library.
Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
libphobos/ChangeLog:
* testsuite/lib/libphobos.exp: Prune warnings from external
tool bugs.
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/fiber.d (defaultStackPages): Increase size
on OSX X86_64 targets.
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.
The _Unwind_Exception struct had its alignment adjusted to 16-bytes,
however malloc() on Solaris X86 is not guaranteed to allocate memory
aligned to 16-bytes as well.
PR d/102837
libphobos/ChangeLog:
* libdruntime/gcc/deh.d (ExceptionHeader.free): Use memset to reset
contents of internal EH storage.
This is analogous to __gdc_personality, which ignores in-flight
exceptions that we haven't collided with yet.
libphobos/ChangeLog:
* libdruntime/gcc/deh.d (ExceptionHeader.getClassInfo): Move to...
(getClassInfo): ...here as free function. Add lsda parameter.
(scanLSDA): Pass lsda to actionTableLookup.
(actionTableLookup): Add lsda parameter, pass to getClassInfo.
(__gdc_personality): Remove currentCfa variable.
By default, D run-time has a top level exception handler to catch
anything that was uncaught by user code. However when the
`rt_trapExceptions' flag is cleared, this handler would not be enabled,
and this termination would occur, aborting the program, but without any
information about the exception.
libphobos/ChangeLog:
* libdruntime/gcc/deh.d (_d_print_throwable): Declare.
(_d_throw): Print stacktrace before terminating program due to
uncaught exception.
The core.runtime module always overrides the default parameter value for
constructor calls. MaxAlignment is not required because a class can be
created on the stack with the `scope' keyword.
libphobos/ChangeLog:
* libdruntime/core/runtime.d (runModuleUnitTests): Use scope to new
LibBacktrace on the stack.
* libdruntime/gcc/backtrace.d (FIRSTFRAME): Remove.
(LibBacktrace.MaxAlignment): Remove.
(LibBacktrace.this): Remove default initialization of firstFrame.
(UnwindBacktrace.this): Likewise.
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__.
The default supplied main function as read when compiling with `-fmain'
has extern(D) linkage. However this does not work when mixing this
option together with `-fno-druntime'.
PR d/102476
gcc/testsuite/ChangeLog:
* gdc.dg/pr102476.d: New test.
libphobos/ChangeLog:
* libdruntime/__main.di: Define main function as extern(C) when
compiling without D runtime.
The D run-time library does not depend on zlib, so only include it in
the library when Phobos is being built as well.
libphobos/ChangeLog:
* src/Makefile.am: Don't add zlib when ENABLE_LIBDRUNTIME_ONLY.
* src/Makefile.in: Regenerate.
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/MERGE: Merge upstream dmd 7a3808254.
libphobos/ChangeLog:
PR d/100999
* src/MERGE: Merge upstream phobos 55bb17543.
The function declarations were updated to use `const scope', but the
static asserts were not.
Reviewed-on: https://github.com/dlang/druntime/pull/3470
libphobos/ChangeLog:
* libdruntime/MERGE: Merge upstream druntime 98c6ff0c.
This symbol is used by std.file.thisExePath on OpenBSD.
Reviewed-on: https://github.com/dlang/phobos/pull/8041
libphobos/ChangeLog:
* src/MERGE: Merge upstream phobos 32cfe9b61.
As register names are required for darwin, but not accepted by gas
unless you use `-mregnames', they have been conditionally removed on
non-darwin targets.
To avoid duplicating large blocks of almost identical code, the inline
assembly is now statically generated.
libphobos/ChangeLog:
* libdruntime/core/thread/osthread.d (callWithStackShell): Statically
generate PPC and PPC64 asm implementations, and conditionally remove
PPC register names on non-Darwin targets.
Instead of unsafe pointer dereferencing, use memcpy() to read encoded
values from memory. The function `read_encoded_value' has been updated
to accept a ref parameter, this simplifies handling of the pointer to
memory needing to be read.
libphobos/ChangeLog:
PR d/98584
* libdruntime/gcc/deh.d (scanLSDA): Update calls to read_uleb128 and
read_encoded_value.
(actionTableLookup): Update calls to read_sleb128 and
read_encoded_value_with_base.
* libdruntime/gcc/unwind/pe.d (read_uleb128): Update signature.
(read_sleb128): Update signature.
(read_unaligned): New function.
(read_encoded_value_with_base): Update signature. Call read_unaligned
instead of unsafe pointer dereferencing.
(read_encoded_value): Update signature.