Hi, On 2023/03/20 10:20, phi...@apache.org wrote: > Author: philip > Date: Mon Mar 20 01:20:29 2023 > New Revision: 1908545 > > URL: http://svn.apache.org/viewvc?rev=1908545&view=rev > Log: > Fix a one definition rule (ODR) violation: explicitly linking > to both the libsvn_subr amalgation wrapper and the libsvn_subr > library is wrong. It's typically not a bug in a static build > because the linker will usually not pull the unneeded file from > the static library, but in a shared build the whole library is > used at runtime. It was harmless in practice because the symbols > were the same, so it didn't matter which ones were used, but an > ODR violation is strictly undefined behaviour, even in > non-amalgamtion builds when only a dummy symbol gets redefined. > GCC's santizer detects ODR violations. > > * build.conf (wc-queries-test): Don't link SQLite wrapper. > > Modified: > subversion/trunk/build.conf > > Modified: subversion/trunk/build.conf > URL: > http://svn.apache.org/viewvc/subversion/trunk/build.conf?rev=1908545&r1=1908544&r2=1908545&view=diff > ============================================================================== > --- subversion/trunk/build.conf (original) > +++ subversion/trunk/build.conf Mon Mar 20 01:20:29 2023 > @@ -1337,7 +1337,7 @@ msvc-force-static = yes > description = Test Sqlite query evaluation > type = exe > path = subversion/tests/libsvn_wc > -sources = wc-queries-test.c ../../libsvn_subr/sqlite3wrapper.c > +sources = wc-queries-test.c > install = test > libs = libsvn_test libsvn_wc libsvn_subr apriconv apr sqlite >
After r1908545, build on Windows is failing with the following errors: [[[ wc-queries-test.obj : error LNK2001: unresolved external symbol svn_sqlite3__api_initialize [D:\a\subversion\subversion\build\win32\vcnet-vcproj\wc-queries-test.vcxproj] wc-queries-test.obj : error LNK2001: unresolved external symbol svn_sqlite3__api_funcs [D:\a\subversion\subversion\build\win32\vcnet-vcproj\wc-queries-test.vcxproj] D:\a\subversion\subversion\Release\subversion\tests\libsvn_wc\wc-queries-test.exe : fatal error LNK1120: 2 unresolved externals [D:\a\subversion\subversion\build\win32\vcnet-vcproj\wc-queries-test.vcxproj] ]]] -- Jun Omae <jun6...@gmail.com> (大前 潤)