Skip to content

Commit

Permalink
Remove ld in example toolchain and use gcc (#17)
Browse files Browse the repository at this point in the history
Summary:
This diff favours gcc over ld, allowing for autodiscovery of link paths.

Pull Request resolved: #17

Reviewed By: ndmitchell

Differential Revision: D40020376

Pulled By: ndmitchell

fbshipit-source-id: 0030776c2b3c7d890191afa119d78cfb1c546f0b
  • Loading branch information
arlyon authored and facebook-github-bot committed Oct 6, 2022
1 parent dc80c88 commit c658244
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions examples/prelude/toolchain/toolchain.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -39,24 +39,9 @@ def _cxx_toolchain(ctx):
CxxToolchainInfo(
mk_comp_db = ctx.attrs.make_comp_db,
linker_info = LinkerInfo(
linker = RunInfo(args = ["ld"]),
linker = RunInfo(args = ["gcc"]),
linker_flags = [
"-dynamic-linker",
"/lib64/ld-linux-x86-64.so.2",
"/usr/lib64/crt1.o",
"/usr/lib64/crti.o",
"/usr/lib64/crtn.o",
"-L/usr/lib/gcc/x86_64-redhat-linux/12",
"-lstdc++",
"-lm",
"-lgcc",
"-lc",
] + [
"/usr/lib/gcc/x86_64-redhat-linux/12/crtendS.o",
"/usr/lib/gcc/x86_64-redhat-linux/12/crtbeginS.o",
] if ctx.attrs.link_style == "shared" else [
"/usr/lib/gcc/x86_64-redhat-linux/12/crtend.o",
"/usr/lib/gcc/x86_64-redhat-linux/12/crtbegin.o",
],
archiver = RunInfo(args = ["ar", "rcs"]),
type = "gnu",
Expand Down

0 comments on commit c658244

Please sign in to comment.