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

Windows support is broken on the latest stable Rust version #48

Open
gnzlbg opened this issue Aug 23, 2018 · 5 comments
Open

Windows support is broken on the latest stable Rust version #48

gnzlbg opened this issue Aug 23, 2018 · 5 comments

Comments

@gnzlbg
Copy link
Owner

gnzlbg commented Aug 23, 2018

Why? no idea.

@steveklabnik
Copy link

I'm not sure what you mean by "is broken", but on my machine, it works but doesn't show any relevant symbols from my crate, only dependencies. and strangely, a fmt implementation.

@gnzlbg
Copy link
Owner Author

gnzlbg commented Sep 12, 2018

Hi Steve,

it works but doesn't show any relevant symbols from my crate, only dependencies.

do you have a reproducer ? Is that the output of calling cargo asm without a path? Are you sure that the symbols are there (e.g. they are not #[inline] functions, generic functions, etc. ?)


I should have added a link to the latest appveyor builds: https://ci.appveyor.com/project/gnzlbg/cargo-asm/branch/master

Basically, for our test crate, it is able to find the right function, but printing the function name appears to be failing, and detecting the end of a function appears to be failing too sometimes.

Without a windows machine it is hard to debug this :/

@steveklabnik
Copy link

generic functions

Ah, so this is

struct List<T> {
    item: T,
}

impl<T> List<T> {
   fn push_back<T>(&mut self, T)

So yeah, that'd be generic. Oops, I must have missed this restriction. Sorry about the spam :/

@gnzlbg
Copy link
Owner Author

gnzlbg commented Sep 12, 2018

Don't worry, so yes, generic functions do not exist in the emitted machine code unless they are actually used (how could they when types are not specified?). If you want to generate the assembly for one you can just create a temporary function for that, e.g.,

pub fn list_push_back(l: &mut List<i32>, x: i32) {
    l.push_back(x);
}

you need to make it pub so that the compiler must actually generate it, otherwise dead code elimination will remove it.

@steveklabnik
Copy link

steveklabnik commented Sep 12, 2018 via email

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

2 participants