W3C home > Mailing lists > Public > public-webassembly@w3.org > September 2019

Converting assembly language to bitcode

From: Bryce Tham <brycetham@gmail.com>
Date: Wed, 18 Sep 2019 17:16:56 -0700
Message-ID: <CAEzbqZeZiRK9wtuz-+GR63xc4TFh8Tgqb-ak3PxrEP64Ap_zwQ@mail.gmail.com>
To: public-webassembly@w3.org
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

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!

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

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:55:34 UTC