summaryrefslogtreecommitdiffstats
path: root/sys/conf/kern.mk
Commit message (Collapse)AuthorAgeFilesLines
* Spell extensions correctly.brooks2013-05-201-2/+2
| | | | Submitted by: dim
* Add a new option WITHOUT_FORMAT_EXTENSIONS to disable flags related tobrooks2013-05-151-2/+10
| | | | | | | checking our kernel printf extensions. This is useful to allow compilers without these extensions to build kernels. Sponsored by: DARPA, AFRL
* Introduce a new make variable COMPILER_TYPE that specifies whatbrooks2012-09-131-3/+3
| | | | | | | | | | | | | | | | | | | | type of compiler is being used (currently clang or gcc). COMPILER_TYPE is set in the new bsd.compiler.mk file based on the value of the CC variable or, should it prove informative, by running ${CC} --version and examining the output. To avoid negative performance impacts in the default case and correct value for COMPILER_TYPE type is determined and passed in the environment of submake instances while building world. Replace adhoc attempts at determining the compiler type by examining CC or MK_CLANG_IS_CC with checks of COMPILER_TYPE. This eliminates bootstrapping complications when first setting WITH_CLANG_IS_CC. Sponsored by: DARPA, AFRL Reviewed by: Yamaya Takashi <yamayan@kbh.biglobe.ne.jp>, imp, linimon (with some modifications post review) MFC after: 2 weeks
* Upgrade our copy of llvm/clang to trunk r162107. With thanks todim2012-08-201-0/+1
| | | | Benjamin Kramer and Joerg Sonnenberger for their input and fixes.
* Work around the following clang warning in mps(4):dim2012-03-231-0/+1
| | | | | | | | | | | sys/dev/mps/mps_sas.c:861:1: error: function 'mpssas_discovery_timeout' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration] mpssas_discovery_timeout(void *data) ^ Because the driver is obtained from upstream, we don't want to modify it; just silence the warning instead, it is harmless. MFC after: 3 days
* Update comments and CFLAGS in sys/conf/kern.mk, introduced in r221879,dim2012-03-131-10/+8
| | | | | | | | | | | to match reality: clang does _not_ disable SSE automatically when -mno-mmx is used, you have to specify -mno-sse explicitly. Note this was the case even before r232894, which only makes a change in the 'positive' flag case; e.g. when you specify -msse, MMX gets enabled too. MFC after: 1 week
* Reenable -Winline on MIPS now that we're not compiling Cavium's errorjmallett2012-03-111-3/+0
| | | | decoding stuff, which is impossibly-huge.
* Disable -Winline on MIPS in preparation for the import of the latest versionjmallett2012-03-111-0/+3
| | | | | | of the Cavium Simple Executive, which violates large function growth rules in such a way that simply increasing the large function growth parameter is insufficient.
* Revert r232473. I have been convinced by Doug Barton and Bjoern Zeebdim2012-03-031-3/+3
| | | | | | | | | | | | | | | | | | | | | | | that it is better to error out when people attempt to build using the wrong bsd.*.mk files, than to silently ignore the problem. This means, that after this commit, if you want to build kernel modules by hand (or via a port) from a head source tree, you *must* make sure the files in /usr/share/mk are in sync with that tree. If that isn't possible, for example when you are running on an older FreeBSD branch, you can: - Run "make buildenv" from your head source tree, to have the correct environment setup. (It's advisable to have run "make buildworld", or at a minimum "make toolchain" first.) - Alternatively, set MAKESYSPATH to the share/mk directory under your head source tree. If your build tools are too old, other problems may still occur. - Alternatively, use "make -m" and specify the share/mk directory under your head source tree. Again, build tools that are too old may still result in trouble. MFC after: 2 weeks
* After r232322, it turned out many people (and some ports) are buildingdim2012-03-031-3/+3
| | | | | | | | | | | | | | | | | | | | | kernel modules using their old installed /usr/share/mk/bsd.*.mk files, instead of the updated ones in their source tree. This leads to errors like: "sys/conf/kmod.mk", line 111: Malformed conditional (${MK_CLANG_IS_CC} == "no" && ${CC:T:Mclang} != "clang") Obviously, these errors will go away after a "make installworld", or alternatively, by using "make buildenv" before attempting to manually build modules. However, since it is apparently an expected use case to build using old .mk files, change the way we test for clang, so it also works when the MK_CLANG_IS_CC macro doesn't exist. Note the conditional expressions are becoming rather unreadable now, but I will attempt to fix that on a followup commit. MFC after: 2 weeks
* Add a WITH_CLANG_IS_CC option for src.conf(5), disabled by default, thatdim2012-02-291-3/+3
| | | | | | | | | | installs clang as /usr/bin/cc, /usr/bin/c++ and /usr/bin/cpp. Note this does *not* disable building and installing gcc, which will still be available as /usr/bin/gcc, /usr/bin/g++ and /usr/bin/gcpp. If you want to disable gcc completely, you must use WITHOUT_GCC. MFC after: 2 weeks
* Revert r231978, so I can apply a more proper fix to silence unneededdim2012-02-231-1/+0
| | | | | | internal declaration warnings in several sys/cam/ctl files. MFC after: 1 week
* When building with clang, disable -Wformat-security fordim2012-02-211-0/+1
| | | | | | | | | | | | | | | | | | | | sys/dev/hpt27xx/osm_bsd.c, since it gets the following warnings: sys/dev/hpt27xx/osm_bsd.c:1180:25: error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security] S_IRUSR | S_IWUSR, driver_name); ^~~~~~~~~~~ @/dev/hpt27xx/hpt27xx_config.h:46:21: note: expanded from: #define driver_name hpt27xx_driver_name ^~~~~~~~~~~~~~~~~~~ Since 'hpt27xx_driver_name' is a constant string symbol (coming from the proprietary hpt27xx_lib.o file), there is no security problem. Because this driver is provided by the vendor, and applying changes requires re-certification and other bureaucratic exercises, just disable the warning for now. MFC after: 1 week
* When building with clang, disable -Wunneeded-internal-declaration fordim2012-02-211-0/+1
| | | | | | | | | | | | | | several sys/cam/ctl files, since these get the following warnings: In file included from sys/cam/ctl/ctl_backend.c:60: sys/cam/ctl/ctl_private.h:300:30: error: variable 'page_index_template' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration] static struct ctl_page_index page_index_template[] = { ^ These warnings are tricky to fix without a lot of overhaul, and they are harmless, so disable them for now. MFC after: 1 week
* Disable several instances instances of clang's -Wself-assign warning.dim2011-12-301-0/+1
| | | | | | | | | | | All of these are harmless, and are in fact used to shut up warnings from lint. While here, remove -Wno-missing-prototypes from the xfs module Makefile, as I could not reproduce those warnings either with gcc or clang. MFC after: 1 week
* For several files in sys/dev/drm, disable -Wunused-value when buildingdim2011-12-301-0/+1
| | | | | | | | | with clang. There are several macros in these files that return values, and in some cases nothing is done with them, but it is completely harmless. For some other files, also disable -Wconstant-conversion, since that triggers a false positive with the DMA_BIT_MASK() macro. MFC after: 1 week
* Make another clang warning, -Wparentheses-equality, non-fatal duringdim2011-12-241-1/+2
| | | | | | | | kernel builds. All the instances of this warning in our tree are completely harmless, and many people seem to like adding extra parentheses to make precedence clearer. MFC after: 1 week
* Make another clang warning, -Wempty-body, non-fatal during kerneldim2011-12-241-1/+1
| | | | | | | | | | | builds. All the instances of this warning in our tree are completely harmless. (Most of the empty bodies look to be used simply as reminder for the developer to add something later.) While here, assign to CWARNEXTRA with ?=, so it can be overridden easily, if needed. MFC after: 1 week
* Update a comment to reflect reality and explain why we're using themarius2011-12-241-1/+2
| | | | medany code model.
* Amend r228822 by not directly adding to CWARNFLAGS, but to an optionaldim2011-12-231-2/+3
| | | | | | | | | CWARNEXTRA variable, which gets included into the initial CWARNFLAGS setting. This makes it easier to override CWARNFLAGS with completely custom settings (including enabling any disabled warnings). Reminded by: arundel MFC after: 1 week
* When building the kernel with clang, it produces several warnings whichdim2011-12-231-0/+4
| | | | | | | | | | | | | might be useful in some cases, but which are not severe enough to error out the whole kernel build. Display them anyway, so there is at least some incentive to fix them eventually. Start with -Wtautological-compare warnings. These usually occur when people check if unsigned quantities are negative, or similar cases. To clean these up would be painful, and might give problems if the base type which is compared against changes to signed later on. MFC after: 1 week
* When building with clang, disable -Wshift-count-negative anddim2011-12-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -Wshift-count-overflow for sys/dev/ath/ath_hal/ah_regdomain.c, as it gets multiple instances of the following warnings: In file included from sys/dev/ath/ath_hal/ah_regdomain.c:99: sys/dev/ath/ath_hal/ah_regdomain/ah_rd_domains.h:69:15: warning: shift count is negative [-Wshift-count-negative] .chan11a = BM4(F1_4950_4980, ^~~~~~~~~~~~~~~~~ sys/dev/ath/ath_hal/ah_regdomain/ah_rd_domains.h:41:4: note: expanded from: W1(_fa) | W1(_fb) | W1(_fc) | W1(_fd) } ^ sys/dev/ath/ath_hal/ah_regdomain/ah_rd_domains.h:34:45: note: expanded from: (((_a) > 63 && (_a) < 128 ? (((uint64_t) 1)<<((_a)-64)) : (uint64_t) 0)) ^ ~~~~~~~~~ and: In file included from sys/dev/ath/ath_hal/ah_regdomain.c:99: sys/dev/ath/ath_hal/ah_regdomain/ah_rd_domains.h:629:15: error: shift count >= width of type [-Werror,-Wshift-count-overflow] .chan11a = BM4(W2_5260_5320, ^~~~~~~~~~~~~~~~~ sys/dev/ath/ath_hal/ah_regdomain/ah_rd_domains.h:40:34: note: expanded from: { W0(_fa) | W0(_fb) | W0(_fc) | W0(_fd), \ ^ sys/dev/ath/ath_hal/ah_regdomain/ah_rd_domains.h:32:44: note: expanded from: (((_a) >= 0 && (_a) < 64 ? (((uint64_t) 1)<<(_a)) : (uint64_t) 0)) ^ ~~~~ Both warnings are false positives, caused by LLVM PR 10030. For global initializations, clang fails to detect that the branch of the ternary operator causing the warning is dead. MFC after: 1 week
* When building with clang, disable -Warray-bounds for sys/dev/asr/asr.c,dim2011-12-211-0/+1
| | | | | | | | | | | | | | | | | | as it gets the following warning: sys/dev/asr/asr.c:1836:29: warning: array index of '58' indexes past the end of an array (that contains 1 element) [-Warray-bounds] while ((len > 0) && (sg < &((PPRIVATE_SCSI_SCB_EXECUTE_MESSAGE) ^ sys/dev/asr/i2omsg.h:934:8: note: array 'Simple' declared here I2O_SGE_SIMPLE_ELEMENT Simple[1]; ^ This is a false positive, since I2O_SG_ELEMENT::Simple is not declared as a C99 flexible array member, but in the old (but more portable) way. At run-time, the proper number of array elements will hopefully have been allocated. MFC after: 1 week
* Start selectively disabling a few kernel build warnings for clang, sincedim2011-12-211-0/+7
| | | | | | | | | | | | | | | | | | | | there are some places in the kernel where fixing them is too disruptive, or where there is a false positive. In this case, disable -Wconstant-conversion for two aic7xxx-related files, as they get the following warning on i386 (and possibly on other 32-bit arches): sys/dev/aic7xxx/ahc_pci.c:112:10: warning: implicit conversion from 'long long' to 'bus_addr_t' (aka 'unsigned int') changes value from 549755813887 to 4294967295 [-Wconstant-conversion] ? 0x7FFFFFFFFFLL ~~^~~~~~~~~~~~~~ This is a false positive, since the code only passes the 0x7FFFFFFFFFLL argument, if sizeof(bus_addr_t) is larger than 4 (e.g. on 64 bit arches, or when PAE is enabled on i386). The code could be refactored to do compile-time checks, but that is more disruptive. MFC after: 1 week
* - fix WITH_CTF when specified in /etc/src.conf [1]fjoe2011-11-291-7/+0
| | | | | | | | | | | | | - CTFCONVERT_CMD=... is a hack (should be defined to empty string instead): make(1) should be taught to ignore empty commands silently in compat mode (as it does in !compat mode, GNU make also silently ignores empty commands) and to skip printing empty commands in !compat mode - config(8) should generate ${NORMAL_CTFCONVERT} invocation without '@': this will allow to simplify kern.pre.mk even more and lessen the number of shell invocations during kernel build when CTF is turned off - WITH_CTF can now be converted to usual MK_CTF=yes/no infrastructure Pointy hat to: fjoe [1]
* Fix typo in comments (conversation -> conversion).fjoe2011-11-291-1/+1
|
* Revert r226665 untill the issues with this change have been resolved.rmh2011-10-261-12/+2
| | | | Approved by: kib (mentor)
* Put in a temporary band-aid to fix kernel builds when CC=clang, afterdim2011-10-241-1/+1
| | | | r226665.
* Conditionalize a pair of FreeBSD GCC extensions so that its CFLAGS are onlyrmh2011-10-231-2/+12
| | | | | | used with FreeBSD GCC. Approved by: kib (mentor)
* Remove an outdated comment as requested by Bruce Evans in a private email tobrucec2011-05-241-5/+2
| | | | | | | | | | | Alexander Best (arundel@). For clang, -fdiagnostics-show-option is enabled by default, but for gcc it isn't. This option will report which -W* flag was responsible for triggering a certain warning. This will bring gcc warnings closer to the ones clang emits and might also help developers track down tinderbox failures a bit quicker. Submitted by: arundel
* gcc and clang semantics imply certain -mno-* flags when other certain -mno-*brucec2011-05-141-5/+28
| | | | | | | | | | | flags are also specified. This change makes use of this behaviour and removes unneeded -mno-* flags. Note that clang does not yet enable AVX support for any CPU. However at some point in the future it will and since we definitely want to disable it for the kernel, we might as well add the -mno-avx flag now. Submitted by: arundel
* Add -Wmissing-include-dirs to CWARNFLAGS, so tinderbox will punish thosebrucec2011-05-021-10/+11
| | | | | | | | | developers committing new code with broken include directories. Fix a few whitespace issues. Improve a couple of comments. -W is now deprecated and is referred to as -Wextra (see gcc(1)). Submitted by: arundel
* Remove support for the Intel C Compiler from the build infrastructure.dim2011-04-191-17/+3
| | | | | | This support has not worked for several years, and is not likely to work again, unless Intel decides to release a native FreeBSD version of their compiler. ;)
* Turn off default generation of userland dot symbols on powerpc64 now thatnwhitehorn2011-02-181-0/+7
| | | | | we have a binutils that supports it. Kernel dot symbols remain on to assist DDB.
* On i386 and amd64, consistently use the following options whenever wedim2011-01-051-1/+1
| | | | | | want to avoid using any "advanced" CPU features: -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float
* Sort -mno-(mmx|3dnow|sse|sse2|sse3) options consistently throughout thedim2011-01-051-1/+1
| | | | | | tree. Submitted by: arundel
* Prefer MACHINE_CPUARCH over MACHINE_ARCHimp2010-09-131-9/+10
|
* For every instance of '.if ${CC} == "foo"' or '.if ${CC} != "foo"' inrpaulo2010-08-171-6/+6
| | | | | | | | | | | | | Makefiles or *.mk files, use ${CC:T:Mfoo} instead, so only the basename of the compiler command (excluding any arguments) is considered. This allows you to use, for example, CC="/nondefault/path/clang -xxx", and still have the various tests in bsd.*.mk identify your compiler as clang correctly. ICC if cases were also changed. Submitted by: Dimitry Andric <dimitry at andric.com>
* Handle a few corner cases for clang like we did with icc. These shouldrpaulo2010-07-221-2/+4
| | | | | | reduce the number of warnings seen while building the kernel. Submitted by: Dimitry Andric <dimitry at andric.com>
* Convert several instances of MACHINE_ARCH to MACHINE_CPUARCH and use thenwhitehorn2010-07-131-1/+1
| | | | correct compiler flags on 64-bit PowerPC.
* WITH_CTF can now be specified in src.conf (not recommended, therenetchild2010-04-021-0/+8
| | | | | | | | | | | | | | | | | | | | | | are some problems with static executables), make.conf (would also affect ports which do not use GNU make and do not override the compile targets) or in the kernel config (via "makeoptions WITH_CTF=yes"). Additional (related) changes: - propagate WITH_CTF to module builds - do not add -g to the linker flags, it's a noop there anyway (at least according to the man page of ld) - do not add -g to CFLAGS unconditionally we need to have a look if it is really needed (IMO not) or if there is a way to add it only when WITH_CTF is used Note: ctfconvert / ctfmerge lines will not appear in the build output, to protect the innocent (those which do not build with WITH_CTF would see the shell-test and may think WITH_CTF is used). Reviewed by: imp, jhb, scottl (earlier version) Discussed on: arch@
* Removed NO_UNDEF.ru2010-01-191-4/+1
| | | | Nudged by: trasz
* Undo r169961, removing WITH_GCC3, added as a temporary workaround threetrasz2010-01-181-4/+1
| | | | years ago.
* Merge r201902 and r195669 from projects/mips into head by hand:imp2010-01-091-3/+2
| | | | | | | | | r201902 | imp | 2010-01-09 10:16:19 -0700 (Sat, 09 Jan 2010) | 2 lines Fix comment, which was missed in an earlier commit... r195669 | gonzo | 2009-07-13 17:03:44 -0600 (Mon, 13 Jul 2009) | 3 lines - Remove -mno-dsp from CFLAGS. MIPS DSP ASE is off by default now (as it should be)
* Bump down the inline limit on MIPS.imp2009-03-031-1/+1
|
* Explicitly disable generation of Altivec instructions in the kernel on PowerPC,nwhitehorn2009-02-221-1/+2
| | | | and add support to allow users to set their CPUTYPE in make.conf.
* Disable SSP for mips until support is added to the base architecture.imp2008-07-231-1/+1
|
* Disable SSP for the kernel on arm as well (see rev 180605).cognet2008-07-221-1/+2
| | | | | | I overlooked this because a SSP kernel booted for me. Apologises to: ticso
* Enable GCC stack protection (aka Propolice) for userland:ru2008-06-251-0/+7
| | | | | | | | | | | | | | | | | | | | | - 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>
* Add -mno-sse3 for amd64 case tooache2008-05-101-1/+1
| | | | | PR: 123518 Submitted by: Marc Olzheim <marcolz@stack.nl>
OpenPOWER on IntegriCloud