diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp --- a/clang/lib/Driver/ToolChains/Linux.cpp +++ b/clang/lib/Driver/ToolChains/Linux.cpp @@ -687,7 +687,7 @@ } bool Linux::IsMathErrnoDefault() const { - if (getTriple().isAndroid()) + if (getTriple().isAndroid() || getTriple().isMusl()) return false; return Generic_ELF::IsMathErrnoDefault(); } diff --git a/clang/test/Driver/fast-math.c b/clang/test/Driver/fast-math.c --- a/clang/test/Driver/fast-math.c +++ b/clang/test/Driver/fast-math.c @@ -119,6 +119,8 @@ // RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s // RUN: %clang -### -target x86_64-linux-android -c %s 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s +// RUN: %clang -### -target x86_64-linux-musl -c %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s // RUN: %clang -### -target amdgcn-amd-amdhsa -c %s 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s // RUN: %clang -### -target amdgcn-amd-amdpal -c %s 2>&1 \