summaryrefslogtreecommitdiffstats
path: root/share/mk/bsd.sys.mk
Commit message (Collapse)AuthorAgeFilesLines
* Allow suppression of -Wcast-align for WARNS>=4 by definingmarcel2010-02-181-1/+4
| | | | | | NO_WCAST_ALIGN. The headers of the standard C++ library are not 64-bit clean and trigger the warning. This prevents use of WARNS>=4 on ia64 for example.
* Undo r169961, removing WITH_GCC3, added as a temporary workaround threetrasz2010-01-181-2/+0
| | | | years ago.
* Disable K&R style function definitions for WARNS=6.ed2009-12-311-1/+2
| | | | | | | | | | | | | | Unfortunately there are two slight problems with that: - Yacc and lex might generate code that generates warnings because of this. Require yacc and lex to be rebuilt during bootstrap. I'm not incrementing __FreeBSD_version here, because I assume someone else will do this eventually. - When running `make buildkernel', it uses share/mk from the source treeo to build aicasm. Because aicasm also depends on lex, this would break. Lower WARNS to 5 for now. We should just increment it to 6 again somewhere in the very far future.
* Unbreak NO_WARNS, keeping CSTD effect on CFLAGS out of its control.ru2009-10-221-1/+3
| | | | Unbreak compiles with icc.
* Set CSTD in all cases except when CC=icc and NO_WARNS is set. Thisrdivacky2009-10-211-1/+1
| | | | | | | | way we can set desired C standard even for cross tools etc. Tested by: make universe Approved by: ed (maintainer) OK by: das
* Switch over to gnu99 compilation on default for userland.rdivacky2009-03-141-8/+9
| | | | | | | | Tested by: make universe Tested by: ports exp build (done by pav) Reviewed by: ru Reviewed by: silence on arch Approved by: ed (mentor)
* Turn of SSP for mips for now until support is added to the baseimp2008-07-231-1/+1
| | | | architecture.
* Disable SSP on arm for the time being.cognet2008-07-191-1/+2
| | | | | | The segfaults when using SSP seem to be a gcc bug, a patch is available in the gcc bugzilla, and will be imported once it's committed into the official gcc tree.
* Enable GCC stack protection (aka Propolice) for userland:ru2008-06-251-0/+6
| | | | | | | | | | | | | | | | | | | | | - It is opt-out for now so as to give it maximum testing, but it may be turned opt-in for stable branches depending on the consensus. You can turn it off with WITHOUT_SSP. - WITHOUT_SSP was previously used to disable the build of GNU libssp. It is harmless to steal the knob as SSP symbols have been provided by libc for a long time, GNU libssp should not have been much used. - SSP is disabled in a few corners such as system bootstrap programs (sys/boot), process bootstrap code (rtld, csu) and SSP symbols themselves. - It should be safe to use -fstack-protector-all to build world, however libc will be automatically downgraded to -fstack-protector because it breaks rtld otherwise. - This option is unavailable on ia64. Enable GCC stack protection (aka Propolice) for kernel: - It is opt-out for now so as to give it maximum testing. - Do not compile your kernel with -fstack-protector-all, it won't work. Submitted by: Jeremie Le Hen <jeremie@le-hen.org>
* Re-enable -Werror again.jb2007-11-221-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This time, change the default CFLAGS to match the simple defaults that the tinderboxes use. That is, don't use -fno-strict-aliasing by default. My last attempt to re-anable -Werror gave me a lesson in what strict aliasing is all about. There was code in libthr that wasn't 64-bit clean. The default use of -fno-strict-aliasing hid that. By using -fno-strict-aliasing by default we were choosing to ignore problems in code which had the potential to shoot ourselves in the foot. Sometimes it would be the 64-bit foot. I have both feet. The left ones are 32 bits and the right ones are 64 bits. Don't ask about my endian orientation. :-) The -fno-strict-aliasing compiler arg can still be used if NO_STRING_ALIASING is define in make. We are early in the FreeBSD 8 development, so we have the opportunity to wait and see if this works for us. I am sure that people will complain. We can easily revert this. All I ask is that we take sides: clean code or not. YMMV. Note that by using -fno-strict-aliasing the build won't actually break. Only where WARNS is set (and -Werror is used) will a compiler warning break the build. The use of WARNS levels implies (to me at least) that the developer has taken some care to make the code pass basic checks. This commit makes those checks just a little bit more strict.
* Unfortunately the tinderbox setup uses custom CFLAGS which are a bigjb2007-11-191-0/+2
| | | | | | | | obstacle to enabling -Werror. I'll continue to work on cleaning up the code so that we can keep this enabled. If the tinderboxes would just use the default CFLAGS set in this file, all would be fine and we'd be able to make use of -Werror.
* Re-enable -Werror ins WARNS as it was roughly 6 months ago beforejb2007-11-191-3/+0
| | | | | | being disabled while gcc 4.2 was bedded in. Tested with 'make release' (amd64 arm i386 ia64 pc98 powerpc sparc64 sun4v)
* Temporarily add 'WITH_GCC3' that removes -Wno-pointer-sign from theobrien2007-05-241-0/+2
| | | | | | | compiler invocation. This is just to help get over the hump of people tracking down bugs that may cross the GCC 4.2 upgrade. It is envisioned that this option goes away after a suitable amount of time.
* Universally disable -Werror until src/ is in better shape for GCC 4.2.kan2007-05-191-0/+4
| | | | | | | There are new warnings that kill the build otherwise. Disable pointer destination sign mismatch warning alltogether. Our tree is in no shape to have that enabled yet.
* Allow a makefile to set IGNORE_PRAGMA so that OpenSolaris code canjb2006-11-041-0/+4
| | | | | | | be built with other gcc warnings enabled. Every Solaris source file has a #pragma ident in it. We can just ignore those definitions.
* Reintroduce CSTD, which allows a Makefile to specify the precise dialectdes2006-08-111-0/+15
| | | | | | | | | | | of C in which the program or library is written. Note that this is *not* intended to be used across the whole tree. It is intended to be used for individual libraries or programs which use specific language features which the compiler must know about in order to produce correct warnings at high WARNS levels. MFC after: 1 month
* Move -Wunused-parameter from WARNS level 3 level 4.obrien2005-01-161-2/+4
| | | | | | | Also break long lines -- note that the '\' must be up against the last character of a line to keep command-line spacing proper. Requested by: rwatson
* Use >= so we can use the actual WARNS levels.obrien2005-01-161-6/+6
|
* This are the build infrastructure changes to allow to use thetrhodes2004-03-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Intel C/C++ compiler (lang/icc) to build the kernel. The icc CPUTYPE CFLAGS use icc v7 syntax, icc v8 moans about them, but doesn't abort. They also produce CPU specific code (new instructions of the CPU, not only CPU specific scheduling), so if you get coredumps with signal 4 (SIGILL, illegal instruction) you've used the wrong CPUTYPE. Incarnations of this patch survive gcc compiles and my make universe. I use it on my desktop. To use it update share/mk, add /usr/local/intel/compiler70/ia32/bin (icc v7, works) or /usr/local/intel_cc_80/bin (icc v8, doesn't work) to your PATH, make sure you have a new kernel compile directory (e.g. MYKERNEL_icc) and run CFLAGS="-O2 -ip" CC=icc make depend CFLAGS="-O2 -ip" CC=icc make in it. Don't compile with -ipo, the build infrastructure uses ld directly to link the kernel and the modules, but -ipo needs the link step to be performed with Intel's linker. Problems with icc v8: - panic: npx0 cannot be emulated on an SMP system - UP: first start of /bin/sh results in a FP exception Parts of this commit contains suggestions or submissions from Marius Strobl <marius@alchemy.franken.de>. Reviewed by: silence on -arch Submitted by: netchild
* Remove -Wbad-function-cast. Its main purpose is to catch bugs that wedes2004-02-161-1/+1
| | | | | already catch with -Wstrict-prototypes, and it causes spurious warnings for some perfectly legitimate constructs.
* Put the warning flags to where they belong (into CWARNFLAGS).ru2004-01-111-10/+10
| | | | | This allows us to easily override them when necessary, e.g., to selectively disable warnings in libc/ contributed sources.
* Put on the core hat and back out all of the CSTD= changes. Core willimp2003-06-141-14/+0
| | | | | | | deal with working with the parties to define a coherent definition for CSTD that doesn't break things. Core hat seconded by: markm
* Revert to a known-good state. Anyone desiring to experiment with stricterdes2003-06-141-23/+9
| | | | global settings is free to do so in his or her own source tree.
* We cannot use c99 on amd64 either due to lack of alloca(). libc:strptime()peter2003-06-131-2/+3
| | | | | | uses alloca() and alloca is impossible to implement as a callable function on amd64. It has to be a compiler builtin. Note that the bigger problem is that libc is not c99 clean internally.
* Be C std strict on i386 and amd64 as we can. Be loose on Alpha and ia64.obrien2003-06-071-0/+6
|
* Compile our code as C99 w/GNU extensions by default.obrien2003-06-061-1/+2
| | | | We can't use straight "c99" due to the lack of alloca.S for non-i386 platforms.
* I got a bazzar bug reportobrien2003-06-021-2/+2
|
* Turn back on c99, the tree should be ready for it now.obrien2003-06-021-1/+1
|
* To quote Tony Maher <tonymaher@optushome.com.au>, "maybe 3rd time lucky ;-)"obrien2003-06-021-1/+1
| | | | *sigh* Just can't get a brake when trying to react too quickly and fix the build.
* Temperarly turn off building the tree with c99.obrien2003-06-021-1/+1
| | | | I swore this made it thru a 'make world', but I don't know what happened.
* Use a bigger hammer -- keep all -std= out of CXXFLAGS.obrien2003-06-011-1/+1
| | | | Also allow for "CSTD=" in a Makefile.
* Do not set a C standard for the C++ compiler.obrien2003-06-011-5/+7
|
* Compile our code as C99 by default.obrien2003-06-011-9/+11
|
* CSTD is virtually worthless for WARNS=2-5. Return -pedantic to WARNS=6+.obrien2003-05-311-1/+3
|
* Make CSTD style match the rest of file.obrien2003-05-311-6/+6
|
* Whitespace cleanup (1.15 had spaces instead of tabs)des2003-05-051-4/+4
|
* Don't use -pedantic unless we also set -std of some kind.des2003-05-051-1/+4
|
* Add a mechanism to allow Makefiles to specify the particular C dialectdes2003-05-011-1/+12
| | | | | | | | | | | | | | | | | | in which the source code is written. This is controlled by the CSTD variable, which can have one of the following values: - "k&r" => -traditional - "c89" or "c90" => -std=iso9899:1990 - "c94" or "c95" => -std=iso9899:199409 - "c99" => -std=iso9899:1999 The corresponding option is added to CFLAGS regardless of WARNS level. This also removes -ansi from WARNS level 6, but adds -Wno-long-long to work around a weird gcc bug (-ansi, which is supposedly equivalent to -std=iso9899:1990, seems to turn long long warnings off instead of on) If CSTD is undefined, CFLAGS are unchanged except for the -ansi / -Wno-long-long change mentioned above for WARNS level 6.
* Migrate to a new way of dealing with building from old revisions ofimp2003-04-051-7/+0
| | | | | | | | | | | | | | | | | FreeBSD. This method attempts to centralize all the necessary hacks or work arounds in one of two places in the tree (src/Makefile.inc1 and src/tools/build). We build a small compatibility library (libbuild.a) as well as selectively installing necessary include files. We then include this directory when building host binaries. This removes all the past release compatibilty hacks from various places in the tree. We still build on tip of stable and current. I will work with those that want to support more, although I anticipate it will just work. Many thanks to ru@, obrien@ and jhb@ for providing valuable input at various stage of implementation, as well as for working together to positively effect a change for the better.
* -Wall implies -Wuninitialized if -O is also in effect.ru2003-04-041-3/+0
| | | | | | | | -Wuninitialized does not work without -O. This fixes the ${WARNS} > 4 compilations with -O0. Spotted by: marcel
* Enable cpp(1) warnings in system headers. GCC is oriented onru2003-03-311-0/+1
| | | | | | glibc which is externally maintained, so GCC ships with these warnings turned off by default. This is also consistent with the src/contrib/gcc/c-lex.c,v 1.2 change.
* Take __FreeBSD_version into account when BOOTSTRAPPING.ru2002-11-131-2/+4
|
* Be more strict with WARNS now -- the GCC 3.1 turmoil is behind us.obrien2002-07-071-0/+6
|
* Tweak the WARNS levels a tad.obrien2002-05-191-6/+0
|
* Gcc 3.1 has different -Wx flags.obrien2002-05-101-2/+5
|
* Add WARNS levels 5 and 6:obrien2002-04-101-1/+8
| | | | | 5 gives us -Wuninitialized rather than -Wno-uninitialized 6 gives us full BDECFLAGS
* FreeBSD prior to 4.5-RELEASE and older versions of 5.0-CURRENT do notru2002-04-071-0/+5
| | | | | | | | | have the __FBSDID() macro in <sys/cdefs.h>. Fix this once and for all for tools that need to be bootstrapped. PR: bin/36747 MFC after: 3 days Prodded by: obrien
* Put -Wno-uninitialized at the end of the warns flags as it may be enabeleddwmalone2002-01-051-3/+5
| | | | | | by several flags (in this case -W and -Wall). Reviewed by: bde
* Add some granularity to the WARNS levels.obrien2001-12-151-5/+10
| | | | | | | 1: add -Werror 2: -Wall [only], as this is the most used warnings setting by developers 3: our old `1' 4: our old `2'
* Only add -Werror if in fact we have set WARNS or WFORMAT to >0kris2001-05-191-4/+6
|
OpenPOWER on IntegriCloud