diff options
| author | Michael Forney <mforney@mforney.org> | 2020-09-07 19:29:01 -0700 |
|---|---|---|
| committer | Michael Forney <mforney@mforney.org> | 2020-09-07 19:29:08 -0700 |
| commit | a4a4ce9142aa60e252c1e1827fe2518000ab6bf9 (patch) | |
| tree | 502bbf4c6059f24619dd504aa51267c13f614410 /pkg/binutils/gen.lua | |
| parent | 49146e3bdf0114f844e4a65cf40a792aaa56eaf2 (diff) | |
binutils: Fix disassembler
Diffstat (limited to 'pkg/binutils/gen.lua')
| -rw-r--r-- | pkg/binutils/gen.lua | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/pkg/binutils/gen.lua b/pkg/binutils/gen.lua index aadbf93b..c7c9a03e 100644 --- a/pkg/binutils/gen.lua +++ b/pkg/binutils/gen.lua @@ -1,7 +1,7 @@ local version = setmetatable({2, 35}, {__index=function() return 0 end}) local defvec = 'x86_64_elf64_vec' local selvecs = {[defvec]=true, i386_elf32_vec=true} -local selarchs = {bfd_i386_arch=true} +local selarchs = {i386=true} local emuls = { 'elf_x86_64', 'elf_i386', @@ -102,13 +102,13 @@ sub('bfd.ninja', function() selvecs.elf32_be_vec = true end if vec:find('iamcu_elf32') then - selarchs.bfd_iamcu_arch = true + selarchs.iamcu = true end if vec:find('l1om_elf64') then - selarchs.bfd_l1om_arch = true + selarchs.l1om = true end if vec:find('k1om_elf64') then - selarchs.bfd_k1om_arch = true + selarchs.k1om = true end end local srcs = {} @@ -125,7 +125,7 @@ sub('bfd.ninja', function() end end for arch in pairs(selarchs) do - srcs['bfd/cpu-'..arch:match('bfd_([%w_]+)_arch')..'.c'] = true + srcs['bfd/cpu-'..arch..'.c'] = true end local deps = { '$gendir/deps', @@ -142,7 +142,7 @@ sub('bfd.ninja', function() }}) cc('bfd/archures.c', nil, {cflags={ '$cflags', - string.format([[-D 'SELECT_ARCHITECTURES=&%s']], table.concat(table.keys(selarchs), ',&')), + string.format([[-D 'SELECT_ARCHITECTURES=&bfd_%s_arch']], table.concat(table.keys(selarchs), '_arch,&bfd_')), }}) cc('bfd/dwarf2.c', nil, {cflags={'$cflags', string.format([[-D 'DEBUGDIR="%s/lib/debug"']], config.prefix)}}) lib('libbfd.a', { @@ -173,8 +173,11 @@ sub('opcodes.ninja', function() end end end + cc('opcodes/disassemble.c', nil, {cflags={ + '$cflags', '-D ARCH_'..table.concat(table.keys(selarchs), ' -D ARCH_'), + }}) lib('libopcodes.a', { - paths[[opcodes/(dis-buf.c disassemble.c dis-init.c)]], + paths[[opcodes/(dis-buf.c disassemble.c.o dis-init.c)]], table.keys(srcs), }) end) |
