Skip to content

Commit 88a4e0e

Browse files
executor: apply optnone to guest_handle_nested_vmentry_intel()
Florent Revest reported ThinLTO builds failing with the following error: <inline asm>:2:1: error: symbol 'after_vmentry_label' is already defined after_vmentry_label: ^ error: cannot compile inline asm , which turned out to be caused by the compiler not respecting `noinline`. Adding __attribute__((optnone)) fixes the problem.
1 parent e833134 commit 88a4e0e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

executor/common_kvm_amd64_syzos.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1151,6 +1151,10 @@ guest_handle_nested_load_code(struct api_call_nested_load_code* cmd, uint64 cpu_
11511151
}
11521152
}
11531153

1154+
// Clang's LTO may ignore noinline and attempt to inline this function into both callers,
1155+
// which results in duplicate declaration of after_vmentry_label.
1156+
// __attribute__((optnone)) should prevent this behavior.
1157+
__attribute__((optnone))
11541158
GUEST_CODE static noinline void
11551159
guest_handle_nested_vmentry_intel(uint64 vm_id, uint64 cpu_id, bool is_launch)
11561160
{

0 commit comments

Comments
 (0)