Closed
Bug 603821
Opened 15 years ago
Closed 15 years ago
debug non-libxul builds fail in WebGLContext.cpp, with "Undefined reference to `mozilla::gl::GLContext::sCurrentGLContext'"
Categories
(Core :: Graphics: CanvasWebGL, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: dholbert, Assigned: ehsan.akhgari)
References
Details
(Keywords: dogfood)
Attachments
(1 file)
|
1016 bytes,
patch
|
khuey
:
review+
|
Details | Diff | Splinter Review |
This build error just started (in my debug non-libxul build) when I did a pull -u:
{
WebGLContext.cpp:(.text._ZN7mozilla2gl9GLContext11MakeCurrentEi[mozilla::gl::GLContext::MakeCurrent(int)]+0x16): undefined reference to `mozilla::gl::GLContext::sCurrentGLContext'
/usr/bin/ld.bfd.real: ../../content/canvas/src/libgkconcvs_s.a(WebGLContext.o): relocation R_X86_64_PC32 against undefined hidden symbol `mozilla::gl::GLContext::sCurrentGLContext' can not be used when making a shared object
/usr/bin/ld.bfd.real: final link failed: Bad value
collect2: ld returned 1 exit status
distcc[8634] ERROR: compile (null) on localhost failed
make[5]: *** [libgklayout.so] Error 1
make[4]: *** [libs] Error 2
make[3]: *** [libs_tier_platform] Error 2
make[2]: *** [tier_platform] Error 2
make[1]: *** [default] Error 2
make: *** [build] Error 2
}
Looks like this variable (sCurrentGLContext) was just added, in bug 597881's changeset:
http://hg.mozilla.org/mozilla-central/rev/d3f448b20f20
| Reporter | ||
Updated•15 years ago
|
Summary: non-libxul builds fail in WebGLContext.cpp, with "Undefined reference to `mozilla::gl::GLContext::sCurrentGLContext'" → debug non-libxul builds fail in WebGLContext.cpp, with "Undefined reference to `mozilla::gl::GLContext::sCurrentGLContext'"
| Reporter | ||
Comment 1•15 years ago
|
||
bjacob / vlad, this probably needs a backout or a bustage fix, right?
Perhaps an #ifdef MOZ_LIBXUL around all uses of sCurrentGLContext would work as a bustage fix. (haven't looked at the patch, so I don't know how much that actually makes sense)
Comment 2•15 years ago
|
||
Sorry, I dont have my ssh key right now. Will take care of this tomorrow morning toronto time if nobody does it before (feel free to backout).
needs a THEBES_API in the declaration, I believe.
| Assignee | ||
Comment 4•15 years ago
|
||
Benoit, it would be great if you remember to add THEBES_API (or the equivalent) for symbols which need to be accessed across modules.
Assignee: nobody → ehsan
Status: NEW → ASSIGNED
Attachment #482786 -
Flags: review?(vladimir)
Attachment #482786 -
Flags: approval2.0?
Comment 5•15 years ago
|
||
(In reply to comment #4)
> Benoit, it would be great if you remember to add THEBES_API (or the equivalent)
> for symbols which need to be accessed across modules.
If only it was that obvious, e.g. try making MakeCurrent virtual.
Comment 6•15 years ago
|
||
(In reply to comment #5)
> (In reply to comment #4)
> > Benoit, it would be great if you remember to add THEBES_API (or the equivalent)
> > for symbols which need to be accessed across modules.
> If only it was that obvious, e.g. try making MakeCurrent virtual.
Sorry, I didn't know about that.
MakeCurrent used to be virtual before my faulty commit.
Neil, are you saying that a virtual function can't access a THEBES_API static member variable?
Anyway, thanks a lot for fixing this for me, Ehsan!
This being a bustage fix, do you really need review?
Comment on attachment 482786 [details] [diff] [review]
Patch (v1)
This is a simple symbol visibility bustage fix. Ship it.
Attachment #482786 -
Flags: review?(vladimir)
Attachment #482786 -
Flags: review+
Attachment #482786 -
Flags: approval2.0?
Comment 8•15 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/c18c9fa00a80
(Checked it doesn't break normal linux debug build)
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
| Assignee | ||
Comment 9•15 years ago
|
||
(In reply to comment #5)
> (In reply to comment #4)
> > Benoit, it would be great if you remember to add THEBES_API (or the equivalent)
> > for symbols which need to be accessed across modules.
> If only it was that obvious, e.g. try making MakeCurrent virtual.
Virtual functions don't need to be visible across modules if called virtually. They only need to be visible when the linker is resolving their symbol statically, right?
Benoit, here's what's happening here (and in the recent similar bugs as well). In libxul builds, we link pretty much everything in a single library called libxul, therefore the linker can resolve almost all symbol names statically. In non-libxul builds, however, we have separate shared object modules. For example, we have libgkgfx.dylib (which includes most of the stuff coming from gfx/), and libgklayout.dylib (which includes layout/ and content/, among other stuff). Now, when you add a symbol which is local to libgkgfx.dylib, it is not exported by default. Therefore, when you use it from code which ends up in libgklayout.dylib for example, the linker can't find that symbol, hence the error. THEBES_API and the equivalent mark the symbol as visible across shared object modules (or exported on Windows), which makes the linker able to find them and correctly link the program.
Comment 10•15 years ago
|
||
Many thanks Ehsan for the explanation! Very useful.
You need to log in
before you can comment on or make changes to this bug.
Description
•