delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/11/05/07:06:45

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-3.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RP_MATCHES_RCVD,SPF_HELO_PASS
X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: Jorge <japreja AT msn DOT com>
Subject: Re: recompiling gcc, make, and binutils for my cpu architecture?
Date: Sat, 5 Nov 2011 11:05:58 +0000 (UTC)
Lines: 62
Message-ID: <loom.20111105T113507-401@post.gmane.org>
References: <loom DOT 20111103T132928-207 AT post DOT gmane DOT org> <4EB29BEE DOT 2030304 AT cs DOT utoronto DOT ca>
Mime-Version: 1.0
User-Agent: Loom/3.14 (http://gmane.org/)
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019