Skip to content

stage2: add zig ar subcommand#8933

Merged
andrewrk merged 3 commits intomasterfrom
zig-ar
May 29, 2021
Merged

stage2: add zig ar subcommand#8933
andrewrk merged 3 commits intomasterfrom
zig-ar

Conversation

@andrewrk
Copy link
Member

@andrewrk andrewrk commented May 29, 2021

The same entrypoint supports the following commands:

  • ar
  • ranlib
  • dlltool
  • lib

For now, our strategy is to bundle the (renamed) main() function of
llvm-ar, same as our strategy for zig clang. However, as Zig matures,
a goal will be to replace the dependency on LLVM with our own
implementation of this tool, so that it is available in builds of zig
that do not have LLVM extensions enabled.

This commit also categorizes the subcommands into categories in the
--help menu.

Closes #7915

andrewrk added 2 commits May 28, 2021 20:12
The same entrypoint supports the following commands:

 * ar
 * ranlib
 * dlltool
 * lib

For now, our strategy is to bundle the (renamed) `main()` function of
llvm-ar, same as our strategy for `zig clang`. However, as Zig matures,
a goal will be to replace the dependency on LLVM  with our own
implementation of this tool, so that it is available in builds of zig
that do not have LLVM extensions enabled.

This commit also categorizes the subcommands into categories in the
--help menu.
Copy link
Member

@kubkon kubkon left a comment

Choose a reason for hiding this comment

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

Looks great!

@daurnimator
Copy link
Contributor

could you add objcopy as a wrapper around llvm-objcopy as well?

@kubkon
Copy link
Member

kubkon commented May 29, 2021

could you add objcopy as a wrapper around llvm-objcopy as well?

Great idea but I’d suggest adding it in a separate PR?

@andrewrk
Copy link
Member Author

Please file a separate issue for objcopy. We already have some zig code for doing objcopy stuff, however it is available as a build.zig step rather than a sub-command. In the issue we can discuss implementation strategies.

In this file is copy+pasted WindowsSupport.h from LLVM 12.0.1-rc1.
This is so that we can patch it. The upstream sources are incorrectly
including "llvm/Config/config.h" which is a private header and thus not
available in the include files distributed with LLVM.
The patch here changes it to include "llvm/Config/config.h" instead.
Patch submitted upstream: https://reviews.llvm.org/D103370
@andrewrk andrewrk merged commit 322215b into master May 29, 2021
@andrewrk andrewrk deleted the zig-ar branch May 29, 2021 23:31
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.

ar-compatible command for zig cc

3 participants