Commit Graph

297 Commits

Author SHA1 Message Date
Eric Miotto
403ccd4072 Extend freestanding to support targeting Darwin platforms (#40202)
* add an option to add freestanding to the Darwin platform, so that
  to get expected compile behaviours (e.g. setting the install name)
* rework testing configuration to relax assumptions about freestanding
* add a preset to test such configuration (at least for PR testing)

Addresses rdar://85465396
2021-12-08 07:09:44 -08:00
Erik Eckstein
77d421cbcd cmake: fix a typo in the libswift Debug bootstrapping build 2021-11-30 16:54:28 +01:00
Erik Eckstein
61db072617 cmake: fix libswift build dependencies
Unfortunately using the convenient "bootstrapping0-all", etc. custom targets does not work.
For some reason it does not cause a dependent file (like libswift's SIL.o) being rebuilt when a depenency (like swift-frontend from the previous bootstrapping stage) changes.
Instead we have to list al library- and executable-targets explicitly.
2021-11-23 18:33:43 +01:00
Erik Eckstein
e30688da82 libswift: fix dependencies in the bootstrapping build mode
swiftDarwin and swiftOnoneSupport  didn't depend on building the Swift core library.
This was a subtle bug, because the compiler just picked up the module from the SDK instead of the (still building) Swift module.
It only resulted in compiler errors if the SDK swiftinterface was too new to be parsable by the compiler.
2021-11-05 18:33:21 +01:00
Erik Eckstein
78c4c3ff6d libswift: fixes for the linux bootstrapping build 2021-10-29 08:56:02 +02:00
Erik Eckstein
4383610ed3 cmake: some fixes for the libswift bootstrapping build
* fix a typo which prevented linking the right bootstrapping libs
* build swiftDarwin for bootstrapping
* disable COW checks if built with bootstrapping-with-hostlibs
2021-10-19 13:10:59 +02:00
Kuba (Brecka) Mracek
c2c1bfb053 Add SWIFT_STDLIB_HAS_ENVIRON to remove usage of getenv/environ from stdlib (#39599) 2021-10-12 07:16:36 -07:00
Max Desiatov
f34e321444 WebAssembly: add WASI cases to POSIXErrorCode enum (#39482)
These new cases match WASI-libc declarations at https://github.com/WebAssembly/wasi-libc/blob/ad513341/libc-bottom-half/headers/public/wasi/api.h#L106
2021-09-28 19:26:25 +01:00
Kuba (Brecka) Mracek
8b189d99e4 Turn off SWIFT_ENABLE_REFLECTION on the stdlib_minimal preset (#39030) 2021-09-12 18:54:53 -07:00
Kuba (Brecka) Mracek
750ba09ef4 Introduce SWIFT_FREESTANDING_FLAVOR to select whether the FREESTANDING stdlib should be built/tested using an Apple SDK, or another SDK (e.g. Linux, not implemented yet) (#34450) 2021-08-19 15:56:04 -07:00
Alex Taffe
715f1ecbcd Move WinUSB out of OS core 2021-05-25 09:07:11 -04:00
Alex Taffe
7ea15d5664 Fix typo 2021-05-24 17:16:07 -04:00
Alex Taffe
9a4a6d4587 Add winusb.h support 2021-05-24 17:13:22 -04:00
Saleem Abdulrasool
73edf071b5 Platform: correct link dependency for WinSDK.User
Add the User32 link dependency for uses of the User module.
2021-03-18 11:06:27 -07:00
Saleem Abdulrasool
621a4207f8 Platform: link against ComCtl32 when using Common Controls
This adds a missing link directive to the ComCtl32 module.  This allows
use of the module without requiring the user to explicitly add the
linked library to the target when building code against this module.
2021-02-27 12:28:45 -08:00
Saleem Abdulrasool
66a9ae44b4 Platform: add dxgidebug.h to _DXGI module
The debug header is used for enumeration of certain DXGI interfaces
related to debugging of the pipeline.  Add this to gain access to the
interfaces and some of the global GUIDs associated with it.
2021-01-27 09:53:04 -08:00
Saleem Abdulrasool
997cb0f671 Platform: add HLSL compiler to the WinSDK modulemap
The DirectX subsystem may require access to the HLSL compiler for
building the shaders before uploading to the GPU.  This is adds to the
modulemap the D3DCompiler module to get access to the compiler.
2021-01-24 13:10:54 -08:00
Saleem Abdulrasool
4084f7a5a6 Platform: add dxgi1_6 to the Direct3D module
There is no usermode header which has the DXGI1.6 interfaces included
unfortunately.  This adds the interfaces to the module which is required
for IDXGIAdapter4 interface.
2021-01-23 12:41:20 -08:00
Saleem Abdulrasool
e508b1ab14 Platform: extend the D3D v10 module
Add the extensions for the Direct3D v10 API to enable access to the
newer DXGISwapChain interfaces.  Additionally, correct the linking to
ensure that we pick up the v10 version of the import library.
2021-01-21 08:46:47 -08:00
Saleem Abdulrasool
86a8b1b4dc Platform: add Direct3D11 module
This adds the Direct3D v11 module for Windows.  This is required to gain
access to the DXGI interfaces, which homes the DXGISwapChain interface.
2021-01-20 15:28:27 -08:00
martinboehme
c5b7e7fb9c Fix two issues with the SwiftGlibc module map (#32404)
* Fix two issues with the SwiftGlibc module map.

The issues are:

- Today, some submodules in `SwiftGlibc` fail to provide definitions that
  they should contain. As a consequence, Swift fails to import some code
  that compiles correctly with standalone Clang. As just one example,
  including `signal.h` should make the type `pid_t` available, but it
  currently does not.

- `SwiftGlibc` is not compatible with the libc++ module map. Trying to
  include libc++ headers in a C++ module imported into Swift results in an
  error message about cyclic dependencies.

This change fixes both of these issues by making it so that `SwiftGlibc`
no actually longer defines a module map for the glibc headers but merely makes
all of the symbols from those headers available in a module that can be
imported into Swift. C / Objective-C / C++ code, on the other hand, will now
include the glibc headers texually.

For more context on the two issues and this fix, see this forum
discussion:

https://forums.swift.org/t/problems-with-swiftglibc-and-proposed-fix/37594

This change only modifies `glibc.modulemap.gyb` for the time being but
leaves `bionic.modulemap.gyb` and `libc-openbsd.modulemap.gyb` unchanged. The
intent is to fix these in the same way, but it will be easier to do this
in separate PRs that can be tested individually.

Co-authored-by: zoecarver <z.zoelec2@gmail.com>
Co-authored-by: Marcel Hlopko <hlopko@google.com>
2021-01-11 14:25:41 +01:00
Saleem Abdulrasool
fc8cd455d0 Platform: add ActiveX module
Add the ActiveX module to the Windows SDK.  This is needed for the
IPropBag2 interface.
2021-01-09 15:18:16 -08:00
Saleem Abdulrasool
5bfbaadb43 WinSDK: use xinput instead of xinputuap
The UAP variant is included into the WinSDK module which then fails to
run.  Adjust the linkage.
2021-01-08 17:27:26 -08:00
Saleem Abdulrasool
715d81cf26 Platform: add a cplusplus requirement to XAudio
In some cases when building the `XAudio` module, we would end up going
down C++ paths:

```
C:\Program Files (x86)\Windows Kits\10\/Include/10.0.17763.0/um/xaudio2.h:61:26: error: 'uuid' attribute is not supported in C
    interface __declspec(uuid("2B02E3CF-2E0B-4ec3-BE45-1B2A3FE7210D")) IXAudio2;
                             ^
<module-includes>:29:10: note: in file included from <module-includes>:29:
         ^
```

Although this works with newer SDKs, it does not work with older SDKs.
Filter out the module for the time being with a requirement on `C++`.
This should be possible to use with `-enable-cxx-interop`.
2021-01-05 14:47:02 -08:00
Saleem Abdulrasool
96b6760276 Merge pull request #35249 from egorzhdan/winsdk-xaml
WinSDK: add XAML hosting submodule
2021-01-05 08:49:24 -08:00
Egor Zhdan
6970054b63 WinSDK: add XAML hosting submodule
This exposes `IDesktopWindowXamlSourceNative` interface, which is used for embedding WinUI XAML controls into Win32 apps
2021-01-02 17:04:14 +03:00
Saleem Abdulrasool
c5bc227ac7 Platform: add DirectX mappings
Add the module definitions for:
- Direct3D v12
- XAudio 2.9
- XInput 1.4

Additionally, add the following, unusable modules:
- DXCore

DXCore requires C++ Support (C++11 or newer to be precise) and is not
yet available until C++ interop can be made to work fully.
2021-01-01 10:41:24 -08:00
stevapple
281ae3c2a6 Add WinSDK.WinSafer 2020-12-21 22:44:28 +08:00
Saleem Abdulrasool
21542b74d2 Merge pull request #34572 from egorzhdan/visualc
VisualC: remove unnecessary submodule
2020-11-17 08:45:00 -08:00
Saleem Abdulrasool
760a4e4951 Platform: add SensorsAPI to the WinSDK modulemap
The SensorsAPI headers are not part of the Windows umbrella header and
do not get pulled into the module through some transitive set.
Explicitly list the SensorsAPIs contract into the WinSDK modulemap to
allow use of the api contract from Swift.
2020-11-11 08:27:02 -08:00
Saleem Abdulrasool
67aef95f62 platform: add WIC (Windows Imaging Component) to the SDK
The Windows Imaging Component does not get included by any of the other
headers.  Explicitly add a submodule for the component.
2020-11-05 10:23:12 -08:00
Egor Zhdan
d93bf20283 VisualC: remove unnecessary submodule
`vadefs.h` is provided by clang, there should be no need to have it in visualc as well
2020-11-03 23:14:49 +03:00
Saleem Abdulrasool
62d788c08d stdlib: add AppNotify.h to the Shell module
This header is a standalone header part of the shell subsystem which
allows application to get notification related to application
suspension.
2020-11-02 22:24:53 -08:00
Kuba (Brecka) Mracek
d7dfa3e942 Bring up tests + validation tests for the 'freestanding' build and the standalone_minimal preset (#34386) 2020-10-26 16:32:36 -07:00
Egor Zhdan
246fe46aa7 Merge pull request #34422 from egorzhdan/winsdk
WinSDK: prevent windows.h from hijacking imm.h
2020-10-24 22:38:00 +03:00
Saleem Abdulrasool
74144e4788 Platform: extract WLANAPI module on Windows
The WLAN APIs are used for the native WiFi implementation and is not as
generally useful.  Extract it into a submodule.
2020-10-21 11:33:15 -07:00
Saleem Abdulrasool
09fc82aac3 Merge pull request #34299 from compnerd/i-dont-visual-c-you
stdlib: remove `swiftMSVCRT`, replace with `swiftCRT` on Windows
2020-10-20 11:05:03 -07:00
Egor Zhdan
a4a1ff6442 WinSDK: prevent windows.h from hijacking imm.h
Both `immdev.h` & `windows.h` include `imm.h`, and sometimes this header gets assigned to the module containing `windows.h` (currently `WinSDK.WinSock2`) instead of the Internationalization submodule
2020-10-18 15:14:09 +03:00
Saleem Abdulrasool
a757d7bd5c Merge pull request #34344 from egorzhdan/winsdk
WinSDK: extract System.MCX submodule
2020-10-17 18:25:07 -07:00
Egor Zhdan
e893ecfaf0 WinSDK: extract System.MCX submodule
Currently this header gets included into `WinSDK.WinSock2` via `windows.h`
2020-10-17 18:08:24 +03:00
Saleem Abdulrasool
2fc5cbdc14 stdlib: remove swiftMSVCRT, replace with swiftCRT on Windows
This replaces swiftMSVCRT with swiftCRT.  The big difference here is
that the `visualc` module is no longer imported nor exported.  The
`visualc` module remains in use for a singular test wrt availability,
but this should effectively remove the need for the `visualc` module.

The difference between the MSVCRT and ucrt module was not well
understood by most.  MSVCRT provided ucrt AND visualc, combining pieces
of the old MSVCRT and the newer ucrt.  The ucrt module is what you
really wanted most of the time, however, would need to use MSVCRT for
the convenience aliases for type-generic math and the deprecated math
constants.

Unfortunately, we cannot shadow the `ucrt` module and create a Swift SDK
overlay for ucrt as that seems to result in circular dependencies when
processing the `_Concurrency` module.

Although this makes using the C library easier for most people, it has a
more important subtle change: it cleaves the dependency on visualc.
This means that this enables use of Swift without Visual Studio for the
singular purpose of providing 3 header files.  Additionally, it removes
the need for the installation of 2 of the 4 support files.  This greatly
simplifies the deployment process on Windows.
2020-10-15 16:02:01 -07:00
Saleem Abdulrasool
78bc6aae36 Platform: link against Pathcch.lib when using pathcch.h
The MSDN documentation indicates that you should link against the
`Pathcch.lib` import library when using functions from `pathcch.h` which
can also be verified by use functions failing to link due to unresolved
symbols.  Add the missing linking to enable autolinking for `WinSDK`.
2020-10-14 14:34:33 -07:00
Egor Zhdan
681805ddca WinSDK: extract Networking submodule
Currently winnetwk.h gets included via windows.h
2020-10-11 16:59:11 +03:00
Egor Zhdan
ec9f5a2311 WinSDK: extract WinNT into a separate submodule 2020-10-10 18:57:56 +03:00
Egor Zhdan
3708e7bbd5 WinSDK: extract Security submodule with winscard.h
Currently this header gets included into `WinSDK.WinSock2` via windows.h
2020-10-07 14:13:05 +03:00
Egor Zhdan
6a431085de Merge pull request #34147 from egorzhdan/winsdk-ioctl
WinSDK: extract System submodule
2020-10-03 19:52:42 +03:00
Egor Zhdan
ae9715ac03 WinSDK: extract System submodule with winioctl.h
Currently this header gets included into `WinSDK.WinSock2` via windows.h & winscard.h
2020-10-02 20:38:17 +03:00
Egor Zhdan
f158e6afce Merge pull request #34085 from egorzhdan/winsdk-version
WinSDK: extract version into a separate submodule
2020-09-26 12:41:37 +03:00
Egor Zhdan
70a6d2c7c5 WinSDK: extract version into a separate submodule
Currently winver.h gets included into `WinSDK.WinSock2`, however its usages might not be related to sockets, and it requires linking against `Version.Lib`
2020-09-25 22:07:37 +03:00
Egor Zhdan
30f7b9ecef WinSDK: extract Performance submodule
Currently some of the headers get included into `WinSDK.WinSock2` via windows.h
2020-09-24 15:05:08 +03:00