public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* recompiling gcc, make, and binutils for my cpu architecture?
@ 2011-11-03 13:00 Jorge
  2011-11-03 13:49 ` Ryan Johnson
  0 siblings, 1 reply; 3+ messages in thread
From: Jorge @ 2011-11-03 13:00 UTC (permalink / raw)
  To: cygwin

Hi all, I hope I am posting in the right location.

I would like to setup/optimize gcc, binutils, and make for my CPU architecture,
AMD K8, and rebuild.  I have installed the cygwin sources.

When I build, I get i686-pc-cygwin.

How can I make the build K8-pc-cygwin with the proper optimizations.  My CPU's
information can be obtained from
http://www.cpu-world.com/CPUs/K8/AMD-Sempron%203100+%20-%20SDA3100AIP3AX%20%28SDA3100AXBOX%29.html
if it is needed.

I would also like to know which order I should build in if it matters... and
also if I should get the sources from the respective tools svn site instead of
using the cygwin sources.

My OS is Windows XP SP3

Thanks in advance for your replies.
Jorge

PS, when/if I have some success with this, I am willing to rebuild and package
the entire cygwin distribution with some guidance from some experienced builders
if it will help in any way.


--
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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: recompiling gcc, make, and binutils for my cpu architecture?
  2011-11-03 13:00 recompiling gcc, make, and binutils for my cpu architecture? Jorge
@ 2011-11-03 13:49 ` Ryan Johnson
  2011-11-05 11:06   ` Jorge
  0 siblings, 1 reply; 3+ messages in thread
From: Ryan Johnson @ 2011-11-03 13:49 UTC (permalink / raw)
  To: cygwin

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.

> 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


--
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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: recompiling gcc, make, and binutils for my cpu architecture?
  2011-11-03 13:49 ` Ryan Johnson
@ 2011-11-05 11:06   ` Jorge
  0 siblings, 0 replies; 3+ messages in thread
From: Jorge @ 2011-11-05 11:06 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-11-05 11:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-03 13:00 recompiling gcc, make, and binutils for my cpu architecture? Jorge
2011-11-03 13:49 ` Ryan Johnson
2011-11-05 11:06   ` Jorge

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).