aboutsummaryrefslogtreecommitdiff
path: root/cc/config/x86_windows_host.go
diff options
context:
space:
mode:
Diffstat (limited to 'cc/config/x86_windows_host.go')
-rw-r--r--cc/config/x86_windows_host.go25
1 files changed, 10 insertions, 15 deletions
diff --git a/cc/config/x86_windows_host.go b/cc/config/x86_windows_host.go
index 505ddfab4..2f1048812 100644
--- a/cc/config/x86_windows_host.go
+++ b/cc/config/x86_windows_host.go
@@ -33,7 +33,8 @@ var (
// Use C99-compliant printf functions (%zd).
"-D__USE_MINGW_ANSI_STDIO=1",
- // Admit to using >= Windows 7. Both are needed because of <_mingw.h>.
+ // Admit to using >= Windows 7.
+ // Both #defines are needed: https://learn.microsoft.com/en-us/cpp/porting/modifying-winver-and-win32-winnt
"-D_WIN32_WINNT=0x0601",
"-DWINVER=0x0601",
// Get 64-bit off_t and related functions.
@@ -68,10 +69,15 @@ var (
windowsLdflags = []string{
"-Wl,--dynamicbase",
"-Wl,--nxcompat",
- }
- windowsLldflags = append(windowsLdflags, []string{
+
"-Wl,--Xlink=-Brepro", // Enable deterministic build
- }...)
+
+ // Additional libraries required for generated static rustlibs
+ "-lssp",
+ "-lgcc_s",
+ "-ladvapi32",
+ "-lntdll",
+ }
windowsX86Cflags = []string{
"-m32",
@@ -141,15 +147,12 @@ func init() {
pctx.StaticVariable("WindowsCflags", strings.Join(windowsCflags, " "))
pctx.StaticVariable("WindowsLdflags", strings.Join(windowsLdflags, " "))
- pctx.StaticVariable("WindowsLldflags", strings.Join(windowsLldflags, " "))
pctx.StaticVariable("WindowsCppflags", strings.Join(windowsCppflags, " "))
pctx.StaticVariable("WindowsX86Cflags", strings.Join(windowsX86Cflags, " "))
pctx.StaticVariable("WindowsX8664Cflags", strings.Join(windowsX8664Cflags, " "))
pctx.StaticVariable("WindowsX86Ldflags", strings.Join(windowsX86Ldflags, " "))
- pctx.StaticVariable("WindowsX86Lldflags", strings.Join(windowsX86Ldflags, " "))
pctx.StaticVariable("WindowsX8664Ldflags", strings.Join(windowsX8664Ldflags, " "))
- pctx.StaticVariable("WindowsX8664Lldflags", strings.Join(windowsX8664Ldflags, " "))
pctx.StaticVariable("WindowsX86Cppflags", strings.Join(windowsX86Cppflags, " "))
pctx.StaticVariable("WindowsX8664Cppflags", strings.Join(windowsX8664Cppflags, " "))
@@ -223,18 +226,10 @@ func (t *toolchainWindowsX86) Ldflags() string {
return "${config.WindowsLdflags} ${config.WindowsX86Ldflags}"
}
-func (t *toolchainWindowsX86) Lldflags() string {
- return "${config.WindowsLldflags} ${config.WindowsX86Lldflags}"
-}
-
func (t *toolchainWindowsX8664) Ldflags() string {
return "${config.WindowsLdflags} ${config.WindowsX8664Ldflags}"
}
-func (t *toolchainWindowsX8664) Lldflags() string {
- return "${config.WindowsLldflags} ${config.WindowsX8664Lldflags}"
-}
-
func (t *toolchainWindowsX86) YasmFlags() string {
return "${config.WindowsX86YasmFlags}"
}