gallium/targets: move LLVM_LIBS handling inside Automake.inc

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
gallium/targets: explicitly include a dummy.cpp and remove all the LINK mayhem

Explicitly setting the linker variable was required for old and broken
build toolchains. At this point this should no longer be needed, and
setting the sources lists will trigger generation of the correct LINK
variables.

Explicitly include dummy.cpp to use g++ to link the static library which
in most cases is based upon C++ code.

v2: Reword commit message.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
targets/omx: do not link against the trace driver

Unused due to the missing GALLIUM_TRACE define.

Requested-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
targets/egl-static: move the common LDFLAGS into AM_LDFLAGS

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
automake: consistently use -no-undefined

Set the flag for all but the dri targets. They have missing
glapi symbols which are required for the normal operation with
the X server.

Jon, I fear that you'll need to carry the "no-undefined" hunk
locally when building the dri drivers under cygwin.

Cc: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
dri/i965: use CLOCK_LIBS over -lrt

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
pipe-loader: use PTHREAD_LIBS over -lpthread

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
pipe-loader: reorder PIPE_LIBS

Reorder -lm, -lrt, -lpthreads and -ldl to be consistent with the
rest of mesa.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
gallium/targets: add missing library dependencies

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
automake: add -Wl,--no-undefined to all libraries

... apart from the dri drivers.
With this final change we can build mesa without fear that
the resulting libraries will have unresolved symbols.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
automake: ask the linker to do garbage collection

By doing GC the linker removes all the symbols that are not referenced
and/or used by the final library. This results in a saving of ~100K
up-to ~600K per (stripped) binary (classic vs gallium drivers).

If interested one can ask the compiler to print the sections that are
removed using -Wl,--print-gc-sections.

v2: Check if ld supports the flag before using it.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com> (v1)
i965/vec4: Don't trim writemasks of texture instructions.

It was my understanding that the writemask works in SIMD4x2 mode for
texturing instructions and doesn't require a message header. Some bit of
this logic must be wrong, so disable it until it's understood.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76617
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
glapi: Remove some duplicate ignore="true" lines

It looks like these were added accidentally by Paul in commit 1a1db174.
From the commit message and the look of the patch, I think this was just
some sed-job left overs.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
glapi: Mark all GL_ARB_separate_shader_objects functions with static_dispatch=false

This prevents the entrypoints from being (incorrectly) advertised by
libGL.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Chad Versace <chad.versace@linux.intel.com>
glapi/es1: Don't mark core functions as static_dispatch=false

Functions that are part of OpenGL ES 1.0 or 1.1 should have static
dispatch functions in libGLESv1_CM.  This doesn't affect any change yet,
but it will prevent later regressions.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Chad Versace <chad.versace@linux.intel.com>
mapi: Hack around glGetInternalformativ not being hidden in GLES

This is hella ugly.  The same-named function in desktop OpenGL is
hidden, but it needs to be exposed by libGLESv2 for OpenGL ES 3.0.
There's no way to express in the XML that a function should be be hidden
in one API but exposed in another.

This won't affect any change now, but it will prevent a regression in a
later patch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
mapi_abi: Make ES1 and ES2 static_dispatch=false functions hidden

This has been a long standing issue with the ES libraries.  Functions
marked in the XML with 'static_dispatch=false' were still incorrectly
exported.  ABI-check is supposed to detect this case, but we have to
paper over failures every time a new extension is added.

This change will cause a big pile of functions to disappear from
libGLESv2 and libGLESv1_CM.

libGLESv2 loses (20 functions):

    glBindVertexArrayOES
    glCompressedTexImage3DOES
    glCompressedTexSubImage3DOES
    glCopyTexSubImage3DOES
    glDeleteVertexArraysOES
    glDiscardFramebufferEXT
    glDrawBuffersNV
    glFlushMappedBufferRangeEXT
    glFramebufferTexture3DOES
    glGenVertexArraysOES
    glGetBufferPointervOES
    glGetProgramBinaryOES
    glIsVertexArrayOES
    glMapBufferOES
    glMapBufferRangeEXT
    glProgramBinaryOES
    glReadBufferNV
    glTexImage3DOES
    glTexSubImage3DOES
    glUnmapBufferOES

libGLESv1_CM loses (88 functions):

    glAlphaFuncxOES
    glBindFramebufferOES
    glBindRenderbufferOES
    glBlendEquationOES
    glBlendEquationSeparateOES
    glBlendFuncSeparateOES
    glCheckFramebufferStatusOES
    glClearColorxOES
    glClearDepthfOES
    glClearDepthxOES
    glClipPlanefOES
    glClipPlanexOES
    glColor4xOES
    glDeleteFramebuffersOES
    glDeleteRenderbuffersOES
    glDepthRangefOES
    glDepthRangexOES
    glDiscardFramebufferEXT
    glDrawTexfOES
    glDrawTexfvOES
    glDrawTexiOES
    glDrawTexivOES
    glDrawTexsOES
    glDrawTexsvOES
    glDrawTexxOES
    glDrawTexxvOES
    glFlushMappedBufferRangeEXT
    glFogxOES
    glFogxvOES
    glFramebufferRenderbufferOES
    glFramebufferTexture2DOES
    glFrustumfOES
    glFrustumxOES
    glGenerateMipmapOES
    glGenFramebuffersOES
    glGenRenderbuffersOES
    glGetBufferPointervOES
    glGetClipPlanefOES
    glGetClipPlanexOES
    glGetFixedvOES
    glGetFramebufferAttachmentParameterivOES
    glGetLightxvOES
    glGetMaterialxvOES
    glGetRenderbufferParameterivOES
    glGetTexEnvxvOES
    glGetTexGenfvOES
    glGetTexGenivOES
    glGetTexGenxvOES
    glGetTexParameterxvOES
    glIsFramebufferOES
    glIsRenderbufferOES
    glLightModelxOES
    glLightModelxvOES
    glLightxOES
    glLightxvOES
    glLineWidthxOES
    glLoadMatrixxOES
    glMapBufferOES
    glMapBufferRangeEXT
    glMaterialxOES
    glMaterialxvOES
    glMultiTexCoord4xOES
    glMultMatrixxOES
    glNormal3xOES
    glOrthofOES
    glOrthoxOES
    glPointParameterxOES
    glPointParameterxvOES
    glPointSizePointerOES
    glPointSizexOES
    glPolygonOffsetxOES
    glQueryMatrixxOES
    glRenderbufferStorageOES
    glRotatexOES
    glSampleCoveragexOES
    glScalexOES
    glTexEnvxOES
    glTexEnvxvOES
    glTexGenfOES
    glTexGenfvOES
    glTexGeniOES
    glTexGenivOES
    glTexGenxOES
    glTexGenxvOES
    glTexParameterxOES
    glTexParameterxvOES
    glTranslatexOES
    glUnmapBufferOES

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Chia-I Wu <olv@lunarg.com>
Cc: Paul Berry <stereotype441@gmail.com>
mapi_abi: Remove ABI-check work arounds for functions that are no longer exported

The previous commit stopped exporting 21 libGLESv2 and 88 libGLESv1_CM
functions.  This removes the work-arounds for those functions from
ABI-check.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Chad Versace <chad.versace@linux.intel.com>
gallium: add interface to clear buffers

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
mesa/st: Accelerate ARB_clear_buffer_object with clear_buffer

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>