[CMakeLists] Make kudu_test_main static

This change makes sure that kudu_util.so is loaded at the beginning of
the library search order. This is needed because in unwind_safeness.cc
there is a dlsym execution in the constructor function, that creates a
wrapper for dlopen and dlclose to prevent a potential deadlock during
unwind stack resolve. It looks for the next declaration of the functions
called "dlopen" and "dlclose" in shared object files. If kudu_util is
loaded too late, then it won't find these functions and throws an error.
This happens in ubuntu 22.04 test runs. To solve this issue, the
kudu_test_main was changed to a static library and kudu_util was moved
to the front of the library list.

This is a best effort fix, and it should only have impact on test
execution.

Change-Id: I0dfeb1fa04ed91e95fd1f8d789f020dd44289fea
Reviewed-on: http://gerrit.cloudera.org:8080/21282
Tested-by: Alexey Serbin <alexey@apache.org>
Reviewed-by: Alexey Serbin <alexey@apache.org>
1 file changed