This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: recompiling gcc, make, and binutils for my cpu architecture?


Ryan Johnson <ryan.johnson <at> cs.utoronto.ca> writes:

> 
> On 03/11/2011 8:54 AM, Jorge wrote:
> > Hi all, I hope I am posting in the right location.
> This has nothing whatsoever to do with cygwin.

In fact, for what I originally asked, it does have to do with cygwin, it's
called optimizing it for my system which involves optimizing the build tools
first.

> 
> > I would like to setup/optimize gcc, binutils, and make for my CPU
> >architecture,
> > AMD K8, and rebuild.  I have installed the cygwin sources.
> Invoking gcc with "-march=native" should do exactly what you want with 
> far less effort than rebuilding the toolchain from scratch (a task not 
> for the faint of heart nor for the impatient). Make cares very little 
> what architecture it runs on; binutils cares deeply but almost certainly 
> does the right thing already.
> 
> If you need more information, try 'man gcc' and 'http://gcc.gnu.org' (in 
> that order).
> 
> Ryan
> 
> 

If anyone would like to optimize cygwin for their exact architecture, the
default configure scripts do allot of work to figure out how to do the build,
but it is still not optimized to the fullest.

You need to set CFLAGS, CPPFLAGS, CXXFLAGS, and LDFLAGS in your environment, for
example: My system is and AMD K8 processor with SSE, SSE2, MMX, and 3DNOW.

-march=native just compiles for a basic i686 system

Here are the flags I have figured out so far for my system. I did this within
the cygwin.bat file.

set CFLAGS=-g -O2 -mtune=k8 -msse -msse2 -m3dnow -mfpmath=sse
set CXXFLAGS=-g -O2 -mtune=k8 -msse -msse2 -m3dnow -mfpmath=sse
set CPPFLAGS=-g -O2 -mtune=k8 -msse -msse2 -m3dnow -mfpmath=sse
set LDFLAGS=-s

This works great for my system so far, and builds are somewhat faster now that I
have recompiled and installed binutils, gcc, and make.  Now to rebuild cygwin :D
<--- has to do with cygwin.

Each person wishing to optimize their system better than default should read
about the GCC's info pages, not just the man pages.  gcc.info has all the
information you need to set your *FLAGS variables to something that is more
representative to your system.  There is allot to read!  But is is all described
very well.

I still have yet to figure out how to alter the prefix properly, from i686 to
k8, but it all still works.  If someone can tell me the proper way to do this it
would be appreciated.

Thanks again for your comments.

Jorge


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]