Commit graph

569 commits

Author SHA1 Message Date
Walter Bright
f99dcb5dd7 fix versions in core.stdc.limits.d 2024-03-31 08:30:32 +02:00
FeepingCreature
9333bfc256
Fix Bugzilla issue 24452: Add --DRT-covopt="disable:1" to suppress writing coverage at runtime. (#16336)
This is useful if you don't want to rebuild a binary just to have coverage on or off.
2024-03-30 21:59:13 +01:00
Martin Kinkelin
2c1deeced9 Fix Bugzilla Issue 24453 - idup fails for inout(T)[] slices 2024-03-27 10:38:07 +01:00
liushuyu
496c87688a fiber: add the support for MIPS64 N64 ABI 2024-03-23 23:39:30 +01:00
Dennis Korpel
271f09ee46 core.runtime: Use new alias syntax 2024-03-21 22:20:39 +01:00
Walter Bright
2fddac39b8
rename __builtins.di to __importc_builtins.di (#16317) 2024-03-20 20:48:42 -07:00
Iain Buclaw
e362917ac6 Merge remote-tracking branch 'upstream/stable' into merge_stable 2024-03-16 01:17:16 +00:00
Martin Kinkelin
5d4f4e11b4 GHA Windows: Make sure building compiler/druntime/Phobos does NOT need an MSVC env anymore
After #16248.
2024-03-04 10:52:02 +08:00
Martin Kinkelin
5afa86aa7b druntime: Fix outdated signatures in onOutOfMemoryError() fwd declarations 2024-03-04 10:50:36 +08:00
Iain Buclaw
53cd4b7c30 Merge remote-tracking branch 'upstream/stable' into merge_stable 2024-03-01 23:11:59 +00:00
Jonathan M Davis
2f7b37c79e Fix bugzilla issue 24417: fds_bits named incorrectly on FreeBSD
This fixes the name of fds_bits on FreeBSD - or actually, on all of the
BSDs listed in select.d. The way that they're declared in C is with a
member named __fds_bits and then a #define for fds_bits. The D
declarations managed to copy the struct declarations with the __ name
but didn't add aliases to correspond to the #defines.

The standard name is fds_bits and is what any user code should be using,
so I don't see any reason to have the __ versions other than to avoid
breaking any code that used the __ versions, because that's what was
there. So, I fixed the names and added deprecated aliases for the old
ones.
2024-02-28 06:27:10 +01:00
Jonathan M Davis
40b60f8f97
Fix Bugzilla issue 24404 - ifaddrs union fields incorrectly name on Linux. (#16233)
You can see the correct declaration for ifaddrs on Linux here:

https://www.man7.org/linux/man-pages/man3/getifaddrs.3.html

What the fields are supposed to be named is ifa_broadaddr and
ifa_dstaddr. However, because Linux defines them using a union, it gives
them different names within the union - ifu_broadaddr and ifu_dstaddr -
and then #defines the proper names to access the union names.

What druntime did was use the union names - and then incorrectly name
ifu_dtsaddr as if_dstaddr. So, it was doubly wrong for that field.

The two approaches that we could take here would be to either

1. Turn the union into a type so that we could have an ifa_ifu field to
   allow accessing the ifu_* names that way - as is technically possible
   in C - and then add wrapper functions with the ifa_* names (since we
   couldn't use an alias to access members of the union member
   variable).

2. Just rename the fields to ifa_* and ignore the fact that you can
   technically access the ifu_* fields via the union name in C.

The simpler approach is #2, so that's what this commit does. I'm pretty
sure that the ability to access the ifu_* fields via the union name is
just an implementation detail - particularly since other platforms just
declare the ifa_* names without using a union at all.

Either way, deprecated aliases are provided so that existing code
doesn't break.
2024-02-26 12:23:52 +02:00
Jonathan M Davis
17293af33a Add core.sys.freebsd.net.if_.
https://cgit.freebsd.org/src/tree/sys/net/if.h?h=stable/14
2024-02-24 16:25:15 +08:00
Jonathan M Davis
7cb2d6a109 Fix bugzilla issue 24408 - Remove duplicate AF_INET6 declaration.
It's already declared in core.sys.posix.sys.socket, so declaring it in
core.sys.linux.sys.socket causes a conflict in code that imports both.

The Linux-specific module publicly imports the POSIX one, so the
declaration in the Linux one is unnecessary. This removes it.
2024-02-24 16:24:09 +08:00
Jonathan M Davis
3476a0403c Fix Bugzilla issue 24405 - FreeBSD's ifaddrs missing the ifa_broadaddr field.
FreeBSD #defines ifa_broadaddr to be ifa_dstaddr, and I missed it when
adding it to druntime. So, this adds the appropriate alias.

It does feel a bit weird to list the alias before the field that it's
aliasing, but that's the order presented in the man page, so it's what I
did.
2024-02-23 17:54:06 +08:00
Iain Buclaw
6f2a6f919d Fix Bugzilla 23517 - dmd with -g flag fails to link on macOS with unaligned pointer 2024-02-22 14:52:34 +01:00
Denis Feklushkin
706fc0587d powerpc64-darwin regression fix 2024-02-20 22:16:09 +01:00
Tim Schendekehl
6a2fe78ba4
Fix Bugzilla 20802 - Link failure with writefln (#16200)
The issue is caused by compiling druntime/phobos and the application
with different flags. The template instance for __switch_errorT is not
included in the build of druntime/phobos, because they are compiled
with -release. DMD will also not include it in an application compiled
without -release, because it assumes, that it is already in druntime.
See comment https://issues.dlang.org/show_bug.cgi?id=20802#c3 by Spoov.

The template instance for __switch_errorT is now always instantiated in
druntime, so it is part of the ABI of druntime.
2024-02-19 06:35:00 +08:00
Denis Feklushkin
1878df0e3f
core.thread.fiber uses more abstract ThreadBase rather than osthread (#16148)
Co-authored-by: Denis Feklushkin <feklushkin.denis@gmail.com>
2024-02-15 12:42:05 +02:00
Steven Schveighoffer
bb6766a6ec
Change toString implementations to a common "get empty string" (#16185)
implementation, to avoid needless bloat.
Change the literal toString to a static member, to allow calling at
compile-time.
2024-02-14 14:24:24 +08:00
The Dlang Bot
8ab0636400
Merge pull request #16144 from denizzzka/non_windows_non_posix_asserts_pr
Adds "Unsupported platform" static asserts

Signed-off-by: Nicholas Wilson <thewilsonator@users.noreply.github.com>
Merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>
2024-02-09 03:32:15 +01:00
The Dlang Bot
51802e8db3
Merge pull request #16037 from kinke/druntime_test_shared_win
druntime: Prepare `test/shared` for Windows support

Signed-off-by: Nicholas Wilson <thewilsonator@users.noreply.github.com>
Signed-off-by: Rainer Schuetze <rainers@users.noreply.github.com>
Merged-on-behalf-of: Martin Kinkelin <kinke@users.noreply.github.com>
2024-02-08 02:45:26 +01:00
Rainer Schuetze
aca5ba63b0 pass -visibility=public for SHARED=1 2024-02-08 00:13:08 +01:00
Denis Feklushkin
6f9c6bf9d4
Introduce version() which disables memory-greedy unittests (#16141)
* OnlyLowMemUnittests version disables memory-greedy unittests

* Comment for OnlyLowMemUnittests version

---------

Co-authored-by: Denis Feklushkin <feklushkin.denis@gmail.com>
2024-02-06 11:12:19 +01:00
Iain Buclaw
5eaf89813b Fix IsAtomicLockFree for PPC targets
The GNU built-in __atomic_is_lock_free either returns 'true' (always
lock free) or 'null' (meaning defer to run-time). So when the type isn't
always lock free - eg: 64-bit types on PPC - a compile-time error occurs
as we have no way of evaluating the run-time implementation of
libatomics at CTFE.

This has been fixed by checking `__traits(compiles)` instead.
2024-02-06 01:24:56 +01:00
Martin Kinkelin
f62c501099
Revert "Remove some errStatus parameters from Demangle (#16122)" (#16147)
This reverts commit ebd2d81081.

It appears to have broken `runnable/testprofile.d` rather consistently
for Windows CI, with weird OutOfMemoryErrors.
2024-02-05 12:27:00 +02:00
Martin Kinkelin
29aecdd375 [nits after rebase] 2024-02-04 15:50:50 +01:00
Rainer Schuetze
ab45c7762c Fix Bugzilla issue 24309 - Memory allocation failed on Azure pipeline
ignore spurious out-of-memory errors, the test is about something else
2024-02-04 13:18:01 +01:00
Rainer Schuetze
e2a5c72a74 test/shared for windows:
- add -visibility=public when building DLLs
- use -dllimport=all to simplify building exe
- enable tests link linkD linkDR loadDR
2024-02-04 10:49:55 +01:00
Martin Kinkelin
2f8041fff5 druntime: Prepare test/shared/Makefile for broader Windows support 2024-02-04 10:49:54 +01:00
Martin Kinkelin
520240e312 druntime: Prepare test/shared source files for Windows support
Upstreaming from LDC.
2024-02-04 10:48:47 +01:00
Denis Feklushkin
26a4e395e8 Unsupported platform static asserts 2024-02-04 03:59:50 +03:00
Iain Buclaw
90e32a79d4
Update constraints of GNU atomicExchange to match DigitalMars (#16142) 2024-02-04 08:55:27 +08:00
Denis Feklushkin
6ab24771f0
qsort debug output fix (#16140)
Co-authored-by: Denis Feklushkin <feklushkin.denis@gmail.com>
2024-02-04 08:10:24 +08:00
Dennis
c5c4def18f
core.demangle: refactor errMsg assignment to a function (#16132) 2024-02-01 17:55:24 +01:00
Dennis
c00b42d4a6
core.demangle: Fix array out of bounds with many hex float digits (#16129) 2024-02-01 19:50:44 +08:00
Dennis
ebd2d81081
Remove some errStatus parameters from Demangle (#16122)
* Add hasErrors

* Remove various errStatus vars
2024-02-01 10:23:02 +02:00
Dennis
95f1895129
core.demangle: refactor superfluous mixin use (#16120) 2024-01-31 14:50:37 +01:00
Denis Feklushkin
8fb2b20339
Fix Bugzilla 15504 - core.demangle: exceptions gone from normal control flow (#16114)
Fix Bugzilla 15504 - core.demangle: exceptions gone from normal control flow

Signed-off-by: Dennis <dkorpel@users.noreply.github.com>
Signed-off-by: Razvan Nitu <razvan.nitu1305@gmail.com>
Merged-on-behalf-of: Razvan Nitu <razvan.nitu1305@gmail.com>
2024-01-31 11:23:31 +01:00
Denis Feklushkin
e89f319657
demangle: minor changes for clarity (#16112)
demangle: minor changes for clarity

Signed-off-by: Dennis <dkorpel@users.noreply.github.com>
Merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>
2024-01-30 01:13:02 +01:00
The Dlang Bot
15ca454e80
Merge pull request #16104 from denizzzka/avoid_overflow_ex_pr
Partial fix Bugzilla 15504 - core.demangle: remove OverflowException

Signed-off-by: Dennis <dkorpel@users.noreply.github.com>
Signed-off-by: Razvan Nitu <razvan.nitu1305@gmail.com>
Merged-on-behalf-of: Razvan Nitu <razvan.nitu1305@gmail.com>
2024-01-29 14:34:24 +01:00
Denis Feklushkin
3223dfb77a formatting 2024-01-29 13:48:12 +03:00
Denis Feklushkin
e0f629d9a8 Erroneous isNull() removed 2024-01-29 13:42:37 +03:00
Denis Feklushkin
aa753ae308 bslice_empty() returns BufSlice with dst == null to prevent accidental slice usage 2024-01-29 13:36:11 +03:00
The Dlang Bot
b426fd9b35
Merge pull request #16091 from denizzzka/mmap_pr
fiber: Fixes mem allocation call status code ambiguity

Signed-off-by: Razvan Nitu <razvan.nitu1305@gmail.com>
Merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>
2024-01-29 04:53:18 +01:00
Iain Buclaw
b514d89f9e Merge remote-tracking branch 'upstream/stable' into merge_stable 2024-01-28 00:17:46 +00:00
Denis Feklushkin
cb973ec8f9 Partially fix 15504 - core.demangle: remove OverflowException 2024-01-28 00:52:44 +03:00
Teodor Dutu
1778ab8876
core.internal.array: Replace _d_newarrayU with template in _dup (#16097)
- Only use the `pure nothrow` wrapper `_d_newarrayUPureNothrow` for the
`pure nothrow` `_dup`
- Unqualify the template type given to `_d_newarrayU`. The initial
template was relying on this unqualification being done by the compiler,
but now it's called from `_dup`
- Fix `TypeInfoSize` to only account for type `struct`s
- Cannot remove `_d_newarray{iT,T,U}` from `rt.lifetime` because they're used by `aaA.d`

Signed-off-by: Teodor Dutu <teodor.dutu@gmail.com>
2024-01-27 16:12:02 +02:00
Denis Feklushkin
7d85d1b511
debug(MARK_PRINTF) compilation fix (#16095)
Co-authored-by: Denis Feklushkin <feklushkin.denis@gmail.com>
2024-01-25 15:13:27 +02:00
Denis Feklushkin
0064bc895d Memory DEallocation call without static condition 2024-01-24 23:47:52 +03:00