[Maria-discuss] what is adding the -g compile parm?
"-O3 -g" appears in the cmake output, that likely breaks ld.gold / -flto and so the question: who the explain the build *not* add that useless param for production builds like most oterh software don't without one could also remove the strip-calls in rpm-spec-files!
Hi, Reindl! On Sep 20, Reindl Harald wrote:
"-O3 -g" appears in the cmake output, that likely breaks ld.gold / -flto and so the question: who the explain the build *not* add that useless param for production builds like most oterh software don't
without one could also remove the strip-calls in rpm-spec-files!
Sorry, I have more questions that answers... * How do you build? Where do you see -O3 -g? * Why do you think it breaks gold? It shouldn't. In fact, gold doesn't work for a completely different reason, see MDEV-5982. * Why would it break -flto? TokuDB is always compiled with -flto, so either "-O3 -g" isn't added autumatically in our builds or -flto works with it just fine. Besides, we don't use rpm spec files, cpack generates then internally as needed. Regards, Sergei
Am 20.09.2015 um 19:14 schrieb Sergei Golubchik:
Hi, Reindl!
On Sep 20, Reindl Harald wrote:
"-O3 -g" appears in the cmake output, that likely breaks ld.gold / -flto and so the question: who the explain the build *not* add that useless param for production builds like most oterh software don't
without one could also remove the strip-calls in rpm-spec-files!
Sorry, I have more questions that answers...
* How do you build?
+ export 'CFLAGS=-m64 -O2 -g0 -march=sandybridge -mtune=sandybridge -fopenmp -mfpmath=sse -pipe -fno-strict-aliasing -fomit-frame-pointer -finline-functions -finline-limit=60 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=6 -D_FORTIFY_SOURCE=2 -Wstack-protector -Wformat -Werror=format-security -O3 -funroll-loops -funswitch-loops -minline-all-stringops -fwrapv -fno-stack-protector -fstack-protector --param=ssp-buffer-size=8 -fPIC -fno-exceptions -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE'
Where do you see -O3 -g?
the " -fPIC -O3 -g -static-libgcc" stuff comes *after* my global CFLAGS and so overrides them [ 6%] Building C object strings/CMakeFiles/strings.dir/ctype-cp932.c.o cd /home/builduser/rpmbuild/BUILD/mariadb-10.0.21/strings && /usr/bin/cc -DDISABLE_MYSQL_THREAD_H -DHAVE_CONFIG_H -m64 -O2 -g0 -march=sandybridge -mtune=sandybridge -fopenmp -mfpmath=sse -pipe -fno-strict-aliasing -fomit-frame-pointer -finline-functions -finline-limit=60 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=6 -D_FORTIFY_SOURCE=2 -Wstack-protector -Wformat -Werror=format-security -O3 -funroll-loops -funswitch-loops -minline-all-stringops -fwrapv -fno-stack-protector -fstack-protector --param=ssp-buffer-size=8 -fPIC -fno-exceptions -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fPIC -O3 -g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing -Wno-uninitialized -DDBUG_OFF -DMY_PTHREAD_FASTMUTEX=1 -I/home/builduser/rpmbuild/BUILD/mariadb-10.0.21/include -o CMakeFiles/strings.dir/ctype-cp932.c.o -c /home/builduser/rpmbuild/BUILD/mariadb-10.0.21/strings/ctype-cp932.c [ 6%] Building C object unittest/examples/CMakeFiles/no_plan-t.dir/no_plan-t.c.o cd /home/builduser/rpmbuild/BUILD/mariadb-10.0.21/unittest/examples && /usr/bin/cc -DHAVE_CONFIG_H -m64 -O2 -g0 -march=sandybridge -mtune=sandybridge -fopenmp -mfpmath=sse -pipe -fno-strict-aliasing -fomit-frame-pointer -finline-functions -finline-limit=60 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=6 -D_FORTIFY_SOURCE=2 -Wstack-protector -Wformat -Werror=format-security -O3 -funroll-loops -funswitch-loops -minline-all-stringops -fwrapv -fno-stack-protector -fstack-protector --param=ssp-buffer-size=8 -fPIC -fno-exceptions -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fPIC -O3 -g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing -Wno-uninitialized -DDBUG_OFF -DMY_PTHREAD_FASTMUTEX=1 -I/home/builduser/rpmbuild/BUILD/mariadb-10.0.21/include -I/home/builduser/rpmbuild/BUILD/mariadb-10.0.21/unittest/mytap -o CMakeFiles/no_plan-t.dir/no_plan-t.c.o -c /home/builduser/rpmbuild/BUILD/mariadb-10.0.21/unittest/examples/no_plan-t.c make[2]: Leaving directory '/home/builduser/rpmbuild/BUILD/mariadb-10.0.21' /usr/bin/make -f unittest/examples/CMakeFiles/simple-t.dir/build.make unittest/examples/CMakeFiles/simple-t.dir/build make[2]: Entering directory '/home/builduser/rpmbuild/BUILD/mariadb-10.0.21' [ 6%] Building C object vio/CMakeFiles/vio.dir/viosslfactories.c.o cd /home/builduser/rpmbuild/BUILD/mariadb-10.0.21/vio && /usr/bin/cc -DHAVE_CONFIG_H -DHAVE_OPENSSL -m64 -O2 -g0 -march=sandybridge -mtune=sandybridge -fopenmp -mfpmath=sse -pipe -fno-strict-aliasing -fomit-frame-pointer -finline-functions -finline-limit=60 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=6 -D_FORTIFY_SOURCE=2 -Wstack-protector -Wformat -Werror=format-security -O3 -funroll-loops -funswitch-loops -minline-all-stringops -fwrapv -fno-stack-protector -fstack-protector --param=ssp-buffer-size=8 -fPIC -fno-exceptions -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fPIC -O3 -g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing -Wno-uninitialized -DDBUG_OFF -DMY_PTHREAD_FASTMUTEX=1 -I/home/builduser/rpmbuild/BUILD/mariadb-10.0.21/include -o CMakeFiles/vio.dir/viosslfactories.c.o -c /home/builduser/rpmbuild/BUILD/mariadb-10.0.21/vio/viosslfactories.c [ 6%] Building C object unittest/examples/CMakeFiles/simple-t.dir/simple-t.c.o make[2]: Leaving directory '/home/builduser/rpmbuild/BUILD/mariadb-10.0.21' cd /home/builduser/rpmbuild/BUILD/mariadb-10.0.21/unittest/examples && /usr/bin/cc -DHAVE_CONFIG_H -m64 -O2 -g0 -march=sandybridge -mtune
* Why do you think it breaks gold? It shouldn't. In fact, gold doesn't work for a completely different reason, see MDEV-5982. * Why would it break -flto? TokuDB is always compiled with -flto, so either "-O3 -g" isn't added autumatically in our builds or -flto works with it just fine.
because a mysql error report which i found in that context tokudb don#t matter here, xtradb fails by build all with -flto
Besides, we don't use rpm spec files, cpack generates then internally as needed
don't matter
Hi, Reindl! On Sep 20, Reindl Harald wrote:
Am 20.09.2015 um 19:14 schrieb Sergei Golubchik:
On Sep 20, Reindl Harald wrote:
"-O3 -g" appears in the cmake output, that likely breaks ld.gold / -flto and so the question: who the explain the build *not* add that useless param for production builds like most oterh software don't
without one could also remove the strip-calls in rpm-spec-files!
Sorry, I have more questions that answers...
* How do you build?
+ export 'CFLAGS=-m64 -O2 -g0 -march=sandybridge -mtune=sandybridge -fopenmp -mfpmath=sse -pipe -fno-strict-aliasing -fomit-frame-pointer -finline-functions -finline-limit=60 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=6 -D_FORTIFY_SOURCE=2 -Wstack-protector -Wformat -Werror=format-security -O3 -funroll-loops -funswitch-loops -minline-all-stringops -fwrapv -fno-stack-protector -fstack-protector --param=ssp-buffer-size=8 -fPIC -fno-exceptions -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE'
But you cannot be building this this line, right? You invoke cmake, somehow, and make, somehow. How? And may be you set CXXFLAGS and I don't know what else.
Where do you see -O3 -g?
the " -fPIC -O3 -g -static-libgcc" stuff comes *after* my global CFLAGS and so overrides them
Okay, that's better. "static-libgcc" is only used in two files in the source tree: ./BUILD/compile-bintar and ./cmake/build_configurations/mysql_release.cmake So, either you're using BUILD/compile-bintar script (which I find unlikely) or you're invoking cmake with -DBUILD_CONFIG=mysql_release (which I find likely - and that's exactly why I was asking "how do you build" !) This is not configurable, you cannot switch a part of mysql_release.cmake off. Either you use -DBUILD_CONFIG=mysql_release or you don't. If you don't like it - you can simply add all options from it manually to your CFLAGS and then you won't need -DBUILD_CONFIG But you said it conflicts with -flto. Where does -flto come from? I don't see it in your CFLAGS. Nor is it on the compiler's command line below:
[ 6%] Building C object strings/CMakeFiles/strings.dir/ctype-cp932.c.o cd /home/builduser/rpmbuild/BUILD/mariadb-10.0.21/strings && /usr/bin/cc -DDISABLE_MYSQL_THREAD_H -DHAVE_CONFIG_H -m64 -O2 -g0 -march=sandybridge -mtune=sandybridge -fopenmp -mfpmath=sse -pipe -fno-strict-aliasing -fomit-frame-pointer -finline-functions -finline-limit=60 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=6 -D_FORTIFY_SOURCE=2 -Wstack-protector -Wformat -Werror=format-security -O3 -funroll-loops -funswitch-loops -minline-all-stringops -fwrapv -fno-stack-protector -fstack-protector --param=ssp-buffer-size=8 -fPIC -fno-exceptions -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fPIC -O3 -g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing -Wno-uninitialized -DDBUG_OFF -DMY_PTHREAD_FASTMUTEX=1 -I/home/builduser/rpmbuild/BUILD/mariadb-10.0.21/include -o CMakeFiles/strings.dir/ctype-cp932.c.o -c /home/builduser/rpmbuild/BUILD/mariadb-10.0.21/strings/ctype-cp932.c
Regards, Sergei
i simply removed -flto since it don't work attached the RPM SPEC file %{optflags} translates to .rpmrc [builduser@testserver:~]$ cat .rpmrc optflags: x86_64 -m64 -O2 -g0 -march=sandybridge -mtune=sandybridge -fopenmp -mfpmath=sse -pipe -fno-strict-aliasing -fomit-frame-pointer -finline-functions -finline-limit=60 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=6 -D_FORTIFY_SOURCE=2 -Wstack-protector -Wformat -Werror=format-security Am 01.10.2015 um 19:26 schrieb Sergei Golubchik:
Hi, Reindl!
On Sep 20, Reindl Harald wrote:
Am 20.09.2015 um 19:14 schrieb Sergei Golubchik:
On Sep 20, Reindl Harald wrote:
"-O3 -g" appears in the cmake output, that likely breaks ld.gold / -flto and so the question: who the explain the build *not* add that useless param for production builds like most oterh software don't
without one could also remove the strip-calls in rpm-spec-files!
Sorry, I have more questions that answers...
* How do you build?
+ export 'CFLAGS=-m64 -O2 -g0 -march=sandybridge -mtune=sandybridge -fopenmp -mfpmath=sse -pipe -fno-strict-aliasing -fomit-frame-pointer -finline-functions -finline-limit=60 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=6 -D_FORTIFY_SOURCE=2 -Wstack-protector -Wformat -Werror=format-security -O3 -funroll-loops -funswitch-loops -minline-all-stringops -fwrapv -fno-stack-protector -fstack-protector --param=ssp-buffer-size=8 -fPIC -fno-exceptions -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE'
But you cannot be building this this line, right? You invoke cmake, somehow, and make, somehow. How? And may be you set CXXFLAGS and I don't know what else.
Where do you see -O3 -g?
the " -fPIC -O3 -g -static-libgcc" stuff comes *after* my global CFLAGS and so overrides them
Okay, that's better. "static-libgcc" is only used in two files in the source tree: ./BUILD/compile-bintar and ./cmake/build_configurations/mysql_release.cmake
So, either you're using BUILD/compile-bintar script (which I find unlikely) or you're invoking cmake with -DBUILD_CONFIG=mysql_release (which I find likely - and that's exactly why I was asking "how do you build" !)
This is not configurable, you cannot switch a part of mysql_release.cmake off. Either you use -DBUILD_CONFIG=mysql_release or you don't. If you don't like it - you can simply add all options from it manually to your CFLAGS and then you won't need -DBUILD_CONFIG
But you said it conflicts with -flto. Where does -flto come from? I don't see it in your CFLAGS. Nor is it on the compiler's command line below:
[ 6%] Building C object strings/CMakeFiles/strings.dir/ctype-cp932.c.o cd /home/builduser/rpmbuild/BUILD/mariadb-10.0.21/strings && /usr/bin/cc -DDISABLE_MYSQL_THREAD_H -DHAVE_CONFIG_H -m64 -O2 -g0 -march=sandybridge -mtune=sandybridge -fopenmp -mfpmath=sse -pipe -fno-strict-aliasing -fomit-frame-pointer -finline-functions -finline-limit=60 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=6 -D_FORTIFY_SOURCE=2 -Wstack-protector -Wformat -Werror=format-security -O3 -funroll-loops -funswitch-loops -minline-all-stringops -fwrapv -fno-stack-protector -fstack-protector --param=ssp-buffer-size=8 -fPIC -fno-exceptions -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fPIC -O3 -g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing -Wno-uninitialized -DDBUG_OFF -DMY_PTHREAD_FASTMUTEX=1 -I/home/builduser/rpmbuild/BUILD/mariadb-10.0.21/include -o CMakeFiles/strings.dir/ctype-cp932.c.o -c /home/builduser/rpmbuild/BUILD/mariadb-10.0.21/strings/ctype-cp932.c
participants (2)
-
Reindl Harald
-
Sergei Golubchik