Commit Graph

129 Commits

Author SHA1 Message Date
Eitan Adler
2f466a9724 Remove variable added by ru@ in r94940 that is no longer used by source or ports in share/mk/sys.mk
PR:		conf/155737
Reviewed by:	ed (two years ago!)
Exp-Run by:	bdrewery
2013-06-23 20:34:54 +00:00
Simon J. Gerraty
b37be1a5d4 We cannot remove the _+_ trick, until old make is completely deprecated.
But we don't want to set it to + for bmake since it breaks make -N
which is used to supress the normal handling of targets marked with .MAKE
(which seems broken in fmake and might be why _+_ was introduced).
Add some comments to explain what's gong on.

Reviewed by:	obrien
2013-06-14 16:24:07 +00:00
Simon J. Gerraty
d58b075701 Override bmake's default MAKEFILE_PREFERENCE 2013-06-07 19:45:04 +00:00
Simon J. Gerraty
93556e96ec Tell bmake to use the FreeBSD preferred makefile preference list.
PR:		177593
Reviewed by:	obrien
2013-04-03 16:20:21 +00:00
Dag-Erling Smørgrav
edd42017c9 Remove all support for legacy NOFOO and NO_FOO build options. 2013-01-10 22:44:19 +00:00
Ed Maste
44383aa35e Hide OBJCOPY and others in POSIX mode
Submitted by: Garrett Cooper
2012-12-17 21:09:44 +00:00
Ed Maste
e97696b5ec Put shared library debug info into separate .symbols file
Sponsored by: ADARA Networks
2012-12-15 00:03:35 +00:00
Eitan Adler
bffa448842 Change the default to 'cru' for speed reasons.
Submitted by:	Erik Cederstrand <erik@cederstrand.dk>
Reviewed by:	imp, toolchain@
Approved by:	cperciva
MFC after:	2 weeks
2012-12-06 01:31:34 +00:00
Marcel Moolenaar
0815243c39 Add support for bmake. This includes:
1.  Don't do upgrade_checks when using bmake. As long as we have WITH_BMAKE,
    there's a bootstrap complication in ths respect. Avoid it. Make the
    necessary changes to have upgrade_checks work wth bmake anyway.
2.  Remove the use of -E. It's not needed in our build because we use ?= for
    the respective variables, which means that we'll take the environment
    value (if any) anyway.
3.  Properly declare phony targets as phony as bmake is a lot smarter (and
    thus agressive) about build avoidance.
4.  Make sure CLEANFILES is complete and use it on .NOPATH. bmake is a lot
    smarter about build avoidance and should not find files we generate in
    the source tree. We should not have files in the repository we want to
    generate, but this is an easier way to cross this hurdle.
5.  Have behavior under bmake the same as it is under make with respect to
    halting when sub-commands fail. Add "set -e" to compound commands so
    that bmake is informed when sub-commands fail.
6.  Make sure crunchgen uses the same make as the rest of the build. This
    is important when the make utility isn't called make (but bmake for
    example).
7.  While here, add support for using MAKEOBJDIR to set the object tree
    location. It's the second alternative bmake looks for when determining
    the actual object directory (= .OBJDIR).

Submitted by:	Simon Gerraty <sjg@juniper.net>
Submitted by:	John Van Horne <jvanhorne@juniper.net>
2012-10-06 20:01:05 +00:00
Oleksandr Tymoshenko
4da573d910 Merging of projects/armv6, part 3
r238211:
Support TARGET_ARCH=armv6 and TARGET_ARCH=armv6eb

This adds a new TARGET_ARCH for building on ARM
processors that support the ARMv6K multiprocessor
extensions.  In particular, these processors have
better support for TLS and mutex operations.

This mostly touches a lot of Makefiles to extend
existing patterns for inferring CPUARCH from ARCH.
It also configures:
 * GCC to default to arm1176jz-s
 * GCC to predefine __FreeBSD_ARCH_armv6__
 * gas to default to ARM_ARCH_V6K
 * uname -p to return 'armv6'
 * make so that MACHINE_ARCH defaults to 'armv6'
It also changes a number of headers to use
the compiler __ARM_ARCH_XXX__ macros to configure
processor-specific support routines.

Submitted by:	Tim Kientzle <kientzle@freebsd.org>
2012-08-15 03:21:56 +00:00
Warner Losh
6f1d6967f2 Sort nm in order.
Submitted by:	bde
2012-04-22 17:14:11 +00:00
Warner Losh
edfe67eab7 Fix partially merged patch from my external compiler tree in r234546.
Define NM except when we're in strict POSIX mode.
2012-04-21 17:45:40 +00:00
Juli Mallett
84db023ec1 Assume a big-endian default on MIPS and drop the "eb" suffix from MACHINE_ARCH.
This makes our naming scheme more closely match other systems and the
expectations of much third-party software.  MIPS builds which are little-endian
should require and exhibit no changes.  Big-endian TARGET_ARCHes must be
changed:
	From:		To:
	mipseb		mips
	mipsn32eb	mipsn32
	mips64eb	mips64

An entry has been added to UPDATING and some foot-shooting protection (complete
with warnings which should become errors in the near future) to the top-level
base system Makefile.
2012-03-29 02:54:35 +00:00
Max Khon
78e7e3ecb5 - fix WITH_CTF when specified in /etc/src.conf [1]
- 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]
2011-11-29 16:34:44 +00:00
Max Khon
cd49c2e840 Conditionalize ctfconvert/ctfmerge runs on make level (.if/.endif) instead
of executing a shell on every object or executable/library file.

This shaves off more than 30,000 shell invocations during buildworld.
2011-11-29 08:38:47 +00:00
Warner Losh
cd2ae2532f Retire TARGET_ABI.
Implement MACHINE_ARCH=mips64e[lb] to build N64 images.  This replaces
MACHINE_ARCH=mipse[lb] TARGET_ABI=n64.

MACHINE_ARCH=mipsn32e[lb] has been added, but currently requires
WITHOUT_CDDL due to atomic issues in libzfs.  I've not investigated
this much, but implemented this to preserve as much of the TARGET_ABI
functionality that I could.  Since its presence doesn't affect the
working cases, I've kept it in for now.

Added mips64e[lb] to make universe, so more kernels build.

And I think this (finally) closes the curtain on the tbemd tree.
2011-01-07 20:26:33 +00:00
Konstantin Belousov
5ada7d99af Introduce make variable ACFLAGS used to supply additional flags to
cc driver when compiling assembler source file that is preprocessed.
2011-01-07 14:32:29 +00:00
Dimitry Andric
bd4473b822 Fix typo, and re-wrap paragraph. 2010-11-11 23:00:37 +00:00
Rui Paulo
9a1d115000 Add the DTRACE variable that points to the executable.
Sponsored by:	The FreeBSD Foundation
2010-09-10 16:19:58 +00:00
Will Andrews
4be3feb212 Fix buildworld -DNO_CLEAN when using with Perforce, which marks files as
read-only by default, meaning files copied can't be overwritten next time.

Reviewed by:	imp
Approved by:	ken (mentor)
2010-08-12 20:46:49 +00:00
Rui Paulo
3a1134997b Fix previous commit: I forgot to include parenthesis.
Submitted by:	anonymous
2010-07-30 08:52:19 +00:00
Rui Paulo
8a5216d5d8 When building WITH_CTF=1, print the ctf executable that's going to be
run. This makes the 'ctfconvert' and 'ctfmerge' programs show up during
a build when compiling a kernel, a library or a program.

Sponsored by:	The FreeBSD Foundation
2010-07-29 16:30:27 +00:00
Nathan Whitehorn
13109bdf8d Minor modifications to know what to do with powerpc64. 2010-07-10 02:32:50 +00:00
Warner Losh
6fc3ead135 Merge from tbemd branch:
Introduce MACHINE_CPUARCH.  Many different MACHINE_ARCHs will be built
from one MACHINE_CPUARCH.  This will allow us to move to a more
standard MACHINE_ARCH for mips and arm which exist in many different
endian variants, and for powerpc where both 32 and 64 bit binaries are
generated from the same sources.

Reviewed by:	arch@ (mostly silence though)
2010-06-11 02:43:36 +00:00
Alexander Leidinger
21edb039c6 WITH_CTF can now be specified in src.conf (not recommended, there
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@
2010-04-02 06:55:31 +00:00
Marcel Moolenaar
96f2d85e89 Unbreak WARNS=6 builds for C++ code: -Wold-style-definition is not accepted
by the C++ compiler. Filter it out.
2010-02-18 01:44:48 +00:00
Stephane E. Potvin
424b4e66a9 Introduce two new flags PO_CFLAGS and PO_CXXFLAGS to make it possible
to have different flags when building profiled objects.

MFC after:	1 month
2010-01-22 14:05:48 +00:00
John Birrell
770ac3b21f Add support for the Compact C Type (CTF) conversions throughout FreeBSD's
system makefiles.

Note that the CTF conversion defaults to off. We may choose to change this
default later if DTrace proves popular and people are prepared to wear
the compilation performance impact of compiling with debug symbols all the
time.

Setting NO_CTF in the make args or user environment turns off CTF conversion.
Even if we choose to default CTF generation to on later, we still need
NO_CTF so that the buildworld process can bootstrap the tools without
needlessly generating CTF data for temporary tools.

Setting WITH_CTF in the make args or user environment (and _NOT_ in
/etc/make.conf) is the only way to enable CTF data conversion. Nore that
this can't be implemented the same way that the WITH_ and WITHOUT_ stuff
is implemented throughout the buildworld because the CTF conversion needs
to work when building a simple object without a Makefile, using the
default rules in sys.mk.

Typing 'make test.o' with no makefile and just a source file test.c
should work. Also, typing 'make WITH_CTF=1 test.o without a makefile and
just a source file test.c should work and produce an object with a CTF
elf section. Typing 'make WITH_CTF=1 CFLAGS=-g test.o' without a makefile
and just a source file test.c should produce an object with both a CTF
elf section and the debug elf sections.

In the FreeBSD build where more .mk files are used than just sys.mk
which is included my make by default, the use of DEBUG_FLAGS is the
correct way to enable a debug build. The important thing to note here
is that it is the DEBUG_FLAGS setting that prevents libraries and
programs from being stripped on installation. So, for the addition of
CTF data conversion, setting DEBUG_FLAGS to contain -g, without NO_CTF,
will cause the ctfconvert and ctfmerge build programs to be executed
also with the -g arg so that debug symbols are retained rather than
being removed after the CTF data elf section has been added.

Add DTrace libraries to the list of libnames.
2008-05-22 01:14:43 +00:00
Warner Losh
fd08931dd5 MFp4 (mips2-jnpr):
o Default to -O on mips as well as arm.  -O2 has been strongly implicated
  in many problems in the past, so we're taking a conservative approach
  until the problems are well understood.
2008-04-04 21:12:40 +00:00
David E. O'Brien
20c46652dc PR ports/121363 (& ports/73797) has been committed, so we can now go back
to JB's revision 1.96 change to remove -fno-strict-aliasing from CFLAGS.

This makes the default CFLAGS to match the simple defaults that the
tinderboxes use.  By using -fno-strict-aliasing by default we are
choosing to ignore problems in code which had the potential to
shoot ourselves in the foot.
2008-04-02 17:24:22 +00:00
David E. O'Brien
92aa7717fa Temporarily back out revision 1.98 to give Portmgr some time to
address PR ports/121363 (current day re-opening of PR ports/73797)
to make ports CFLAGS more independent of src/'s CFLAGS WRT aliasing.

Discussed with: brooks
2008-03-04 20:26:03 +00:00
David E. O'Brien
b9b482710e Back out revision 1.97, which backed out part of revision 1.96.
Change the default CFLAGS to match the simple defaults that the
tinderboxes use.  By using -fno-strict-aliasing by default we are
choosing to ignore problems in code which had the potential to
shoot ourselves in the foot.
2008-03-04 19:00:11 +00:00
John Birrell
221a97c194 Although the entire src tree builds cleanly now without -fno-strict-aliasing
in the default CFLAGS, we're in the middle of a ports freeze, so we can't
really go making the corresponding change to the ports mk files.

I'll take -fno-strict-aliasing out again when the ports freeze ends.
2007-11-26 21:46:21 +00:00
John Birrell
cfb5b3256b Re-enable -Werror again.
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.
2007-11-22 23:21:12 +00:00
John Birrell
c117aee58e Weed out a warning argument that isn't applicable to C++ code. 2007-11-19 09:01:58 +00:00
Olivier Houchard
cdc162fe0e Switch arm to -O until the -O2 issues are resolved.
MFC After:	3 days
2007-11-05 23:08:34 +00:00
Yaroslav Tykhiy
a39cea66f4 Allow the shell used by make(1) to be changed early via the
__MAKE_SHELL variable.  This feature isn't supposed to be in wide
use, but it's needed now to make `installworld' independent of the
stock binaries and libs so that radical ABI changes can go in safely.

Reviewed by:	ru
2007-10-27 18:40:34 +00:00
Xin LI
179dc282b4 Restore -O2 optimization after gcc 4.2.1 import, which has
fixed the issue raised by gcc 4.2.0.

Tested with:	test case found in gcc bug 32500
Approved by:	re (kensmith), ache, kan
2007-08-14 13:44:08 +00:00
Andrey A. Chernov
5f308feb93 Switch to "-O1 -pipe" as cross-build compatible gcc workaround.
"Looks like Alexander chimed in with "I'm comfortable with that until we
can import a fixed GCC"."

Approved by:	re (kensmith)
2007-07-01 11:51:06 +00:00
Andrey A. Chernov
cf7e2eb063 Back out gcc workaround per re@ request. Details:
"There seems to be some continuing discussion about how this is best fixed,
and we'd like to get Alexander (as our gcc guru) to opine on a final
solution before picking one.  In the mean time, could you back out the
original commit (sys.mk:1.89)?"

Approved by:	re (rwatson)
2007-06-28 09:25:47 +00:00
Andrey A. Chernov
3f5b2c267b This is temp workaround of nasty gcc 4.2.0 -O2 bug which may skip the rest
of the loop when arrays used inside.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32500

Approved by:    re (kensmith)
2007-06-26 19:10:20 +00:00
Dejan Lesjak
eb91fad699 Remove X11BASE from here so the one from bsd.port.mk has a chance to set
default. Grepping through src shows only gnu/usr.bin/groff which doesn't
use it in src build and OpenSSH for which this was a NOOP.

Discussed with:	des, ru
Approved by:	ru
2006-10-06 23:32:23 +00:00
Ruslan Ermilov
d9423c1bc1 We bootstrap make(1) if necessary during an upgrade, so checking
if MACHINE_ARCH is defined is no longer needed.
2005-09-28 08:17:30 +00:00
Hartmut Brandt
dea3d8703e Toggle on warnings. This resolves the problem with building old releases
(getting zillions of warnings). Building an old release uses that release's
sys.mk which does not switch on these warnings, so make will be silent.
They can be switch on on the command line with the -x option to make.
This has been tested by building RELENG_5_4 on CURRENT.
2005-04-29 14:44:10 +00:00
Darren Reed
a63b0146dc IPFIlter problems that prevented building should all now be resolved so
remove this temporary measure.
2005-04-28 23:29:00 +00:00
Scott Long
6230360e99 Disable the IPFILTER bits until they compile again. This can be overriden
by adding WANT_IPFILTER to /etc/make.conf.  Note that this is only a partial
hack and only works when building the world and kernel the 'sanctioned' way.
I hope that this hack is only temporary and can be reverted soon.
2005-04-27 14:13:55 +00:00
Ruslan Ermilov
52dbe95f4d Include bsd.compat.mk early from sys.mk, enough for makefiles
using conditional statements to see the new spellings of NO_*
knobs (in case user still uses old spellings).

Reported by:	kris
2004-12-23 08:51:50 +00:00
David E. O'Brien
96b8536954 Compiling with 'strict-aliasing' optimization breaks some [notable] ports.
GCC turns on 'strict-aliasing' optimization at all levels above -O[1], so
explicitly turn it off when using compiling with the -O2 optimization level.
2004-11-11 01:09:56 +00:00
Dag-Erling Smørgrav
ecdb24f5d3 Switch the default CFLAGS to -O2 -pipe.
Submitted by:	obrien
2004-10-25 20:04:50 +00:00
Hartmut Brandt
acabf29a1b Use the '+' flag to make make recurse into sub-directories even when
given -n. For POLA reasons this behaviour is switched on only when
at least two -n flags are given to make. One -n flag keeps the old behaviour
of showing the shell command that would recurse into the sub-directories.

Discussed with: ru
2004-08-09 10:54:05 +00:00