Skip to content

Instantly share code, notes, and snippets.

@DianQK
Created May 7, 2021 02:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DianQK/b7fee4fe988b4056462e03dd66afbb96 to your computer and use it in GitHub Desktop.
Save DianQK/b7fee4fe988b4056462e03dd66afbb96 to your computer and use it in GitHub Desktop.
使用 @response_file_path 减少命令行传递链接参数数量
// response_file
-demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch arm64 -platform_version macos 11.3.0 11.3 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk -o /Users/yahaha/Desktop/lto-example/foo/build/foo/Build/Products/Release/foo -L/Users/yahaha/Desktop/lto-example/foo/build/foo/Build/Products/Release -filelist /Users/yahaha/Desktop/lto-example/foo/build/foo/Build/Intermediates.noindex/foo.build/Release/foo.build/Objects-normal/arm64/foo.LinkFileList -object_path_lto /Users/yahaha/Desktop/lto-example/foo/build/foo/Build/Intermediates.noindex/foo.build/Release/foo.build/Objects-normal/arm64/foo_lto.o -print_statistics -save-temps -lbar -no_adhoc_codesign -dependency_info /Users/yahaha/Desktop/lto-example/foo/build/foo/Build/Intermediates.noindex/foo.build/Release/foo.build/Objects-normal/arm64/foo_dependency_info.dat -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.5/lib/darwin/libclang_rt.osx.a -F/Users/yahaha/Desktop/lto-example/foo/build/foo/Build/Products/Release
// ld 命令
ld @response_file
参数说明
@response_file_path
Inserts contents of file at response_file_path into argu-
ments. This allows for linker command line args to be store
in a file. Note: ld is normally invoked through clang, and
clang also interprets @file on the command line. To have
clang ignore the @file and pass it through to ld, use
-Wl,@file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment