Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: build for emcc 2.0.9 #149

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

FIX: build for emcc 2.0.9 #149

wants to merge 1 commit into from

Conversation

erisco
Copy link

@erisco erisco commented Nov 22, 2020

FIX: build for emcc 2.0.9, -r linking flag is required and a non-executable file extension to produce object files instead of
javascript files

non-executable file extension to produce object files instead of
javascript files
&& \
emmake make -j && \
cp ffmpeg ffmpeg.bc
emmake make -j EXESUF=.bc
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend using .o since this is not necessarily a bitcode file

&& \
emmake make -j && \
cp ffmpeg ffmpeg.bc
emmake make -j EXESUF=.bc
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When emconfigure is use emmake is not necessary. All the emscripten-specific details will be encoding into the autoconf-generated makefile. emmake is for normal non-autoconf-based Makefiles

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What should this line be changed to then?

@fujinxiang
Copy link

I use erisco:master branch , but still get error

nm: /tmp/ffconf.bMB3JO1u/test.o: file format not recognized
ERROR: libx264 not found

If you think configure made a mistake, make sure you are using the latest
version from Git.  If the latest version fails, report the problem to the
[email protected] mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "ffbuild/config.log" produced by configure as this will help
solve the problem.
make: *** [Makefile:203: build/ffmpeg-mp4/ffmpeg.bc] Error 1

@sbc100
Copy link

sbc100 commented Nov 28, 2020

Do you know who is running nm there? If normal GNU nm tool doesn't works with emscripten since we use wasm object files which GNU tools can't parse.. You would need to use llvm-nm.

@fujinxiang
Copy link

I don't konw, I just run make mp4 command in WSL (Ubuntu), this is error info image.
error

@zbryikt
Copy link

zbryikt commented Aug 23, 2021

it seems that the error nm: /tmp/ffconf.bMB3JO1u/test.o: file format not recognized didn't affect the final output since I've successfully built while with the error shown.

It should be the error ERROR: libx264 not found that caused the build failure. however x264 should be built by this target:

build/x264/dist/lib/libx264.so:

perhaps you didn't fetch the submodules or there's something wrong with that part of Makefile?

@1inus
Copy link

1inus commented Oct 4, 2021

I don't konw, I just run make mp4 command in WSL (Ubuntu), this is error info image. error

install pkgconf apt install pkgconf

@sbc100
Copy link

sbc100 commented Oct 4, 2021

Somewhere in your build system nm is being run directly. emcmake is setting $NM to point to llvm-nm, but if your build system doesn't honor this environment variable and just runs nm directly you will need to fix it.

@Aloento
Copy link

Aloento commented Dec 21, 2021

I have new problem with em3(latest), could you help me to check it? @sbc100


wasm-ld: error: duplicate symbol: cos
>>> defined in build/opus/dist/lib/libopus.so
>>> defined in build/lame/dist/lib/libmp3lame.so

wasm-ld: error: duplicate symbol: __cos
>>> defined in build/opus/dist/lib/libopus.so
>>> defined in build/lame/dist/lib/libmp3lame.so

wasm-ld: error: duplicate symbol: __rem_pio2
>>> defined in build/opus/dist/lib/libopus.so
>>> defined in build/lame/dist/lib/libmp3lame.so

wasm-ld: error: duplicate symbol: __rem_pio2_large
>>> defined in build/opus/dist/lib/libopus.so
>>> defined in build/lame/dist/lib/libmp3lame.so

wasm-ld: error: duplicate symbol: __sin
>>> defined in build/opus/dist/lib/libopus.so
>>> defined in build/lame/dist/lib/libmp3lame.so

wasm-ld: error: duplicate symbol: floor
>>> defined in build/opus/dist/lib/libopus.so
>>> defined in build/lame/dist/lib/libmp3lame.so

@sbc100
Copy link

sbc100 commented Dec 21, 2021

Can share the full command line used to build both build/opus/dist/lib/libopus.so and build/lame/dist/lib/libmp3lame.so? Those math symbols should not end in these "shared libraries" (they are really just combined object files I this case I assume since are you most like building them with -shared and not with -sSIDE_MODULE, right?)

@Aloento
Copy link

Aloento commented Dec 21, 2021

Can share the full command line used to build both build/opus/dist/lib/libopus.so and build/lame/dist/lib/libmp3lame.so? Those math symbols should not end in these "shared libraries" (they are really just combined object files I this case I assume since are you most like building them with -shared and not with -sSIDE_MODULE, right?)

Thanks for your reply!
Please see here https://github.com/Aloento/ffmpeg.js

The build command for libopus and libmp3lame are same as the Kagami's version and works fine in very old em.
The diff is that I added libwebp and removed h264.
Now I'm trying to use em2.0.11 to build...

@Aloento
Copy link

Aloento commented Dec 21, 2021

After trying 2.0.11, I got:

wasm-ld: error: duplicate symbol: cos
>>> defined in build/opus/dist/lib/libopus.so
>>> defined in build/lame/dist/lib/libmp3lame.so

wasm-ld: error: duplicate symbol: log
>>> defined in build/opus/dist/lib/libopus.so
>>> defined in build/lame/dist/lib/libmp3lame.so

wasm-ld: error: duplicate symbol: exp
>>> defined in build/opus/dist/lib/libopus.so
>>> defined in build/lame/dist/lib/libmp3lame.so

wasm-ld: error: duplicate symbol: __rem_pio2
>>> defined in build/opus/dist/lib/libopus.so
>>> defined in build/lame/dist/lib/libmp3lame.so

wasm-ld: error: duplicate symbol: __rem_pio2_large
>>> defined in build/opus/dist/lib/libopus.so
>>> defined in build/lame/dist/lib/libmp3lame.so

wasm-ld: error: duplicate symbol: __sin
>>> defined in build/opus/dist/lib/libopus.so
>>> defined in build/lame/dist/lib/libmp3lame.so

wasm-ld: error: duplicate symbol: __cos
>>> defined in build/opus/dist/lib/libopus.so
>>> defined in build/lame/dist/lib/libmp3lame.so

wasm-ld: error: duplicate symbol: floor
>>> defined in build/opus/dist/lib/libopus.so
>>> defined in build/lame/dist/lib/libmp3lame.so

Then I tried em2.0.1 and I got
ERROR: libwebp >= 0.2.0 not found using pkg-config

Now I'm so confused...

@sbc100
Copy link

sbc100 commented Dec 21, 2021

Emscripten is in 3.0.1 these days. Can you try with this latest version?

@Aloento
Copy link

Aloento commented Dec 21, 2021

@sbc100 this is from latest version

When I use the Kagami's em version then I got
wasm-ld: error: unknown argument: -rpath

After removed libwebp, still get same errors.
And I tried with SIDE_MODULE=1
emcc: error: WASM2JS is not compatible with relocatable output

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants