summaryrefslogtreecommitdiff
path: root/xmake/core/base/binutils.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2025-12-19 22:55:22 +0800
committerruki <[email protected]>2025-12-19 22:55:22 +0800
commit2c497bc57fc27af645afbf3de2e4e6068ea853dc (patch)
treedef81c9e79c644381502f0bfe7c0ee7547536241 /xmake/core/base/binutils.lua
parentbbe585b9b8927d71f79f8c723110224e31348381 (diff)
add rpath list 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)