Skip to content

Commit 803d16e

Browse files
committed
Fix undefined symbol errors on windows/arm
Fix undefined symbol linker errors when building rust for windows/arm by excluding unneeded symbols. The errors are: = note: lib.def : error LNK2001: unresolved external symbol __aeabi_memclr4 lib.def : error LNK2001: unresolved external symbol __aeabi_memclr8 lib.def : error LNK2001: unresolved external symbol __aeabi_memmove4 lib.def : error LNK2001: unresolved external symbol __aeabi_memmove8
1 parent b41ba0b commit 803d16e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/arm.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,14 +164,14 @@ pub unsafe extern "aapcs" fn __aeabi_memmove(dest: *mut u8, src: *const u8, n: u
164164
::mem::memmove(dest, src, n);
165165
}
166166

167-
#[cfg(not(target_os = "ios"))]
167+
#[cfg(not(any(target_os = "ios", target_env = "msvc")))]
168168
#[cfg_attr(not(feature = "mangled-names"), no_mangle)]
169169
#[cfg_attr(thumb, linkage = "weak")]
170170
pub unsafe extern "aapcs" fn __aeabi_memmove4(dest: *mut u8, src: *const u8, n: usize) {
171171
__aeabi_memmove(dest, src, n);
172172
}
173173

174-
#[cfg(not(target_os = "ios"))]
174+
#[cfg(not(any(target_os = "ios", target_env = "msvc")))]
175175
#[cfg_attr(not(feature = "mangled-names"), no_mangle)]
176176
#[cfg_attr(thumb, linkage = "weak")]
177177
pub unsafe extern "aapcs" fn __aeabi_memmove8(dest: *mut u8, src: *const u8, n: usize) {
@@ -220,14 +220,14 @@ pub unsafe extern "aapcs" fn __aeabi_memclr(dest: *mut u8, n: usize) {
220220
__aeabi_memset(dest, n, 0);
221221
}
222222

223-
#[cfg(not(target_os = "ios"))]
223+
#[cfg(not(any(target_os = "ios", target_env = "msvc")))]
224224
#[cfg_attr(not(feature = "mangled-names"), no_mangle)]
225225
#[cfg_attr(thumb, linkage = "weak")]
226226
pub unsafe extern "aapcs" fn __aeabi_memclr4(dest: *mut u8, n: usize) {
227227
__aeabi_memset4(dest, n, 0);
228228
}
229229

230-
#[cfg(not(target_os = "ios"))]
230+
#[cfg(not(any(target_os = "ios", target_env = "msvc")))]
231231
#[cfg_attr(not(feature = "mangled-names"), no_mangle)]
232232
#[cfg_attr(thumb, linkage = "weak")]
233233
pub unsafe extern "aapcs" fn __aeabi_memclr8(dest: *mut u8, n: usize) {

0 commit comments

Comments
 (0)