CFLAGS/CXXFLAGS used in our build scripts
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Percona Server moved to https://jira.percona.com/projects/PS |
Fix Released
|
Medium
|
Tomislav Plavcic | |||
5.1 |
Fix Released
|
Medium
|
Tomislav Plavcic | |||
5.5 |
Fix Released
|
Medium
|
Tomislav Plavcic | |||
5.6 |
Fix Released
|
Medium
|
Tomislav Plavcic | |||
Percona XtraDB Cluster moved to https://jira.percona.com/projects/PXC | Status tracked in 5.6 | |||||
5.5 |
Won't Fix
|
Medium
|
Unassigned | |||
5.6 |
Fix Released
|
Medium
|
Unassigned |
Bug Description
Currently we have following in our build scripts (that we use for releases):
export CFLAGS="-fPIC -Wall -O3 -g -static-libgcc -fno-omit-
export CXXFLAGS="-O2 -fno-omit-
There are a few anomalies here:
a) -Wp,-D_
it there for CFLAGS. Also, we need to compare the costs to
performance here (also, if stack protection is really desired
then -fstack-protector --param=
addition)
b) Why O3 for CFLAGS and O2 for CXXFLAGS? Again, here the
costs/benefits of O3 need to be analysed (size/icache v/s performance).
c) Is static-libstdc++ required for CXXFLAGS like static-libgcc
in CFLAGS?
In debian/rules we have
"-O3 -DBIG_JOINS=1" for CFLAGS
"-O3 -DBIG_JOINS=1 -felide-
These also need to be checked and added to rpm build script if
needed.
Related branches
- Laurynas Biveinis (community): Approve
-
Diff: 109 lines (+19/-12)6 files modifiedMakefile (+2/-2)
UDF/configure.ac (+1/-1)
build/build-binary.sh (+11/-4)
build/debian/percona-server-server-5.1.postinst (+2/-2)
build/debian/rules (+1/-1)
build/percona-server.spec (+2/-2)
- Laurynas Biveinis (community): Approve
-
Diff: 93 lines (+20/-7) (has conflicts)4 files modifiedMakefile-ps (+2/-2)
UDF/configure.ac (+1/-1)
build-ps/build-binary.sh (+14/-1)
build-ps/percona-server.spec (+3/-3)
- Laurynas Biveinis (community): Approve
-
Diff: 76 lines (+7/-9)4 files modifiedMakefile-ps (+2/-2)
UDF/configure.ac (+1/-1)
build-ps/build-binary.sh (+1/-3)
build-ps/percona-server.spec (+3/-3)
tags: | added: pkg |
This is easy to confirm using grep:
openxs@ ao756:~ /bzr/percona- 5.5/build- ps$ grep -n FLAGS * sh:17:TARGET_ CFLAGS= '' sh:157: export CFLAGS="-fPIC -Wall -O3 -g -static-libgcc -fno-omit- frame-pointer -DPERCONA_ INNODB_ VERSION= $PERCONA_ SERVER_ VERSION $TARGET_CFLAGS ${ FLAGS:-}" sh:158: export CXXFLAGS="-O2 -fno-omit- frame-pointer -g -pipe -Wall -Wp,-D_ FORTIFY_ SOURCE= 2 -fno-exceptions -DPERCONA_ INNODB_ VERSION= $PERCONA_ SERVER_ VERSION $TARGET_CFLAGS ${CXXFLAGS:-}" sh:20:TARGET_ CFLAGS= '' sh:126: export CFLAGS="-fPIC -Wall -O3 -g -static-libgcc -fno-omit- frame-pointer -DPERCONA_ INNODB_ VERSION= $PERCONA_ SERVER_ VERSION $TARGET_CFLAGS ${CFLAGS:-}" sh:127: export CXXFLAGS="-O2 -fno-omit- frame-pointer -g -pipe -Wall -Wp,-D_ FORTIFY_ SOURCE= 2 -fno-exceptions -DPERCONA_ INNODB_ VERSION= $PERCONA_ SERVER_ VERSION $TARGET_CFLAGS ${CXXFLAGS:-}" compat- rpm.sh: 21:TARGET_ CFLAGS= '' compat- rpm.sh: 41: TARGET_CFLAGS="-m32 -march=i686" compat- rpm.sh: 89: TARGET_CFLAGS='-m32 -march=i686' compat- rpm.sh: 116:export CFLAGS="-fPIC -Wall -O3 -g -static-libgcc -fno-omit- frame-pointer $TARGET_CFLAGS" compat- rpm.sh: 117:export CXXFLAGS="-O2 -fno-omit- frame-pointer -g -pipe -Wall -Wp,-D_ FORTIFY_ SOURCE= 2 -fno-exceptions $TARGET_CFLAGS" server. spec:344: MYSQL_CFLAGS="-I $RPM_BUILD_ DIR/%{src_ dir}/release/ include" \ server. spec:357: CXXFLAGS="$CXXFLAGS -I$RPM_ BUILD_DIR/ %{src_dir} /release/ include" \ server. spec:369: # name, finally a default. RPM_OPT_FLAGS is assumed to be a part of the server. spec:378: # This is a hack, $RPM_OPT_FLAGS on ia64 hosts contains flags which break server. spec:382: RPM_OPT_ FLAGS= server. spec:388: export CFLAGS= ${MYSQL_ BUILD_CFLAGS: -${CFLAGS: -$RPM_OPT_ FLAGS}} server. spec:389: export CXXFLAGS= ${MYSQL_ BUILD_CXXFLAGS: -${CXXFLAGS: -$RPM_OPT_ FLAGS -felide- constructors -fno-exceptions -fno-rtti}} server. spec:390: export LDFLAGS= ${MYSQL_ BUILD_LDFLAGS: -${LDFLAGS: -}} server. spec:408: CFLAGS=`echo " ${CFLAGS} " | \ server. spec:414: CXXFLAGS=`echo " ${CXXFLAGS} " | \ server. spec:479: libgcc=`$CC $CFLAGS --print- libgcc- file` server. spec:1341: - Modify CFLAGS and CXXFLAGS such that a debug build is not optimized. server. spec:1402: - Add CFLAGS to gcc call with --print- libgcc- file, to make sure the server. spec:1494: - Set $LDFLAGS from $MYSQL_ BUILD_LDFLAGS server. spec:1809: - CFLAGS and CXXFLAGS should honor RPM_OPT_FLAGS ao756:~ /bzr/percona- 5.5/build- ps$ grep -n FLAGS debian/* $${MYSQL_ BUILD_CFLAGS: -"-O3 -DBIG_JOINS=1"} \ $${MYSQL_ BUILD_CXXFLAGS: -"-O3 -DBIG_JOINS=1 -felide- constructors -fno-exceptio...
build-binary.
build-binary.sh:48: TARGET_CFLAGS="-m32 -march=i686"
build-binary.
build-binary.
build-rpm.
build-rpm.sh:40: TARGET_CFLAGS="-m32 -march=i686"
build-rpm.sh:93: TARGET_CFLAGS='-m32 -march=i686'
build-rpm.
build-rpm.
build-shared-
build-shared-
build-shared-
build-shared-
build-shared-
grep: debian: Is a directory
percona-
percona-
percona-
percona-
percona-
percona-
percona-
percona-
percona-
percona-
percona-
percona-
percona-
percona-
percona-
grep: rpm: Is a directory
openxs@
grep: debian/additions: Is a directory
grep: debian/patches: Is a directory
grep: debian/po: Is a directory
debian/rules:81: CFLAGS=
debian/rules:83: CXXFLAGS=