From: Martin Mares Date: Sat, 28 May 2005 17:51:48 +0000 (+0000) Subject: Added switches for gcc-4.0. "-fstrict-aliasing" is now added only for X-Git-Tag: holmes-import~778 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=673668d5211cedbc77018bde346ea6d118e02825;p=libucw.git Added switches for gcc-4.0. "-fstrict-aliasing" is now added only for gcc 3.0 since 3.3 and newer turn in by default with -O2 or higher. Added CWARNS_OFF, which turns off even the warnings which default to on. Expect lots of warnings with gcc 4.0.0; some of them are caused by compiler bugs (e.g., http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21800). --- diff --git a/lib/autoconf.cfg b/lib/autoconf.cfg index 9a353a23..815583f9 100644 --- a/lib/autoconf.cfg +++ b/lib/autoconf.cfg @@ -102,7 +102,7 @@ if (Get("CPU_ARCH") eq "unknown") { Warn "CPU type not recognized, using default Set("CLANG" => "-std=gnu99"); # C optimizations -Set("COPT" => '-O2 -fstrict-aliasing'); +Set("COPT" => '-O2'); Append("COPT", '-march=$(CPU_ARCH)') if IsSet("CPU_ARCH"); # C optimizations for highly exposed code @@ -110,6 +110,7 @@ Set("COPT2" => '-O3'); # Warnings Set("CWARNS" => '-Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes -Winline'); +Set("CWARNS_OFF" => ''); # Linker flags Set("LOPT" => ""); @@ -123,12 +124,17 @@ Set("LSHARED" => '-shared -Wl,-soname,lib/$(@F)'); # Extra switches depending on GCC version: if ($gccver == 3000) { + Append("COPT" => "-fstrict-aliasing"); } elsif ($gccver == 3003) { Append("CWARNS" => "-Wundef -Wredundant-decls"); Append("COPT" => "-finline-limit=20000 --param max-inline-insns-auto=1000"); } elsif ($gccver == 3004) { Append("CWARNS" => "-Wundef -Wredundant-decls"); Append("COPT" => "-finline-limit=5000 --param large-function-insns=5000 --param inline-unit-growth=200 --param large-function-growth=400"); +} elsif ($gccver == 4000) { + Append("CWARNS" => "-Wundef -Wredundant-decls -Wno-pointer-sign -Wdisabled-optimization -Wno-missing-field-initializers"); + Append("CWARNS_OFF" => "-Wno-pointer-sign"); + Append("COPT" => "-finline-limit=5000 --param large-function-insns=5000 --param inline-unit-growth=200 --param large-function-growth=400"); } else { Warn "Don't know anything about this GCC version, using default switches.\n"; }