Commit graph

568 commits

Author SHA1 Message Date
0-v-0
f727e7fb36
refactor nested reference checking (#16693) 2024-07-14 13:14:16 +08:00
Tim Schendekehl
845adf8e3c Fix bugzilla 24661 - wctype_t and wctrans_t are platform-dependent
The previous definitions are left as the default. They could still
be wrong on some other platforms.
2024-07-13 18:51:42 +02:00
Tim Schendekehl
5f4002ba5e
Fix bugzilla 24660 - atomic_wchar_t has wrong size on Posix (#16688) 2024-07-13 18:46:13 +02:00
Tim Schendekehl
67996abdc9
Compare type sizes in druntime with ImportC (#16571)
Types for bindings of C libraries in druntime need to match the
C headers. Small differences can result in hard to debug problems.

This test tries to automatically find types with a wrong size.
This is done by also getting type sizes from C headers using ImportC
and comparing them. Differences between the sizes can have different reasons:
* Bugs in ImportC (e.g. for bitfields) can result in a wrong size
* Type definitions in druntime can be wrong
* Different preprocessor options could be used, like _FILE_OFFSET_BITS
* Size differences can be fine, because some structs contain a member
    for the size or a version

Members of structs and unions with the same name are also compared.
For types with potential problems a comparison of the layout is printed.

The test contains a list of known problems, which are only treated as
warnings and not errors.
2024-07-08 10:39:36 +08:00
Denis Feklushkin
9d122f94cd
core.stdc.stdint: UINT_FAST*_MIN added (#16668) 2024-07-07 08:51:25 +08:00
0-v-0
4699dd273d
refactor _d_print_throwable() (#16666) 2024-07-06 10:28:37 +08:00
0v0
8f64141e75
simplify nested reference checking (#16656) 2024-07-04 22:56:43 +02:00
The Dlang Bot
66b93fc24a
Merge pull request #16642 from ibuclaw/merge_stable
merge stable

Signed-off-by: Nicholas Wilson <thewilsonator@users.noreply.github.com>
Merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>
2024-07-01 16:52:47 +02:00
Iain Buclaw
3c5d12bd1f Merge remote-tracking branch 'upstream/stable' into merge_stable 2024-07-01 13:58:42 +00:00
0v0
2700b86566
reduce duplicative code (#16640) 2024-07-01 11:47:17 +03:00
Johan Engelen
0c8e5b10a4 Remove never used functions from unwind.d
Note the X86_64 typo. These functions are never used in druntime, and if the typo is fixed, it adds two unused function _definitions_ to druntime. Let's not do that, and instead remove these function definitions all-together.
2024-06-30 23:17:53 +02:00
Johan Engelen
b5130fd880 Fix bugzilla issue 24623 followup.
Rename CppRuntime to _LLVM and _GNU
Also accept c++ for cxx in target string.
2024-06-30 13:45:31 +02:00
0-v-0
c29c71cb1e remove redundant static of enum 2024-06-28 06:45:27 +02:00
Johan Engelen
6b7c18d9a9 Add correct statvfs_t for Musl. 2024-06-27 01:20:37 +02:00
0-v-0
4e2417880c Fix bugzilla 24626 - hasUDA does not handle multiple UDAs of the same symbol 2024-06-25 04:07:35 +02:00
Johan Engelen
349b493810 Fix bugzilla issue 24623: Rename CppRuntime_Clang/Gcc to CppRuntime_libcpp/libstdcpp. Add libcpp and libstdcpp -target= option recognition. 2024-06-22 11:55:11 +02:00
ryuukk
9773c41a13
Mute noisy warnings (#16605) 2024-06-21 15:37:19 +02:00
Nick Treleaven
c6058f9b76
Fix Bugzilla 17148 - Copying from const(void)[] to void[] breaks immu… (#16583) 2024-06-17 17:11:52 +08:00
Tim Schendekehl
cba86d3ed9 Fix bugzilla 24579 - stat_t has wrong size for Android armv7a
Offsets in stat_t and dirent are 64-bit on Android, but 32-bit
for most other types on 32-bit architectures.

For comparison the headers can be seen here:
https://android.googlesource.com/platform/bionic/+/refs/heads/main/libc/include/sys/stat.h
https://android.googlesource.com/platform/bionic/+/refs/heads/main/libc/include/dirent.h

DMD does not support armv7a and does not run tests on Android. I have
only tested this patch with LDC for Android armv7a.
2024-06-16 00:32:18 +02:00
Martin Kinkelin
635aeb79c2 Android: Use rt.sections_elf_shared, not rt.sections_android
Android supports native ELF TLS since API level 29 (Android v10),
so we can use the generic rt.sections_elf_shared implementation now,
which among other things also enables *shared* druntime/Phobos libs.
2024-06-12 02:53:08 +02:00
Martin Kinkelin
6f20e8f9da Fix Bugzilla 24590 - Don't run module destructors if druntime failed to initialize 2024-06-11 15:51:17 +02:00
Iain Buclaw
9ca85e493d Merge remote-tracking branch 'upstream/stable' into merge_stable 2024-05-27 09:41:18 +00:00
Martin Kinkelin
e9f1e1dfa4 Remove some more OMF leftovers 2024-05-26 02:20:49 +02:00
Martin Kinkelin
801ad02294 druntime: Streamline make clean for integration tests
The 22 integration tests came with a mix of removing only ROOT
(generated/OS/BUILD/MODEL) or GENERATED (generated) subdirs as
part of their `make clean`.

And running `make clean` in the druntime dir only cleaned up the
default BUILD=release variant, while running `make unittest` without
explicit BUILD type includes running the integration tests in both
debug and release variants.

Streamline/fix this to always cleaning up ROOT, and running `make clean`
in both variants when running druntime's `make clean`.
2024-05-25 22:56:15 +02:00
The Dlang Bot
97dc44aa76
Merge pull request #16521 from kinke/rm_cruntime_dm
Get rid of obsolete `{C,Cpp}Runtime_DigitalMars` special cases

Signed-off-by: Dennis <dkorpel@users.noreply.github.com>
Signed-off-by: Nicholas Wilson <thewilsonator@users.noreply.github.com>
Merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>
2024-05-25 22:14:39 +02:00
Martin Kinkelin
47771d49fd Get rid of obsolete DMC special cases 2024-05-25 19:34:44 +02:00
Martin Kinkelin
01c9c22f3f Get rid of obsolete CppRuntime_DigitalMars special cases 2024-05-25 18:58:37 +02:00
Martin Kinkelin
6d69608aae Get rid of some obsolete optlink workarounds 2024-05-25 18:07:16 +02:00
Martin Kinkelin
920678a820 Revise remaining 32{omf,mscoff} usages 2024-05-25 16:35:11 +02:00
Martin Kinkelin
f08bbff91f Get rid of obsolete CRuntime_DigitalMars special cases 2024-05-25 15:17:31 +02:00
Johan Engelen
673ddf38bc
Only test druntime exceptions gdb test case (rt_trap_exceptions_drt_gdb) when gdb is available. (#16513) 2024-05-20 06:17:23 +08:00
Johan Engelen
cc66e60109
Fix bugzilla 24546 for musl libc (#16507) 2024-05-19 18:09:09 +08:00
Nick Treleaven
05bf50a59c
[core.attribute] Add cheat sheet links (#16457)
* [core.attribute] Add cheat sheet links

* Stray `)`

* Fix row macro

* Add links
2024-05-08 14:55:21 +03:00
Johan Engelen
1beaeff0c3
Fix alignment of calloc memory in rt.dwarfeh (#16446)
The signature of calloc is `void* calloc( size_t num, size_t size )`, where `num` is the number of objects and `size` is the byte size per object. (https://en.cppreference.com/w/c/memory/calloc)
The number of bytes allocated is the same with this fix, but it solves potential memory alignment issues.
2024-05-07 08:02:47 +08:00
zopsicle
5eb426e588 Add module core.sys.linux.sys.mount
The new module core.sys.linux.sys.mount provides definitions corresponding to
those in the header <sys/mount.h> on Linux.
2024-05-07 02:02:11 +02:00
dokutoku
748fab1e02
Fix some invalid links (#16424)
Co-authored-by: dokutoku <3729541-dokutoku@users.noreply.gitlab.com>
2024-04-30 10:20:07 +03:00
Sönke Ludwig
78e4d93498 Fix linker symbol clash for Android libc++.
This adjusts the constructor to be extern(D), analogous to the other C++ exception class definitions.

See ldc-developers/ldc#4634
2024-04-29 23:27:50 +02:00
Nick Treleaven
e60bfd11bd
Fix Bugzilla 24434 - Casting away const with cast() is not a @safe lv… (#16315)
* Fix Bugzilla 24434 - Casting away const with cast() is not a @safe lvalue

* Use `pointerTo`

* Use cast to hide lvalue append error

* Fix unsafe shared increment

* Use setUnsafePreview

* Add test for lvalue assign

* Fix qualifier cast check

* Workaround for safe append

Fixes Bugzilla 23530 - casting immutable away allowed in safe.

* Update header

* Trigger tests
2024-04-28 22:44:48 +08:00
chloekek
ab7f6e65a5
Mark Thread.sleep as @trusted (#16411)
I am fairly convinced that no possible arguments to or global state at the time
of any call to Thread.sleep can result in memory corruption.

There is a precondition on Thread.sleep, that the duration must be
non-negative. On Windows, Thread.sleep calls Sleep, which takes an unsigned
integer. On POSIX, Thread.sleep calls nanosleep, which is specified to handle
negative durations gracefully. As such, violating this precondition should not
be a source of undefined behavior.
2024-04-26 10:57:35 +03:00
Walter Bright
f1d38e40cc
add const to toHash() overrides (#16414) 2024-04-25 17:57:35 -07:00
Dennis Korpel
33c32407c0 Merge branch 'stable' into merge-stable 2024-04-23 14:44:01 +02:00
Steven Schveighoffer
aec16d889c
Remove the interface function fullCollectNoStack from the gcinterface (#16401)
* Remove the interface function fullCollectNoStack from the gcinterface

* Fix tests that depend on the GC not scanning the stack.

* Remove all nostack remnants

* Add changelog entry
2024-04-23 15:06:21 +08:00
Jonathan M Davis
757ba61fea Fix bugzilla issue 24517: druntime tests crash on FreeBSD 14
FreeBSD 14 changed the signature of qsort_r to be POSIX-compliant with
POSIX, making it so that our binding for it no longer matches, resulting
in a crash when it's used.

This implements a fix similar to what the FreeBSD headers do to avoid
breaking code (they provide a static inline extern(C++) overload for the
old signature). This provides a deprecated extern(D) overload for the
old signature. The extern(C) overload now matches the new signature. The
changes have been versioned so that they only affect FreeBSD 14 and
newer.

Technically, if someone used Cmp when declaring their function for
qsort_r, this would still break them (though with a compilation error
that should be easy to fix rather than silent breakage or a crash), but
I don't really see a way around that, and Cmp is not part of the POSIX
API, so no one would have a clue that it was a thing without digging
through the bindings. Arguably, we should make it private, since it's
not part of POSIX, but I haven't done anything with that in this commit.
My guess is that in reality, no D programs are both written to use
qsort_r and run on FreeBSD (outside of the druntime tests), but this
way, they won't break unless they use Cmp to declare their comparator
function. They'll just get a deprecation message that they should update
their code.

Regardless, we have to change the signature for FreeBSD 14 for it to
work, and this does that.
2024-04-22 17:16:36 +02:00
Ferhat Kurtulmuş
d61f72cbdc
Fix bugzilla 24509: importC cannot handle _stdcall Function Calling … (#16392)
* Fix bugzilla 24509: importC cannot handle _stdcall Function Calling Convention with single heading underscore
2024-04-21 11:30:22 +08:00
Matheus C. França
b31aa942a2
fix: mmap64 error (#16361)
ref.: https://git.alpinelinux.org/aports/tree/community/ldc/lfs64.patch
2024-04-15 19:39:11 +02:00
FeepingCreature
a9c8648f17 Fix Bugzilla 24436: array-of-array-of-NOSCAN falsely marked as NOSCAN. 2024-04-13 14:59:41 +02:00
Jonathan M Davis
e9c6884046 Add mqueue declarations for FreeBSD.
The glibc declarations are unchanged, but they had to be put in a proper
version block instead of using : with the version statement.
2024-04-06 14:50:47 +02:00
Iain Buclaw
f2b61e6c48 Merge remote-tracking branch 'upstream/stable' into merge_stable 2024-04-01 20:58:54 +00:00
Denis Feklushkin
8272384b3e
enum PAGESIZE eliminated inside of unittest (#16351)
Co-authored-by: Denis Feklushkin <feklushkin.denis@gmail.com>
2024-04-01 22:20:39 +08:00
Walter Bright
f99dcb5dd7 fix versions in core.stdc.limits.d 2024-03-31 08:30:32 +02:00