|
1 | 1 | /* |
2 | | - * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved. |
| 2 | + * Copyright (c) 2022, 2025, Oracle and/or its affiliates. All rights reserved. |
3 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 | 4 | * |
5 | 5 | * This code is free software; you can redistribute it and/or modify it |
|
43 | 43 | #define ATTRIBUTE_USED |
44 | 44 | #endif |
45 | 45 |
|
| 46 | +// On AIX, the llvm_symbolizer is not found out of the box, so we have to provide the |
| 47 | +// full qualified llvm_symbolizer path in the __ubsan_default_options() function. |
| 48 | +// To get it here we compile our sources with an additional define LLVM_SYMBOLIZER |
| 49 | +// containing the path, which we set in make/autoconf/jdk-options.m4. |
| 50 | +#ifdef LLVM_SYMBOLIZER |
| 51 | +#define _LLVM_SYMBOLIZER(X) ",external_symbolizer_path=" X_LLVM_SYMBOLIZER(X) |
| 52 | +#define X_LLVM_SYMBOLIZER(X) #X |
| 53 | +#else |
| 54 | +#define LLVM_SYMBOLIZER |
| 55 | +#define _LLVM_SYMBOLIZER(X) |
| 56 | +#endif |
| 57 | + |
46 | 58 | // Override weak symbol exposed by UBSan to override default options. This is called by UBSan |
47 | 59 | // extremely early during library loading, before main is called. We need to override the default |
48 | 60 | // options because by default UBSan only prints a warning for each occurrence. We want jtreg tests |
49 | 61 | // to fail when undefined behavior is encountered. We also want a full stack trace for the offending |
50 | 62 | // thread so it is easier to track down. You can override these options by setting the environment |
51 | 63 | // variable UBSAN_OPTIONS. |
52 | 64 | ATTRIBUTE_DEFAULT_VISIBILITY ATTRIBUTE_USED const char* __ubsan_default_options() { |
53 | | - return "halt_on_error=1,print_stacktrace=1"; |
| 65 | + return "halt_on_error=1,print_stacktrace=1" _LLVM_SYMBOLIZER(LLVM_SYMBOLIZER); |
54 | 66 | } |
0 commit comments