Commit graph

557 commits

Author SHA1 Message Date
fossdd
81dd72b2a3
druntime: add support for musl RISCV64 (#21213)
Based on https://git.musl-libc.org/cgit/musl/tree/arch/riscv64/bits?h=v1.2.5
2025-04-12 18:01:30 +08:00
Dennis
cfa763d301
Turn macro translations into template functions (#21108) 2025-03-29 06:31:49 +08:00
Martin Kinkelin
b390c7ec13 [druntime] core.int128: Add 64-bit mul() overload and optimize via inline asm on x86_64 2025-03-25 16:12:24 +08:00
Martin Kinkelin
6b7bbdd330 [druntime] core.int128: Optimize new udivmod overload via inline asm on x86_64 2025-03-24 14:43:17 +08:00
Martin Kinkelin
3a661c1f8c [druntime] core.int128: Extract nested udivmod128_64 as udivmod overload 2025-03-24 14:43:17 +08:00
Martin Kinkelin
ea4b1e9607 [druntime] core.int128: Don't support/test invalid shift-by values >= 128
This enables using (LLVM/gcc) intrinsics for shifts, for which such
inputs are undefined behavior, as for builtin types.
2025-03-24 14:43:17 +08:00
Dennis
649223bff5
Remove redundant GC allocation for _d_newarraymTX.dims (#21051) 2025-03-22 06:36:00 +08:00
Dennis
d5db322fce
Merge stable (#21048)
* bump VERSION to v2.110.0

* purge changelog

* bump VERSION to v2.111.0-beta.1

* Accept __rvalue attribute on ref functions; which will force the result to be treated as __rvalue. (#20946)

This is essential to implement `move`, `forward`, etc.

* memoryerror.d: Fix AnySupported version condition (#20983)

* Fix #20982 - wrong line number in iasmgcc (#20993)

* Move genCfunc to cxxfrontend (#20992)

* druntime: Fix compilation of rt.cover on Android (#21015)

* Expose SourceLoc to C++ interface (#20980)

* [stable] C++ header fixes for declaration, expression, and typinf (#21016)

Seen either from compilation errors or missing symbols at link time.

* C++ headers: Add 3 Declaration bitfield setters/getters required by LDC

* druntime: Add module declaration to rt.invariant, to prevent conflicts with user-provided invariant.d (#21017)

* Fix #21020 - Indexing a *cast* AA yields no lvalue anymore (#21029)

* Add C++23 to CppStdRevision enum (#21043)

* Improve UFCS/property error message (#21046)

---------

Co-authored-by: Manu Evans <turkeyman@gmail.com>
Co-authored-by: Martin Kinkelin <kinke@users.noreply.github.com>
Co-authored-by: Iain Buclaw <ibuclaw@gdcproject.org>
Co-authored-by: Martin Kinkelin <noone@nowhere.com>
2025-03-21 15:48:21 +01:00
Albert24GG
9a8302a941
Fix #17481 - free ctors before returning (#20975) 2025-03-11 08:30:29 +08:00
Dennis
4661fec6b7
Update copyright years to 2025 (#20958) 2025-03-06 18:17:32 +08:00
Paul Backus
5fc114165d
Fix importc_compare test on Windows (#20922)
MSVC does not support C11 atomics, but it still provides a "stub"
version of stdatomic.h, which aborts compilation with an #error
directive when included.

To avoid this error, explicitly set the C standard to C11 when invoking
the C preprocessor on Windows, and check for the C11 macro
__STDC_NO_ATOMICS__ before including stdatomic.h.
2025-02-27 20:15:31 +01:00
Adam Wilson
a0581f2538 Fix deprecation message. 2025-02-23 16:58:46 -08:00
Adam Wilson
d1d6c60a12 Move ODBVER outside of deprecation block. 2025-02-23 16:32:28 -08:00
Adam Wilson
a9b688f2fd Fix deprecation message. 2025-02-23 16:20:53 -08:00
Adam Wilson
b76d185fa1 Fix deprecation message. 2025-02-23 16:03:26 -08:00
Adam Wilson
60d915b23d Deprecate the old ODBC 3.5 modules in core.sys.windows. 2025-02-23 15:46:01 -08:00
Steven Schveighoffer
60a3060cdf
Use Entry struct from TypeInfo_AssociativeArray instead of local one, (#20900)
just one less template and one less place to maintain.
2025-02-20 06:00:27 +08:00
Rainer
c4a9796472 add test case from #20853 2025-02-18 13:51:06 +01:00
Rainer
7d6fff7bcf Fix issue #17503 - Associative Arrays improperly register a GC-allocated TypeInfo for element cleanup
- let the compiler generate type info for the AA Entry and add it to TypeInfo_AssociativeArray
- strip modifiers for index and next in TypeInfo_AssociativeArray to make it agnostic to changes by the glue layer
2025-02-17 22:02:57 +01:00
Dennis
c0c1b0ab12
Use __FILE__, __LINE__ for templated tracegc hooks (#20882) 2025-02-17 11:53:16 +01:00
Dennis
0bb48e277c
Remove version (tracegc) blocks (#20881) 2025-02-17 07:15:00 +08:00
liushuyu
12e64881f2
druntime: redirect dual-ABI functions on glibc to IEEE128 version ... (#20826)
... if IEEE long double ABI is selected
2025-02-13 15:26:07 +08:00
Steven Schveighoffer
0542419acb
Remove knowledge of metadata storage from rt/lifetime and (#20833)
core/internal/array. All metadata management should be done by GC.
2025-02-09 16:46:34 +08:00
Steven Schveighoffer
935d72a79e Remove unnecessary NoPointersBitmapPayload template. 2025-02-08 03:52:29 +01:00
Steven Schveighoffer
6d6e170cf2
Fix race condition when alternative GC mechanisms are used to scan (#20820)
threads. The `thread_preSuspend` hook should return true when druntime
has knowledge of a thread. But it's based on `sm_this` (the storage for
`Thread.getThis`) being set. Because the thread lock is not taken to set
`sm_this`, a race exists when a thread is suspended between this
setting, and the adding to the thread list for scanning. Therefore,
`thread_preSuspend` can return true, but `thread_scanAll` will not
include that thread in the list of scannables.
2025-02-06 05:39:59 +08:00
Jonathan M Davis
6e249f01dd
Fix issue 20812: hasIndirections wrong when void has qualifiers. (#20813)
The current check that special cases static arrays of void doesn't take
type qualifiers into account - e.g. void[42] is treated as having
indirections, but const(void[42]) is not. This fixes that.
2025-02-03 13:18:29 +08:00
Martin Kinkelin
130e6aa1d4
GHA main: Add Alpine Linux job, to CI-test musl libc (#20741)
* GHA main: Add Alpine Linux job, to CI-test musl libc

Incl. some test fixes.

* [refactor common isDlcoseNoop logic and prepare for Darwin support]
2025-01-28 00:28:20 +01:00
Walter Bright
94714307ec
add __builtin__popcount() for ImportC (#20790) 2025-01-28 06:25:04 +08:00
Walter Bright
2ca7960029
implement cdpopcnt for AArch64 (#20787) 2025-01-27 22:33:15 +08:00
Elias Batek
af002fcad0
Port ntdef macros NT_INFORMATION, NT_WARNING and NT_ERROR (#20782) 2025-01-26 07:32:28 +08:00
Elias Batek
63630b4287
Mark NT_SUCCESS with various applicable attributes (#20781) 2025-01-26 05:53:22 +08:00
Elias Batek
b7e3b3b617
Add core.sys.windows.bcrypt to the build process (#20780) 2025-01-25 21:54:49 +01:00
IchorDev
32883d3994
Add Windows BCrypt bindings (#20740)
* Update sdkddkver/w32api bindings

* Add BCrypt bindings

---------

Co-authored-by: IchorDev <ichordev@noreply.git.sleeping.town>
2025-01-25 16:33:27 +01:00
Johan Engelen
047dfb5703
druntime: Upstream exception stack traces on musl platforms from LDC (#20758)
Based on:
* https://github.com/ldc-developers/ldc/pull/4639
* https://github.com/ldc-developers/ldc/pull/4691

Co-authored-by: Martin Kinkelin <noone@nowhere.com>
2025-01-23 15:44:45 +08:00
Jonas Meeuws
2ecfa63ce7
Use selective imports when importing from core.stdc in rt (#20742) 2025-01-20 21:12:30 +01:00
Jonas Meeuws
5a02544ea3
Use selective imports when importing from core.stdc in druntime tests (#20743) 2025-01-20 19:59:19 +01:00
Iain Buclaw
ad947b55a8 druntime: Add GNU_InlineAsm implementations 2025-01-19 15:46:27 +01:00
Iain Buclaw
3e50cd8f94 druntime: Update GNU implementation of callWithStackShell 2025-01-19 15:46:00 +01:00
Iain Buclaw
5c47e5cdc6 druntime: Add version(GNU) imports to rt.deh and sections modules 2025-01-19 11:30:20 +01:00
Iain Buclaw
37dddf5dd0 druntime: Add version(GNU) definitions of c_long and c_ulong 2025-01-19 11:28:34 +01:00
Jonas Meeuws
8c5051803a
Use selective imports when importing from core.stdc in core.internal (#20723) 2025-01-19 09:45:13 +08:00
Jonas Meeuws
d115713410
Add an assert-based segfault handler to etc.linux.memoryerror (#20643)
* Add an assert-based segfault handler to `etc.linux.memoryerror`

* Commit memoryAssertError review feedback

* Indent the MemoryErrorSupported version block

* Fix a bad ucontext_t in memoryerror.d

* Fix bad imports in memoryerror.d

* Use a module-scope version: in memoryerror.d

* Add a memoryerror.d unittest

* Prefer version-else-version... in memoryerror.d
2025-01-18 22:38:54 +01:00
Jonas Meeuws
e49b67e969
Remove usage of obsolete _fdToHandle in rt/dmain2.d (#20722) 2025-01-18 22:38:22 +01:00
0-v-0
9c9720493d
Use number suffix instead of cast (#20729) 2025-01-18 22:31:58 +01:00
Jonas Meeuws
c71c3b231d
Use selective imports when importing from core.stdc in core (#20725) 2025-01-17 15:20:47 +01:00
Iain Sandoe
f224123e56
Fix build on i686, arm64 and x86_64+32b multilib for Darwin. (#20710)
* Fix build on i686, arm64 and x86_64+32b multilib for Darwin.

osthread.d needs to import the thread state definitions for each
supported arch (but was only importing x86_64).

NOTE1: Iain Buclaw pointed out that the ucontext import was unused
and do I have removed that too.

NOTE2: I did not add the data for 32bit Arm (as distinct from the
possible use of AArch64/ILP32), because there is no way I know
to test that - since there's no upstream 32b Arm implementation.

NOTE3: The earlier Darwin versions (equivalent to MacOSX 10.5) have
quite limited D support - but both i686 and PowerPC should be able
(at least) to build the druntime.

I tested on x86_64,i686-Darwin17 and aarch64-darwin23.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>

* Address code reviews.

---------

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
Co-authored-by: Iain Buclaw <ibuclaw@gdcproject.org>
2025-01-16 22:35:06 +08:00
Nicholas Wilson
93ca4676b6
Merge pull request #20698 from schveiguy/gcfinalizerarrays
Move all array and finalizer functionality into the GC
2025-01-15 06:27:36 +08:00
Steven Schveighoffer
ed08053424 fix translation of nested array construction length. 2025-01-14 15:20:09 -05:00
Steven Schveighoffer
4f93c2a1a2 Trying to "fix" obvious non-deterministic test. 2025-01-14 14:21:29 -05:00
Steven Schveighoffer
6b914aef11 Zero out padding for 32-bit systems for large blocks. 2025-01-14 11:14:53 -05:00