From 5679a3ce876696422717e2a4233acdb7719f0108 Mon Sep 17 00:00:00 2001 From: Maksim Panchenko Date: Fri, 1 Apr 2022 16:43:21 -0700 Subject: [PATCH] [BOLT][test] Fix AArch64 cross-platform tests Use target-specific flags for building AArch64 non-runnable tests. Reviewed By: yota9 Differential Revision: https://reviews.llvm.org/D122520 --- bolt/test/AArch64/double_jump.cpp | 2 +- bolt/test/AArch64/lit.local.cfg | 5 +++++ bolt/test/AArch64/tailcall_traps.s | 8 ++++---- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/bolt/test/AArch64/double_jump.cpp b/bolt/test/AArch64/double_jump.cpp index 180b566..1faae98 100644 --- a/bolt/test/AArch64/double_jump.cpp +++ b/bolt/test/AArch64/double_jump.cpp @@ -52,4 +52,4 @@ unsigned long foo(unsigned long count) { return count; } -int main(int argc, const char *argv[]) { return foo(38); } +extern "C" int _start() { return foo(38); } diff --git a/bolt/test/AArch64/lit.local.cfg b/bolt/test/AArch64/lit.local.cfg index b565c79..f3c0e3f 100644 --- a/bolt/test/AArch64/lit.local.cfg +++ b/bolt/test/AArch64/lit.local.cfg @@ -1,2 +1,7 @@ if config.host_arch not in ['aarch64']: config.unsupported = True + +config.substitutions.insert( + 0, ('%cflags', + '%cflags --target=aarch64-pc-linux -nostartfiles -nostdlib -fuse-ld=lld' + ' -Wl,--unresolved-symbols=ignore-all')) diff --git a/bolt/test/AArch64/tailcall_traps.s b/bolt/test/AArch64/tailcall_traps.s index 2a1535d..26f0a39 100644 --- a/bolt/test/AArch64/tailcall_traps.s +++ b/bolt/test/AArch64/tailcall_traps.s @@ -17,12 +17,12 @@ .text .align 4 - .global main - .type main, %function -main: + .global _start + .type _start, %function +_start: nop ret - .size main, .-main + .size _start, .-_start .global foo .type foo, %function -- 2.7.4