From 9e4ffe9b0d66055cd8cab3eb061de6108eec3451 Mon Sep 17 00:00:00 2001 From: Mofidul Jamal Date: Mon, 10 Feb 2025 15:22:21 -0500 Subject: [PATCH] Fix proxygen-macros issues causing proxygen projects to not build properly in latest rust --- proxygen-macros/src/lib.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/proxygen-macros/src/lib.rs b/proxygen-macros/src/lib.rs index ff2cd3c..88b6f35 100644 --- a/proxygen-macros/src/lib.rs +++ b/proxygen-macros/src/lib.rs @@ -112,7 +112,7 @@ pub fn forward(_attr_input: TokenStream, item: TokenStream) -> TokenStream { pub unsafe extern "C" fn #func_name() { #[cfg(target_arch = "x86_64")] { - std::arch::asm!( + std::arch::naked_asm!( "call {wait_dll_proxy_init}", "mov rax, qword ptr [rip + {ORIG_FUNCS_PTR}]", "add rax, {orig_index} * 8", @@ -122,13 +122,12 @@ pub fn forward(_attr_input: TokenStream, item: TokenStream) -> TokenStream { wait_dll_proxy_init = sym crate::wait_dll_proxy_init, ORIG_FUNCS_PTR = sym crate::ORIG_FUNCS_PTR, orig_index = const #orig_index_ident, - options(noreturn) ) } #[cfg(target_arch = "x86")] { - std::arch::asm!( + std::arch::naked_asm!( "call {wait_dll_proxy_init}", "mov eax, dword ptr [{ORIG_FUNCS_PTR}]", "add eax, {orig_index} * 4", @@ -138,7 +137,6 @@ pub fn forward(_attr_input: TokenStream, item: TokenStream) -> TokenStream { wait_dll_proxy_init = sym crate::wait_dll_proxy_init, ORIG_FUNCS_PTR = sym crate::ORIG_FUNCS_PTR, orig_index = const #orig_index_ident, - options(noreturn) ) } } @@ -254,7 +252,7 @@ pub fn pre_hook(attr_input: TokenStream, item: TokenStream) -> TokenStream { #[naked] #(#attrs)* pub unsafe extern "C" fn #func_name() { - std::arch::asm!( + std::arch::naked_asm!( // Wait for dll proxy to initialize "call {wait_dll_proxy_init}", "mov rax, qword ptr [rip + {ORIG_FUNCS_PTR}]", @@ -293,7 +291,6 @@ pub fn pre_hook(attr_input: TokenStream, item: TokenStream) -> TokenStream { ORIG_FUNCS_PTR = sym crate::ORIG_FUNCS_PTR, orig_index = const #orig_index_ident, proxygen_pre_hook_func = sym #hook_func_name, - options(noreturn) ); } ))