Linux command
llvm-ar 命令
文件
复制后可按需替换文件名、目录或参数。
常用示例
Create archive from object files
llvm-ar rcs [libname.a] [file1.o] [file2.o]
List archive contents
llvm-ar t [archive.a]
Extract files from archive
llvm-ar x [archive.a]
Add files to archive
llvm-ar r [archive.a] [file.o]
Delete file from archive
llvm-ar d [archive.a] [file.o]
说明
llvm-ar is the LLVM archiver for creating and manipulating static library archives. Drop-in replacement for GNU ar. Creates archives compatible with the system linker for static linking.
参数
- r
- Replace or add files to archive.
- c
- Create archive without warning.
- s
- Create archive index.
- t
- List archive contents.
- x
- Extract files from archive.
- d
- Delete files from archive.
- --format _type_
- Archive format (gnu, darwin, bsd).
FAQ
What is the llvm-ar command used for?
llvm-ar is the LLVM archiver for creating and manipulating static library archives. Drop-in replacement for GNU ar. Creates archives compatible with the system linker for static linking.
How do I run a basic llvm-ar example?
Run `llvm-ar rcs [libname.a] [file1.o] [file2.o]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does r do in llvm-ar?
Replace or add files to archive.