Converting assembly language to bitcode

Hi all,

I'm trying to compile OpenH264 (https://github.com/cisco/openh264) with
Emscripten so I can use it in my own C++ project. Running the command
`emmake make` from the root directory yields several warnings such as the
following:

emcc:WARNING: codec/encoder/core/x86/coeff.o is not a valid input file

Upon closer inspection, this is because the file `coeff.o` is the result of
assembling another file `coeff.asm` in the same folder. The assembler used
is NASM (https://www.nasm.us/), and the command used to produce `coeff.o`
is the following:

nasm -DUNIX64 -DHAVE_AVX2 -f elf64 -I./codec/common/x86/   -o
codec/encoder/core/x86/coeff.o codec/encoder/core/x86/coeff.asm

Is there any way to make coeff.o usable by Emscripten? From what I know,
the resulting output file needs to be in bitcode for Emscripten to
recognize it.

I've tried using McSema (https://github.com/trailofbits/mcsema) to lift
`coeff.o` but it is incompatible with the latest version of IDA Pro and I
can't figure out a way to downgrade it. I've also looked at llvm-as (
https://llvm.org/docs/CommandGuide/llvm-as.html) but it looks like it
requires the input file to be written strictly in LLVM assembly language.

Thanks in advance!

Sincerely,
Bryce

Received on Monday, 23 September 2019 21:13:27 UTC