Skip to content

-lGL may pick up libGL.a instead of library_webgl.js #10171

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

Closed
juj opened this issue Jan 9, 2020 · 5 comments · Fixed by #14337
Closed

-lGL may pick up libGL.a instead of library_webgl.js #10171

juj opened this issue Jan 9, 2020 · 5 comments · Fixed by #14337
Assignees
Labels

Comments

@juj
Copy link
Collaborator

juj commented Jan 9, 2020

In PR #10116, upstream mac bot gives

emcc:WARNING: invocation: /Users/distiller/project/emcc.py -o a.html /Users/distiller/project/tests/minimal_webgl/main.cpp /Users/distiller/project/tests/minimal_webgl/webgl.c --js-library /Users/distiller/project/tests/minimal_webgl/library_js.js -s RUNTIME_FUNCS_TO_IMPORT=[] -s USES_DYNAMIC_ALLOC=2 -lGL -s MODULARIZE=1 -s MINIMAL_RUNTIME=2 -s AGGRESSIVE_VARIABLE_ELIMINATION=1 -s ENVIRONMENT=web -s TEXTDECODER=2 -s ABORTING_MALLOC=0 -s ALLOW_MEMORY_GROWTH=0 -s SUPPORT_ERRNO=0 -s DECLARE_ASM_MODULE_EXPORTS=1 -s MALLOC=emmalloc -s GL_EMULATE_GLES_VERSION_STRING_FORMAT=0 -s GL_EXTENSIONS_IN_PREFIXED_FORMAT=0 -s GL_SUPPORT_AUTOMATIC_ENABLE_EXTENSIONS=0 -s GL_TRACK_ERRORS=0 -s GL_SUPPORT_EXPLICIT_SWAP_CONTROL=0 -s GL_POOL_TEMP_BUFFERS=0 -s FAST_UNROLLED_MEMCPY_AND_MEMSET=0 -s MIN_CHROME_VERSION=58 --output_eol linux -O3 --closure 1 -DNDEBUG -ffast-math  (in /private/var/folders/ms/xg67k5sn16xc7sdr_w3q45840000gn/T/emscripten_test_other_11g8vels)
shared:DEBUG: successfully executed /Users/distiller/emsdk-master/upstream/bin/clang++ --version
root:DEBUG: Checking JS engine ['/Users/distiller/emsdk-master/node/12.9.1_64bit/bin/node']
shared:DEBUG: successfully executed /Users/distiller/emsdk-master/node/12.9.1_64bit/bin/node --version
shared:DEBUG: successfully executed /Users/distiller/emsdk-master/upstream/bin/llc --version
shared:INFO: (Emscripten: Running sanity checks)
shared:DEBUG: successfully executed java -version
shared:DEBUG: successfully executed java -version
emcc:DEBUG: asm.js opts not forced by user or an option that depends them, and we do not intend to run the asm.js, so disabling and leaving opts to the binaryen optimizer
emcc:DEBUG: compiling to bitcode
emcc:DEBUG: emcc step "parse arguments and setup" took 0.32 seconds
cache:DEBUG: PID 1008 acquiring multiprocess file lock to Emscripten cache at /Users/distiller/.emscripten_cache/wasm-obj
cache:DEBUG: done
emcc:DEBUG: compiling source file: /Users/distiller/project/tests/minimal_webgl/main.cpp
shared:DEBUG: successfully executed /Users/distiller/emsdk-master/upstream/bin/clang -target wasm32-unknown-emscripten -D__EMSCRIPTEN_major__=1 -D__EMSCRIPTEN_minor__=39 -D__EMSCRIPTEN_tiny__=5 -D_LIBCPP_ABI_VERSION=2 -Dunix -D__unix -D__unix__ -Werror=implicit-function-declaration -Xclang -nostdsysteminc -Xclang -isystem/Users/distiller/project/system/include/libcxx -Xclang -isystem/Users/distiller/project/system/lib/libcxxabi/include -Xclang -isystem/Users/distiller/project/system/include/compat -Xclang -isystem/Users/distiller/project/system/include -Xclang -isystem/Users/distiller/project/system/include/libc -Xclang -isystem/Users/distiller/project/system/lib/libc/musl/arch/emscripten -Xclang -isystem/Users/distiller/project/system/local/include -Xclang -isystem/Users/distiller/.emscripten_cache/wasm-obj/include -O3 -DNDEBUG -ffast-math -DEMSCRIPTEN /Users/distiller/project/tests/minimal_webgl/main.cpp -Xclang -isystem/Users/distiller/project/system/include/SDL -c -o /var/folders/ms/xg67k5sn16xc7sdr_w3q45840000gn/T/emscripten_temp/main_0.o -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr
emcc:DEBUG: compiling source file: /Users/distiller/project/tests/minimal_webgl/webgl.c
shared:DEBUG: successfully executed /Users/distiller/emsdk-master/upstream/bin/clang -target wasm32-unknown-emscripten -D__EMSCRIPTEN_major__=1 -D__EMSCRIPTEN_minor__=39 -D__EMSCRIPTEN_tiny__=5 -D_LIBCPP_ABI_VERSION=2 -Dunix -D__unix -D__unix__ -Werror=implicit-function-declaration -Xclang -nostdsysteminc -Xclang -isystem/Users/distiller/project/system/include/libcxx -Xclang -isystem/Users/distiller/project/system/lib/libcxxabi/include -Xclang -isystem/Users/distiller/project/system/include/compat -Xclang -isystem/Users/distiller/project/system/include -Xclang -isystem/Users/distiller/project/system/include/libc -Xclang -isystem/Users/distiller/project/system/lib/libc/musl/arch/emscripten -Xclang -isystem/Users/distiller/project/system/local/include -Xclang -isystem/Users/distiller/.emscripten_cache/wasm-obj/include -O3 -DNDEBUG -ffast-math -DEMSCRIPTEN /Users/distiller/project/tests/minimal_webgl/webgl.c -Xclang -isystem/Users/distiller/project/system/include/SDL -c -o /var/folders/ms/xg67k5sn16xc7sdr_w3q45840000gn/T/emscripten_temp/webgl_1.o -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr
emcc:DEBUG: emcc step "compile inputs" took 0.34 seconds
emcc:DEBUG: emcc step "process inputs" took 0.00 seconds
emcc:DEBUG: looking for library "GL"
emcc:DEBUG: found library "GL" at /Users/distiller/.emscripten_cache/wasm-obj/libGL.a

i.e. -lGL picks up libGL.a from Emscripten cache. Not quite sure why the cache directory is in -L directories or how it gets there, or why it happens only on the macOS bot, but that was the cause of the bug in #10116.

@juj
Copy link
Collaborator Author

juj commented Jan 9, 2020

One can work around that by passing -lwebgl.js instead of -lGL.

@juj juj added the GL label Jan 9, 2020
@sbc100
Copy link
Collaborator

sbc100 commented Jan 9, 2020

I'll take a look and see if I can find a sensible solution. Is the behavior you are expecting is that -lGL would give you both libGL native and webgl.js library?

I've been trying to make the cache directory more like a normal sysroot and less magical, which is why its in the -I and -L paths these days.

@sbc100 sbc100 self-assigned this Jan 9, 2020
@juj
Copy link
Collaborator Author

juj commented Jan 13, 2020

Yeah, when linking with WebGL, both library_webgl.js and the native lib libGL.a should get picked up. (it's never one or the other, but both always come together)

@stale
Copy link

stale bot commented Jan 14, 2021

This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 30 days. Feel free to re-open at any time if this issue is still relevant.

@stale stale bot added the wontfix label Jan 14, 2021
@sbc100
Copy link
Collaborator

sbc100 commented Jan 14, 2021

bump

@stale stale bot removed the wontfix label Jan 14, 2021
sbc100 added a commit that referenced this issue Jun 1, 2021
This also happens to fix an old bug (#10171) where
we would look on the file system for `libGL.a` before
looking in `map_to_js_libs`.

Fixes: #10171
Fixes: #14335
sbc100 added a commit that referenced this issue Jun 1, 2021
When calling `map_to_js_libs('GL')` we were mapping this to the JS
libraries, and not also including the native `libgl` library.  Normally
this doesn't matter since `libgl` is normally included by default but
not when `AUTO_NATIVE_LIBRARIES=0` is used.

This also happens to fix an old bug (#10171) where we would look on the
file system for `libGL.a` before looking in `map_to_js_libs`.

Fixes: #10171
Fixes: #14335
sbc100 added a commit that referenced this issue Jun 1, 2021
When calling `map_to_js_libs('GL')` we were mapping this to the JS
libraries, and not also including the native `libgl` library.  Normally
this doesn't matter since `libgl` is normally included by default but
not when `AUTO_NATIVE_LIBRARIES=0` is used.

This also happens to fix an old bug (#10171) where we would look on the
file system for `libGL.a` before looking in `map_to_js_libs`.

Fixes: #10171
Fixes: #14335
sbc100 added a commit that referenced this issue Jun 1, 2021
When calling `map_to_js_libs('GL')` we were mapping this to the JS
libraries, and not also including the native `libgl` library.  Normally
this doesn't matter since `libgl` is normally included by default but
not when `AUTO_NATIVE_LIBRARIES=0` is used.

This also happens to fix an old bug (#10171) where we would look on the
file system for `libGL.a` before looking in `map_to_js_libs`.

Fixes: #10171
Fixes: #14335
sbc100 added a commit that referenced this issue Jun 2, 2021
When calling `map_to_js_libs('GL')` we were mapping this to the JS
libraries, and not also including the native `libgl` library.  Normally
this doesn't matter since `libgl` is normally included by default but
not when `AUTO_NATIVE_LIBRARIES=0` is used.

This also happens to fix an old bug (#10171) where we would look on the
file system for `libGL.a` before looking in `map_to_js_libs`.

Fixes: #10171
Fixes: #14335
sbc100 added a commit that referenced this issue Jun 2, 2021
When calling `map_to_js_libs('GL')` we were mapping this to the JS
libraries, and not also including the native `libgl` library.  Normally
this doesn't matter since `libgl` is normally included by default but
not when `AUTO_NATIVE_LIBRARIES=0` is used.

This also happens to fix an old bug (#10171) where we would look on the
file system for `libGL.a` before looking in `map_to_js_libs`.

Fixes: #10171
Fixes: #14335
sbc100 added a commit that referenced this issue Jun 2, 2021
When calling `map_to_js_libs('GL')` we were mapping this to the JS
libraries, and not also including the native `libgl` library.  Normally
this doesn't matter since `libgl` is normally included by default but
not when `AUTO_NATIVE_LIBRARIES=0` is used.

This also happens to fix an old bug (#10171) where we would look on the
file system for `libGL.a` before looking in `map_to_js_libs`.

Fixes: #10171
Fixes: #14335
sbc100 added a commit that referenced this issue Jun 2, 2021
When calling `map_to_js_libs('GL')` we were mapping this to the JS
libraries, and not also including the native `libgl` library.  Normally
this doesn't matter since `libgl` is normally included by default but
not when `AUTO_NATIVE_LIBRARIES=0` is used.

This also happens to fix an old bug (#10171) where we would look on the
file system for `libGL.a` before looking in `map_to_js_libs`.

Fixes: #10171
Fixes: #14335
sbc100 added a commit that referenced this issue Jun 3, 2021
When calling `map_to_js_libs('GL')` we were mapping this to the JS
libraries, and not also including the native `libgl` library.  Normally
this doesn't matter since `libgl` is normally included by default but
not when `AUTO_NATIVE_LIBRARIES=0` is used.

This also happens to fix an old bug (#10171) where we would look on the
file system for `libGL.a` before looking in `map_to_js_libs`.

Fixes: #10171
Fixes: #14335
sbc100 added a commit that referenced this issue Jun 3, 2021
When calling `map_to_js_libs('GL')` we were mapping this to the JS
libraries, and not also including the native `libgl` library.  Normally
this doesn't matter since `libgl` is normally included by default but
not when `AUTO_NATIVE_LIBRARIES=0` is used.

This also happens to fix an old bug (#10171) where we would look on the
file system for `libGL.a` before looking in `map_to_js_libs`.

Fixes: #10171
Fixes: #14335
sbc100 added a commit that referenced this issue Jun 3, 2021
When calling `map_to_js_libs('GL')` we were mapping this to the JS
libraries, and not also including the native `libgl` library.  Normally
this doesn't matter since `libgl` is included by default, but not when
`AUTO_NATIVE_LIBRARIES=0` is used.

This also happens to fix an old bug (#10171) where we would look on the
file system for `libGL.a` before looking in `map_to_js_libs`.

Fixes: #10171
Fixes: #14335
sbc100 added a commit that referenced this issue Jun 3, 2021
When calling `map_to_js_libs('GL')` we were mapping this to the JS
libraries, and not also including the native `libgl` library.  Normally
this doesn't matter since `libgl` is included by default, but not when
`AUTO_NATIVE_LIBRARIES=0` is used.

This also happens to fix an old bug (#10171) where we would look on the
file system for `libGL.a` before looking in `map_to_js_libs`.

Fixes: #10171
Fixes: #14335
sbc100 added a commit that referenced this issue Jun 4, 2021
When calling `map_to_js_libs('GL')` we were mapping this to the JS
libraries, and not also including the native `libgl` library.  Normally
this doesn't matter since `libgl` is included by default, but not when
`AUTO_NATIVE_LIBRARIES=0` is used.

This also happens to fix an old bug (#10171) where we would look on the
file system for `libGL.a` before looking in `map_to_js_libs`.

Fixes: #10171
Fixes: #14335
sbc100 added a commit that referenced this issue Jun 4, 2021
When calling `map_to_js_libs('GL')` we were mapping this to the JS
libraries, and not also including the native `libgl` library.  Normally
this doesn't matter since `libgl` is included by default, but not when
`AUTO_NATIVE_LIBRARIES=0` is used.

This also happens to fix an old bug (#10171) where we would look on the
file system for `libGL.a` before looking in `map_to_js_libs`.

Fixes: #10171
Fixes: #14335
sbc100 added a commit that referenced this issue Jun 4, 2021
When calling `map_to_js_libs('GL')` we were mapping this to the JS
libraries, and not also including the native `libgl` library.  Normally
this doesn't matter since `libgl` is included by default, but not when
`AUTO_NATIVE_LIBRARIES=0` is used.

This also happens to fix an old bug (#10171) where we would look on the
file system for `libGL.a` before looking in `map_to_js_libs`.

Fixes: #10171
Fixes: #14335
sbc100 added a commit that referenced this issue Jun 4, 2021
When calling `map_to_js_libs('GL')` we were mapping this to the JS
libraries, and not also including the native `libgl` library.  Normally
this doesn't matter since `libgl` is included by default, but not when
`AUTO_NATIVE_LIBRARIES=0` is used.

This also happens to fix an old bug (#10171) where we would look on the
file system for `libGL.a` before looking in `map_to_js_libs`.

Fixes: #10171
Fixes: #14335
sbc100 added a commit that referenced this issue Jun 4, 2021
When calling `map_to_js_libs('GL')` we were mapping this to the JS
libraries, and not also including the native `libgl` library.  Normally
this doesn't matter since `libgl` is included by default, but not when
`AUTO_NATIVE_LIBRARIES=0` is used.

This also happens to fix an old bug (#10171) where we would look on the
file system for `libGL.a` before looking in `map_to_js_libs`.

Fixes: #10171
Fixes: #14335
sbc100 added a commit that referenced this issue Jun 4, 2021
When calling `map_to_js_libs('GL')` we were mapping this to the JS
libraries, and not also including the native `libgl` library.  Normally
this doesn't matter since `libgl` is included by default, but not when
`AUTO_NATIVE_LIBRARIES=0` is used.

This also happens to fix an old bug (#10171) where we would look on the
file system for `libGL.a` before looking in `map_to_js_libs`.

Fixes: #10171
Fixes: #14335
sbc100 added a commit that referenced this issue Jun 4, 2021
When calling `map_to_js_libs('GL')` we were mapping this to the JS
libraries, and not also including the native `libgl` library.  Normally
this doesn't matter since `libgl` is included by default, but not when
`AUTO_NATIVE_LIBRARIES=0` is used.

This also happens to fix an old bug (#10171) where we would look on the
file system for `libGL.a` before looking in `map_to_js_libs`.

Fixes: #10171
Fixes: #14335
sbc100 added a commit that referenced this issue Jun 5, 2021
When calling `map_to_js_libs('GL')` we were mapping this to the JS
libraries, and not also including the native `libgl` library.  Normally
this doesn't matter since `libgl` is included by default, but not when
`AUTO_NATIVE_LIBRARIES=0` is used.

This also happens to fix an old bug (#10171) where we would look on the
file system for `libGL.a` before looking in `map_to_js_libs`.

Fixes: #10171
Fixes: #14335
sbc100 added a commit that referenced this issue Jun 7, 2021
When calling `map_to_js_libs('GL')` we were mapping this to the JS
libraries, and not also including the native `libgl` library.  Normally
this doesn't matter since `libgl` is included by default, but not when
`AUTO_NATIVE_LIBRARIES=0` is used.

This also happens to fix an old bug (#10171) where we would look on the
file system for `libGL.a` before looking in `map_to_js_libs`.

Fixes: #10171
Fixes: #14335
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants