From 13e5b79f181dcf7b8e23223cbffb337127e13718 Mon Sep 17 00:00:00 2001 From: Sven Vermeulen Date: Fri, 27 Aug 2010 22:25:07 +0200 Subject: [PATCH] Use march=native as default, add link to list of archs --- ChangeLog | 2 ++ src/linux_sea/09-softwaremanagement.xml | 22 ++++++++++++---------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 08fd09c..ed5d7e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,8 @@ - Add information on kernel module parameters - Add information on autoloading modules and blacklisting modules - Add blurb about "make install" in kernel installation + - Use -march=native as default example, add reference to online list + of GCC-supported architectures ** (2010-08-26) Sven Vermeulen - Reorganize sections within "Software Management" diff --git a/src/linux_sea/09-softwaremanagement.xml b/src/linux_sea/09-softwaremanagement.xml index 583db46..97a6444 100644 --- a/src/linux_sea/09-softwaremanagement.xml +++ b/src/linux_sea/09-softwaremanagement.xml @@ -2106,19 +2106,21 @@ LINGUAS="en nl fr de" I'll start off with my example CFLAGS (CXXFLAGS is the same): - CFLAGS="-O2 -march=pentium3 -pipe" + CFLAGS="-O2 -march=native -pipe" CXXFLAGS="${CFLAGS}" Let's start off with the architecture selection: march. With - -march=pentium3, the compiler is asked to optimize - code for the pentium 3 architecture. Also, because I select - -march=, it will only run on pentium3 (or higher). If - you want to optimize code for a specific x86 architecture but want to be - able to run the code on any x86 architecture, use - -mcpu= instead. Since GCC 4.2, you can also use - -march=native: the compiler will then select the - architecture of the current system (your system), saving you the trouble - of finding out what your architecture is. + -march=native, the compiler is asked to optimize code + for the architecture of the current system (say a pentium 3 + architecture). Also, because I select -march=, it + will only run on this architecture (or architectures that are backwards + compatible with mine). If you want to optimize code for a specific + architecture but want to be able to run the code on any x86 + architecture, use -mcpu= instead. You can also select + a particular architecture, like "core2" or "nocona". A full list of + supported architectures for the current GCC (make sure you are using the + current one) is available online. With -O2 (Optimizations, not zero) I ask GCC to use a list of optimization flags (-O2 is