public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "lasse dot collin at tukaani dot org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug target/26877] New: configure switches --with-arch and --with-tune are broken on x86 Date: Sun, 26 Mar 2006 16:51:00 -0000 [thread overview] Message-ID: <bug-26877-12414@http.gcc.gnu.org/bugzilla/> (raw) I was trying to build GCC on x86 so that it would default to -march=i586 -mtune=i686. I specified --with-arch=i586 --with-tune=i686 to configure, but the resulting gcc still used -mtune=i586 instead of -mtune=i686. The configure switches --with-arch, --with-cpu and --with-tune write appropriate values to gcc/configargs.h correctly. However, if --with-arch=foo has been specified, the cpu and tune values have no effect, because in gcc/config/i386/i386.h the order of arch/tune/cpu is wrong: #define OPTION_DEFAULT_SPECS \ {"arch", "%{!march=*:-march=%(VALUE)}"}, \ {"tune", "%{!mtune=*:%{!mcpu=*:%{!march=*:-mtune=%(VALUE)}}}" }, \ {"cpu", "%{!mtune=*:%{!mcpu=*:%{!march=*:-mtune=%(VALUE)}}}" } Example command line: gcc -o foo foo.c "arch": -march= hasn't been given on the command line, append -march=%(VALUE). This is correct. "tune": -mtune= hasn't been given on the command line, neither is -mcpu=. But -march is (we just appended it) so -mtune=%(VALUE) does NOT get appended. This is wrong. "cpu": Same as with "tune". The solution is changing the order from arch/tune/cpu to tune/cpu/arch. This problem applies to at least GCC 3.4.6 and 4.1.0; probably all versions since 3.4.0. --- gcc-4.1.0/gcc/config/i386/i386.h.orig 2006-03-24 23:22:04.000000000 +0200 +++ gcc-4.1.0/gcc/config/i386/i386.h 2006-03-24 23:39:30.000000000 +0200 @@ -269,9 +269,9 @@ /* Support for configure-time defaults of some command line options. */ #define OPTION_DEFAULT_SPECS \ - {"arch", "%{!march=*:-march=%(VALUE)}"}, \ {"tune", "%{!mtune=*:%{!mcpu=*:%{!march=*:-mtune=%(VALUE)}}}" }, \ - {"cpu", "%{!mtune=*:%{!mcpu=*:%{!march=*:-mtune=%(VALUE)}}}" } + {"cpu", "%{!mtune=*:%{!mcpu=*:%{!march=*:-mtune=%(VALUE)}}}" }, \ + {"arch", "%{!march=*:-march=%(VALUE)}"} /* Specs for the compiler proper */ -- Summary: configure switches --with-arch and --with-tune are broken on x86 Product: gcc Version: 4.1.0 Status: UNCONFIRMED Severity: trivial Priority: P3 Component: target AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: lasse dot collin at tukaani dot org GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linux-gnu GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26877
next reply other threads:[~2006-03-26 16:51 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2006-03-26 16:51 lasse dot collin at tukaani dot org [this message] 2006-03-30 20:25 ` [Bug target/26877] " pinskia at gcc dot gnu dot org 2006-07-19 21:59 ` echristo at apple dot com 2006-07-20 7:40 ` echristo at gcc dot gnu dot org 2006-07-20 7:40 ` echristo at apple dot com
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=bug-26877-12414@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /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: linkBe 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).