Hi, Macports clang work fine for me, what OS are you on ? If you are on an old OS it’s more likely the santizers don’t work or are just disabled there.
I see the same with GCC, I guess they just aren’t working there currently. Chris > On 1 Jun 2026, at 5:59 pm, Ryan Carsten Schmidt <[email protected]> > wrote: > > I'm trying to compile a program using the address sanitizer and/or the > undefined behavior sanitizer. I've tried clang 18 and gcc 15 and neither seem > to be able to link: > > $ clang-mp-18 -fsanitize=address test.c -o test > ld: file not found: > /opt/local/libexec/llvm-18/lib/clang/18/lib/darwin/libclang_rt.asan_osx_dynamic.dylib > clang: error: linker command failed with exit code 1 (use -v to see > invocation) > > $ clang-mp-18 -fsanitize=undefined test.c -o test > ld: file not found: > /opt/local/libexec/llvm-18/lib/clang/18/lib/darwin/libclang_rt.ubsan_osx_dynamic.dylib > clang: error: linker command failed with exit code 1 (use -v to see > invocation) > > $ gcc-mp-15 -fsanitize=address test.c -o test > ld: library not found for -lasan > collect2: error: ld returned 1 exit status > > $ gcc-mp-15 -fsanitize=undefined test.c -o test > ld: library not found for -lubsan > collect2: error: ld returned 1 exit status > > Is this supposed to work? Am I supposed to be doing something else to get > this to work? > >
