public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Jorge <japreja@msn.com>
To: cygwin@cygwin.com
Subject: Re: recompiling gcc, make, and binutils for my cpu architecture?
Date: Sat, 05 Nov 2011 11:06:00 -0000	[thread overview]
Message-ID: <loom.20111105T113507-401@post.gmane.org> (raw)
In-Reply-To: <4EB29BEE.2030304@cs.utoronto.ca>

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

      reply	other threads:[~2011-11-05 11:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-03 13:00 Jorge
2011-11-03 13:49 ` Ryan Johnson
2011-11-05 11:06   ` Jorge [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=loom.20111105T113507-401@post.gmane.org \
    --to=japreja@msn.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).