util/process_test: make the error variable static
Make the `error` variable static to prevent a clash with the glibc error() function when LTO is used. Fixes the LTO build. Otherwise, it'll fail in the linking phase with a conflict: ``` [411/2321] Linking target src/util/process_test FAILED: src/util/process_test c++ -o src/util/process_test src/util/process_test.p/tests_process_test.c.o -flto -Wl,--as-needed -Wl,--no-undefined -Wl,--fatal-warnings -Wl,--start-group src/util/libmesa_util.a src/util/format/libmesa_format.a src/util/libmesa_util_sse41.a src/c11/impl/libmesa_util_c11.a subprojects/perfetto/libperfetto.a /usr/lib/x86_64-linux-gnu/libz.so -pthread -lm -ldl /usr/lib/x86_64-linux-gnu/libunwind.so -Wl,--end-group mold: error: symbol type mismatch: error >>> defined in /tmp/process_test.SLc9I6.ltrans0.ltrans.o as STT_OBJECT >>> defined in /lib/x86_64-linux-gnu/libc.so.6 as STT_FUNC ``` Reviewed-by: Yonggang Luo <luoyonggang@gmail.com> Signed-off-by: David Heidelberg <david.heidelberg@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21511>
This commit is contained in:
@@ -36,7 +36,7 @@
|
||||
#define PATH_MAX MAX_PATH
|
||||
#endif
|
||||
|
||||
bool error = false;
|
||||
static bool error = false;
|
||||
|
||||
static void
|
||||
expect_equal_str(const char *expected, const char *actual, const char *test)
|
||||
|
Reference in New Issue
Block a user