https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65675
--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> --- libitm needs getenv, and so does libsanitizer: /home/test/src/gcc/libsanitizer/ubsan/ubsan_flags.cpp: In function ‘const char* __ubsan::GetFlag(const char*)’: /home/test/src/gcc/libsanitizer/ubsan/ubsan_flags.cpp:29:12: error: ‘getenv’ was not declared in this scope 29 | return getenv(flag); | ^~~~~~ So we need --disable-libsanitizer too.