rusticstuff / simdutf8

SIMD-accelerated UTF-8 validation for Rust.
Other
522 stars 25 forks source link

Mislink on Windows with lld and thinlto #53

Closed djkoloski closed 1 year ago

djkoloski commented 3 years ago

It appears that validate_utf8_basic and similar functions trigger a mislink on Windows with lld and thinlto. This is not a terribly uncommon combination, so it may be worth exploring alternatives that do not cause this mislink.

This is an issue @Kixiron ran into while using bytecheck, which uses simdutf8 for fast string validation. The issue was traced back to simdutf8 using a release build with debug symbols and WinDbg, then the memory backing the AtomicPtr was rewound to the beginning of the application and verified to be invalid. This indicates that the function pointer placed in it was not relocated to the correct address.

hkratz commented 3 years ago

@djkoloski Thanks for the heads-up! Seems like a bug in LLD, let's hope we can get it fixed soon.

hkratz commented 3 years ago

That is unfortunately still an issue with LLD from LLVM 13.

hkratz commented 1 year ago

This has been fixed.