OpenBSD CVS

CVS log for src/usr.sbin/crunchgen/crunchgen.c


[BACK] Up to [local] / src / usr.sbin / crunchgen

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.30 / (download) - annotate - [select for diffs], Sun Jun 2 18:47:17 2024 UTC (6 days, 5 hours ago) by deraadt
Branch: MAIN
CVS Tags: HEAD
Changes since 1.29: +2 -2 lines
Diff to previous 1.29 (colored)

ugh, another typo; spotted by naddy

Revision 1.29 / (download) - annotate - [select for diffs], Sun Jun 2 18:01:37 2024 UTC (6 days, 6 hours ago) by deraadt
Branch: MAIN
Changes since 1.28: +2 -2 lines
Diff to previous 1.28 (colored)

oops typo

Revision 1.28 / (download) - annotate - [select for diffs], Sun Jun 2 15:55:36 2024 UTC (6 days, 8 hours ago) by deraadt
Branch: MAIN
Changes since 1.27: +2 -1 lines
Diff to previous 1.27 (colored)

Due to growth, crunchgen must also try to block -fret-clean, so also use
COPTS+=-fno-ret-clean

Revision 1.27 / (download) - annotate - [select for diffs], Thu Sep 14 16:39:00 2023 UTC (8 months, 3 weeks ago) by jca
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4
Changes since 1.26: +2 -2 lines
Diff to previous 1.26 (colored)

Instead of ld -dc use ld -d, supported by both ld.bfd and ld.lld >= 15

Upstream LLVM decided to drop the -dc flag and keep its -d alias for
some time:
  https://github.com/llvm/llvm-project/commit/0688b00fc39fe87ec6dd3d37a732d067ff487f16

So this is only a workaround to let us update llvm to a recent release.
We'll probably need another fix not so distant future.  Another approach
would be to just drop -dc from the linker invocation, and use
cc -fno-common when building instbin with base-gcc (already the default
with base-clang).  But this approach needs more testing than I can
provide, as deraadt@ feared it would break in subtle ways.

ld -d compat alias pointed out by robert@, ok robert@

Revision 1.26 / (download) - annotate - [select for diffs], Sun Apr 16 19:57:01 2023 UTC (13 months, 3 weeks ago) by deraadt
Branch: MAIN
Changes since 1.25: +7 -1 lines
Diff to previous 1.25 (colored)

if (actually... when) the compiler is flipped to do BTI/ENDBR by default,
the install media would grow too much, so use the same strategy as we
for stack protector and other things: disable them, just on the install
media
ok kettenis

Revision 1.25 / (download) - annotate - [select for diffs], Mon Nov 15 15:14:24 2021 UTC (2 years, 6 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1
Changes since 1.24: +1 -3 lines
Diff to previous 1.24 (colored)

No need to declare optind, optarg or opterr; unistd.h does this for us.
From Jan Stary.  OK deraadt@

Revision 1.24 / (download) - annotate - [select for diffs], Sun Oct 24 21:24:18 2021 UTC (2 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.23: +2 -2 lines
Diff to previous 1.23 (colored)

For open/openat, if the flags parameter does not contain O_CREAT, the
3rd (variadic) mode_t parameter is irrelevant.  Many developers in the past
have passed mode_t (0, 044, 0644, or such), which might lead future people
to copy this broken idiom, and perhaps even believe this parameter has some
meaning or implication or application. Delete them all.
This comes out of a conversation where tb@ noticed that a strange (but
intentional) pledge behaviour is to always knock-out high-bits from
mode_t on a number of system calls as a safety factor, and his bewilderment
that this appeared to be happening against valid modes (at least visually),
but no sorry, they are all irrelevant junk.  They could all be 0xdeafbeef.
ok millert

Revision 1.23 / (download) - annotate - [select for diffs], Wed Mar 10 22:52:28 2021 UTC (3 years, 2 months ago) by jsg
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.22: +2 -1 lines
Diff to previous 1.22 (colored)

Build install media with -fno-asynchronous-unwind-tables to further
reduce size.  Allows a clang 11 amd64 release to complete without
overflowing the floppy image.

ok kettenis@ deraadt@

Revision 1.22 / (download) - annotate - [select for diffs], Sat Feb 13 18:52:08 2021 UTC (3 years, 3 months ago) by semarie
Branch: MAIN
Changes since 1.21: +2 -2 lines
Diff to previous 1.21 (colored)

distrib: remove .comment section systematically

remove this section as part of crunchgen generated commands.
it avoids calling "strip -R .comment" for some but not all architectures.

ok deraadt@ danj@

Revision 1.21 / (download) - annotate - [select for diffs], Thu Oct 18 14:25:14 2018 UTC (5 years, 7 months ago) by naddy
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.20: +5 -2 lines
Diff to previous 1.20 (colored)

Ensure that the install media are built with a consistent set of
compiler flags.  Pass DIST_CFLAGS from the crunchgen-generated .mk
file.

Compile the install media with -fno-unwind-tables to avoid emitting
.eh_frame sections.  This saves substantial space on amd64.

with/ok kettenis@

Revision 1.20 / (download) - annotate - [select for diffs], Tue Feb 6 00:05:24 2018 UTC (6 years, 4 months ago) by henning
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.19: +21 -3 lines
Diff to previous 1.19 (colored)

chdir to the target directory, run make there and fchdir back after.
allows Makefiles with ${.CURDIR} constructs to work with crunchgen.
pointed out by Holger Mikolon, input from theo, ok theo millert

Revision 1.19 / (download) - annotate - [select for diffs], Thu Jul 27 15:33:42 2017 UTC (6 years, 10 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.18: +2 -1 lines
Diff to previous 1.18 (colored)

insist on -Oz in the *.mk file
(note it's *after* the normal flags, so it will pre-empt a -O2)

okay deraadt@

Revision 1.18 / (download) - annotate - [select for diffs], Thu Jul 27 15:12:30 2017 UTC (6 years, 10 months ago) by deraadt
Branch: MAIN
Changes since 1.17: +2 -1 lines
Diff to previous 1.17 (colored)

Mute clang's zeal for whining by providing prototypes.

Revision 1.17 / (download) - annotate - [select for diffs], Tue Feb 28 20:42:12 2017 UTC (7 years, 3 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.16: +2 -2 lines
Diff to previous 1.16 (colored)

Make object-in-archive-used identification portable to lld: use --trace
instead of -M and transform the output to a common
/path/to/archive.a(object.o)
syntax.

problem noted by jsg@
ok kettenis@ jsg@

Revision 1.16 / (download) - annotate - [select for diffs], Wed Nov 11 02:52:46 2015 UTC (8 years, 6 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.15: +4 -2 lines
Diff to previous 1.15 (colored)

exit() after perror() for pledge failure.  Perhaps this got introduced
as a test idiom, either when pledge was young or during the transition
to strings.... dunno

Revision 1.15 / (download) - annotate - [select for diffs], Tue Oct 13 15:11:48 2015 UTC (8 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.14: +4 -1 lines
Diff to previous 1.14 (colored)

pledge "stdio rpath wpath cpath proc exec".  creates files throughout
it's lifetime, and often runs a pipe through "cpp"

Revision 1.14 / (download) - annotate - [select for diffs], Fri Jan 16 06:40:16 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.13: +18 -17 lines
Diff to previous 1.13 (colored)

Replace <sys/param.h> with <limits.h> and other less dirty headers where
possible.  Annotate <sys/param.h> lines with their current reasons.  Switch
to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc.  Change
MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where
sensible to avoid pulling in the pollution.  These are the files confirmed
through binary verification.
ok guenther, millert, doug (helped with the verification protocol)

Revision 1.13 / (download) - annotate - [select for diffs], Sat Jan 11 04:44:15 2014 UTC (10 years, 4 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.12: +4 -42 lines
Diff to previous 1.12 (colored)

Create cleaner & less noisy makefiles, now that we've been using
this for 20 years.  We don't need to see the splatter as much anymore.

Revision 1.12 / (download) - annotate - [select for diffs], Sat Nov 23 22:51:41 2013 UTC (10 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.11: +7 -7 lines
Diff to previous 1.11 (colored)

yet more unsigned char casts for ctype
checked by jca

Revision 1.11 / (download) - annotate - [select for diffs], Mon Oct 14 07:06:25 2013 UTC (10 years, 7 months ago) by guenther
Branch: MAIN
Changes since 1.10: +2 -2 lines
Diff to previous 1.10 (colored)

Using 'cc -o /dev/null' has weird side-effects as root, so use a real file
problem noted by deraadt@

Revision 1.10 / (download) - annotate - [select for diffs], Mon Oct 14 06:59:11 2013 UTC (10 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.9: +2 -2 lines
Diff to previous 1.9 (colored)

handle DESTDIR; with guenther

Revision 1.9 / (download) - annotate - [select for diffs], Sun Oct 13 23:33:14 2013 UTC (10 years, 7 months ago) by guenther
Branch: MAIN
Changes since 1.8: +31 -3 lines
Diff to previous 1.8 (colored)

Use the new DIST_LIB/DIST_OBJS hooks to make it possible to link crunched
binaries against libraries compiled with smaller objects.  Determination
of which objects to include done by linking once and checking the link map.
SRCLIBDIR must be set by the calling makefile to /usr/src/lib for this to
have any effect

Revision 1.8 / (download) - annotate - [select for diffs], Wed Aug 29 16:23:34 2012 UTC (11 years, 9 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.7: +4 -3 lines
Diff to previous 1.7 (colored)

Using the currently chosen (and in my opinion insane) abstraction, pass
-nopie to the linker if needed; ok pascal

Revision 1.7 / (download) - annotate - [select for diffs], Wed Aug 22 17:12:47 2012 UTC (11 years, 9 months ago) by pascal
Branch: MAIN
Changes since 1.6: +3 -1 lines
Diff to previous 1.6 (colored)

Build crunched binaries with -fno-pie.

ok deraadt@

Revision 1.6 / (download) - annotate - [select for diffs], Fri Dec 4 04:59:48 2009 UTC (14 years, 6 months ago) by drahn
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8, OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.5: +3 -3 lines
Diff to previous 1.5 (colored)

Change crunchgen to mangle names in sequence instead of randomly,
save the sequence numbers between runs, currently uses file 'mangledata'
this may be changed to be specified on the command line later.
Requested by Theo.

Revision 1.5 / (download) - annotate - [select for diffs], Wed Oct 7 13:55:38 2009 UTC (14 years, 8 months ago) by fkr
Branch: MAIN
Changes since 1.4: +9 -1 lines
Diff to previous 1.4 (colored)

under certain conditions (srcdir defined, no objdir defined) crunchgen
would emit a false .mk file, which contains "(null)" for the Makefile
name due to a null pointer. Make sure, p->mf_name is set in this case.

ok deraadt@

Revision 1.4 / (download) - annotate - [select for diffs], Mon Nov 24 17:23:26 2008 UTC (15 years, 6 months ago) by drahn
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.3: +9 -5 lines
Diff to previous 1.3 (colored)

Change mips detection in crunchgen from ifdef to command line flag
ok deraadt@, fkr@, rainer@. manpage cleanup thanks to jmc@

Revision 1.3 / (download) - annotate - [select for diffs], Sat Aug 23 07:24:06 2008 UTC (15 years, 9 months ago) by jmc
Branch: MAIN
Changes since 1.2: +2 -2 lines
Diff to previous 1.2 (colored)

- document -h
- (re)organise the page a little
- zap second "usage:" string from usage()

Revision 1.2 / (download) - annotate - [select for diffs], Fri Aug 22 15:38:37 2008 UTC (15 years, 9 months ago) by deraadt
Branch: MAIN
Changes since 1.1: +15 -20 lines
Diff to previous 1.1 (colored)

merge crunchide into crunchgen as the -h flag.  this is not yet done the
nicest way since there is lot of code that has to churn, but it works.

Revision 1.1 / (download) - annotate - [select for diffs], Fri Aug 22 15:18:55 2008 UTC (15 years, 9 months ago) by deraadt
Branch: MAIN

Merge crunchgen & crunchhide (using name checking), and move to usr.sbin
next step is to not install it as two programs, but be even more clever

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.