Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The EXE file compiled by rust cannot export related export functions #99749

Closed
zofoc opened this issue Jul 26, 2022 · 4 comments
Closed

The EXE file compiled by rust cannot export related export functions #99749

zofoc opened this issue Jul 26, 2022 · 4 comments

Comments

@zofoc
Copy link

zofoc commented Jul 26, 2022

I encountered a problem with the rust compiler. In the bin program made by rust, I exported a function in the main unit, but I couldn't find the exported function with a third-party tool. I also use several other languages to do the same thing, and I can find the relevant exported functions. The function is simple in the following format:
#[no_mangle]
pub extern "C" fn func1(data:String)->i32{}
My final question is, does our Rust compile exe files that cannot export related export functions? This is the only language I have found that exe files cannot export functions. Does trust add such functions

@nagisa
Copy link
Member

nagisa commented Aug 1, 2022

This is probably a duplicate of #84161

@zofoc
Copy link
Author

zofoc commented Aug 1, 2022

"This is a tracking issue for the RFC "2841" (rust-lang/rfcs#2841).
The feature gate for the issue is #![feature(export_executable_symbols)]. " and "Add the ability to export symbols from executables, not just dylibs, via a new compiler flag: -C export-executable-symbols"" , But none of them worked

@csmoe
Copy link
Member

csmoe commented Nov 18, 2022

Could you test your code with rustc -Zexport-executable-symbols? it's not stabilized yet, and #![feature(export_executable_symbols)] is unneeded.

@jyn514
Copy link
Member

jyn514 commented Apr 12, 2023

I'm going to close this as a duplicate of #84161; feel free to reopen if you try -Zexport-executable-symbols and it doesn't fix your problem.

@jyn514 jyn514 closed this as not planned Won't fix, can't repro, duplicate, stale Apr 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants