Page MenuHomeFreeBSD

Allow building usr.bin/vi with MK_ASAN

Authored by arichardson on Jul 5 2021, 12:30 PM.



We have to namespace the regex functions to avoid duplicate symbol errors.
This also ensures that vi doesn't define the libc reg* functions with
mismatched signatures.

ld: error: duplicate symbol: regcomp

defined at (/usr/src/contrib/llvm-project/compiler-rt/lib/sanitizer_common/

asan_interceptors.o:(__interceptor_regcomp) in archive /usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.asan-x86_64.a

defined at regcomp.c


ld: error: duplicate symbol: regerror

defined at (/usr/src/contrib/llvm-project/compiler-rt/lib/sanitizer_common/

asan_interceptors.o:(__interceptor_regerror) in archive /usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.asan-x86_64.a

defined at regerror.c


ld: error: duplicate symbol: regexec

defined at (/usr/src/contrib/llvm-project/compiler-rt/lib/sanitizer_common/

asan_interceptors.o:(__interceptor_regexec) in archive /usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.asan-x86_64.a

defined at regexec.c


ld: error: duplicate symbol: regfree

defined at (/usr/src/contrib/llvm-project/compiler-rt/lib/sanitizer_common/

asan_interceptors.o:(__interceptor_regfree) in archive /usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.asan-x86_64.a

defined at regfree.c


Submitted upstream as

Diff Detail

rG FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

@bapt This has now been committed upstream, should I commit this locally first or wait for the next import?

just commit it now, thank you for it!

This revision is now accepted and ready to land.Jul 19 2021, 12:54 PM
This revision was automatically updated to reflect the committed changes.