Commit graph

536 commits

Author SHA1 Message Date
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
Steven Schveighoffer
76fb1c03f2 Fix issue with appending zero items to an array that was previously
handled by allocating an empty array with metadata!
2025-01-14 10:20:55 -05:00
Steven Schveighoffer
d370a117b4 Remove almost all blockmeta/cache functionality from rt, using the GC
API instead.
2025-01-14 09:49:03 -05:00
Walter Bright
d6f693b46a
fix #20516 ImportC undefined identifier _Float16 (#20699) 2025-01-14 15:14:28 +08:00
0-v-0
b2c4f89d53 Remove redundant else 2025-01-14 08:11:48 +01:00
Steven Schveighoffer
b711f1ac89 Fix custom_gc to avoid alignment issues on platforms where alignment
matters.
2025-01-13 20:29:49 +01:00
Nicholas Wilson
4ad3fc7942
Fix #20691 - Add SO_REUSEPORT for Solaris (#20692) 2025-01-13 20:06:12 +08:00
Nicholas Wilson
6455cb27ef
Fix #20688 SO_REUSEPORT not defined (#20689) 2025-01-13 16:38:19 +08:00
0-v-0
0ee5b318b3 Remove redundant else 2025-01-11 17:09:54 +08:00
Iain Buclaw
126064282f core.builtins: Fix return value of likely/unlikely
For both GCC and LLVM, `__builtin_expect` and `llvm_expect` respectively
return an integer, not a boolean. This triggers a compiler error as
implicit narrow conversions are not allowed.
2025-01-11 07:48:33 +08:00
Dennis
eb910dc865
Make likely and unlikely templates (#20680) 2025-01-10 23:57:03 +01:00
Dennis
e9ae684df5
Merge pull request #20663 from Reavershark/fix-late-linux-version
Place the `version(linux):` in `core.sys.linux.sys.procfs` higher.
2025-01-08 23:28:44 +01:00
Jonas Meeuws
21af76d40d
Place the version(linux): in core.sys.linux.sys.procfs higher. 2025-01-08 21:49:00 +01:00
Jonas Meeuws
5b39097ef8
Fix building druntime with all -debug= flags on non-linux-amd64 platforms 2025-01-08 21:24:25 +01:00
Jonas Meeuws
b985f8cb3a
Fix building druntime with all other -debug= flags 2025-01-08 21:24:25 +01:00
Jonas Meeuws
9d978fddb9
Fix building druntime with -debug=PRINTF 2025-01-08 21:24:25 +01:00
Jonas Meeuws
999454ec91
Replace remaining github links with $(DRUNTIMESRC) in module ddocs 2025-01-08 15:20:17 +01:00
Jonas Meeuws
c0fb282be9
Use selective imports when importing platform-specific modules (core.sys) (#20632) 2025-01-08 08:57:39 +08:00
Jonas Meeuws
9c350031c7
Fix invalid "Source: " links in druntime module ddocs 2025-01-07 10:54:00 +01:00
Steven Schveighoffer
bc773a3369
Update docs for new gc array interface. (#20633) 2025-01-05 18:51:10 +08:00
Elias Batek
1a15d20a8a
Prevent core.internal.traits.AliasSeq from bleeding through core.time (#20638)
Workaround for:

- <https://github.com/dlang/dmd/issues/18223>
- <https://github.com/dlang/phobos/issues/10610>
2025-01-05 18:50:19 +08:00
Steven Schveighoffer
caad83f773 Add GC handling of metadata based on passed in typeinfo and bits. 2025-01-04 23:33:45 -05:00