Skip to content

Commit 6678f60

Browse files
[BOLT][test] Fix cross-compilation tests after D151920
Fix tests that are failing in cross-compilation after D151920 (https://lab.llvm.org/buildbot/#/builders/221/builds/17715): - instrumentation-ind-call, basic-instrumentation: add -mno-outline-atomics flag to runtime lib - bolt-address-translation-internal-call, internal-call-instrument: add %cflags - meta-merge-fdata: restrict to x86_64 Reviewed By: Amir Differential Revision: https://reviews.llvm.org/D159094
1 parent e1cc299 commit 6678f60

5 files changed

+33
-5
lines changed

bolt/runtime/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ set(BOLT_RT_FLAGS
3232
if (CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
3333
set(BOLT_RT_FLAGS ${BOLT_RT_FLAGS} "-mno-sse")
3434
endif()
35+
if (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
36+
set(BOLT_RT_FLAGS ${BOLT_RT_FLAGS} "-mno-outline-atomics")
37+
endif()
3538

3639
# Don't let the compiler think it can create calls to standard libs
3740
target_compile_options(bolt_rt_instr PRIVATE ${BOLT_RT_FLAGS})

bolt/test/X86/bolt-address-translation-internal-call.test

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o
1010
# Delete our BB symbols so BOLT doesn't mark them as entry points
1111
# RUN: llvm-strip --strip-unneeded %t.o
12-
# RUN: %clang %t.o -o %t.exe -Wl,-q
12+
# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q
1313

1414
# RUN: llvm-bolt --enable-bat %t.exe --relocs -o %t.out | FileCheck %s
1515
# CHECK: BOLT-INFO: Wrote {{.*}} BAT maps
@@ -29,6 +29,7 @@ main:
2929
push %rbx
3030
sub $0x120,%rsp
3131
mov $0x3,%rbx
32+
movq rel(%rip), %rdi
3233
.J1:
3334
cmp $0x0,%rbx
3435
je .J2
@@ -49,4 +50,8 @@ main:
4950
.J4:
5051
pop %rbp
5152
retq
53+
end:
5254
.size main, .-main
55+
56+
.data
57+
rel: .quad end

bolt/test/X86/instrumentation-eh_frame_hdr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// This test checks that .eh_frame_hdr address is in bounds of the last LOAD
22
// end address i.e. the section address is smaller then the LOAD end address.
33

4-
// REQUIRES: system-linux,bolt-runtime
4+
// REQUIRES: system-linux,bolt-runtime,target=x86_64{{.*}}
55

66
// RUN: %clangxx %cxxflags -static -Wl,-q %s -o %t.exe -Wl,--entry=_start
77
// RUN: llvm-bolt %t.exe -o %t.instr -instrument \

bolt/test/X86/internal-call-instrument.s

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,23 @@
11
# This reproduces a bug with instrumentation crashes on internal call
22

3-
# REQUIRES: x86_64-linux,bolt-runtime
3+
# REQUIRES: x86_64-linux,bolt-runtime,target=x86_64{{.*}}
44

55
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o
66
# Delete our BB symbols so BOLT doesn't mark them as entry points
77
# RUN: llvm-strip --strip-unneeded %t.o
8-
# RUN: %clang %t.o -o %t.exe -Wl,-q
8+
# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q
99

1010
# RUN: llvm-bolt --instrument %t.exe --relocs -o %t.out
1111

1212
.text
13+
.globl _start
14+
.type _start, %function
15+
.p2align 4
16+
_start:
17+
call main
18+
ret
19+
.size _start, .-_start
20+
1321
.globl main
1422
.type main, %function
1523
.p2align 4
@@ -20,6 +28,7 @@ main:
2028
push %rbx
2129
sub $0x120,%rsp
2230
mov $0x3,%rbx
31+
movq rel(%rip), %rdi
2332
.J1:
2433
cmp $0x0,%rbx
2534
je .J2
@@ -40,4 +49,15 @@ main:
4049
.J4:
4150
pop %rbp
4251
retq
52+
end:
4353
.size main, .-main
54+
55+
.globl _fini
56+
.type _fini, %function
57+
.p2align 4
58+
_fini:
59+
hlt
60+
.size _fini, .-_fini
61+
62+
.data
63+
rel: .quad end

bolt/test/runtime/meta-merge-fdata.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Meta test using merge-fdata binary
22
UNSUPPORTED: asan
33
# Instrumentation currently only works on X86
4-
REQUIRES: bolt-runtime
4+
REQUIRES: x86_64-linux,bolt-runtime
55

66
# Instrumentation, should test:
77
# - Direct branches

0 commit comments

Comments
 (0)