diff options
| author | ruki <[email protected]> | 2025-12-15 22:41:55 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-12-15 22:41:55 +0800 |
| commit | 0edd8ff4b884eebc30ab04870ab0ea2bb9e4bb60 (patch) | |
| tree | 84a39e33c6483f459e5b97cc3b46e9619bb3e9db /xmake/rules/utils/bin2obj/utils.lua | |
| parent | f23872ba7f507474cd3ee77e718f3ff5e30035a9 (diff) | |
improve cosmocc for binutils
Diffstat (limited to 'xmake/rules/utils/bin2obj/utils.lua')
| -rw-r--r-- | xmake/rules/utils/bin2obj/utils.lua | 32 |
1 files changed, 2 insertions, 30 deletions
diff --git a/xmake/rules/utils/bin2obj/utils.lua b/xmake/rules/utils/bin2obj/utils.lua index 7149a72a6..3e8802e97 100644 --- a/xmake/rules/utils/bin2obj/utils.lua +++ b/xmake/rules/utils/bin2obj/utils.lua @@ -113,38 +113,10 @@ function generate_objectfile(target, batchcmds, binaryfile, opt) if zeroend then table.insert(argv, "--zeroend") end - batchcmds:vlua("cli.binutils.bin2obj", argv) - - -- generate concomitant object file for cosmocc if is_cosmocc then - local arch_concomitant - local objectfile_concomitant - if arch == "x86_64" or arch == "x64" then - arch_concomitant = "aarch64" - objectfile_concomitant = path.join(path.directory(objectfile), ".aarch64", path.filename(objectfile)) - elseif arch == "aarch64" or arch == "arm64" then - arch_concomitant = "x86_64" - objectfile_concomitant = path.join(path.directory(objectfile), ".x86_64", path.filename(objectfile)) - end - - if arch_concomitant and objectfile_concomitant then - batchcmds:mkdir(path.directory(objectfile_concomitant)) - local argv_concomitant = { - "-i", path(binaryfile), - "-o", path(objectfile_concomitant), - "-f", format, - "-a", arch_concomitant, - "-p", plat - } - if symbol_prefix ~= "_binary_" then - table.insert(argv_concomitant, "--symbol_prefix=" .. symbol_prefix) - end - if zeroend then - table.insert(argv_concomitant, "--zeroend") - end - batchcmds:vlua("cli.binutils.bin2obj", argv_concomitant) - end + table.insert(argv, "--cosmocc") end + batchcmds:vlua("cli.binutils.bin2obj", argv) return objectfile end |
