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

Support auto linking #13388

Closed
llvmbot opened this issue Jun 2, 2012 · 7 comments
Closed

Support auto linking #13388

llvmbot opened this issue Jun 2, 2012 · 7 comments
Labels
bugzilla Issues migrated from bugzilla c++

Comments

@llvmbot
Copy link
Member

llvmbot commented Jun 2, 2012

Bugzilla Link 13016
Resolution FIXED
Resolved on Oct 21, 2015 15:41
Version trunk
OS All
Reporter LLVM Bugzilla Contributor
CC @asl,@d0k,@DougGregor,@rnk,@timurrrr

Extended Description

Could you support auto linking, like supported by MSVC and used by for example Boost?

http://www.boost.org/doc/libs/1_49_0/more/getting_started/windows.html#auto-linking

It'd simplify build scripts of 'simple' apps.

@d0k
Copy link
Member

d0k commented Jun 2, 2012

This feature consists of 3 parts:

  1. Parsing of the #pragma comment directive. I think we have that in clang.
  2. Emitting a note in the object file. We don't do that currently.
  3. Have the linker pick up the note and link the specified libs.

While we can implement #​2 in LLVM, #​3 is beyond its scope. We currently rely on the linker from binutils on windows and most unices. As far as I know it doesn't have the required feature. It's a bit of a chicken-and-egg problem, but it doesn't make much sense to implement only one side.

@llvmbot
Copy link
Member Author

llvmbot commented Jun 2, 2012

Could you talk to the binutils guys and see if they're willing to implement this?

@timurrrr
Copy link
Contributor

Hi Olaf,

Do you want this support for Linux or Windows or both?

@llvmbot
Copy link
Member Author

llvmbot commented Apr 23, 2013

Eh, both. Or Linux. Currently I use MSVC on Windows, which already supported this. But ideally clang should support it on Windows too.

@rnk
Copy link
Collaborator

rnk commented Apr 23, 2013

I'm looking at threading #pragma comment through to codegen. It's a lot like a stripped down ImportDecl: it basically gets passed through the backend and concatenated with linker options, with some changes on the way.

Is it work implementing something like #pragma clang linker_options "..." to implement this in terms of, and then thread that all the way through to the back, or would it be better to have a one off AST node just for #pragma comment?

Or is there some better way to move data all the way through Sema to CodeGen?

@rnk
Copy link
Collaborator

rnk commented May 8, 2013

I added #pragma comment(lib)-style autolinking in r181426, but that doesn't fix this problem for everyone.

@rnk
Copy link
Collaborator

rnk commented Oct 21, 2015

I'm going to close this. We have '#pragma comment lib' support in clang on Windows. Other platforms will have to wait.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla c++
Projects
None yet
Development

No branches or pull requests

4 participants