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 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: References: <4EB29BEE DOT 2030304 AT cs DOT utoronto DOT ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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: List-Subscribe: List-Archive: List-Post: List-Help: , 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 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