Git Product home page Git Product logo

Comments (11)

kripken avatar kripken commented on May 24, 2024

Not sure, we'd need to debug it. First though, can you test on linux?

from box2d.js.

kjyv avatar kjyv commented on May 24, 2024

Yes, I can try. And yes, it seems to be alright there. I built with llvm 3.1 and clang 3.0 on ubuntu and while comparing versions I found that the default clang points to the 3.0svn based clang version that apple supplied. After that I tried clang 3.0 from macports but it still results in the same problem. The same with llvm-3.0 + clang-3.0

from box2d.js.

kripken avatar kripken commented on May 24, 2024

Might be worth trying to build llvm+clang 3.1 and testing with that - we've
had reports of problems with modified versions in repos.

On Wed, Nov 28, 2012 at 7:50 PM, Stefan [email protected] wrote:

Yes, I can try. And yes, it seems to be alright there. I built with llvm
3.1 and clang 3.0 on ubuntu and while comparing versions I found that the
default clang points to the 3.0svn based clang version that apple supplied.
After that I tried clang 3.0 from macports but it still results in the same
problem.

β€”
Reply to this email directly or view it on GitHubhttps://github.com//issues/14#issuecomment-10834123.

from box2d.js.

kjyv avatar kjyv commented on May 24, 2024

I just tried that, same issue. Just at the end of making, I get this

Warning: Unresolved symbol: __ZSt9terminatev
Warning: Unresolved symbol: _llvm_va_start
Warning: Unresolved symbol: __ZNK12b2WheelJoint13GetDefinitionEP15b2WheelJointDef
Warning: Unresolved symbol: __ZNSt9type_infoD2Ev
Warning: Unresolved symbol: _llvm_dbg_declare
Warning: Unresolved symbol: _llvm_expect_i32
Warning: Unresolved symbol: __ZNSt9exceptionD2Ev

in between, there are also a few warnings "(...) C-linkage specified, but returns user-defined type 'b2Vec2 &' which is incompatible with C [-Wreturn-type-c-linkage]"

Is it possible that some wrong c libraries are used?

from box2d.js.

kripken avatar kripken commented on May 24, 2024

Can you gist the entire build output? Something is definitely not going right if that is the output.

from box2d.js.

kjyv avatar kjyv commented on May 24, 2024

Sure, here you go. https://gist.github.com/4205181
(make output and errors are separated)

from box2d.js.

kripken avatar kripken commented on May 24, 2024

That output is actually correct.

Try on latest emscripten and llvm 3.2, if that doesn't work, please run with EMCC_DEBUG=1 and paste the output and files.

from box2d.js.

bunnyhero avatar bunnyhero commented on May 24, 2024

I am also getting runtime errors with box2d.js when building it on my Mac. I am using the binary release of LLVM 3.2 (clang+llvm-3.2-x86_64-apple-darwin11 as specified in this gist https://gist.github.com/dweekly/5873953 ). The build completes without error, but running the testbed results in an "Assertion: 20" error. If I build a non-optiimized version of box2d.js, I get the following error:

Uncaught TypeError: Property '0' of object [object Array] is not a function embox2d.js:24323
__ZN9b2Fixture6CreateEP16b2BlockAllocatorP6b2BodyPK12b2FixtureDef embox2d.js:24323
__ZN6b2Body13CreateFixtureEPK12b2FixtureDef embox2d.js:20131
__ZN6b2Body13CreateFixtureEPK7b2Shapef embox2d.js:19812
_emscripten_bind_b2Body__CreateFixture_p2 embox2d.js:61984
b2Body.CreateFixture embox2d.js:80137
embox2dTest_dominos.setup dominos.js:19
createWorld embox2d-html5canvas-testbed.js:314
resetScene embox2d-html5canvas-testbed.js:318
changeTest embox2d-html5canvas-testbed.js:292
window.onload testbed.html:25

Here is the build output, with EMCC_DEBUG=1: https://gist.github.com/bunnyhero/5915887

I have also confirmed that box2d.js builds correctly on Linux with the same sources for emscripten and box2d.js.

Let me know if there are any other files I should share. Thank you.

Update: I compared the box2d.bc files generated on Mac and on Linux. While they are identical in size, their contents differ. I could upload the LLVM disassemblies of each somewhere if that would help (they're about 3.5 MB each uncompressed).

from box2d.js.

bunnyhero avatar bunnyhero commented on May 24, 2024

I don't know if this is a valid thing to do, but: because I noticed that all of the generated .bc files were the same on Mac and Linux (except for box2d_bindings.bc), I copied box2d.bc from Linux to the Mac, and ran emmake make again (so that it would only run the last step of the Makefile). The resulting box2d.js file exhibits the runtime error noted above.

This might suggest that the error is occurring in the final conversion to JavaScript.

from box2d.js.

bunnyhero avatar bunnyhero commented on May 24, 2024

More investigation:

I used the same Linux-generated box2d.bc on Mac and on Linux, and ran

../emscripten/emcc --clear-cache
rm -f /tmp/emscripten_temp/*
EMCC_DEBUG=1 EMCC_CORES=1 ../emscripten/emmake make

on both platforms, and then investigated the cache files and temp files.

The cache files (for libc etc) were identical. The temp files, however:

Linux:

    $ openssl dgst -sha1 /tmp/emscripten_temp/*
    SHA1(/tmp/emscripten_temp/emcc-0-basebc.bc)= f4fe5cfa75591540b75c357507a134232541d2d9
    SHA1(/tmp/emscripten_temp/emcc-1-linktime.bc)= 1894450c508ac3ab320bb436a09e92c86e839c5c
    SHA1(/tmp/emscripten_temp/emcc-2-ll.ll)= debb808c3ff9fb3a96a95b368acab22f00a7aa87
    SHA1(/tmp/emscripten_temp/emcc-3-original.js)= d402c09e8859aa4dbea389ae3f3ef2aa416b1ffa
    SHA1(/tmp/emscripten_temp/emcc-4-transformed.js)= 7ec6c64bad9413dd23306474b928cc542032b20a

Mac:

    $ openssl dgst -sha1 /tmp/emscripten_temp/*
    SHA1(/tmp/emscripten_temp/emcc-0-basebc.bc)= f4fe5cfa75591540b75c357507a134232541d2d9
    SHA1(/tmp/emscripten_temp/emcc-1-linktime.bc)= 1894450c508ac3ab320bb436a09e92c86e839c5c
    SHA1(/tmp/emscripten_temp/emcc-2-ll.ll)= eed3eee8e7e40c8939683091093d49d8215d0b0c
    SHA1(/tmp/emscripten_temp/emcc-3-original.js)= d402c09e8859aa4dbea389ae3f3ef2aa416b1ffa
    SHA1(/tmp/emscripten_temp/emcc-4-transformed.js)= 194d9a4c6319c6a575b86193b4921a9fcba6f73b

Not sure if this is helpful for figuring out where I should look next; apologies for all the comments.

UPDATE: the difference in the .ll file seems insignificant, it was just this:

1c1
< ; ModuleID = '/tmp/tmpqZFIEO/box2d.bc'
---
> ; ModuleID = '/tmp/tmpiKBeDd/box2d.bc'

so I think somewhere between original.js and transformed.js, something goes wrong on the Mac.

from box2d.js.

bunnyhero avatar bunnyhero commented on May 24, 2024

Last comment before I see if I can fix or work around this: the problem seems to be with the C preprocessor on the Mac. The box2d.clean.h file it generates results in a broken bindings file. If I use the Linux-generated box2d.clean.h, then the bindings file gets created fine. Note that on recent versions of Xcode, the cpp command is actually a shell script that wraps llvm-gcc-4.2 -E.

Apologies for all the noise...

from box2d.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.