summaryrefslogtreecommitdiff
path: root/xmake/core/base/binutils.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2025-12-19 13:48:46 +0800
committerGitHub <[email protected]>2025-12-19 13:48:46 +0800
commit5df20ea1dafb3c19e95b8bcd2df6cbbbf03fde81 (patch)
treed7554bec8522d1be9eb6e7e45953b1d8010bf522 /xmake/core/base/binutils.lua
parentbbe585b9b8927d71f79f8c723110224e31348381 (diff)
parent68be1c62a74322993a6b21f74476a716cb3a6963 (diff)
Merge pull request #7149 from xmake-io/rpath
Add rpath in binutils
Diffstat (limited to 'xmake/core/base/binutils.lua')
-rw-r--r--xmake/core/base/binutils.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/xmake/core/base/binutils.lua b/xmake/core/base/binutils.lua
index af71e8ae7..5bed5de21 100644
--- a/xmake/core/base/binutils.lua
+++ b/xmake/core/base/binutils.lua
@@ -31,6 +31,7 @@ binutils._bin2macho = binutils._bin2macho or binutils.bin2macho
binutils._bin2elf = binutils._bin2elf or binutils.bin2elf
binutils._readsyms = binutils._readsyms or binutils.readsyms
binutils._deplibs = binutils._deplibs or binutils.deplibs
+binutils._rpath_list = binutils._rpath_list or binutils.rpath_list
binutils._extractlib = binutils._extractlib or binutils.extractlib
-- generate c/c++ code from the binary file
@@ -111,6 +112,15 @@ function binutils.deplibs(binaryfile)
end
end
+-- get rpath list from binary file (auto-detect format: ELF or Mach-O)
+function binutils.rpath_list(binaryfile)
+ if binutils._rpath_list then
+ return binutils._rpath_list(binaryfile)
+ else
+ return nil, "binutils: internal rpath_list not supported!"
+ end
+end
+
-- extract static library to directory
-- Supports AR format (.a) and MSVC lib format (.lib)
-- @param libraryfile the static library file path (.a or .lib)