Skip to content

respect ld from pkg-config#898

Merged
mato merged 3 commits intomirage:dev-solo5from
hannesm:ld-pkg-config
Apr 11, 2018
Merged

respect ld from pkg-config#898
mato merged 3 commits intomirage:dev-solo5from
hannesm:ld-pkg-config

Conversation

@hannesm
Copy link
Copy Markdown
Member

@hannesm hannesm commented Mar 28, 2018

this is needed again for OpenBSD support in solo5 (since OpenBSD's ld is an ancient GNU ld, which doesn't work with the solo5 linker script -- but their ld.lld (from clang/llvm) does..
//cc @adamsteen @mato

this basically reverts e0aba4d -- but since ld is no longer called via Makefile, but rather from OCaml code, it needs some adjustments.

the failure semantics (if pkg-config returns an error) is atm to log (on the warning channel) and call out to ld.

lib/mirage.ml Outdated
Bos.OS.Cmd.run Bos.Cmd.(v "ukvm-configure" % (libdir ^ "/src/ukvm") %% of_list ukvm_mods) >>= fun () ->
Bos.OS.Cmd.run Bos.Cmd.(v "make" % "-f" % "Makefile.ukvm" % "ukvm-bin") >>= fun () ->
Log.info (fun m -> m "linking with %a" Bos.Cmd.pp linker);
Bos.OS.Cmd.run linker >>= fun () ->
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hannesm Maybe I'm misreading the diff, but won't this run the linker twice for ukvm? The first call is on line 1927 just before the if target = Ukvm.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well spotted, I pushed 093ba78 which removes the second call to linker

@mato
Copy link
Copy Markdown
Contributor

mato commented Apr 11, 2018

Tested this manually, LGTM, thanks!

@mato mato merged commit a99196e into mirage:dev-solo5 Apr 11, 2018
@hannesm hannesm deleted the ld-pkg-config branch April 11, 2018 16:08
mato pushed a commit that referenced this pull request Jun 11, 2018
* respect ld from pkg-config

* mirage: unify link step of solo5-*, add solo5_pkt : target -> string, string

* mirage: avoid calling the linker twice (in the ukvm case), thx @mato
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

Successfully merging this pull request may close these issues.

2 participants