Re: [Maria-developers] [Commits] Rev 3227: Fix embedded build on Windows. in file:///H:/bzr/5.5/

Hi, Vladislav! On Jan 20, Vladislav Vaintroub wrote:
Why is that? I thought that WITH_SAFEMALLOC is always off on Windows? Note, that we should always use mysys/new.cc when safemalloc is enabled. Regards, Sergei

I'm not surprised that embedded build failed, yet I'm surprised that normal server was built on Windows. On Windows, one cannot have multiply defined symbols, and since there is already one "new" in C runtime library, it actually had to fail.
A more general thought on WITH_SAFEMALLOC: May I suggest to get back to a configuration where WITH_SAFEMALLOC is Boolean and either ON or OFF, and ignore it in non-debug builds. The triple value logic adds some confusion for me? Maybe, we should make WITH_SAFEMALLOC OFF even in debug compilation, it was not ON even back in autotools days (one had to compile with --with-debug-full to get it). Wlad

Hi, Vladislav! On Jan 20, Vladislav Vaintroub wrote:
I thought that it was me who added WITH_SAFEMALLOC to that IF(). But now I've checked and indeed, I did not. I did it in the top-level CMakeLists.txt: 193 # force -DUSE_MYSYS_NEW unless already done by HAVE_CXX_NEW 194 IF(HAVE_CXX_NEW) 195 SET(DUSE_MYSYS_NEW "-DUSE_MYSYS_NEW") 196 ENDIF() 197 198 IF(WITH_SAFEMALLOC MATCHES "ON") 199 ADD_DEFINITIONS( -DSAFEMALLOC ${DUSE_MYSYS_NEW}) 200 ELSEIF(WITH_SAFEMALLOC MATCHES "AUTO" AND NOT WIN32) 201 SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC") 202 SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC ${DUSE_MYSYS_NEW"} 203 ENDIF() which is supposed to add -DUSE_MYSYS_NEW to the debug flags if safemalloc is used and HAVE_CXX_NEW is set (is HAVE_CXX_NEW is unset, -DUSE_MYSYS_NEW is added in mysys, independently from safemalloc). This should be enough and no additional safemalloc checks in mysys/CMakeLists.txt should be needed, as far as I understand it. Regards, Sergei
participants (2)
-
Sergei Golubchik
-
Vladislav Vaintroub