Re-implement libGL such that ELF symbol filtering is optional

Unfortunately, glibc has a bug where dlopening a shared library with
DT_FILTER or DT_AUXILIARY ELF headers can cause the application to
segfault (see https://sourceware.org/bugzilla/show_bug.cgi?id=16272).
Hence, for now, we can't rely on ELF symbol filtering to implement the
libGL compatibility library for libGLdispatch and libGLX.  This change
re-implements libGL such that this is no longer necessary, by building
in the glapi static dispatch stubs and implementing thin wrapper
functions around GLX entrypoints.

- Rename getCachedProcAddress() to __glXGetCachedProcAddress() and give
  this public visibility.  This is used by the libGL wrapper library to
  retrieve GLX entrypoints at load time.

- Link libGLX with the -Bsymbolic flag so __glXGetCachedProcAddress()
  avoids referencing functions in the libGL wrapper library when libGL
  and libGLX are both loaded.

- Replace the hand-coded no-op definitions in libglxnoopdefs.h with
  a spec file, glx_funcs.spec, and a simple Perl script, gen_stubs.pl,
  which parses the file and generates no-op functions as well as
  pass-through functions that are used by libGL.

- Restructure GLdispatch/vnd-glapi/mapi/entry.c such that the pure C
  fallback code is in its own header, entry_pure_c.h.  In each of the
  entry_*.h headers, separate code not related to implementing the
  static dispatch stubs into an "#if !defined(STATIC_DISPATCH_ONLY)"
  block.

- Give u_current (which is #defined as _glapi_Current or
  _glapi_tls_Current depending on the thread storage model used) public
  visibility so it can be referenced from outside of libGLdispatch.so.

- When building libGL, include GLdispatch/vnd-glapi/mapi/entry.c in the
  sources, and define STATIC_DISPATCH_ONLY so that only the static
  entrypoints are compiled.  Remove the -Wl,--auxiliary flags from
  Makefile.am.

Bonus: fix "make distcheck" by adding GLdispatchABI.h to noinst_HEADERS.

Signed-off-by: Brian Nguyen <brnguyen@nvidia.com>
Re-implement libOpenGL such that ELF symbol filtering is optional

This implementation uses the same strategy as libGL to implement OpenGL
entrypoints.  The only difference between this library and libGL is
that the GLX wrapper functions are omitted.

Signed-off-by: Brian Nguyen <brnguyen@nvidia.com>
Add a configure option to build libGL with ELF symbol filtering

This option is disabled by default due to glibc bug 16272.

Signed-off-by: Brian Nguyen <brnguyen@nvidia.com>
Allow arguments to be passed to the configure script through dbg_configure.sh

Signed-off-by: Brian Nguyen <brnguyen@nvidia.com>
Unifdef USE_MGL_NAMESPACE macro

This macro is unused by libglvnd.

Signed-off-by: Brian Nguyen <brnguyen@nvidia.com>
Add missing _GNU_SOURCE define in libglx.c

This is needed to use the RTLD_DEFAULT pseudo-handle on x86 platforms.

Signed-off-by: Brian Nguyen <brnguyen@nvidia.com>
[testglxmakecurrent] Initialize the window_info struct before possible failure

Signed-off-by: Brian Nguyen <brnguyen@nvidia.com>
Update README now that ELF symbol filtering is disabled by default

Signed-off-by: Brian Nguyen <brnguyen@nvidia.com>