← Back to team overview

maria-developers team mailing list archive

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

 


> -----Original Message-----
> From: Sergei Golubchik [mailto:serg@xxxxxxxxxxxx]
> Sent: Freitag, 20. Januar 2012 17:23
> To: maria-developers@xxxxxxxxxxxxxxxxxxx; wlad@xxxxxxxxxxxx
> Subject: Re: [Commits] Rev 3227: Fix embedded build on Windows. in
> file:///H:/bzr/5.5/
> 
> Hi, Vladislav!
> 
> On Jan 20, Vladislav Vaintroub wrote:
> > revno: 3227
> > revision-id: wlad@xxxxxxxxxxxxxxxx-20120120155435-y8tyd01st3fpbq1e
> > parent: wlad@xxxxxxxxxxxxxxxx-20120120113906-f6wcj47dyo6jyt45
> > committer: Vladislav Vaintroub <wlad@xxxxxxxxxxxxxxxx>
> > branch nick: 5.5
> > timestamp: Fri 2012-01-20 16:54:35 +0100
> > message:
> >   Fix embedded build on Windows.
> 
> > === modified file 'mysys/CMakeLists.txt'
> > --- a/mysys/CMakeLists.txt	2012-01-20 00:57:58 +0000
> > +++ b/mysys/CMakeLists.txt	2012-01-20 15:54:35 +0000
> > @@ -46,7 +46,7 @@
> >   SET (MYSYS_SOURCES ${MYSYS_SOURCES} my_addr_resolve.c)
> >  ENDIF()
> >
> > -IF(WITH_SAFEMALLOC OR NOT HAVE_CXX_NEW)
> > +IF(NOT HAVE_CXX_NEW)
> >   ADD_DEFINITIONS( -DUSE_MYSYS_NEW)
> 
> Why is that?
Well, when I added WITH_SAFEMALLOC , build started to fail. Thus I removed
it again. The build started to fail because I forgot that WITH_SAFEMALLOC is
no more Boolean, and is set AUTO on Windows, so it was compiled in.

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.

> Note, that we should always use mysys/new.cc when safemalloc is enabled.
This was my thought exactly, when I added it. But I guess, in this case
my_new.cc might need some smarter tricks in order to replace system new().If
I'm not mistaken, the old MySQL version of this file used "weak" attributes
or something similar.

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



Follow ups

References