Skip to content

Commit 82cd981

Browse files
committed
[GR-58485] ensure libgraal has symbols
PullRequest: graal/18890
2 parents 8e1efc3 + abffc4a commit 82cd981

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/image/NativeImageDebugInfoStripFeature.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
*/
2525
package com.oracle.svm.hosted.image;
2626

27+
import static com.oracle.svm.core.SubstrateOptions.DeleteLocalSymbols;
28+
2729
import java.io.IOException;
2830
import java.nio.file.Files;
2931
import java.nio.file.Path;
@@ -127,7 +129,7 @@ private static void stripLinux(AfterImageWriteAccessImpl accessImpl) {
127129

128130
private static Path createKeepSymbolsListFile(AfterImageWriteAccessImpl accessImpl) throws IOException {
129131
Path exportedSymbolsPath = accessImpl.getTempDirectory().resolve("keep-symbols.list").toAbsolutePath();
130-
Files.write(exportedSymbolsPath, accessImpl.getImageSymbols(true));
132+
Files.write(exportedSymbolsPath, accessImpl.getImageSymbols(DeleteLocalSymbols.getValue()));
131133
return exportedSymbolsPath;
132134
}
133135
}

vm/mx.vm/mx_vm_gate.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,15 @@ def _test_libgraal_fatal_error_handling(extra_vm_arguments):
274274
pass
275275
else:
276276
mx.abort('Expected "Fatal error in JVMCI" to be in contents of ' + hs_err + ':' + linesep + contents)
277+
# check that the hs_err contains libgraal symbols on supported platforms
278+
symbol_patterns = {
279+
'linux' : 'com.oracle.svm.core.jdk.VMErrorSubstitutions::doShutdown',
280+
'darwin' : 'VMErrorSubstitutions_doShutdown',
281+
'windows' : None
282+
}
283+
pattern = symbol_patterns[mx.get_os()]
284+
if pattern and pattern not in contents:
285+
mx.abort('Expected "' + pattern + '" to be in contents of ' + hs_err + ':' + linesep + contents)
277286

278287
if 'JVMCINativeLibraryErrorFile' in out.data and not seen_libjvmci_log:
279288
mx.abort('Expected a file matching "hs_err_pid*_libjvmci.log" in test directory. Entries found=' + str(listdir(scratch_dir)))

0 commit comments

Comments
 (0)