Commit Graph

209 Commits

Author SHA1 Message Date
joerg 9b296e99bc Decouple clang and gcc handling a bit. Add -Wmissing-noreturn for clang
builds. GCC complains about about non-void functions not returning,
which is quite a bit more bogus, so don't enable it for that.
2011-09-20 09:11:06 +00:00
christos 875018bf8a add -Wformat=2 2011-08-23 05:22:25 +00:00
uwe cc65ce8e22 Augment previous. Use -Wno-uninitialized for sh3 in general, not just
dreamcast.  The problem is not sh3 per-se, but the fact that for sh3
we use -Os by default.  That causes false positives since gcc doesn't
detect that e.g. a variable is set and used under the same condition
in different "if" statements.

XXX: This should probably check for optimization level instead,
though, for all I know, phase of moon might be a contributing cause
too.

XXX2: MACHINE_CPU is set in bsd.own.mk and is not available here, so
we have to spell the test in terms of MACHINE_ARCH.
2011-07-08 20:59:53 +00:00
mrg 5f311ecb4a # XXX GCC 4.5 for dreamcast is extra noisy for cases it should be better with
workaround via: CFLAGS+=      -Wno-uninitialized
2011-07-08 03:29:52 +00:00
mrg f53e78abc3 XXX: for now, disable fatal linker warnings for GCC 4.5. 2011-06-29 08:10:05 +00:00
mrg 8f161cd6d3 remove all the code that supported HAVE_GCC=3. mostly from chuq. 2011-06-20 06:52:36 +00:00
joerg 78ec0254df Reorder CWARNFLAGS and -Werror in CFLAGS to allow CWARNFLAGS and by
extension CWARNFLAGS.${SOURCE} to override it selectively.
2011-05-30 13:56:34 +00:00
joerg 70e887f5ec Add an alternative to NOGCCERROR for clang. 2011-05-30 13:47:01 +00:00
joerg a216da57a6 Default to -Wno-sign-compare -Wno-pointer-sign for clang.
Push -Wno-array-bounds down to the cases that depend on it.
Selectively disable warnings for 3rd party software or non-trivial
issues to be reviewed later to get clang -Werror to build most of the
tree.
2011-05-26 12:56:24 +00:00
joerg 7e217e1f53 Restrict -Wno-non-template-friend and -Wno-pmf-conversions to GCC. 2011-05-25 15:02:25 +00:00
joerg 175c50ac7e Add support for compiler specific warning flags with
CWARNFLAGS.${COMPILER}
2011-05-25 15:01:08 +00:00
joerg 0cd1e39abe Disable Clang's array boundary checker for now (hits e.g. in GCC and BDB) 2011-05-23 14:32:05 +00:00
joerg 1742cf8828 Simplify a bit 2011-05-22 20:52:12 +00:00
joerg 7cfd64c6f6 Split SSP parameters on a per-compiler base 2011-05-22 20:49:16 +00:00
joerg e7d3de7e55 No -Wno-traditional for clang. 2011-05-22 20:24:46 +00:00
christos 6bbebf8328 Enable c99 mode by default.
This has the side effect of complaining for missing prototypes
implicit type declarations and missing return statements.

NB:	I've only ran a build on amd64, so other platforms MI code might break.
	If you can't wait for me to fix them, revert this commit.
2011-05-17 01:12:34 +00:00
joerg 762325586d If MKREPRO, transform ${NETBSDSRCDIR} to /usr/src and ${DESTDIR} to /
for the purpose of the C preprocessor.  This avoids leaking the source
path into the final binaries.
2010-12-25 18:56:44 +00:00
pooka 1ceaafde2e dial . for operator 2010-04-21 16:09:11 +00:00
christos 21003f688c don't try to build PIE binaries when LDSTATIC 2010-04-21 15:07:20 +00:00
darran 61fb3737eb DTrace: Add CTF generation to the make framework. Only enabled when
MKDTRACE=yes.
2010-03-02 20:49:18 +00:00
mrg 6540a82b31 brace a --fatal-warnings with a NOGCCERROR check. 2009-12-15 04:03:55 +00:00
matt 1e301281a1 Merge from matt-nb5-mips64 2009-12-14 01:00:46 +00:00
christos 2561f2eece Don't add the .h rule for yacc if we are not really building (-n) 2009-12-13 18:40:50 +00:00
uebayasi d166c4bf28 Support "extsrc", externally added programs and libraries. Users can write
their own reach-overs, cross-build, install, and get set files just like base
and X11 / X.org.  (These sets are not included as TNF releases.)
2009-11-30 16:13:22 +00:00
tron d6e33297fb Revert SSP changes because at least rmind@, pooka@ and haad@ consider
5% more performance more important than the gain in security.
2009-11-12 14:30:34 +00:00
tron 559872b175 Invent a new flag "USE_SSP_DEFAULT" which defines whether we want to use
SSP for building the whole source tree. Set this to "yes" for
NetBSD/amd64 and NetBSD/i386. It is now possible to get the old
behavior (build libs and certain programs with SSP) by setting
"USE_SSP_DEFAULT" to "no".
2009-11-12 13:22:34 +00:00
tron 47db09157e Fix broken conditional to get manual builds (not using "build.sh")
working again.
2009-11-12 08:51:50 +00:00
tron 840a46601a Enable Stack Smash Protection (SSP) by default for NetBSD/amd64 and
NetBSD/i386 as previously discussed on the "port-amd64" and
"port-i386" mailing lists. No objections from the core team.

Thanks a lot to Tobias Nygren for helping me with the benchmarking
and to Christos Zoulas for fixing SSP problems in cgd(4).
2009-11-11 16:35:45 +00:00
skrll 29d2620fc4 IA64 doesn't have SSP. 2009-11-09 15:58:09 +00:00
lukem c0d472c616 Enable -Wsign-compare for WARNS=4 (and above).
Test compiled on i386 and amd64; there may be some stragglers
on other platforms.

Note: -Wall has this by default in gcc4, and we explicitly disable it at
WARNS=1 (i.e., -Wall -Wno-sign-compare).  A goal is to reduce the WARNS level
where this feature is enabled, so we can eventually remove -Wno-sign-compare.
2009-02-12 22:49:05 +00:00
apb 2962a4be8e Always define TOOL_* variables in bsd.own.mk, not in bsd.sys.mk.
Previously, they were defined in bsd.own.mk if USETOOLS=yes, but in
bsd.sys.mk if USETOOLS!=yes.  This caused makefiles that did this:

	.include <bsd.own.mk>
	FOO != ${TOOL_BAR} args...

to work in the USETOOLS=yes case but not in the USETOOLS!=yes case.
2008-10-26 23:13:24 +00:00
apb 6710f563cb Set HOST_SH?=/bin/sh unconditionally. Previously, it was conditionally
set to /usr/bin/bash if HOST_CYGWIN was defined, but now build.sh
tries to set HOST_SH appropriately.

Remove the HOST_CYGWIN variable, which was not used for any other purpose.

Document that HOST_SH should be an absolute path.

THis was proposed in tech-toolchain.
2008-10-26 15:51:20 +00:00
apb 8140020f95 Remove AWK variable, which is no longer used. All previous users
now use TOOL_AWK instead.
2008-10-25 18:29:03 +00:00
apb 60f5d15a00 Define TOOL_AWK. 2008-10-19 19:44:47 +00:00
christos 81dd08df0d handle assembly files for MKPIE 2008-10-19 15:22:50 +00:00
christos 18c51ff05b Provide a way for a program to override the PIE flags. 2008-10-16 14:36:42 +00:00
christos 1269d9a570 don't compile/link libraries with pie 2008-10-15 17:31:50 +00:00
apb 4c441fdf08 Use "?=", not "=", to set default values for the TOOL_* variables
added in the previous commit.
2008-10-14 07:24:34 +00:00
apb 59b0ced7eb Add missing TOOL_* variables to bsd.sys.mk and document them in
bsd.README.  Previously, several of these variables were present in
bsd.own.mk but not in bsd.sys.mk or bsd.README.
2008-10-13 18:24:21 +00:00
apb bbaac8b3bb In bsd.sys.mk and bsd.own.mk, sort lists of TOOL_* variables.
In bsd.README, document all TOOL_* variables that are set in bsd.sys.mk.

There are several TOOL_* variables that are set in bsd.own.mk, but not
set in bsd.sys.mk and not documented in bsd.README.
2008-10-13 15:29:22 +00:00
apb 1d782af00e Remove the definition of HOST_SED. HOST_SED was previously used only in
tools/atf-compile, which has now been adjusted to use TOOL_SED.
2008-10-05 20:20:55 +00:00
apb 520cbbf81f Build strfile both as a host tool and as an installed program:
* in games/fortune/strfile/Makefile, build strfile as a
  regular program instead of as a host tool;
* add tools/strfile directory to build strfile as a host tool;
* in tools/Makefile, add strfile to SUBDIR list;
* in BSD.*.mk, define TOOL_STRFILE variable;
* in games/fortune/datfiles/Makefile, use TOOL_STRFILE when creating
  databases at build time;
* in distrib/sets/lists/games/mi, mention usr/games/strfile.
2008-09-26 18:23:09 +00:00
christos 99ca374317 support per file lex and yacc prefixes. 2008-09-19 22:54:55 +00:00
gmcgarry ce206e318d Honour HAVE_PCC 2008-08-24 06:27:00 +00:00
christos ee372c7d11 Disable PIE for kernel builds. Some architectures pass -mcmodel to gcc and
this is incompatible with PIE. And we don't really want pic objects in the
kernel
2008-07-23 23:21:56 +00:00
lukem 9ceb85ca59 If WARNS>0 and !defined(NOGCCERROR), add
-Wa,--fatal-warnings
to CFLAGS to set assembler warnings to be fatal.
(Done via CFLAGS instead of AFLAGS so that all assembling, not just
that of .S/.s files, uses the option.)
2008-07-21 23:30:48 +00:00
garbled c3408ed04a Convert prep to use the new unified mkbootimage rather than it's own. This
mkbootimage can be shared by prep, rs6000, and bebox.

TODO: Convert bebox to use this.  Needs someone to test.
2008-04-30 21:15:33 +00:00
tsutsui c81a918994 Redo a change in rev 1.160 with more proper way:
> Don't make linker warnings fatal on linking static libs since
> there is no proper way to avoid "FOO is a patented algorithm" warnings.

Ok'ed by christos@ and dogcow@ on tech-toolchain, and
tested build.sh build for sun2, news68k, alpha and newsmips.
2008-04-22 12:47:59 +00:00
tsutsui a91b6f6d11 Backout previous for now. We have to rethink dependency for MKPIC and LDSTATIC.
Pointed out by dogcow@.
2008-04-15 00:08:05 +00:00
tsutsui 6dadfb80d4 Don't make linker warnings fatal on linking static libs since
there is no proper way to avoid "FOO is a patented algorithm" warnings.
Ok'ed by christos@ on tech-toolchain.
2008-04-14 13:41:43 +00:00