-
Notifications
You must be signed in to change notification settings - Fork 273
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 linking with LLVM shared libraries #1593
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,9 +30,13 @@ let args = [ | |
|
||
|
||
let () = C.main ~args ~name:"bap-llvm" @@ fun self -> | ||
let linkmode = | ||
"--link-" ^ | ||
(String.strip @@ | ||
C.Process.run_capture_exn self llvm_config ["--shared-mode"]) in | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It exists at least as far back as llvm 4.0. I don't know if there's a great solution here in general, since the installed version of llvm could change since bap was built, and then we might have a mismatch of the linking mode anyway. |
||
C.Flags.write_sexp "link.flags" @@ List.concat [ | ||
llvm self ["--link-static"; "--ldflags"]; | ||
llvm self (["--link-static"; "--libs"] @ llvm_components); | ||
llvm self [linkmode; "--ldflags"]; | ||
llvm self ([linkmode; "--libs"] @ llvm_components); | ||
["-lstdc++"; "-lcurses"; "-lzstd"]; | ||
]; | ||
C.Flags.write_sexp "cxx.flags" @@ List.concat [ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wow, didn't know about this syntax, is it new? (I mean will it work with opam 2.0)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this was added in opam 1.2.1.