// Demonstrates unintended strong linking when using Xcode 15, new linker, and ThinLTO. // // Run: /* $ MACOSX_DEPLOYMENT_TARGET=10.13 clang -arch x86_64 -dynamic -c -o testdsd.o testdsd.m -flto=thin $ MACOSX_DEPLOYMENT_TARGET=10.13 clang -arch x86_64 -bundle -o testdsd.dylib testdsd.o $ nm -m -u testdsd.dylib | grep shared_cache (undefined) external __dyld_shared_cache_contains_path (from libSystem) $ MACOSX_DEPLOYMENT_TARGET=10.13 clang -arch x86_64 -bundle -o testdsd.dylib testdsd.o -Wl,-ld_classic $ nm -m -u testdsd.dylib | grep shared_cache (undefined) weak external __dyld_shared_cache_contains_path (from libSystem) */ #include int dsd(void) { if (@available(macOS 10.16, *)) { int result = _dyld_shared_cache_contains_path("/"); } return 0; }