Bug #9263 GCC4: -mcpu is depricated, use -mtune or -march instead
Submitted: 18 Mar 2005 6:05 Modified: 28 Apr 2005 4:07
Reporter: Stewart Smith
Status: Closed
Category:Server: Compiling Severity:S3 (Non-critical)
Version:5.0 bk (probably 4 as well) OS:Linux (Linux)
Assigned to: Magnus Blaudd Target Version:

[18 Mar 2005 6:05] Stewart Smith
Description:
when building with ./BUILD/compile-pentium-debug-max on a system with GCC4, it warns that
the -mcpu option is depricated and we should use -mtune or -march.

These seem to be available in earlier versions of GCC.

How to repeat:
CC="gcc-4.0" CXX="g++-4.0" ./BUILD/compile-pentium-debug-max

I used Ubuntu Hoary with gcc4 packages. Fedora Core 4 Test 1 also has GCC4

Suggested fix:
Use -march and -mtune instead
[1 Apr 2005 12:24] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/23557
[15 Apr 2005 13:13] Magnus Blaudd
Added a sed command to configure.in that will convert -mcpu to -mtune if it's a high
enough version of gcc/g++
[22 Apr 2005 14:58] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/24226
[27 Apr 2005 12:51] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/24361
[27 Apr 2005 21:58] Magnus Blaudd
Added the script BUILD/check-cpu which will set the compiler optimization flagg based on
cpu and compiler version. Currently only GCC supported.
Pushed to 4.1.12 and 5.0.6
[28 Apr 2005 4:07] Paul DuBois
No changelog note needed.
[4 May 2005 12:10] Stewart Smith
Going to need to fix the script on ppc. With gcc 3.3 at least, there isn't a -march flag
for ppc.

It seems that consistency for gcc flags is not one of their goals :(