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

Unable to build hello world: mono-wasm.cpp #18

Closed
leriel opened this issue Jun 26, 2018 · 7 comments
Closed

Unable to build hello world: mono-wasm.cpp #18

leriel opened this issue Jun 26, 2018 · 7 comments

Comments

@leriel
Copy link

leriel commented Jun 26, 2018

Hello. I managed to build the compiler, up to the step where we compile hello world app from this repo. Running this step:

$ cd ~/src/mono-wasm/build
$ vi Makefile               # make sure the *_PATH variables point to proper locations, should be the case if you followed these instructions
$ make

i get some warnings and an error that makes me unable to build:

mono-wasm.cpp:173:52: warning: cast from 'const char *' to 'char *' drops const qualifier
      [-Wcast-qual]
    char *first_assembly = strdup(basename((char *)assembly_paths[0].c_str()));
                                                   ^
mono-wasm.cpp:358:53: error: too few arguments to function call, expected at least 4, have 3
                llvm::TargetMachine::CGFT_ObjectFile)) {
                                                    ^
/Users/jedrzejg/Work/mono-wasm/llvm/include/llvm/Target/TargetMachine.h:254:3: note:
      'addPassesToEmitFile' declared here
  virtual bool addPassesToEmitFile(PassManagerBase &, raw_pwrite_stream &,
  ^
mono-wasm.cpp:405:22: warning: cast from 'const char *' to 'char *' drops const qualifier
      [-Wcast-qual]
        free((char *)args[i + 1]);

I suppose this is caused by some sort of wrong version. Could you point me in the right direction?

I also noticed makefile uses clang we just built, except two cases for clang and clang++. However, when i replaced those with clang we just built, i am getting

mono-wasm.cpp:5:10: fatal error: 'mach/mach_time.h' file not found

One more thing, running $ ~/src/mono-wasm/llvm-build/bin/clang --version shows clang version 7 instead of 5 and no registered targets:

(~/Work/mono-wasm/build)
$ ../llvm-build/bin/clang --version
clang version 7.0.0 (trunk 335475) (llvm/trunk 335466)
Target: x86_64-apple-darwin17.6.0
Thread model: posix
InstalledDir: (...)/mono-wasm/build/../llvm-build/bin

Should i now target any specific branch for llvm svn repos?

$ svn co http://llvm.org/svn/llvm-project/cfe/trunk clang
$ svn co http://llvm.org/svn/llvm-project/lld/trunk lld

Thanks in advance for any help.

@stefan-schweiger
Copy link

Everthing mono-wasm related was merged into the main mono repo.

See: #17

@leriel
Copy link
Author

leriel commented Jun 26, 2018

I should also mention that i didn't have VERSION env var which i added and set randomly to x86_64

@leriel
Copy link
Author

leriel commented Jun 26, 2018

@stefan-schweiger thanks! However the issues arise only when trying to build file from this repo. Should i link mono-wasm.cpp from this repo in the issue in mono repo ?

@stefan-schweiger
Copy link

@leriel this repo isn't maintained anymore. I also never got anything running with it. You should simply move on to the real mono repo (only caveat is that currently you can't do AOT with it).

@leriel
Copy link
Author

leriel commented Jun 27, 2018

I understand now - thanks!

@leriel leriel closed this as completed Jun 27, 2018
@ArionTT
Copy link

ArionTT commented Aug 30, 2018

it mean if I want to compile C# to WebAssembly, I just use mono respo to compile the C# file ??
I cann't understand what you mean....

@leriel
Copy link
Author

leriel commented Aug 30, 2018

@ArionTT just use Blazor project. https://github.com/aspnet/Blazor
There is overhead coming from Razor framework which you may not need, but with the ease of setup (blazor has dotnet project templates ready to go) it will save you insane amount of time.

Minimal bundle size for blazor is 1.9MB gzipped (as of 07.2018)

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

3 participants