leaningtech / cheerp-meta

Cheerp - a C/C++ compiler for Web applications - compiles to WebAssembly and JavaScript
https://labs.leaningtech.com/cheerp
Other
1.02k stars 50 forks source link

Problems encountered when building cheerp #116

Closed unicornt closed 2 years ago

unicornt commented 2 years ago

I try to build cheerp according to build-instructions. However, I meet some problems.

Problem 1

In "Build utilities and libraries" section. When running instruction "ninja -C build_runtimes_genericjs", it will report no member error. 5d770280e7298fd755d17085d4d2256 I fix it by removing this code.

Problem 2

In "Build utilities and libraries" section. When running instruction "make -C stdlibs install INSTALL_PREFIX=/opt/cheerp CHEERP_PREFIX=/opt/cheerp". It will report no rule error. 61bbd0c918d76fed765997314836800 I fix it by removing "crt1.bc" from Makefile.

Problem 3

After building successfully, when trying to compile C++ file, it will report no file error. image

I have fixed all of them and built cheerp successfully, but i am not sure if i do it right and why these problem would arise. These problems is because of bad environment configuration, or failure in these instructions?

carlopi commented 2 years ago

Hi @unicornt, thanks for trying Cheerp, and reporting back the problems you were faced with.

Problem 1: I think I have a fix, will check and come back to it in a bit.

Problem 2: The file crt1.bc should be genertated during cheerp-musl build step, and then found both at /opt/cheerp/lib/genericjs/crt1.bc and at /opt/cheerp/lib/asmjs/crt1.bc Could you possibly check whether this was the case?

Problem 3: I still have to check, unsure what's happening, the file libsystem.bc should also be listed in /opt/cheerp/bin/../lib/asmjs/libsystem.bc.

unicornt commented 2 years ago

Hi @unicornt, thanks for trying Cheerp, and reporting back the problems you were faced with.

Problem 1: I think I have a fix, will check and come back to it in a bit.

Problem 2: The file crt1.bc should be genertated during cheerp-musl build step, and then found both at /opt/cheerp/lib/genericjs/crt1.bc and at /opt/cheerp/lib/asmjs/crt1.bc Could you possibly check whether this was the case?

Problem 3: I still have to check, unsure what's happening, the file libsystem.bc should also be listed in /opt/cheerp/bin/../lib/asmjs/libsystem.bc.

In Problem 2, do you mean cheerp-musl? I didn't see it in Installation instructions.

carlopi commented 2 years ago

Yes, we recently moved from newlib to musl as the backing libc implementation.

Thanks for pointing out that the documentation is outdated, I will fix it now, this probably generates all 3 problems.

I will ping when the documentation is up to date.

By the way, probably the simplest way to get started with Cheerp development is using PPAs, also available for nightly builds.

carlopi commented 2 years ago

I believe all 3 problem are connected to the switch to musl.

I changed the build instructions to point to the latest stable release, Cheerp 2.7, that still uses cheerp-newlib: https://docs.leaningtech.com/cheerp/Linux-build-instructions.

Thanks you again for noticing, looking forward for other feedback you might have on Cheerp.