Commit Graph

139 Commits

Author SHA1 Message Date
David E. O'Brien
02c751922e Some amount of style(9)
-- function definitions, header ordering, and $FreeBSD$.
2012-06-27 04:39:30 +00:00
David E. O'Brien
70840a510a Ensure crunchen uses the same make binary as the rest of the build.
Submitted by:	Simon Gerraty <sjg@juniper.net>
2012-06-25 21:56:36 +00:00
Eitan Adler
1d76342e83 Remove variables which are initialized but never used thereafter reported by gcc46 warning
Approved by:	cperciva
MFC After:	3 days
2012-06-19 06:09:58 +00:00
Juli Mallett
505a01e936 Fix crunchide on MIPS with other than the O32 ABI. 2012-03-13 05:21:14 +00:00
Ulrich Spörlein
0d9deed52c mdoc: drop redundant .Pp and .LP calls
They have no effect when coming in pairs, or before .Bl/.Bd
2010-10-08 12:40:16 +00:00
Warner Losh
9117ce0c88 It turns out that TARGET_CPUARCH doesn't buy us much here, if anything, but
costs us another copy of the transform.  Revert it.

# Maybe makefile.inc1 should set TARGET_CPUARCH for the cross-tools, but
# it doesn't now.  That would solve problems in other places too.

Submitted by:	jmallet@
2010-09-13 07:15:01 +00:00
Warner Losh
cb015705d8 Use TARGET_CPUARCH instead of TARGET_ARCH here. Define TARGET_CPUARCH
based on TARGET_ARCH.  Use TARGET_ARCH still for a powerpc64 test.
Futureproof for coming mipsel/mipseb and arm/armeb rename.
2010-09-13 00:57:48 +00:00
Adrian Chadd
2c4575477e Fix crunchide to work on sparc64 and perhaps other 64 bit platforms.
I used the wrong type when setting st_name in the symbol table entry
struct. It's an Elf64_Word which is defined as an unsigned 32 bit int
on both 32 and 64 bit platforms.

To make things sensible, define some new macros to use as "word" macros
and use those, rather than simply using the explicit 32 bit macros.
2010-08-12 14:16:57 +00:00
Adrian Chadd
7420b323a0 Port over changes to the crunch symbol hiding method from NetBSD.
The older symbol hiding method breaks for MIPS. This implements
symbol hiding through renaming to a symbol name which is highly
unlikely to clash.

The NetBSD code didn't use byte-swapping macros for endian-awareness;
so it didn't work when cross-compiling a MIPS world on i386/amd64.
This patch includes those (as best as I could figure what they
should be) and has been tested to generate valid MIPS crunch
binaries both cross- and native- compiled.
2010-08-10 09:24:19 +00:00
Nathan Whitehorn
8a10bad25e Teach crunchide(1) about PPC ELF64. 2010-07-10 22:06:51 +00:00
Ulrich Spörlein
0afc94c17a mdoc: move CAVEATS, BUGS and SECURITY CONSIDERATIONS sections to the
bottom of the manpages and order them consistently.

GNU groff doesn't care about the ordering, and doesn't even mention
CAVEATS and SECURITY CONSIDERATIONS as common sections and where to put
them.

Found by:	mdocml lint run
Reviewed by:	ru
2010-05-13 12:07:55 +00:00
Ed Schouten
71ccf09269 The last big commit: let usr.sbin/ use WARNS=6 by default. 2010-01-02 11:07:44 +00:00
Edward Tomasz Napierala
871130f516 Remove extra space introduced by the previous commit.
Submitted by:	rwatson
2009-12-29 20:30:50 +00:00
Edward Tomasz Napierala
ee00619105 Remove pppd and SLIP-related stuff. 2009-12-29 20:15:23 +00:00
David E. O'Brien
b08897254c Run with -B and just .POSIX. 2009-01-31 07:03:36 +00:00
David E. O'Brien
7328f91370 Set .POSIX mode, along with disable parallel mode. Crunchgen parses the
output from make(1) and its picky what it should look like.
Also use make's conditional assignment operator rather than test and set.
2009-01-13 06:52:51 +00:00
David E. O'Brien
22407452f5 Introduce crunchide to the ELF e_machine MIPS values. 2008-09-03 16:21:28 +00:00
Kevin Lo
784bddbc5b Cleanup of userland __P use 2007-11-07 10:53:41 +00:00
Yaroslav Tykhiy
5e8bbdf131 Include <stdlib.h> for the right prototype for exit(3). 2007-10-27 16:16:02 +00:00
Yaroslav Tykhiy
a7aebe893d Set the program name if the crunched program is selected through
argv[1] to mimic crt0 behaviour.  Do the job by a direct assignment
to __progname in order to stay compatible with NetBSD, whose
setprogname() is a deliberate no-op.

The reason for this change is that some programs (usually those
imported from NetBSD) use getprogname() to distinguish between their
aliases.  (See pkill aka pgrep for example.)

This change can be useful, and applicable, to NetBSD, too.
2007-10-27 16:13:31 +00:00
Kevin Lo
d069140339 Use sizeof() for calculating the buffer size instead of hard-coded values. 2007-03-06 09:32:41 +00:00
John Birrell
51d9ddc635 Back out half of my previous change to support parallel makes.
The generated Makefile clashes with the src/bin/sh/Makefile, causing
it to try to use a rule to build something it doesn't need to.
2006-11-27 01:35:11 +00:00
John Birrell
80f498e559 Fix another parallel make problem with the generated make file.
Define the xxx_OBJPATHS earlier and then use it in the xxx_make
target because each obj is actually made through that.

This allows the crunch to work with -j32 on sun4v.

The makefile generated is still poor, though. It really shouldn't use
the general 'make all' to do the submakes in the app directories being
crunched because each of those objects is listed as a dependency in
the generated crunch makefile. Doing that really requires a unique rule
to generate them.
2006-11-24 03:56:25 +00:00
John Birrell
e8a1d46e97 Add the SUBMAKE_TARGETS (like ppp_make) to the dependency list
for linking the crunched app so that when a parallel make is run
(like -j32 on sun4v), the link waits for the sub-make processes
to complete.
2006-11-22 07:52:14 +00:00
Craig Rodrigues
c327d865f6 Remove reference to mount_fdescfs.
Reminded by:	ru
2006-11-22 00:34:17 +00:00
Ruslan Ermilov
bc84aa4ba3 Markup fixes. 2006-09-29 17:57:04 +00:00
Bruce M Simpson
2d20d32344 Push removal of mrouted down to the rest of the tree. 2006-09-29 15:45:11 +00:00
Ruslan Ermilov
2b46c64c9c Remove alpha left-overs. 2006-08-22 08:03:01 +00:00
Ceri Davies
8211eded3e Bump .Dd before I get told off. 2005-12-23 15:33:31 +00:00
Ceri Davies
55f92f6465 Commands like gmirror, graid3, ... and others which use dlopen() to load
classes from say, /lib/geom, cannot be statically linked completely.
Moreover, those shared objects may require other shared objects (i.e.
 for geom, libraries like -lmd, -lcrypto).

The libs_so extension to crunchgen fixes this by allowing some libraries
to be linked in dynamically.  This requires that a copy of rtld and the
shared libraries be made available to the crunched binary, and so is not
suitable for all environments.  Crunchgen configurations which do not
use the 'libs_so' keyword are unaffected and produce identical binaries
with and without this commit.

Approved by:		murray (mentor, in spirit), jhb
In collaboration with:	Adrian Steinmann <ast at marabu dot ch>
MFC After:		6 weeks
2005-12-23 15:31:37 +00:00
Marcel Moolenaar
757686b115 Make our ELF64 type definitions match standards. In particular this
means:
o  Remove Elf64_Quarter,
o  Redefine Elf64_Half to be 16-bit,
o  Redefine Elf64_Word to be 32-bit,
o  Add Elf64_Xword and Elf64_Sxword for 64-bit entities,
o  Use Elf_Size in MI code to abstract the difference between
   Elf32_Word and Elf64_Word.
o  Add Elf_Ssize as the signed counterpart of Elf_Size.

MFC after: 2 weeks
2005-12-18 04:52:37 +00:00
Ruslan Ermilov
951e4d1c91 In crunchgen(1), when calling make(1), don't redirect stderr to stdout,
just rely on the exit status to detect an error.  This makes crunchgen(1)
safe to use with certain make(1) debugging flags.

MFC after:	1 week
2005-01-20 10:49:03 +00:00
Ruslan Ermilov
e653b48c80 Start the dreaded NOFOO -> NO_FOO conversion.
OK'ed by:	core
2004-12-21 08:47:35 +00:00
Ruslan Ermilov
a35d88931c For variables that are only checked with defined(), don't provide
any fake value.
2004-10-24 15:33:08 +00:00
Hartmut Brandt
a8595b6640 Fix a 4.X -> 5.X upgrade problem: crunchgen used to emit a line 'MAKE=make'
or 'env MAKEOBJDIRPREFIX=... make' depending on the setting of
MAKEOBJDIRPREFIX in the environment. In any case this line kills the
original value of ${MAKE}. When during buildworld a new make is built (as
is the case during the upgrade) this causes a wrong make to be picked up
(the first one in the path). Use the same technique as Makefile.inc1:
create a MAKEENV variable and a CRUNCHMAKE that calls ${MAKE} with that
MAKEENV prefixed. Use CRUNCHMAKE instead of MAKE throughout the generated
makefile. This leaves the original ${MAKE} undisturbed.
2004-08-09 19:18:19 +00:00
Ruslan Ermilov
07bfccd71e Mechanically kill hard sentence breaks. 2004-07-02 23:13:00 +00:00
David E. O'Brien
49a3940873 Adjust the system endian and a.out headers to be more MI and cross-building
friendly.  Use the systems headers rather than local versions.

Reviewed by:	ru
2004-06-22 17:05:39 +00:00
Olivier Houchard
ed575be468 Tell crunchide to deal with arm elf binaries as well.
Rescue can now be built for arm.
2004-06-06 16:01:36 +00:00
Stefan Farfeleder
40905e9049 Include <netinet/in.h> for ntoh*() and hton*() prototypes.
Approved by:	das (mentor)
2004-05-24 11:59:17 +00:00
Ruslan Ermilov
adcb86e214 Fix a bug that caused i386 to produce broken binaries for big-endian
64-bit platforms.  (size_t is 32bit on i386, but Elf_Shdr.sh_size is
64bit on SPARC64.)
2003-08-08 15:44:17 +00:00
David E. O'Brien
930d8c703a Teach crunchide(1) about PowerPC ELF.
PR:		54526
Submitted by:	Stefan Farfeleder <stefan@fafoe.narf.at>
2003-07-22 00:19:40 +00:00
Peter Wemm
8e81109e14 Add AMD64 support. 2003-06-03 01:37:32 +00:00
Ruslan Ermilov
2343a53401 The second chdir(1) that I trimmed is needed too
if the program has an object directory.

Explained by:	Tim Kientzle <kientzle@acm.org>
2003-04-23 04:28:35 +00:00
Ruslan Ermilov
7cc7315cfb chdir(1) into a source directory before attempting to determine the
OBJS list.  This is needed to crunch any program that relies on the
correct .CURDIR setting, e.g. src/bin/csh.

Submitted by:	Tim Kientzle <kientzle@acm.org>
2003-04-22 14:01:33 +00:00
David E. O'Brien
2d57da023a Back out the totally unapproved backout of my commits. 2003-03-29 03:03:42 +00:00
Ruslan Ermilov
82c7cf3159 Complete the endianness support -- sparc64 can now do i386.
Tested on:	sparc64 -> i386, i386 -> sparc64
Debugged by:	elfdump(1)
2003-03-13 11:47:31 +00:00
Ruslan Ermilov
d51456da6f Part 1/3 of unbreaking cross releases:
Back out the removal of custom version of endian.h system header.
On recent systems, it just falls back to <sys/endian.h>.  But on
older systems like 5.0-DP1 or 4-STABLE, this private version may
be necessary, as crunchide(1) is a cross-tool for "make release".

Spotted by:	kris, markm
2003-01-29 08:37:26 +00:00
David E. O'Brien
90b77cf39a Use <sys/endian.h> rather than a private verison.
Tested on:	sparc64, Athlon[32]
2002-12-30 10:04:46 +00:00
Ruslan Ermilov
4192cfffe2 Bootstrapping aid for 4.0-RELEASE. 2002-11-13 11:50:40 +00:00
Philippe Charnier
557f7e714d Put author name under .An/Aq. 2002-10-16 15:51:16 +00:00