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

Make a new attribute for the #[link_name = ""] special case #1296

Closed
brson opened this issue Dec 14, 2011 · 7 comments
Closed

Make a new attribute for the #[link_name = ""] special case #1296

brson opened this issue Dec 14, 2011 · 7 comments
Labels
A-linkage Area: linking into static, shared libraries and binaries C-cleanup Category: PRs that clean code up or issues documenting cleanup. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@brson
Copy link
Contributor

brson commented Dec 14, 2011

[link_name = ""] is used to tell rustc not to issue the -L linker flag. This is a special case of the link_name flag so let's replace it with its own attribute, like #[nolink].

@gmfawcett
Copy link
Contributor

I'd like to try this. Would #[link_name = ""] still be acceptable, or should it result in an error?

@brson
Copy link
Contributor Author

brson commented Dec 15, 2011

My opinion is that #[link_name = ""] should go away.

@brson
Copy link
Contributor Author

brson commented Dec 15, 2011

In that case yes, it would have to be an error.

@gmfawcett
Copy link
Contributor

OK, I implemented #[nolink](except for making #[link_name=""] an error), then updated the tests to use #[nolink], and got green lights under "make check." But when I try to update the stdlib (say, std::linux_os), it adds a "-llibc" flag, and fails. If I understand correctly, this is because "make check" builds libruststd.so before building my updated rustc.

Should I just leave the stdlib alone? Will your staged compilers eventually learn how to do #[nolink], and then you'd update the stdlib? Or, how can I build a stage N rustc without first building the stage N stdlib?

@brson
Copy link
Contributor Author

brson commented Dec 15, 2011

Probably the way to do this is use both #[link_name = ""] and #[nolink] in std (and core possibly?) with a FIXME to remove link_name later. Then we'll snapshot the compiler that knows about #[nolink], remove link_name, then make #[link_name = ""] an error.

@gmfawcett
Copy link
Contributor

Good idea. OK, let me prepare a pull request.

@gmfawcett
Copy link
Contributor

Pull request sent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linkage Area: linking into static, shared libraries and binaries C-cleanup Category: PRs that clean code up or issues documenting cleanup. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

No branches or pull requests

2 participants