tag:blogger.com,1999:blog-9149523927864751087.post2799566721102896052..comments2024-03-26T09:43:01.052-07:00Comments on Small Datum: CMAKE_BUILD_TYPE: RelWithDebInfo vs Release for MySQLMark Callaghanhttp://www.blogger.com/profile/09590445221922043181noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-9149523927864751087.post-42845769498212186152023-02-21T06:29:19.924-08:002023-02-21T06:29:19.924-08:00The answer from an expert (Yura Surokin of Percona...The answer from an expert (Yura Surokin of Percona) is:<br /><br />'-fstack-protector-strong' comes from this commit https://github.com/mysql/mysql-server/commit/38474c44e5330c0cbd338ee10613d4d3e703e672<br />Basically, it introduces a new CMake option 'WITH_PACKAGE_FLAGS' (ON by default for RelWithDebInfo), which, when enabled, automatically adds the output of the 'dpkg-buildflags' / 'rpm --eval %optflags' to CFLAGS / CXXFLAGS.<br />On my Ubuntu 22.04 Jammy, for instance,<br />CXXFLAGS=-g -O2 -ffile-prefix-map=/home/yura/ws/percona-server=. -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security<br /><br />From:<br />https://www.linkedin.com/feed/update/urn:li:activity:7029876032086118400?commentUrn=urn%3Ali%3Acomment%3A%28activity%3A7029876032086118400%2C7032030298649333760%29&replyUrn=urn%3Ali%3Acomment%3A%28activity%3A7029876032086118400%2C7033473230988296192%29&dashCommentUrn=urn%3Ali%3Afsd_comment%3A%287032030298649333760%2Curn%3Ali%3Aactivity%3A7029876032086118400%29&dashReplyUrn=urn%3Ali%3Afsd_comment%3A%287033473230988296192%2Curn%3Ali%3Aactivity%3A7029876032086118400%29Mark Callaghanhttps://www.blogger.com/profile/09590445221922043181noreply@blogger.comtag:blogger.com,1999:blog-9149523927864751087.post-45948635202099368362023-02-18T17:01:33.984-08:002023-02-18T17:01:33.984-08:00Did a build with -DBUILD_CONFIG=mysql_release and ...Did a build with -DBUILD_CONFIG=mysql_release and the compiler options didn't change. That doesn't surprise me after reading: cmake/build_configurations/mysql_release.cmake Mark Callaghanhttps://www.blogger.com/profile/09590445221922043181noreply@blogger.comtag:blogger.com,1999:blog-9149523927864751087.post-66424251238196132732023-02-16T11:19:53.771-08:002023-02-16T11:19:53.771-08:00I will try BUILD_TYPE soon, just need an idle mach...I will try BUILD_TYPE soon, just need an idle machine and both are busy with sysbench and the insert benchmark. Later today I will add a third server to my Beelink cluster.Mark Callaghanhttps://www.blogger.com/profile/09590445221922043181noreply@blogger.comtag:blogger.com,1999:blog-9149523927864751087.post-36526385215740622922023-02-16T11:06:53.142-08:002023-02-16T11:06:53.142-08:00So, from cmake point of view, the easiest experime...So, from cmake point of view, the easiest experiment you can do on your own , to check flags it adds for the BULD_TYPE, is to create a dummy hello-world project. Compile it with VERBOSE=1, or cmake --build . --verbose, that will work whether you use ninja or make. Afaik, the cmake's own flags are -O2 (Release), -O2 -g (RelWithDebInfo), -O1 (MinSizeRel) and -g (Debug) . MySQL and MariaDB will add own stuff to the predefined flags, or change them sometimes. They could have also define own build types, but chose not to.wladhttps://www.blogger.com/profile/14657227220070201326noreply@blogger.com