fix regression in detecting native glibc version

closes #4519
This commit is contained in:
Andrew Kelley 2020-02-21 20:48:50 -05:00
parent 6305ce828b
commit dca19b6757
No known key found for this signature in database
GPG Key ID: 7C5F548F728501A9
2 changed files with 8 additions and 6 deletions

View File

@ -992,6 +992,14 @@ static int main0(int argc, char **argv) {
}
} else {
target_init_default_glibc_version(&target);
#if defined(ZIG_OS_LINUX)
if (target.is_native) {
// TODO self-host glibc version detection, and then this logic can go away
if ((err = glibc_detect_native_version(target.glibc_version))) {
// Fall back to the default version.
}
}
#endif
}
} else if (target_glibc != nullptr) {
fprintf(stderr, "'%s' is not a glibc-compatible target", target_string);

View File

@ -467,12 +467,6 @@ void get_native_target(ZigTarget *target) {
if (target_is_glibc(target)) {
target->glibc_version = heap::c_allocator.create<ZigGLibCVersion>();
target_init_default_glibc_version(target);
#ifdef ZIG_OS_LINUX
Error err;
if ((err = glibc_detect_native_version(target->glibc_version))) {
// Fall back to the default version.
}
#endif
}
}