[PATCH] Add --enable-optimized and --disable-debug & set --march properly
Hi folks, This patch cleans up the -march=i686 from src/Makefile.am, setting it in configure.ac if we're not on a 64-bit system. It also adds --enable-optimized and --disable-debug to the configure script, giving slightly more control over CFLAGS (and if you set CFLAGS as part of the configure arguments it overrides all these settings. I had a bit more work to split the headers off into their own directory, but I need to clean up the patchset. It applies with: patch -p1 <path/to/patch Let me know how it looks, in particular the detection of 64-bit is a bit hackish. yours, Bobby
On Tue, 15 Sep 2009, Bobby Powers wrote:
This patch cleans up the -march=i686 from src/Makefile.am, setting it in configure.ac if we're not on a 64-bit system. It also adds --enable-optimized and --disable-debug to the configure script, giving slightly more control over CFLAGS (and if you set CFLAGS as part of the configure arguments it overrides all these settings. I had a bit more work to split the headers off into their own directory, but I need to clean up the patchset.
It applies with: patch -p1 <path/to/patch
Let me know how it looks, in particular the detection of 64-bit is a bit hackish.
Hi Bobby-- I've actually now received three different patches, each with a slightly different take on the -march problem/solution. I'll take a look at merging the best elements from each and try to get something in the libdispatch tree in the next day or two. Part of the general problem here is that what we really want to know is "what additional flags are required to use gcc built-in atomic operations", and at least in my experimentation so far it appears that gcc generates a link, rather than compile, error if they're unsupported, as it simply puts in a dependency on symbols to provide the atomic operations if it can't deal. Abstracting that nicely proves tricky, so we'll be stuck with some or another hackish solution regardless :-). Thanks! Robert N M Watson Computer Laboratory University of Cambridge
Abstracting that nicely proves tricky, so we'll be stuck with some or another hackish solution regardless :-).
You'll probably have to compile/link a small test program and see if it runs, right? Making that happen in autoconf can be considered hackish, I guess... /r$ -- STSM, WebSphere Appliance Architect https://www.ibm.com/developerworks/mydeveloperworks/blogs/soma/
Richard Salz wrote:
Abstracting that nicely proves tricky, so we'll be stuck with some or another hackish solution regardless :-).
You'll probably have to compile/link a small test program and see if it runs, right? Making that happen in autoconf can be considered hackish, I guess... /r$
Not tested on fbsd (where I assume you needed it), -march is not needed for __sync_lock_test_and_set() on either my Mac OS X or Linux systems. Peter -- Peter O'Gorman http://pogma.com
On Tue, 15 Sep 2009, Peter O'Gorman wrote:
Richard Salz wrote:
Abstracting that nicely proves tricky, so we'll be stuck with some or another hackish solution regardless :-).
You'll probably have to compile/link a small test program and see if it runs, right? Making that happen in autoconf can be considered hackish, I guess...
Not tested on fbsd (where I assume you needed it), -march is not needed for __sync_lock_test_and_set() on either my Mac OS X or Linux systems.
I've committed this patch but with some modifications. __sync_lock_test_and_set() doesn't require at least -march=i486, so I substituted __sync_add_and_fetch(). That also didn't work, as it turns out you can implement the atomic add on i386 w/o -march=i486 as well, so I had to check the return value in order to force gcc to fall back on (unimplemented) library symbols. Probably, we should try testing the need for -march=i486 only on i386 hardware, but I'm not sure it makes too much difference. In any case, this should fix the build problem on x86_64 systems. Robert N M Watson Computer Laboratory University of Cambridge
On Tue, 15 Sep 2009, Bobby Powers wrote:
This patch cleans up the -march=i686 from src/Makefile.am, setting it in configure.ac if we're not on a 64-bit system. It also adds --enable-optimized and --disable-debug to the configure script, giving slightly more control over CFLAGS (and if you set CFLAGS as part of the configure arguments it overrides all these settings. I had a bit more work to split the headers off into their own directory, but I need to clean up the patchset.
It applies with: patch -p1 <path/to/patch
Let me know how it looks, in particular the detection of 64-bit is a bit hackish.
Hi Bobby-- Thanks for this patch. In the end I've merged a slightly different -march handling bit for configure.ac, still arguably imperfect. I hope to dig into optimization issues in the next week or two and will take a look at the impact of -O3 then. Robert
participants (5)
-
Bobby Powers
-
Peter O'Gorman
-
Richard Salz
-
Robert Watson
-
Robert Watson