Commit graph

61 commits

Author SHA1 Message Date
David Senoner
70e22d79a4 libc: delete superfluous c and assembly trunc implementations 2025-08-28 20:09:07 +02:00
David Senoner
f707de15a1 libc: delete superfluous c and assembly ceil implementation 2025-08-28 07:33:50 +02:00
David Senoner
9399fcddce libc: use zig isnan and derivates for mingw 2025-08-27 03:58:32 +02:00
David Senoner
b78751051f
delete superfluous assembly libc floor implementations 2025-07-04 20:05:18 +02:00
Alex Rønne Petersen
879bc2e5cb
mingw: Update MinGW-w64 sources to 38c8142f660b6ba11e7c408f2de1e9f8bfaf839e. 2025-06-11 18:27:15 +02:00
Alex Rønne Petersen
6671442a7c
mingw: Update MinGW-w64 definitions to 38c8142f660b6ba11e7c408f2de1e9f8bfaf839e. 2025-06-11 15:28:36 +02:00
Super User
7bc3f294ce Added zig patch comments to annotate the deletion of the sincos symbol 2025-06-02 14:05:03 +00:00
Koki Ueha
71ff3830df libc: replace MinGW's trigonometric functions with compiler_rt's
- sinf
- cosf
- sincos
- sincosf
- tanf
2025-06-01 11:25:51 +00:00
Alex Rønne Petersen
0cbff2ff7f mingw: Remove libscrnsav(e,w) support.
This defines a WinMain() function that can be potentially problematic when it
isn't wanted. If we add back support for this library in the future, it should
be built separately from mingw32.lib and on demand.
2025-05-30 01:03:47 +02:00
David
55848363fd
libc: implement common abs for various integer sizes (#23893)
* libc: implement common `abs` for various integer sizes

* libc: move imaxabs to inttypes.zig and don't use cInclude

* libc: delete `fabs` c implementations because already implemented in compiler_rt

* libc: export functions depending on the target libc

Previously all the functions that were exported were handled equally,
though some may exist and some not inside the same file. Moving the
checks inside the file allows handling different functions differently

* remove empty ifs in inttypes

Co-authored-by: Alex Rønne Petersen <alex@alexrp.com>

* remove empty ifs in stdlib

Co-authored-by: Alex Rønne Petersen <alex@alexrp.com>

* libc: use `@abs` for the absolute value calculation

---------

Co-authored-by: Alex Rønne Petersen <alex@alexrp.com>
2025-05-21 00:57:38 +02:00
Alex Rønne Petersen
8afe928b6e
mingw: Update MinGW-w64 sources to 3839e21b08807479a31d5a9764666f82ae2f0356. 2025-02-24 12:01:07 +01:00
Alex Rønne Petersen
8019694e17 mingw: Add upstream RtlSecureZeroMemory implementation.
Closes #22475.
2025-01-14 05:31:14 +01:00
Alex Rønne Petersen
45fff0a511
mingw: Update sources to dcd7fefc703fb4b12187235386900d34cc13fdc5. 2024-12-14 07:02:14 +01:00
Elaine Gibson
add74427b9 mingw: support -municode 2024-03-27 10:05:57 +00:00
Andrew Kelley
f47e92ca0d mingw-w64: update to latest master
upstream commit 0bac2d3cdb122dadcdee90009f7e24a69d56939f
2024-03-20 11:26:09 -07:00
Andrew Kelley
25fb6de83c mingw-w64: update to reflect latest tool changes
upstream commit dddccbc3ef50ac52bf00723fd2f68d98140aab80

closes #18968
2024-03-20 11:23:51 -07:00
Elaine Gibson
b126978555 mingw-w64: remove msvcrt sources 2024-01-20 00:21:34 +00:00
Elaine Gibson
bbecbaab0a mingw-w64: add missing CRT sources 2024-01-20 00:21:34 +00:00
Krzysztof Wolicki
78549d1e10 mingw: Add missing misc/mingw-access.c and misc/ucrt-access.c 2024-01-14 11:25:01 -08:00
Andrew Kelley
9a4a74eb65 mingw: remove pow.c from aarch64-windows mingw builds
I observed a duplicate symbol linker error; pow was defined both by
mingwex.lib and ucrtbase.dll.
2024-01-08 11:53:06 -07:00
Andrew Kelley
9df0177f33 mingw: add the mingw stdio functions back
We would rather use the ucrt for these, but sometimes dependencies on
the mingw stdio functions creep in. 仕方ない.

The cost is only paid if they are used; otherwise the symbols are
garbage-collected at link time.
2024-01-08 11:52:38 -07:00
Andrew Kelley
6405d37d9f add config.h 2024-01-08 11:52:38 -07:00
Andrew Kelley
c26bace606 mingw-w64: update CRT files to latest git commit
Upstream commit dddccbc3ef50ac52bf00723fd2f68d98140aab80

* adds ucrtbase.def.in
* mingwex: replace mingw crt files with ucrt files
* adds missing mingw-w64 ucrt files

The rules that govern which set of files are included or excluded is
contained in the logic for tools/update_mingw.zig
2024-01-08 11:52:38 -07:00
Andrew Kelley
94cee4fb27 mingw-w64: add shcore def files
these are copied from mingw-w64 v10.0.0
2023-11-02 12:20:09 -07:00
praschke
72a7e3dc5e mingw: stop using K&R-style function definitions
this patch is from upstream, to fix -Wdeprecated-non-prototypes issues.

K&R-style has apparently been deprecated since even C89, and C2x will be
repurposing the syntax space. this warning triggers when the change would
affect the meaning of the code.
2023-02-01 22:11:16 -05:00
Andrew Kelley
7350f0d9b5 mingw: add missing vscprintf.c file
closes #13733

Thanks to @kcbanner for finding this.
2022-12-28 12:33:55 -07:00
Andrew Kelley
02b221051a fix aarch64-windows-gnu libc
We were missing some math functions. After this enhancement I verified
that I was able to cross-compile ninja.exe for aarch64-windows and
produce a viable binary.
2022-12-10 03:06:17 -05:00
Andrew Kelley
6d999abba0 mingw-w64: add gdiplus def files
closes #13192
2022-10-30 19:04:00 -07:00
Andrew Kelley
e4ed8c3f37 update mingw-w64 crt files to v10.0.0 2022-10-11 01:05:42 -07:00
Andrew Kelley
fdc04101f3 mingw-w64: add wsock32 def files
closes #7877
2021-11-26 20:57:30 -07:00
Andrew Kelley
4cdf5b6662 mingw-w64: patch to silence implicit-function-declaration warnings
Closes #7356

I did this as a patch to the source rather than passing flags so that
it would intentionally be reverted when we update to the next release of
mingw-w64. At this time if any warnings are still emitted we should find
out why and make sure upstream is aware of the problem.
2021-11-26 20:34:01 -07:00
Andrew Kelley
b891ee1f23 mingw-w64: add glu32 def files
closes #9372
2021-11-25 18:41:07 -07:00
Michal Ziulek
e06052f201
Added implementation for _fseeki64 and _ftelli64 from mingw-w64 9.0.0 (#9402). (#9766)
* Added fseeki64.c from mingw-w64 9.0.0. This file was missing in Zig distribution. This file contains implementation for _fseeki64 and _ftelli64 functions.
2021-09-15 13:38:00 -04:00
Jonathan Marler
375619820e changes to build zig-bootstrap aarch64-windows 2021-09-07 14:27:50 -06:00
Jonathan Marler
fd2c1d8605
Fix building aarch64-windows-gnu by adding missing libc files and compiler_rt functions (#9555)
* fix issue 9519

Added some missing files from mingw

* add missing compiler_rt functions

* finish PR

* add aarch64-windows-gnu to test targets

* add more compiler_rt

* add log2

* add pow

* add modti3
2021-09-07 19:44:21 +03:00
Jonathan Marler
6c55d854cf Add compstui.def
The compstui library contains 4 Windows functions which were recently added to the win32metadta project.  I copied this def file from the mingw-w64 project.
2021-08-20 19:44:24 -04:00
Andrew Kelley
9d1fb98fa8 mingw-w64: add odbc32 and dbghelp def files
related: #9124
2021-07-10 13:27:24 -07:00
Andrew Kelley
6f4339be3a update mingw-w64 crt files to v9.0.0 2021-06-04 09:49:36 -07:00
Jonathan Marler
61bcac108c Add more mingw def files
I've added more of the ".def" files from mingw. The list is based on all the libraries referenced by the win32metadata project. (see https://github.com/marlersoft/zigwin32).
2021-02-10 13:38:16 -08:00
Christian Wesselhoeft
b3f4802aa0 mingw-w64: add .def files for xaudio2_8 2020-12-15 15:00:39 -05:00
Andrew Kelley
5b56f4e48a mingw-w64: add .def files for xinput1_4
closes #7398
2020-12-11 11:12:23 -07:00
Andrew Kelley
a1d3886ff0 mingw-w64: add support for -lwldap32
closes #7395
2020-12-11 00:50:28 -07:00
Andrew Kelley
7c93d9aacb mingw-w64: patch to silence implicit-function-declaration warnings
Closes #7356

I did this as a patch to the source rather than passing flags so that
it would intentionally be reverted when we update to the next release of
mingw-w64. At this time if any warnings are still emitted we should find
out why and make sure upstream is aware of the problem.
2020-12-09 16:12:03 -07:00
Andrew Kelley
58241364cb add more mingw-w64 .def files
closes #7268
2020-12-03 18:03:34 -07:00
Alexandros Naskos
3e1639c53b
Fixed mingw-w64 8.0.0 compilation
Reaplied mingw-w64 header patch
2020-11-05 20:04:25 +02:00
Alexandros Naskos
708962d51e
Updated mingw-w64 to version 8.0.0 2020-11-05 18:59:36 +02:00
LemonBoy
1b2d50737a mingw: Add user32.def for 32bit Windows
Closes #6479
2020-10-01 11:27:59 +02:00
Andrew Kelley
b3aef49eea
zig provides shlwapi.lib for *-windows-gnu
closes #3711
2020-04-08 01:21:00 -04:00
Andrew Kelley
fc662ddd54
mingw-w64: add 32-bit version.def
fixes -lversion on 32-bit windows builds
2020-04-06 20:31:00 -04:00
Andrew Kelley
9ed00b3829
provide ___mb_cur_max_func for i386-windows-gnu 2020-04-06 19:26:31 -04:00