ld --trap-mode

88 views
Skip to first unread message

Mark Sibly

unread,
Feb 23, 2018, 9:29:37 PM2/23/18
to emscripten-discuss
Hi,

I have users who have installed the 1.37.9 'portable' SDK who are getting the error below when trying to link.

Is it the same as this issue?


I have been rebuilding everything from incoming source lately myself - will users need to do the same?

Bye,
Mark

// ***** link + error

em++ -s USE_SDL=2 -s TOTAL_MEMORY=268435456 -s DISABLE_EXCEPTION_CATCHING=1 -O2 -s ASSERTIONS=2 --preload-file "D:/dev/monkey2/bananas/toy-plane/plane.buildv1.1.10/emscripten_debug/assets/@/assets" -s BINARYEN=1 -o "D:/dev/monkey2/bananas/toy-plane/plane.products/Emscripten/Plane.js" @tmp/lnkFiles1.txt

Unknown option '--trap-mode'

Traceback (most recent call last):

  File "D:\devtools\emsdk-portable-64bit\emscripten\incoming\\em++", line 16, in <module>

    emcc.run()

  File "D:\devtools\emsdk-portable-64bit\emscripten\incoming\emcc.py", line 1876, in run

    wasm_text_target, misc_temp_files, optimizer)

  File "D:\devtools\emsdk-portable-64bit\emscripten\incoming\emcc.py", line 2348, in do_binaryen

    subprocess.check_call(cmd)

  File "D:\dev\monkey2\playniax\installers\emsdk\emsdk-portable\python\2.7.5.3_64bit\lib\subprocess.py", line 542, in check_call

    raise CalledProcessError(retcode, cmd)

subprocess.CalledProcessError: Command '['D:/dev/monkey2/playniax/installers/emsdk/emsdk-portable/clang/e1.37.9_64bit/binaryen\\bin\\asm2wasm', 'D:/dev/monkey2/bananas/toy-plane/plane.products/Emscripten/Plane.temp.asm.js', '--total-memory=268435456', '--trap-mode=allow', '-O2', '--mem-init=D:/dev/monkey2/bananas/toy-plane/plane.products/Emscripten/Plane.js.mem', '--mem-base=1024', '--wasm-only', '-o', 'D:/dev/monkey2/bananas/toy-plane/plane.products/Emscripten/Plane.wasm']' returned non-zero exit status 1



Mark Sibly

unread,
Feb 23, 2018, 10:49:36 PM2/23/18
to emscripte...@googlegroups.com
Ok, I seem to have reached the point where I install *any* version of emscripten on Windows any more! Attempts so far include:

* 'emsdk install sdk-incoming-64bit' results in a ton of really obscure c++ STL errors - used to be able to compile this).

* 'emsdk install latest' results in 'Error downloading URL 'https://github.com/kripken/emscripten/archive/1.37.35.zip': <urlopen error [Errno 1] _ssl.c:504: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version>'.

And activating 'sdk-incoming-64bit' now results in one of those scary 'ERROR:root:Emscripten, llvm and clang repo versions do not match, this is dangerous (1.37.27, 1.37.35, 1.37.35)' messages.

Any advice?

--
You received this message because you are subscribed to a topic in the Google Groups "emscripten-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/emscripten-discuss/yNv7y1cFI20/unsubscribe.
To unsubscribe from this group and all its topics, send an email to emscripten-discuss+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mark Sibly

unread,
Feb 23, 2018, 10:58:51 PM2/23/18
to emscripte...@googlegroups.com
(ps: that should be *can't install*).

(pps: sorry about including trimmed content in last post - there seems to be no way to prevent gmail including it by default, what is up with that?).

Alon Zakai

unread,
Feb 23, 2018, 11:45:23 PM2/23/18
to emscripten-discuss
"Unknown option '--trap-mode'" can be caused by a mismatch in the binaryen version and emscripten version. Are you specifying a custom binaryen build? (BINARYEN_ROOT in the config file, which may look at a BINARYEN env var by default) If you don't specify a custom binaryen, emscripten should automatically fetch the proper version from ports, which is best.

Any special reason for 1.37.9, btw? It's also possible that's an old enough version (almost a year) that I don't remember if it had some bug related to the trap mode.

--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsub...@googlegroups.com.

Mark Sibly

unread,
Feb 24, 2018, 12:15:51 AM2/24/18
to emscripte...@googlegroups.com
> Are you specifying a custom binaryen build?  

Yikes, no idea how to. All I use is emsdk install/activate, and em++, emcc and emar from the command line.

A bit of progress with 'install latest' though. I got around the weird SSL url open error by directly downloading emscripten_blah1.37.35.zip from the URL and extracting it into the emsdk dir, so I can now at least 'activate latest' again - hooray! Sort of...

When I build my apps I now get 100001 lines like this during linking I assume:

(data (i32.const 135238) "\8a\00\00....." )

This is some kind of debug output I assume, and has never happened before. I think. I will now clean every trace of emscripten I can find on my system and try to install it again from scratch.

Given I apparently can't compile incoming from source any more, is 'latest' the correct version to be using? Is 'latest' currently 1.37.35?

Brion Vibber

unread,
Feb 24, 2018, 12:16:11 AM2/24/18
to emscripte...@googlegroups.com
On Sat, Feb 24, 2018 at 3:49 AM Mark Sibly <blitz...@gmail.com> wrote:
Ok, I seem to have reached the point where I install *any* version of emscripten on Windows any more! Attempts so far include:

* 'emsdk install sdk-incoming-64bit' results in a ton of really obscure c++ STL errors - used to be able to compile this).

* 'emsdk install latest' results in 'Error downloading URL 'https://github.com/kripken/emscripten/archive/1.37.35.zip': <urlopen error [Errno 1] _ssl.c:504: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version>'.

This bit looks like having too old a version of curl, that doesn't support newer TLS versions. Many sites have cut off the older insecure versions for security, so github may have recently changed in that regard...

-- brion 

To unsubscribe from this group and all its topics, send an email to emscripten-disc...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-disc...@googlegroups.com.

Mark Sibly

unread,
Feb 24, 2018, 12:24:48 AM2/24/18
to emscripte...@googlegroups.com
> This bit looks like having too old a version of curl, that doesn't support newer TLS versions 

I'm on windows 10 so I don't think I have curl at all?

Brion Vibber

unread,
Feb 24, 2018, 1:10:50 AM2/24/18
to emscripten Mailing List
On Feb 24, 2018 5:24 AM, "Mark Sibly" <blitz...@gmail.com> wrote:
> This bit looks like having too old a version of curl, that doesn't support newer TLS versions 

I'm on windows 10 so I don't think I have curl at all?

Most likely libcurl or openssl is bundled with Python... Double check that your Python installation is reasonably current.

I'll see if I can get it working on my Win10 machine at home Monday (I usually do my emscripten work on Mac or Linux) and see if I get the same errors...

-- brion


--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsub...@googlegroups.com.

Mark Sibly

unread,
Feb 24, 2018, 1:15:08 AM2/24/18
to emscripte...@googlegroups.com
> Most likely libcurl or openssl is bundled with Python... Double check that your Python installation is reasonably current. 

I *think* I just use whatever python emscripten installs (and it used to work) - will double check though, as I guess another app could've sneaked in a different version or something.

> I'll see if I can get it working on my Win10 machine at home Monday (I usually do my emscripten work on Mac or Linux) and see if I get the same errors... 

Thanks!  

Brion Vibber

unread,
Feb 25, 2018, 8:45:48 AM2/25/18
to emscripten Mailing List
Ok, I can confirm I get the same error with a freshly downloaded and updated emsdk on Windows 10.

It looks like it's using a bundled copy of python that's pretty old -- 2.7.5.3 where current is 2.7.14.


As a workaround, you can download and install a newer Python from https://www.python.org/downloads/ and use that to run the script instead of the bundled on, and it seems to work.

Once the newer Python is installed (I used Python 3.6.3 which I happened to have installed already), run:

  python ./emsdk install latest

instead of

  ./emsdk.bat install latest


-- brion

Mark Sibly

unread,
Feb 25, 2018, 6:33:07 PM2/25/18
to emscripte...@googlegroups.com
python ./emsdk install latest

Thanks, that fixes the download, but I now get this when trying to activate.

>  python ./emsdk activate latest
Writing .emscripten configuration file to user home directory C:\Users\The Razorback/
The Emscripten configuration file C:\Users\The Razorback\.emscripten has been rewritten with the following contents:

import os
LLVM_ROOT='D:/devtools/emsdk-portable-64bit/clang/e1.37.35_64bit'
EMSCRIPTEN_NATIVE_OPTIMIZER='D:/devtools/emsdk-portable-64bit/clang/e1.37.35_64bit/optimizer.exe'
BINARYEN_ROOT='D:/devtools/emsdk-portable-64bit/clang/e1.37.35_64bit/binaryen'
NODE_JS='D:/devtools/emsdk-portable-64bit/node/8.9.1_64bit/bin/node.exe'
PYTHON='D:/devtools/emsdk-portable-64bit/python/2.7.5.3_64bit/python.exe'
JAVA='D:/devtools/emsdk-portable-64bit/java/8.152_64bit/bin/java.exe'
EMSCRIPTEN_ROOT='D:/devtools/emsdk-portable-64bit/emscripten/1.37.35'
SPIDERMONKEY_ENGINE = ''
V8_ENGINE = ''
TEMP_DIR = 'c:/users/theraz~1/appdata/local/temp'
COMPILER_ENGINE = NODE_JS
JS_ENGINES = [NODE_JS]

Failed to read environment variable PATH:
No module named win32api
Traceback (most recent call last):
  File "./emsdk", line 2337, in <module>
    sys.exit(main())
  File "./emsdk", line 2273, in main
    tools_to_activate = set_active_tools(tools_to_activate, permanently_activate=arg_global)
  File "./emsdk", line 1814, in set_active_tools
    env_string = construct_env(tools_to_activate, False)
  File "./emsdk", line 1912, in construct_env
    newpath, added_path = adjusted_path(tools_to_activate)
  File "./emsdk", line 1875, in adjusted_path
    existing_path = win_get_environment_variable('PATH', system=True)
  File "./emsdk", line 222, in win_get_environment_variable
    win32api.RegCloseKey(folder)
UnboundLocalError: local variable 'win32api' referenced before assignment


Brion Vibber

unread,
Feb 25, 2018, 7:06:58 PM2/25/18
to emscripten Mailing List
On Sun, Feb 25, 2018 at 3:32 PM, Mark Sibly <blitz...@gmail.com> wrote:
python ./emsdk install latest

Thanks, that fixes the download, but I now get this when trying to activate.
[snip]
Failed to read environment variable PATH:
No module named win32api

Just discovered that myself too. :) The bundled python includes an extra module or two that weren't around by default.

You can work around that by going back to emsdk.bat for the activate step (since it doesn't need to download anything at that stage).

-- brion

 
Traceback (most recent call last):
  File "./emsdk", line 2337, in <module>
    sys.exit(main())
  File "./emsdk", line 2273, in main
    tools_to_activate = set_active_tools(tools_to_activate, permanently_activate=arg_global)
  File "./emsdk", line 1814, in set_active_tools
    env_string = construct_env(tools_to_activate, False)
  File "./emsdk", line 1912, in construct_env
    newpath, added_path = adjusted_path(tools_to_activate)
  File "./emsdk", line 1875, in adjusted_path
    existing_path = win_get_environment_variable('PATH', system=True)
  File "./emsdk", line 222, in win_get_environment_variable
    win32api.RegCloseKey(folder)
UnboundLocalError: local variable 'win32api' referenced before assignment


Mark Sibly

unread,
Feb 25, 2018, 8:02:52 PM2/25/18
to emscripte...@googlegroups.com
> You can work around that by going back to emsdk.bat for the activate step (since it doesn't need to download anything at that stage). 

Ok, thanks, I can activate latest now and even compile! Linking was initially a problem as em++ was having problems installing/building the SDL2 'port' (and others) - I think I was getting the same original URL errors and have posted them below if anyone's interested.

So I copied the 'new' Python27 dir into emsdk/python dir, renamed it to whatever em++ was expecting, and it worked!

I can now build with emscripten again, but what a drama! I am trying to write an 'easy to use' programming env and the emscripten target is currently really out of bounds for most users - it's just too hard. I would love to see a self-contained 'binary installer' exe that didn't have to go online and didn't haven't any dependancies on anything, ie: something that 'just worked'.

That'll come eventually I guess, but in the meantime emscripten just seems to get harder and harder to install. Besides this windows python problem, macos users also have to apparently build emscripten from scratch due to os versioning issues with 'ar' or something. Not complaining really, I realize it's a big project and all, just letting off some steam!

// ***** Initial em++ link error - fixedg by blasting over emsdk/python with python27:

Mx2cc version 1.1.10

***** Making app 'D:/dev/monkey2/bananas/toy-plane/plane.monkey2' (emscripten debug llvm gcc) *****

Parsing...
Semanting...
Translating...
Compiling...
wopts=-s BINARYEN=1
Linking D:/dev/monkey2/bananas/toy-plane/plane.products/Emscripten/Plane.js...
Build error: System command failed:

em++ -s USE_SDL=2 -s TOTAL_MEMORY=268435456 -s DISABLE_EXCEPTION_CATCHING=1 -O2 -s ASSERTIONS=2 --preload-file "D:/dev/monkey2/bananas/toy-plane/plane.buildv1.1.10/emscripten_debug/assets/@/assets" -s BINARYEN=1 -o "D:/dev/monkey2/bananas/toy-plane/plane.products/Emscripten/Plane.js" @tmp/lnkFiles1.txt

INFO:root:generating system asset: is_vanilla.txt... (this will be cached in "C:\Users\The Razorback\.emscripten_cache\is_vanilla.txt" for subsequent builds)

INFO:root: - ok

INFO:root:(Emscripten: Running sanity checks)


ERROR:root:a problem occurred when using an emscripten-ports library. try to run    emcc --clear-ports    and then run this command again

Traceback (most recent call last):

  File "D:\devtools\emsdk-portable-64bit\emscripten\1.37.35\\em++", line 15, in <module>

    python_selector.run(emcc, profile=True)

  File "D:\devtools\emsdk-portable-64bit\emscripten\1.37.35\tools\python_selector.py", line 43, in run

    sys.exit(run_by_import(filename, main) if on_allowed_version() else run_by_subprocess(filename))

  File "D:\devtools\emsdk-portable-64bit\emscripten\1.37.35\tools\python_selector.py", line 13, in run_by_import

    return getattr(importlib.import_module(os.path.basename(filename)), main)()

  File "D:\devtools\emsdk-portable-64bit\emscripten\1.37.35\emcc.py", line 1483, in run

    extra_files_to_link = system_libs.get_ports(shared.Settings)

  File "D:\devtools\emsdk-portable-64bit\emscripten\1.37.35\tools\system_libs.py", line 749, in get_ports

    ret += [f for f in port.get(Ports, settings, shared) if not f.endswith('.txt')]

  File "D:\devtools\emsdk-portable-64bit\emscripten\1.37.35\tools\ports\sdl.py", line 26, in get

    ports.fetch_project('sdl2', 'https://github.com/emscripten-ports/SDL2/archive/' + TAG + '.zip', 'SDL2-' + TAG)

  File "D:\devtools\emsdk-portable-64bit\emscripten\1.37.35\tools\system_libs.py", line 676, in fetch_project

    retrieve()

  File "D:\devtools\emsdk-portable-64bit\emscripten\1.37.35\tools\system_libs.py", line 639, in retrieve

    f = urlopen(url)

  File "D:\devtools\emsdk-portable-64bit\python\2.7.5.3_64bit\lib\urllib2.py", line 127, in urlopen

    return _opener.open(url, data, timeout)

  File "D:\devtools\emsdk-portable-64bit\python\2.7.5.3_64bit\lib\urllib2.py", line 404, in open

    response = self._open(req, data)

  File "D:\devtools\emsdk-portable-64bit\python\2.7.5.3_64bit\lib\urllib2.py", line 422, in _open

    '_open', req)

  File "D:\devtools\emsdk-portable-64bit\python\2.7.5.3_64bit\lib\urllib2.py", line 382, in _call_chain

    result = func(*args)

  File "D:\devtools\emsdk-portable-64bit\python\2.7.5.3_64bit\lib\urllib2.py", line 1222, in https_open

    return self.do_open(httplib.HTTPSConnection, req)

  File "D:\devtools\emsdk-portable-64bit\python\2.7.5.3_64bit\lib\urllib2.py", line 1184, in do_open

    raise URLError(err)

urllib2.URLError: <urlopen error [Errno 1] _ssl.c:504: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version>

Reply all
Reply to author
Forward
0 new messages