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

Latest (3.x) emscripten vs 2.x, broken build scripts/libs/headers? #1331

Open
spider853 opened this issue Jan 5, 2024 · 6 comments
Open

Comments

@spider853
Copy link

spider853 commented Jan 5, 2024

Hi,

I've tried to compile ffmpeg with emscripten using this guide: https://dev.to/alfg/ffmpeg-webassembly-2cbl using MSYS2

I've used the latest version of both.
It took a few hours of patches to go through compilation of it with emscripten 3.x, starting from missing -nologo in clang and ending with multiple missing functions, links and other stuff during compilation like gethrtime and so on...

with emscripten 2.0.16 it didn't had many issues except one hand patch for missing shutil.which('mingw32-make') (it was using tools.building.which)

Is there a reason so many issues are in the current version, will they get fixed or it's because backwards compatibility was lost?
Couldn't find no information on things like missing nologo (is it a Microsoft only thing?), had to edit the py file to strip the argument

Thanks

@spider853 spider853 changed the title Latest emscripten vs 2.x, broken build libs/headers? Latest (3.x) emscripten vs 2.x, broken build libs/headers? Jan 5, 2024
@spider853 spider853 changed the title Latest (3.x) emscripten vs 2.x, broken build libs/headers? Latest (3.x) emscripten vs 2.x, broken build scripts/libs/headers? Jan 5, 2024
@sbc100
Copy link
Collaborator

sbc100 commented Jan 5, 2024

We try not to break existing code unless there is good reason. Perhaps you could file individual issues with details of the specific problems you ran into and we can try to address them individually.

For the nologo issue specifically, IIRC emsripten has never supported the /nologo command line flag. IIUC that is cl.exe specific flag that is not supported by gcc or clang (or emscripten).

@sbc100
Copy link
Collaborator

sbc100 commented Jan 5, 2024

For the gethrtime issue, I don't think emscripten ever supported that either. I cannot find any reference to it anywhere in the git history. Maybe something odd is going on with the build setup that is causing the project to think its building on some other platform that does support that library call (e.g. solaris?)

@spider853
Copy link
Author

I think that might be the difference in 2.x and 3.x it detects the platform differently maybe?
Like I mentioned above a good testbed is to just try to compile ffmpeg with that guide, and see the differences, 2.x no issues, 3.x (latest) a ton of issues 🤷‍♂️

@spider853
Copy link
Author

spider853 commented Jan 6, 2024

also forgot to mention I tried to build on the latest Ubuntu too, same issue

@sbc100
Copy link
Collaborator

sbc100 commented Jan 6, 2024

Between 2.0.16 and 3.0.0 there were over 1000 changes so its hard to say what might be causing your issues. Perhaps we can address them specifically one by one.

In order to reproduce do we just follow the instructions at https://dev.to/alfg/ffmpeg-webassembly-2cbl?

@spider853
Copy link
Author

yes, the only difference is you need to give the dirs to nm and ranlib (if not part of environment, which they're not by default)

-ranlib="$EMSDK/upstream/bin/llvm-ranlib"
--nm="$EMSDK/upstream/bin/llvm-nm -g"

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

No branches or pull requests

2 participants