Commit graph

592 commits

Author SHA1 Message Date
Kyle Brenneman 55fad54ac7 Make Python optional when building from the make dist tarball.
When you run "make dist", the resulting tarball includes all of the generated
files. When building from that, we don't need to generate anything.
2018-08-17 07:17:56 -06:00
Kyle Brenneman 56450264b8 EGL: Fix typo in the makefile.
The $(VM_V_GEN) variable should be $(AM_V_GEN).
2018-08-17 07:17:53 -06:00
Kyle Brenneman 85705b4cf2
Merge pull request #157 from bochecha/python
build: Find Python the Autotools way
2018-08-17 07:16:49 -06:00
Mathieu Bridon 90f973f74d build: Find Python the Autotools way
An added advantage to this is that it makes it really easy to build with
Python 3, the same way other Autotools projects support it:

    $ export PYTHON=/usr/bin/python3
    $ ./configure
2018-08-16 13:57:27 +02:00
Kyle Brenneman 59dbb141a6 Bump the version number to 1.1.0. 2018-07-24 11:35:26 -06:00
Kyle Brenneman 9d909106f2 Update the OpenGL XML and header files.
Update the gl.xml, GL/glext.h, and the GLES headers to commit
42f61786696df5102625d9b046976ee857645704 from the Khronos registry.
2018-06-20 15:57:00 -06:00
Kyle Brenneman 638ef33fc7 EGL: Remove a few unused functions in egldispatchstubs.c.
Remove FindProcIndex, __eglSetDispatchIndex, and
__eglDispatchFindDispatchFunction from egldispatchstubs.c.

The dispatch indices are allocated and assigned during initialization, so none
of those functions are ever called.
2018-06-06 08:42:41 -06:00
Kyle Brenneman 8709003ffd GLdispatch: Add a version script for the TSD build.
Add a separate version script export_list_tsd.ver for the TSD build of
libGLdispatch, since the two builds don't have the same set of symbols.
2018-05-24 08:42:52 -06:00
Kyle Brenneman 652909fbff Some fixes for "make dist"
Don't point nonst_HEADERS or EXTRA_DIST at entire directories. That causes
"make dist" to include files that it shouldn't, such as configured makefiles
and .pyc files.

Also added a few generated header files to noinst_HEADERS.
2018-04-13 16:15:37 -06:00
Kyle Brenneman 4914b61fa4 GLdispatch: Use --version-script instead -export-symbols.
The -export-symbols option in libtool creates a version script on Linux, but
on FreeBSD it instead uses the -retain-symbols-file option, which doesn't do
anything with the dynamic symbol table.

Instead, manually pass the --version-script option to the linker.
2018-04-11 15:14:10 -06:00
Kyle Brenneman 5baa1e5cfc Merge branch 'freebsd-fixes'
Various fixes so that libglvnd can build and run on FreeBSD.

The only change to C code is to deal with a difference in the parameters for
mincore(2).

Most of the rest is to to remove the dependency on GNU make and bash.
2018-03-27 13:20:46 -06:00
Kyle Brenneman dfaf0fd2b9 Add a (void*) cast for the last parameter when calling mincore.
The third parameter to mincore(2) can be a pointer to char or unsigned char,
depending on what system it's building on. To build in either case, just cast
that argument to a (void *).
2018-03-26 14:41:07 -06:00
Kyle Brenneman 82413e05ff Use sh instead of bash for the test scripts.
Not all systems have bash available, and in those that do, we can't assume that
it's located at /bin/bash.
2018-03-26 14:41:05 -06:00
Kyle Brenneman c413eae4f9 configure: Recognize both "x86_64" and "amd64" for host_cpu.
On FreeBSD, $host_cpu is set to "amd64" instead of "x86_64", so update the
configure script to recognize either string.
2018-03-26 14:41:03 -06:00
Kyle Brenneman 0177ade402 configure: Check if linking against libdl is necessary.
Add an AC_CHECK_FUNC call to check whether dlopen is available without any
additional libraries. Some systems provide dlopen as part of libc, in which
case we can't (and don't need to) link against libdl.so.
2018-03-26 14:41:01 -06:00
Kyle Brenneman f47132e649 GL: Expand glapi_gen_libglglxstubs in the makefile.
glapi_gen_libglglxstubs is only used once, so just expand it out instead of
using a function.
2018-03-26 14:40:59 -06:00
Kyle Brenneman adf997feb8 Move the glapi_gen_libglglxstubs function into the GL makefile.
Remove the now-empty file glvnd_gen.mk.
2018-03-26 14:40:57 -06:00
Kyle Brenneman f2b886ddea vnd-glapi: Change glapi_gen_mapi to a makefile variable.
Change glapi_gen_mapi to be a makefile variable instead of a function, so that
it still works when not using GNU make.
2018-03-26 14:40:55 -06:00
Kyle Brenneman 342cb23f22 Move the glapi_gen_mapi function into the vnd-glapi makefile.
$(glapi_gen_mapi) is only used in the vnd-glapi makefile, so define it there.
2018-03-26 14:40:52 -06:00
Kyle Brenneman 1578be92f2 generate: Remove glapi_gen_libopengl_exports.
Generating a symbol list for the entrypoint libraries used to be necessary when
we generated the same set of dispatch stubs in each library.

Since then, we only generate the stubs that each library is going to export, so
we don't need a separate export list anymore.
2018-03-26 14:40:50 -06:00
Kyle Brenneman 1e8ea3fe10 GL: Don't generate g_glapi_mapi_gl_tmp.h
Don't generate g_glapi_mapi_gl_tmp.h in the libGL makefile. That's not needed
anymore, because all of the GLDispatch stuff is built separately under
src/GLdispatch/vnd-glapi.

Likewise, remove the STATIC_DISPATCH_ONLY define from the compiler flags.
2018-03-26 14:40:48 -06:00
Kyle Brenneman f6d236e8dc
Merge pull request #150 from aaronp24/work-around-xorgproto-api-break
GLX: Work around 'X_GLXCreateContextAtrribsARB' typo fix API break
2018-03-08 09:40:32 -07:00
Kyle Brenneman 8cb4a2f8b7
Merge pull request #153 from RAOF/fix-egl-platform-detection-crash
Handle dlsym succeeding with info.dli_sname == NULL.
2018-03-05 12:38:46 -07:00
Christopher James Halse Rogers 45d92a4b6d
Handle dlsym succeeding with info.dli_sname == NULL.
When dlsym is handed an address in a shared object that doesn't match a symbol
in that shared object (such as a C++ vtable) it returns success but sets
dli_sname to null.

Handle this case rather than crashing.
2018-03-05 10:15:02 +01:00
Kyle Brenneman b029c24a63
Merge pull request #152 from kbrenneman/fix-eglMakeCurrent-bad-display
Always return an error from eglMakeCurrent if the EGLDispaly is invalid
2018-02-26 08:27:15 -07:00
Kyle Brenneman 28e05b9349 Always return an error from eglMakeCurrent if the EGLDispaly is invalid
In eglMakeCurrent, check to make sure the EGLDisplay is valid, even if the
context is NULL.

Fixes https://github.com/NVIDIA/libglvnd/issues/151
2018-02-22 11:33:43 -07:00
Aaron Plattner 627cc6634c GLX: Work around 'X_GLXCreateContextAtrribsARB' typo fix API break
Older versions of glxproto.h contained a typo where "Attribs" was misspelled.
The typo was fixed in the xorgproto version of glxproto.h, breaking the API.

Fixes #149.
2018-02-12 09:45:39 -08:00
Kyle Brenneman 212861e5e7
Merge pull request #148 from kbrenneman/bump-library-versions
Bump the version numbers in the library filenames
2018-01-31 10:20:55 -07:00
Kyle Brenneman 1b74e819e1 Bump the version numbers in the library filenames.
If libglvnd is installed onto a system that already has non-libglvnd versions
of any of the OpenGL libraries installed, then ldconfig can get confused about
which files to create symlinks to. At worst, you could end up with a mix of the
libglvnd libraries and leftover non-libglvnd libraries.

To avoid that, bump the version numbers in these filenames:
- libGL.so.1.0.0 -> libGL.so.1.7.0
- libGLESv1_CM.so.1.0.0 -> libGLESv1_CM.so.1.2.0
- libGLESv2.so.2.0.0 -> libGLESv2.so.2.1.0
- libEGL.so.1.0.0 -> libEGL.so.1.1.0

Fixes https://github.com/NVIDIA/libglvnd/issues/147
2018-01-30 11:04:18 -07:00
Kyle Brenneman 398e80757f
Merge pull request #143 from kbrenneman/gldispatch-fix-execmem
Fix executable memory allocation ifdefs and size
2018-01-17 09:34:53 -07:00
Kyle Brenneman fa8cea5bce GLdispatch: Fix the allocation size for the dynamic stubs.
In u_execmem.c, use entry_stub_size and MAPI_TABLE_NUM_DYNAMIC to determine how
much executable memory to allocate, instead of just hard-coding 256KB.

The stubs on some architectures are larger than 64 bytes, so 256KB isn't always
going to be large enough, and it's wasteful on architectures with stubs that
are smaller than 64 bytes.
2018-01-16 11:34:41 -07:00
Kyle Brenneman 294ccb2f49 GLdispatch: Remove obsolete #ifdefs from u_execmem.c.
Remove the #ifdefs and the Win32 and malloc-based code from u_execmem.c. It's
not needed or used anymore, and even if it was, the allocation code is in
src/utils/utils_misc.c now.
2018-01-16 11:26:50 -07:00
Kyle Brenneman e4a1393ffe
Merge pull request #140 from kbrenneman/add-GLX_EXT_no_config_context
Add support for GLX_EXT_no_config_context
2017-12-27 13:32:54 -07:00
Kyle Brenneman 55b962809b tests: Only use glXCreateContext in testglxmakecurrent.
In testglxmakecurrent, remove the paths to test using glXCreateNewContext and
glXCreateContextAttribsARB.

The testglxcreatecontext test now tests the various context creation functions,
so we don't need to shoehorn them into testglxmakecurrent.
2017-12-06 13:35:11 -07:00
Kyle Brenneman f34d06facf tests: Add a test for creating GLX contexts.
Add a new test, testglxcreatecontext to test the various functions for creating
GLX contexts.

It tests the core GLX functions, the GLX_ARB_create_context and
GLX_EXT_no_config_context extensions, and using a vendor-provided extension
function.

The new test is much simpler than trying to use testglxmakecurrent to test both
context creation and MakeCurrent, especially for trying to test multiple
context creation functions.
2017-12-06 13:33:42 -07:00
Kyle Brenneman 151c595ed1 tests/GLX_dummy: Add a vendor-provided create context function
Added a glXCreateContextVendorDUMMY extension function to GLX_dummy to test
using a vendor-provided extension function to create a context. We can't use
glXCreateContextAttribsARB for that now, because it has a dispatch stub in
libGLX itself.

glXCreateContextVendorDUMMY takes the same arguments as
glXCreateContextAttribsARB, so it can also serve as an example for implementing
a dispatch stub for glXCreateContextAttribsARB in a real vendor library.
2017-12-06 13:29:59 -07:00
Kyle Brenneman 26bdafb0a0 tests: Add a dummy attribute for glXQueryContext.
Defined a dummy attribute that a test program can use with glXQueryContext to
test dispatching by GLXContext.
2017-12-06 13:25:06 -07:00
Kyle Brenneman e0d43b79f7 tests: Add support for GLX_EXT_no_context_config to GLX_dummy
The implementation of glXCreateContextAttribARB in GLX_dummy will now handle
a screen number attribute or a GLXFBConfig.
2017-12-06 13:23:01 -07:00
Kyle Brenneman 82125032e8 tests: Remove the vendor dispatch stub for glXCreateContextAttribsARB.
glXCreateContextAttribsARB now has a dispatch stub in libGLX.so, so the dummy
vendor doesn't need to provide one.
2017-12-06 13:17:06 -07:00
Kyle Brenneman 60331f22d2 Add support for GLX_EXT_no_config_context.
Added a dispatch handler for glXCreateContextAttribsARB. It'll look for a
GLX_SCREEN attribute first if the caller provides one, and then the GLXFBConfig
handle if the caller doesn't.
2017-12-06 12:43:39 -07:00
Kyle Brenneman 005fd3a0c4 Set package version to 1.0.0.
Now that both the EGL and GLX interfaces are defined and stable, set the
package version to 1.0.0.
2017-11-02 10:58:38 -06:00
Kyle Brenneman e202ebf27f Merge pull request #137 from polarina/memleak
Fix memory leak in LoadVendorsFromConfigDir and __eglMappingInit
2017-10-09 09:58:31 -06:00
Gabríel Arthúr Pétursson e3ab0a24cf Cleanup winsys dispatch index list on EGL mapping teardown
This fixes a memory leak reported by both Valgrind and LeakSanitizer
when libEGL is dlopen()-ed and dlclose()-ed afterwards.
2017-10-07 01:15:20 +00:00
Gabríel Arthúr Pétursson c2f81ca7ce Fix memory leak in LoadVendorsFromConfigDir
The individual entries allocated by scandir need to be freed too.
2017-10-06 22:39:20 +00:00
Kyle Brenneman fe4a384094 Merge pull request #135 from aaronp24/remove-misleading-indentation
Update cJSON to version 1.5.9.

Remove -Wno-misleading-indentation, which doesn't work in clang.
2017-09-13 14:15:59 -06:00
Aaron Plattner 6198bd6ef6 Update cJSON to version 1.5.9
Downloaded from https://github.com/DaveGamble/cJSON/releases/tag/v1.5.9
2017-09-13 12:56:57 -07:00
Aaron Plattner 75d2385205 Remove the cJSON README and tests
These aren't used by the build system, so there's no reason to include them in
the repository.

Leave the LICENSE file, to indicate the license as it appeared in the snapshot
from https://github.com/DaveGamble/cJSON/
2017-09-13 12:54:17 -07:00
Aaron Plattner cf6bcb36ab Remove -Wno-misleading-indentation
This option is not recognized by clang, so it produces an error when configured
with

  CC=clang ./configure

  error: unknown warning option '-Wno-misleading-indentation'; did you mean '-Wno-missing-declarations'? [-Werror,-Wunknown-warning-option]

This flag is only needed for cJSON.c. Deobfuscate that file just enough to
eliminate the misleading indentation warnings, then remove the warning flag from
Makefile.am.
2017-09-13 12:35:55 -07:00
Aaron Plattner b0f7755142 Don't #define USE_ASM (defined(USE_X86_ASM) || ... )
This produces a warning when built with clang:

 ../../home/aaron/git/libglvnd/src/util/glvnd_genentry.c:46:26: warning: macro expansion producing 'defined' has undefined behavior [-Wexpansion-to-defined]
 #if defined(__GNUC__) && USE_ASM
                          ^
 ../../home/aaron/git/libglvnd/src/util/glvnd_genentry.c:40:18: note: expanded from macro 'USE_ASM'
 #define USE_ASM (defined(USE_X86_ASM) ||    \

Instead, use the defined(...) conditions to conditionally define USE_ASM to 1 or
0 explicitly.
2017-09-13 12:24:25 -07:00
Kyle Brenneman 5ff90a1568 Merge pull request #125 from kbrenneman/ppc64le-convert-lq-stq
Convert lq/stq instructions
2017-08-30 09:45:18 -06:00