diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2021-05-28 20:54:11 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-05-28 20:54:11 -0700 |
| commit | 0afb5b2ec6de494efe0605b2270f6a01b95237af (patch) | |
| tree | b43c1faae430a6a0ac3f5801a278d36a0a13ed04 /src/zig_llvm-ar.cpp | |
| parent | e248de93a07fd6a7f48581ce0d9f6f77a69c76de (diff) | |
| download | zig-0afb5b2ec6de494efe0605b2270f6a01b95237af.tar.gz zig-0afb5b2ec6de494efe0605b2270f6a01b95237af.zip | |
stage2: add `zig ar` subcommand
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.
Diffstat (limited to 'src/zig_llvm-ar.cpp')
| -rw-r--r-- | src/zig_llvm-ar.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/zig_llvm-ar.cpp b/src/zig_llvm-ar.cpp index 4c26c8cad3..f4d8c1e84b 100644 --- a/src/zig_llvm-ar.cpp +++ b/src/zig_llvm-ar.cpp @@ -1260,7 +1260,8 @@ static int ranlib_main(int argc, char **argv) { return performOperation(CreateSymTab, nullptr); } -int main(int argc, char **argv) { +extern "C" int ZigLlvmAr_main(int argc, char **argv); +int ZigLlvmAr_main(int argc, char **argv) { InitLLVM X(argc, argv); ToolName = argv[0]; |
