mesa; add a dummy _mesa_error_no_memory() symbol to libglsl_util
authorEmil Velikov <emil.l.velikov@gmail.com>
Wed, 15 Apr 2015 12:40:55 +0000 (13:40 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Fri, 12 Jun 2015 14:32:18 +0000 (15:32 +0100)
Rather than forcing everyone to provide their own definition of the symbol
provide a common (dummy) one.

This helps us resolve the build of the standalone pipe-drivers (amongst
others), which are missing the symbol.

Cc: Rob Clark <robclark@freedesktop.org>
Cc: "10.6" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
src/Makefile.am
src/gallium/drivers/freedreno/ir3/ir3_cmdline.c
src/gallium/state_trackers/xa/xa_tracker.c
src/glsl/Makefile.am
src/glsl/SConscript
src/glsl/main.cpp
src/glsl/tests/common.c [deleted file]
src/mesa/Android.libmesa_glsl_utils.mk
src/mesa/program/dummy_errors.c [new file with mode: 0644]

index 18cb4ce76d7da8f106fbeeb569b43f1dc6bb060f..5d69abd996d658bb8c5e7ac0de7fbc6cb0163088 100644 (file)
@@ -72,4 +72,5 @@ noinst_LTLIBRARIES = libglsl_util.la
 libglsl_util_la_SOURCES = \
        mesa/main/imports.c \
        mesa/program/prog_hash_table.c \
-       mesa/program/symbol_table.c
+       mesa/program/symbol_table.c \
+       mesa/program/dummy_errors.c
index d0517aab8ce9a868cc69ac2004cff58fe4cd0f52..0b16cc1eb54a8973b6cb605ab7403134043413e2 100644 (file)
@@ -360,11 +360,3 @@ int main(int argc, char **argv)
        }
        dump_info(&v, info);
 }
-
-void _mesa_error_no_memory(const char *caller);
-
-void
-_mesa_error_no_memory(const char *caller)
-{
-       fprintf(stderr, "Mesa error: out of memory in %s", caller);
-}
index 89019988d57af8cf8914c122dba3b17a284f7fa2..f69ac8edf2774a1dfd2d824d4a2ea6fc0c55ef4f 100644 (file)
@@ -535,15 +535,3 @@ xa_surface_format(const struct xa_surface *srf)
 {
     return srf->fdesc.xa_format;
 }
-
-/*
- * _mesa_error_no_memory() is expected by NIR to be provided by the
- * user.  Normally this is in mesa st, but other state trackers
- * must provide their own.
- */
-void _mesa_error_no_memory(const char *caller);
-void
-_mesa_error_no_memory(const char *caller)
-{
-       debug_printf("Mesa error: out of memory in %s", caller);
-}
index 1b7b1f8c69123c95d24892afb16bce99e5bc1fb9..fa8c9f5d3ca63404477678831e98c25e7d0213f6 100644 (file)
@@ -89,8 +89,7 @@ tests_general_ir_test_SOURCES =               \
        tests/builtin_variable_test.cpp                 \
        tests/invalidate_locations_test.cpp             \
        tests/general_ir_test.cpp                       \
-       tests/varyings_test.cpp                         \
-       tests/common.c
+       tests/varyings_test.cpp
 tests_general_ir_test_CFLAGS =                         \
        $(PTHREAD_CFLAGS)
 tests_general_ir_test_LDADD =                          \
@@ -103,8 +102,7 @@ tests_uniform_initializer_test_SOURCES =            \
        tests/copy_constant_to_storage_tests.cpp        \
        tests/set_uniform_initializer_tests.cpp         \
        tests/uniform_initializer_utils.cpp             \
-       tests/uniform_initializer_utils.h               \
-       tests/common.c
+       tests/uniform_initializer_utils.h
 tests_uniform_initializer_test_CFLAGS =                        \
        $(PTHREAD_CFLAGS)
 tests_uniform_initializer_test_LDADD =                 \
@@ -114,8 +112,7 @@ tests_uniform_initializer_test_LDADD =                      \
        $(PTHREAD_LIBS)
 
 tests_sampler_types_test_SOURCES =                     \
-       tests/sampler_types_test.cpp                    \
-       tests/common.c
+       tests/sampler_types_test.cpp
 tests_sampler_types_test_CFLAGS =                      \
        $(PTHREAD_CFLAGS)
 tests_sampler_types_test_LDADD =                       \
@@ -133,8 +130,7 @@ libglcpp_la_SOURCES =                                       \
        $(LIBGLCPP_FILES)
 
 glcpp_glcpp_SOURCES =                                  \
-       glcpp/glcpp.c                                   \
-       tests/common.c
+       glcpp/glcpp.c
 glcpp_glcpp_LDADD =                                    \
        libglcpp.la                                     \
        $(top_builddir)/src/libglsl_util.la             \
@@ -164,7 +160,6 @@ glsl_compiler_LDADD =                                       \
 
 glsl_test_SOURCES = \
        standalone_scaffolding.cpp \
-       tests/common.c \
        test.cpp \
        test_optpass.cpp \
        test_optpass.h
index 284b375844fd9de8f3163b33f7d9ba9a121325fa..89c603580a5d76e7cf1619cfe97353f37f62d35a 100644 (file)
@@ -71,6 +71,7 @@ env.Command('imports.c', '#src/mesa/main/imports.c', Copy('$TARGET', '$SOURCE'))
 env.Prepend(CPPPATH = ['#src/mesa/program'])
 env.Command('prog_hash_table.c', '#src/mesa/program/prog_hash_table.c', Copy('$TARGET', '$SOURCE'))
 env.Command('symbol_table.c', '#src/mesa/program/symbol_table.c', Copy('$TARGET', '$SOURCE'))
+env.Command('dummy_errors.c', '#src/mesa/program/dummy_errors.c', Copy('$TARGET', '$SOURCE'))
 
 compiler_objs = env.StaticObject(source_lists['GLSL_COMPILER_CXX_FILES'])
 
@@ -78,6 +79,7 @@ mesa_objs = env.StaticObject([
     'imports.c',
     'prog_hash_table.c',
     'symbol_table.c',
+    'dummy_errors.c',
 ])
 
 compiler_objs += mesa_objs
@@ -115,6 +117,6 @@ env.Alias('glsl_compiler', glsl_compiler)
 
 glcpp = env.Program(
     target = 'glcpp/glcpp',
-    source = ['glcpp/glcpp.c', 'tests/common.c'] + mesa_objs,
+    source = ['glcpp/glcpp.c'] + mesa_objs,
 )
 env.Alias('glcpp', glcpp)
index 4b39c9e54c272770271175c8a33cad551f34f2d0..23412980dce1ba3570314ae5e5700b02d98f4826 100644 (file)
 
 static int glsl_version = 330;
 
-extern "C" void
-_mesa_error_no_memory(const char *caller)
-{
-   fprintf(stderr, "Mesa error: out of memory in %s", caller);
-}
-
 static void
 initialize_context(struct gl_context *ctx, gl_api api)
 {
diff --git a/src/glsl/tests/common.c b/src/glsl/tests/common.c
deleted file mode 100644 (file)
index d69f54d..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright © 2014 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-#include <stdio.h>
-#include "main/errors.h"
-
-void
-_mesa_error_no_memory(const char *caller)
-{
-   fprintf(stderr, "Mesa error: out of memory in %s", caller);
-}
index 3497377af8c8b17f781060d59f569b55c1d09685..ed620ac648cfa25361f061b05dcd758c514e6364 100644 (file)
@@ -44,7 +44,8 @@ LOCAL_C_INCLUDES := \
 LOCAL_SRC_FILES := \
        main/imports.c \
        program/prog_hash_table.c \
-       program/symbol_table.c
+       program/symbol_table.c \
+       program/dummy_errors.c
 
 include $(MESA_COMMON_MK)
 include $(BUILD_STATIC_LIBRARY)
@@ -68,7 +69,8 @@ LOCAL_C_INCLUDES := \
 LOCAL_SRC_FILES := \
        main/imports.c \
        program/prog_hash_table.c \
-       program/symbol_table.c
+       program/symbol_table.c \
+       program/dummy_errors.c
 
 include $(MESA_COMMON_MK)
 include $(BUILD_HOST_STATIC_LIBRARY)
diff --git a/src/mesa/program/dummy_errors.c b/src/mesa/program/dummy_errors.c
new file mode 100644 (file)
index 0000000..d69f54d
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright © 2014 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+#include <stdio.h>
+#include "main/errors.h"
+
+void
+_mesa_error_no_memory(const char *caller)
+{
+   fprintf(stderr, "Mesa error: out of memory in %s", caller);
+}