diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp index d416c287f8a2d..853ff99d9fe59 100644 --- a/clang/lib/Driver/ToolChains/Linux.cpp +++ b/clang/lib/Driver/ToolChains/Linux.cpp @@ -806,6 +806,9 @@ SanitizerMask Linux::getSupportedSanitizers() const { if (IsX86_64 || IsAArch64) { Res |= SanitizerKind::KernelHWAddress; } + // Work around "Cannot represent a difference across sections". + if (getTriple().getArch() == llvm::Triple::ppc64) + Res &= ~SanitizerKind::Function; return Res; } diff --git a/compiler-rt/test/ubsan/TestCases/TypeCheck/Function/function.cpp b/compiler-rt/test/ubsan/TestCases/TypeCheck/Function/function.cpp index 2f7db994364ca..645ec3c8c6d76 100644 --- a/compiler-rt/test/ubsan/TestCases/TypeCheck/Function/function.cpp +++ b/compiler-rt/test/ubsan/TestCases/TypeCheck/Function/function.cpp @@ -1,3 +1,6 @@ +// Work around "Cannot represent a difference across sections" +// UNSUPPORTED: target=powerpc64-{{.*}} + // RUN: %clangxx -DDETERMINE_UNIQUE %s -o %t-unique // RUN: %clangxx -std=c++17 -fsanitize=function %s -O3 -g -DSHARED_LIB -fPIC -shared -o %t-so.so // RUN: %clangxx -std=c++17 -fsanitize=function %s -O3 -g -o %t %t-so.so