Commit Graph

149 Commits

Author SHA1 Message Date
tsutsui a46df0d20b Don't use data in freed stack. 2006-01-13 16:36:25 +00:00
jmc 1bd5227b67 Make dependency checking for the pull-over make's actually work.
The make depend needs to be it's own separate make so it's done before the
main make runs. This also fixes issues w. -j breaking on 'depend <target'.

In addition, force the sub cross-over make to always run or otherwise it'll
never check dependencies once a valid foo.cro has been created.

Bump to 20050208
2005-02-10 16:03:04 +00:00
christos 36eef77064 Revert part of previous [remove cd to objdir] and bump the crunchdate.
Make has been fixed. The cd was in the wrong place anyway, it should
immediately follow ${MAKE}, so it did not work as expected.
2005-01-31 23:48:38 +00:00
lukem ebb5895a82 Explicitly cd to the .OBJDIR in the ${PROG}.strip target.
This fixes the "make -j N dependall" build issues people were
seeing in src/rescue, that appears to have been introduced
in rev 1.62.

Use the MAKEVERBOSE macros (if present) to print the pretty message.

Set the CRUNCH_VERSION to 20050130.
2005-01-30 23:04:33 +00:00
dsl 43371ff1ac Add (unsigned char) cast to ctype functions 2004-10-30 17:17:35 +00:00
wiz ab90f76ed3 Sync usage with man page (sort, add -O). 2004-09-25 21:48:15 +00:00
wiz 7a57b6bd09 Sort options in SYNOPSIS and in description; use more mdoc macros. 2004-09-25 21:47:53 +00:00
dsl 6e443a613f Change the way crunchgen works when doing 'reachover' builds.
Instead of trying to identify all the .o files that make each target rely
on the targets own Makefile having a program.ro target that will compile
all the objects and link them into a single relocatable.
Rename each program's 'main' to '_crunched_<prog>_stub' instead of compiling
a small piece of C.
The old behaviour can be forced by specifying -O, and is also done if the
config file specifies 'objs' or 'objpaths'.
As well as simplifying the logic, this means you only get a single 'prog.ro
is up to date' message for each program during the build.
2004-09-25 20:43:47 +00:00
dsl eb23ef8ce9 Use a single awk command (instead of awk and a lot of greps) to generate
the list of symbols to be renamed.
Rename symbols to <symbol>$$from%%<prog> (not _$$hide$$<prog>.cro$$<symbol>)
so that gdb reports the symbol name instead of  "_" (the $$ is treated as a
C++ name mangle and nothing after it is output by default).
2004-09-25 20:21:57 +00:00
dsl 8e4e69acab Whitespace police:
if, for and while are not functions,
put controlled statements of if and while onto separate lines
put function names into column 1
2004-09-25 19:21:07 +00:00
dsl ef0ef24324 Remove the always defined RENAME_SYMS and the code that would be
compiled were it defined.
That code is out of date, doesn't work on some archs, and is in the way
of another commit.
2004-09-25 18:32:37 +00:00
wiz cfb72c3de3 Adapt to /usr/share/misc/style.
Sync usage with man page.
Use getprogname()/setprogname().
2004-08-24 12:25:26 +00:00
wiz 71ad289a40 One object-file argument is mandatory, noted by jmc@openbsd.
New sentence, new line. Use more mdoc macros.
2004-08-24 12:11:44 +00:00
wiz 83e5dd40b4 Sync usage with man page. 2004-08-23 00:42:32 +00:00
wiz a908bd6f92 The conffile argument is not optional; also, move it behind all
the options. Bump date.
2004-08-23 00:42:12 +00:00
christos 5eb3a1ebce Add -v VARSPEC, so that we can pass variable assignments to make(1) 2004-08-19 22:24:04 +00:00
christos 999ef51181 remove copyright and comment sections. Saves ~40K on the crunched
ramdisk binary.
2004-06-06 01:46:53 +00:00
lukem 986979b8c9 Consistently check ${TOOLCHAIN_MISSING} against "no". 2004-01-03 14:04:27 +00:00
jmc 6cf7ed4ade Fix PR#4980 and support common symbols correctly in crunched programs.
Exclude them from renaming and expect the linker to do the right thing in
resolving them all to the library copy (i.e. optarg) or locally as the
case may be. Testing multiple programs crunched which reference optarg shows
correct behavior now.
2003-12-28 09:21:36 +00:00
jmc c392dc52fe Support crunch configs which specify relative srcdir's but don't use -D. For
these cases, prepend getwd() onto the front of them so a full correct path
is passed to the reach over make command (as it's running from at least
a subdir of the current directory for each object)
2003-12-27 22:28:38 +00:00
dmcmahill e399647d5d Use grep in favor of egrep in a few places. The pattern being searched
for is just a string and some egrep's (notably the Solaris one) don't like
the -w option.
2003-12-08 23:57:13 +00:00
nathanw 31bbd833a9 Change the make(1) command lines generated by crunchgen from:
"make -a -b VAR=VALUE -c -d target" to
"make -a -b -c -d VAR=VALUE target"

to avoid depending on make's undocumented and unportably-implemented
handling of the former case.

Makes crunchgen and nbmake work together on Cygwin.
2003-11-19 22:44:15 +00:00
lukem 171d653219 Overhaul how `build.sh tools' are used:
*	Rename "config.h" to "nbtool_config.h" and
	HAVE_CONFIG_H to HAVE_NBTOOL_CONFIG_H.
	This makes in more obvious in the source when we're using
	tools/compat/config.h versus "standard autoconf" config.h

    *	Consistently move the inclusion of nbtool_config.h to before
    	<sys/cdefs.h> so that the former can provide __RCSID() (et al),
    	and there's no need to protect those macros any more.

These changes should make it easier to "tool-ify" a program by adding:
	#if HAVE_NBTOOL_CONFIG_H
	#include "nbtool_config.h"
	#endif
to the top of the source files (for the general case).
2003-10-27 00:12:41 +00:00
lukem 130ab7336b Rework how MAKEVERBOSE operates:
*	Don't bother prefixing commands with a line of  ${_MKCMD}\
	and instead rely upon "make -s".  This is less intrusive on
	all the Makefiles than the former.  Idea from David Laight.

    *	Rename the variables use to print messages.  The scheme now is:
	    _MKMSG_FOO		Run  _MKMSG 'foo'
	    _MKTARGET_FOO	Run  _MKMSG_FOO ${.TARGET}
	From discussion with Alistair Crooks.
2003-10-21 10:01:19 +00:00
lukem 87755a0463 support MAKEVERBOSE and use ${HOST_SH} 2003-10-19 04:05:01 +00:00
lukem 53a9d2856c fix typo that prevented ${PROG}.unstripped from being removed in "clean" 2003-10-07 07:08:20 +00:00
salo 0f5a0c156d netbsd.org->NetBSD.org 2003-07-26 20:34:11 +00:00
lukem 29a6151db1 NOxxx= variables should appear first 2003-07-10 11:21:51 +00:00
dsl 9778762a60 Keep unstripped binary in $OBJ, use are timestamp instead of prog.stripped.
Patentially useful as a source of symbol information for debugging.
2003-07-09 19:51:07 +00:00
thorpej d6c02b1523 "objcopy --redefine-syms-file" is now "objcopy --redefine-syms". 2003-06-01 02:03:22 +00:00
lukem 826a14607a Now that <bsd.prog.mk> DTRT if HOSTPROG is defined (i.e, it is a no-op),
there's no need to special-case .include-ing it.
2003-05-18 07:57:31 +00:00
dsl cd7432d0cb Add an extra target to the xxx.mk file that is equivalent to 'all', but which
doesn't pick up baggage from bsd.own.mk and bsd.prog.mk.
This stops parallel makes exploding because they try to build ${PROG} to soon.
Fixes toolchain/21563 (with change to src/distrib/common/Makefile.crunch).
Upped version of crunchgen to 0.3
2003-05-15 17:49:46 +00:00
dsl 606b795c6a Add a .WAIT to ensure that all the program objects are built before
trying to build the crunched binary.
Might fix toolchain/21563
2003-05-14 11:20:01 +00:00
dsl 13d371ab4c Make the prog.mk makefile run make in each of the target directories and
then build the program itself.
This means that changes to any of the program source files cause the
crunched binary to be rebuilt.
Seems to work ok with the sysinst ramdisks.
2003-05-09 12:10:15 +00:00
perry 2bb5ccc638 progams->programs (Igor Sobrado, PR misc/19700) + homegrown->home-grown 2003-03-31 01:46:29 +00:00
fvdl 083af7aab4 Back out rev 1.43 for now, it seems to create some new problems (see
the sysinst Makefile).
2003-03-18 01:30:54 +00:00
enami 3d76616fbe No need to invoke the make command so many times. It can handle all
the target specified in command line.
2003-03-01 08:36:05 +00:00
wiz 990562bfef .Nm does not need a dummy argument ("") before punctuation or
for correct formatting of the SYNOPSIS any longer.
2003-02-25 10:34:36 +00:00
msaitoh f81acfd9b4 The name of the working directory for each prog is converted by "s/-/_/".
The directory list to be removed (i.e. make clean) has to be set with
the converted name.
2003-02-18 18:12:07 +00:00
simonb 6960865826 Use new the --redefine-syms-file option to objcopy to rename the symbols
we want to hide instead of making global symbols local (which doesn't
work on MIPS).
2003-01-29 10:32:34 +00:00
fvdl 286cf86961 Get the right formats for x86_64. 2002-12-05 01:38:26 +00:00
wiz ceff784594 Two typos. From Adrian Mrva. eg -> e.g. 2002-10-02 16:04:58 +00:00
thorpej 3b08abd277 * Eliminate the USE_NEW_TOOLCHAIN variable. Instead, split it into
two variables:

  TOOLCHAIN_MISSING -- set to "yes" on platforms for which there is
  no working in-tree toolchain (hppa, ns32k, sh5, x86_64).

  EXTERNAL_TOOLCHAIN -- if defined by the user, points to the root of
  an external toolchain (e.g. /usr/local/gnu).  This enables the cross-build
  framework even for TOOLCHAIN_MISSING platforms.

  If TOOLCHAIN_MISSING is set to "yes", MKGDB, MKBFD, and MKGCC are all
  unconditionally set to "no", since the bits are not there to build.

  If EXTERNAL_TOOLCHAIN is set, MKGCC is unconditionally set to "no",
  since the external toolchain's compiler is not in-sync with the
  in-tree compiler support components (e.g. libgcc).

* Set MACHINE_CPU much earlier in bsd.own.mk, so that more tests in
  that file can use it.
2002-09-17 23:18:25 +00:00
lukem 951972b555 - move LDSTATIC=-static to the bottom, so that "LDSTATIC=" in /etc/mk.conf
doesn't cause lossage
- set NOMAN= at the top (rather than MKMAN=no)
2002-08-20 01:52:58 +00:00
scw 4c8e482124 Add SH5 support. (Missed these during the last sweep of my local tree) 2002-07-11 21:46:21 +00:00
pooka ade9640026 Add -o, -D, and -L to usage() to get it in sync with reality. 2002-07-09 12:49:10 +00:00
pooka d395d11df0 Add envp argument support to crunchgen.
Even though envp is not the POSIX way of crawling through the environment,
this will hopefully save someone from having to scratch their head
really hard with a crunched program using envp.

from henric@aimnet.com, via OpenBSD
2002-07-03 12:45:06 +00:00
tsutsui 490896d4c4 Include <limits.h> for SIZE_T_MAX since time.h no longer
includes <machine/limits.h>.
2002-06-30 03:26:59 +00:00
pooka b31cb5dea9 add -o to synopsis 2002-06-12 11:22:41 +00:00
lukem f5aa03d2fa revert revision 1.37; it causes problems when running make(1) on a
crunchgen-created makefile with a partiallly complete build
(a situation which is more common than you think...)

solving the "parallel build" problem for crunchgen-created makefiles
needs to be done a different way...

fixes [toolchain/17012] from me.
2002-05-29 09:41:51 +00:00