@@ -20,6 +20,7 @@ The .NET Foundation licenses this file to you under the MIT license.
20
20
<CppLinker >$(CppCompilerAndLinker)</CppLinker >
21
21
<CppLibCreator >ar</CppLibCreator >
22
22
<DsymUtilOptions Condition =" '$(TargetOS)' == 'osx'" >--flat</DsymUtilOptions >
23
+ <_SymbolPrefix Condition =" '$(TargetOS)' == 'osx'" >_</_SymbolPrefix >
23
24
</PropertyGroup >
24
25
25
26
<Target Name =" SetupOSSpecificProps" DependsOnTargets =" $(IlcDynamicBuildPropertyDependencies)" >
@@ -79,15 +80,15 @@ The .NET Foundation licenses this file to you under the MIT license.
79
80
</ItemGroup >
80
81
81
82
<ItemGroup Condition =" '$(StaticICULinking)' == 'true' and '$(NativeLib)' != 'Static'" >
82
- <NativeLibrary Include =" $(IntermediateOutputPath)/ libs/System.Globalization.Native/build/libSystem.Globalization.Native.a" />
83
+ <NativeLibrary Include =" $(IntermediateOutputPath)libs/System.Globalization.Native/build/libSystem.Globalization.Native.a" />
83
84
<DirectPInvoke Include =" libSystem.Globalization.Native" />
84
85
<StaticICULibs Include =" -Wl,-Bstatic" Condition =" '$(StaticExecutable)' != 'true'" />
85
86
<StaticICULibs Include =" -licuio -licutu -licui18n -licuuc -licudata -lstdc++" />
86
87
<StaticICULibs Include =" -Wl,-Bdynamic" Condition =" '$(StaticExecutable)' != 'true'" />
87
88
</ItemGroup >
88
89
89
90
<ItemGroup Condition =" '$(StaticOpenSslLinking)' == 'true' and '$(NativeLib)' != 'Static'" >
90
- <NativeLibrary Include =" $(IntermediateOutputPath)/ libs/System.Security.Cryptography.Native/build/libSystem.Security.Cryptography.Native.OpenSsl.a" />
91
+ <NativeLibrary Include =" $(IntermediateOutputPath)libs/System.Security.Cryptography.Native/build/libSystem.Security.Cryptography.Native.OpenSsl.a" />
91
92
<DirectPInvoke Include =" libSystem.Security.Cryptography.Native.OpenSsl" />
92
93
<StaticSslLibs Include =" -Wl,-Bstatic" Condition =" '$(StaticExecutable)' != 'true'" />
93
94
<StaticSslLibs Include =" -lssl -lcrypto" />
@@ -102,13 +103,8 @@ The .NET Foundation licenses this file to you under the MIT license.
102
103
<NativeFramework Include =" GSS" />
103
104
</ItemGroup >
104
105
105
- <Exec Command =" " $(IlcHostPackagePath)/native/src/libs/build-local.sh" " $(IlcHostPackagePath)/" " $(IntermediateOutputPath)" System.Globalization.Native" Condition =" '$(StaticICULinking)' == 'true'" />
106
-
107
- <Exec Command =" " $(IlcHostPackagePath)/native/src/libs/build-local.sh" " $(IlcHostPackagePath)/" " $(IntermediateOutputPath)" System.Security.Cryptography.Native" Condition =" '$(StaticOpenSslLinking)' == 'true'" />
108
-
109
106
<ItemGroup >
110
107
<LinkerArg Include =" -fuse-ld=lld" Condition =" '$(UseLLVMLinker)' == 'true'" />
111
- <LinkerArg Include =" -static" Condition =" '$(StaticExecutable)' == 'true'" />
112
108
<LinkerArg Include =" @(NativeLibrary)" />
113
109
<LinkerArg Include =" --sysroot=$(SysRoot)" Condition =" '$(SysRoot)' != ''" />
114
110
<LinkerArg Include =" --target=$(TargetTriple)" Condition =" '$(TargetOS)' != 'osx' and '$(TargetTriple)' != ''" />
@@ -122,7 +118,6 @@ The .NET Foundation licenses this file to you under the MIT license.
122
118
<LinkerArg Include =" -pthread" Condition =" '$(TargetOS)' != 'osx'" />
123
119
<LinkerArg Include =" -lstdc++" Condition =" '$(LinkStandardCPlusPlusLibrary)' == 'true'" />
124
120
<LinkerArg Include =" -ldl" />
125
- <LinkerArg Include =" -lm" />
126
121
<LinkerArg Include =" -lobjc" Condition =" '$(TargetOS)' == 'osx'" />
127
122
<LinkerArg Include =" -lswiftCore" Condition =" '$(TargetOS)' == 'osx'" />
128
123
<LinkerArg Include =" -lswiftFoundation" Condition =" '$(TargetOS)' == 'osx'" />
@@ -133,6 +128,8 @@ The .NET Foundation licenses this file to you under the MIT license.
133
128
<LinkerArg Include =" @(StaticNumaLibs)" Condition =" '$(StaticNumaLinking)' == 'true'" />
134
129
<LinkerArg Include =" @(StaticICULibs)" Condition =" '$(StaticICULinking)' == 'true'" />
135
130
<LinkerArg Include =" @(StaticSslLibs)" Condition =" '$(StaticOpenSslLinking)' == 'true'" />
131
+ <LinkerArg Include =" -lm" />
132
+ <LinkerArg Include =" -static" Condition =" '$(StaticExecutable)' == 'true'" />
136
133
<LinkerArg Include =" -dynamiclib" Condition =" '$(TargetOS)' == 'osx' and '$(NativeLib)' == 'Shared'" />
137
134
<LinkerArg Include =" -shared" Condition =" '$(TargetOS)' != 'osx' and '$(NativeLib)' == 'Shared'" />
138
135
<!-- binskim warning BA3001 PIE disabled on executable -->
@@ -142,8 +139,12 @@ The .NET Foundation licenses this file to you under the MIT license.
142
139
<LinkerArg Include =" -Wl,-z,relro" Condition =" '$(TargetOS)' != 'osx'" />
143
140
<!-- binskim warning BA3011 The BIND_NOW flag is missing -->
144
141
<LinkerArg Include =" -Wl,-z,now" Condition =" '$(TargetOS)' != 'osx'" />
145
- <LinkerArg Include =" -Wl,-u,_NativeAOT_StaticInitialization " Condition =" ('$(UseLLVMLinker)' == 'true' or '$(TargetOS)' == 'osx' or '$(TargetOS)' == 'freebsd') and '$(NativeLib)' == 'Shared'" />
142
+ <LinkerArg Include =" -Wl,-u,$(_SymbolPrefix)NativeAOT_StaticInitialization " Condition =" ('$(UseLLVMLinker)' == 'true' or '$(TargetOS)' == 'osx' or '$(TargetOS)' == 'freebsd') and '$(NativeLib)' == 'Shared'" />
146
143
<LinkerArg Include =" -Wl,--require-defined,NativeAOT_StaticInitialization" Condition =" '$(UseLLVMLinker)' != 'true' and '$(TargetOS)' == 'linux' and '$(NativeLib)' == 'Shared'" />
144
+ <!-- this workaround can be deleted once the minimum supported glibc version
145
+ (runtime's official build machine's glibc version) is at least 2.33
146
+ see https://github.com/bminor/glibc/commit/99468ed45f5a58f584bab60364af937eb6f8afda -->
147
+ <LinkerArg Include =" -Wl,--defsym,__xmknod=mknod" Condition =" '$(StaticExecutable)' == 'true'" />
147
148
<!-- FreeBSD has two versions of the GSSAPI it can use, but we only use the ports version (MIT version) here -->
148
149
<LinkerArg Include =" -L/usr/local/lib -lgssapi_krb5" Condition =" '$(TargetOS)' == 'freebsd'" />
149
150
<!-- FreeBSD's inotify is an installed package and not found in default libraries -->
@@ -207,6 +208,12 @@ The .NET Foundation licenses this file to you under the MIT license.
207
208
<Output TaskParameter =" ExitCode" PropertyName =" _DsymUtilOutput" />
208
209
</Exec >
209
210
211
+ <Exec Command =" CC=" $(CppLinker)" " $(IlcHostPackagePath)/native/src/libs/build-local.sh" " $(IlcHostPackagePath)/" " $(IntermediateOutputPath)" System.Globalization.Native"
212
+ Condition =" '$(StaticICULinking)' == 'true'" />
213
+
214
+ <Exec Command =" CC=" $(CppLinker)" " $(IlcHostPackagePath)/native/src/libs/build-local.sh" " $(IlcHostPackagePath)/" " $(IntermediateOutputPath)" System.Security.Cryptography.Native"
215
+ Condition =" '$(StaticOpenSslLinking)' == 'true'" />
216
+
210
217
<PropertyGroup Condition =" '$(TargetOS)' == 'osx' and '$(StripSymbols)' == 'true' and $(_DsymUtilOutput.Contains('--minimize'))" >
211
218
<DsymUtilOptions >$(DsymUtilOptions) --minimize</DsymUtilOptions >
212
219
</PropertyGroup >
0 commit comments