Skip to content

Commit 5c7678d

Browse files
committed
default arch
1 parent f8de161 commit 5c7678d

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_libcdep.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,9 @@ class LLVMSymbolizerProcess final : public SymbolizerProcess {
282282
const char *const kSymbolizerArch = "--default-arch=powerpc64";
283283
# elif defined(__powerpc64__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
284284
const char *const kSymbolizerArch = "--default-arch=powerpc64le";
285+
# elif defined(__powerpc__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
286+
// Must check __powerpc__ after __powerpc64__ because both can be set.
287+
const char* const kSymbolizerArch = "--default-arch=powerpc";
285288
# elif defined(__s390x__)
286289
const char *const kSymbolizerArch = "--default-arch=s390x";
287290
# elif defined(__s390__)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env python3
2+
3+
# Assisted by watsonx Code Assistant
4+
import json
5+
import sys
6+
print(json.dumps(sys.argv[1:]), file=sys.stderr)
7+
print("main\n??:0:0\n")
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// REQUIRES: powerpc64-target-arch
2+
3+
// RUN: %clangxx -O0 %s -o %t
4+
// RUN: %env_tool_opts=external_symbolizer_path=%p/Inputs/sanitizer_default_arch/llvm-symbolizer \
5+
// RUN: %run %t 2>&1 | FileCheck %s
6+
7+
#include <sanitizer/common_interface_defs.h>
8+
9+
static void Symbolize() {
10+
char buffer[100];
11+
__sanitizer_symbolize_pc(__builtin_return_address(0), "%p %F %L", buffer,
12+
sizeof(buffer));
13+
}
14+
15+
int main() {
16+
// CHECK: "--default-arch=powerpc64"
17+
Symbolize();
18+
}

0 commit comments

Comments
 (0)