When we are finally statically linking bin/vm, we must be careful the order of arguments to the linker. Gnnerally speaking, we shouldn't pass ldflags first before object files because the order matters with the static linking. To be specifc, we can't find library symbols used in the object files in this order. So, just reverse the order of arguments. Previously, there was no problem because LLVM din't depend on any other library symbols. But when OProfile is enabled this is not the case.
Suppress warnings from Clang when compiling with Valgrind like this: In file included from vm/capi/handle.cpp:3: vm/gc/baker.hpp:274:7: error: expression result unused [-Werror,-Wunused-value] VALGRIND_MAKE_MEM_NOACCESS(next->start().as_int(), next->size()); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/valgrind/memcheck.h:110:5: note: expanded from: VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* default return */, \ ^ /usr/include/valgrind/valgrind.h:383:5: note: expanded from: _zzq_result; \ ^~~~~~~~~~~ Please remove this when this bug (*1) is fixed and the fixed Valgrind is available everywhere. *1: https://bugs.kde.org/show_bug.cgi?id=316612
When one of the arguments to replace into the string is a string itself and doesn't fit, the API of ruby_vsnprintf is that it returns the needed size of the string. Handle this case and grow the string to that size in that case. Fixes #2196