summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2013-12-11 12:55:57 -0800
committerEric Anholt <eric@anholt.net>2013-12-11 15:03:58 -0800
commit1e443b2daf3de617b20c2263d57de8a484b49dbc (patch)
tree2e7a77827a3aee7e6b3b65d22e76aef3b9b8b319 /README.md
parent6553c08752f3f977db232932dfd92019add9c5da (diff)
downloadlibepoxy-1e443b2daf3de617b20c2263d57de8a484b49dbc.tar.gz
Use ifuncs on Linux to avoid dispatch table overhead.
These tell the linker to generate GNU_IFUNC relocs that rewrite the PLT entries in the user's address space to point to our resolved GL function, so there's no extra function pointer. It also, as a bonus, cuts 400k out of the library. This requires a toolchain from 2010 or so. Unfortunately, it's going to take a bit more investigation to find out what specific bits are required. Fixes #4
Diffstat (limited to 'README.md')
-rw-r--r--README.md18
1 files changed, 18 insertions, 0 deletions
diff --git a/README.md b/README.md
index 57890e2..489943e 100644
--- a/README.md
+++ b/README.md
@@ -80,3 +80,21 @@ We had to solve some of GLEW's problems for piglit and solving them
meant replacing every single piece of GLEW, so we built
piglit-dispatch from scratch. And since we wanted to reuse it in
other GL-related projects, this is the result.
+
+Caveats
+-------
+
+* libepoxy isn't intended to be dlopen()ed. On ifunc platforms,
+ RTLD_NOW would cause early resolution of all GL symbols, and the
+ following error from reentering the linker:
+
+```
+Inconsistency detected by ld.so: dl-open.c: 235: dl_open_worker:
+Assertion `_dl_debug_initialize (0, args->nsid)->r_state ==
+RT_CONSISTENT' failed!
+```
+
+* libepoxy isn't intended to be built statically. It usess ifuncs on
+ linux, since it can avoid its dispatch table entirely in that case.
+ Building statically disables ifuncs, dropping you to a
+ higher-overhead path!