Commit Graph

301313 Commits

Author SHA1 Message Date
lukem 58beaa2b43 adapt to ${CC_WNO_MAYBE_UNINITIALIZED}
Use ${CC_WNO_MAYBE_UNINITIALIZED} instead of
the older style more complex expressions.

Remove workarounds if they were for a specific
version of gcc < 10.
2023-06-03 21:31:45 +00:00
lukem 230c41e44c adapt to ${CC_WNO_IMPLICIT_FALLTHROUGH}
Use ${CC_WNO_IMPLICIT_FALLTHROUGH} instead of
the older style more complex expressions.
2023-06-03 21:30:20 +00:00
lukem 1a214827c2 adapt to ${CC_WNO_FORMAT_TRUNCATION} 2023-06-03 21:28:52 +00:00
lukem 39588391d2 dhcp: remove gcc 8 workaround
(if it's needed, add it back using ${CC_WNO_FORMAT_OVERFLOW})
2023-06-03 21:27:11 +00:00
lukem 2075f2d0bf ipmon: remove duplicate warning suppression 2023-06-03 21:26:52 +00:00
lukem a9a927dd92 adapt to ${CC_WNO_ADDRESS_OF_PACKED_MEMBER}
Simplify CWARNFLAGS to use ${CC_WNO_ADDRESS_OF_PACKED_MEMBER}
which works for both clang and gcc, and remove compiler-specific
equivalents.
2023-06-03 21:26:27 +00:00
lukem 2ffa4e20ef bsd.*.mk: move MKSTRIPSYM default to bsd.own.mk
Add default for MKSTRIPSYM=yes to to bsd.own.mk _MKVARS.no.
Test ${MKSTRIPSYM} != "no".
2023-06-03 21:24:57 +00:00
rillig c367044d68 indent: clean up handling of brace indentation
No functional change.
2023-06-03 21:24:26 +00:00
lukem 23c510a48b bsd.obj.mk: move MKHOSTOBJ to bsd.own.mk
Add default for MKHOSTOBJ=no to to bsd.own.mk _MKVARS.no.
Simplify bsd.obj.mk check.
2023-06-03 21:23:49 +00:00
lukem 3b104e300e bsd.dep.mk: move MKDEPINCLUDES to bsd.own.mk
Add default for MKDEPINCLUDES=no to to bsd.own.mk _MKVARS.no.
Simplify bsd.dep.mk check.
2023-06-03 21:23:07 +00:00
lukem b3558439e9 bsd.*.mk: move MKCLEAN* to bsd.own.mk
Move the defaults for MKCLEANSRC and MKCLEANVERIFY
from bsd.clean.mk to bsd.own.mk _MKVARS.yes.
2023-06-03 21:21:32 +00:00
lukem 7615e96ba2 mkvars.mk: sort MKEXTRAVARS and remove dupes
Sort MKEXTRAVARS.
Remove obsolete MKBFD.
Remove entries already in <bsd.own.mk> _MKVARS.no or _MKVARS.yes:
	MKCOMPATTESTS MKDTC MKDYNAMICROOT MKFIRMWARE MKMANZ
	MKRADEONFIRMWARE MKSLJIT MKSOFTFLOAT MKXORG_SERVER

Sorted output of comparing "before" and "after" is identical
besides those variables listed above.
2023-06-03 21:20:53 +00:00
rillig 79e55a0f42 lint: add query for static variables in functions
This query allows finding hidden global variables, as an easier-to-read
alternative to 'objdump -t'.
2023-06-03 21:08:06 +00:00
rillig 770e6460e3 lint: loosen assertion that unary operators have only a single operand 2023-06-03 20:58:00 +00:00
andvar 11688feb47 fix various typos in comments and messages. 2023-06-03 20:41:44 +00:00
rillig 99ae6bc081 lint: use consistent and configurable stream for debug output 2023-06-03 20:40:28 +00:00
rillig f9624b3c8d lint: provide more detailed types when operands do not match 2023-06-03 20:28:54 +00:00
andvar 4ce1b76da5 fix typo xbase-obsolet -> xbase-obsolete. 2023-06-03 19:57:33 +00:00
riastradh aa47a9a159 ld.elf_so: Fix missing tab in debug/shl.mi in last change.
XXX pullup-10
2023-06-03 13:20:42 +00:00
lukem 0f2b82fc80 mk.conf: fix the year 2023-06-03 11:13:40 +00:00
lukem 869cdbbd1c regen 2023-06-03 09:18:14 +00:00
lukem 97766c5b60 tools/compat: support all bsd.own.mk disabled warnings
Check the host CC support for all the warnings now in <bsd.own.mk>
and override appropriately in defs.mk.

In general there's a 1:1 mapping, with the special case
CC_WNO_ADDRESS_OF_PACKED_MEMBER which is set from both
@CC_WNO_ADDRESS_OF_PACKED_MEMBER@ (gcc) and
@CC_WNO_ERROR_ADDRESS_OF_PACKED_MEMBER@ (clang).
2023-06-03 09:10:13 +00:00
lukem c4b7a9e794 bsd.own.mk: rename GCC_NO_* to CC_WNO_*
Rename compiler-warning-disable variables from
	GCC_NO_warning
to
	CC_WNO_warning
where warning is the full warning name as used by the compiler.

GCC_NO_IMPLICIT_FALLTHRU is CC_WNO_IMPLICIT_FALLTHROUGH

Using the convention CC_compilerflag, where compilerflag
is based on the full compiler flag name.
2023-06-03 09:09:01 +00:00
lukem f937c412f3 bsd.own.mk: rename to CC_WNO_ADDRESS_OF_PACKED_MEMBER
Provide a single variable
	CC_WNO_ADDRESS_OF_PACKED_MEMBER
with options for both clang and gcc, to replace
	CLANG_NO_ADDR_OF_PACKED_MEMBER
	CC_NO_ADDR_OF_PACKED_MEMBER
	GCC_NO_ADDR_OF_PACKED_MEMBER

Using the convention CC_compilerflag, where compilerflag
is based on the full compiler flag name.
2023-06-03 08:52:53 +00:00
lukem a84ebf3fbc etc.sparc64: remove obsolete MK32BITLIBS
As there's a functional MKCOMPAT implementation, and
MK32BITLIBS=yes hasn't worked since 2002 (and noone
noticed the latter), remove obsolete MK32BITLIBS code.

Per confirmation from martin@, mrg@, and riastradh@ on ICB.
2023-06-02 20:49:07 +00:00
lukem 105457a1c4 build.sh: MAKECONF and mk.conf(5) improvements
Move MAKECONF to the Environment variables section.
Add mk.conf(5) cross-references.
Make Notes more obvious.
Fix mandoc lint.
2023-06-02 20:48:41 +00:00
lukem 439f74ef3e build.sh: add show-params operation
Add show-params operation to the makefile target, and reword
params operation to describe what it's done since 2012.

(In 2012-11-04 the Makefile's previous params target was renamed
to show-params and a new params target was added to save a 'params'
file, and build.sh wasn't adapted.)
2023-06-02 20:48:09 +00:00
lukem a25022c648 tools: use NONLS= not MKNLS=no 2023-06-02 20:47:27 +00:00
riastradh 067c5136b3 ld.elf_so: Test dynamic-then-static abuse via ctor.
XXX pullup-10
2023-06-02 19:09:11 +00:00
riastradh f4e534dd53 ld.elf_so: Test another edge case of mismatched TLS models.
One library defines a symbol and _doesn't_ use it, so it has no
indication of whether the symbol is for static TLS or dynamic TLS,
and then two other libraries use it in different ways.

XXX pullup-10
2023-06-02 19:08:48 +00:00
riastradh 4dedd5fc26 ld.elf_so: tls_extern dynamic_defabuse_eager must xfail differently.
If a symbol has already been resolved as dynamic TLS, any library
that tries to use it as static TLS cannot be dlopened.

XXX pullup-10
2023-06-02 19:08:01 +00:00
rillig 3eeca426f5 indent: force each statement on a new line
Previously, '{} while (cond)' was kept on a single line, even though the
'while' was independent of the '{}'.
2023-06-02 15:07:46 +00:00
rillig 9e6f62d1d8 indent: remove newline between 'switch' and '{' 2023-06-02 14:34:14 +00:00
lukem e3f25515e3 etc.sparc64: fix syntax errors in MK32BITLIBS=yes
sparc64 snapshots with MK32BITLIBS=yes has been broken
because of make(1) and sh(1) syntax errors since
my change in revision 1.18 on 2002-12-03, when
snap_md_pre target was deprecated...
Move the rules to snap_md_post and fix the syntax errors.

The cross-build make snapshot snapbecause of the missing
$TOOLDIR/bin/sparc--netbsdelf-gcc due to the invocation
with SPARC32_ENV=MACHINE=sparc MACHINE_ARCH=sparc.
A separate issue to resolve.

(It seems MK32BITLIBS hasn't worked for 20+ years and
noone noticed! Do we need it?)
2023-06-02 14:32:04 +00:00
lukem b329684b89 bsd.own.mk: obsolete non-MK variants MANZ UNPRIVED UPDATE
Remove support for variables deprecated 20 years ago
by their MK* equivalents.
2023-06-02 14:30:23 +00:00
lukem bd4a734738 build.sh: fix MKUNPRIVED comment
I renamed UNPRIVED to MKUNPRIVED 20 years ago, and missed a comment.
2023-06-02 14:29:11 +00:00
lukem db689ccb2d etc.hp300, etc.sparc64: fix MKUPDATE handling
UPDATE was replaced with MKUPDATE 20 years ago,
but these directories were missed in the conversion.
2023-06-02 14:25:35 +00:00
rillig 6fc430af5c indent: improve heuristics of classifying '*' as pointer or operator 2023-06-02 14:21:55 +00:00
rillig ef25c88e9b indent: clean up
Only print the 'token' buffer in debug mode if it is interesting, group
the blocks in handling of '(' tokens by topic, remove obsolete comment
from test.
2023-06-02 13:59:33 +00:00
riastradh e0bd56e642 ld.elf_so: Add new files to debug/shl.mi.
XXX pullup-10
2023-06-02 12:08:26 +00:00
rillig a565c86f6c indent: fix formatting of declarations with preprocessing lines 2023-06-02 11:43:07 +00:00
rillig 7511320300 tests/indent: demonstrate bugs when formatting preprocessing lines 2023-06-02 11:26:21 +00:00
martin eba8370ebe Add recent ld.elf_so test helpers debug info 2023-06-02 11:09:39 +00:00
andvar cb40c69b16 follow the steps of Andrew Doran (ad) commit and fix more s/loose/lose/ typos.
also s/beyound/beyond/ and few others along the way, mainly in comments.
2023-06-02 08:51:46 +00:00
riastradh 98256cacf3 ld.elf_so: Separately test eager and lazy resolution of def tls ptr.
eager: before loading use library
lazy: after loading use library

XXX pullup-10
2023-06-01 23:47:24 +00:00
riastradh e04ffa379b ld.elf_so: Shorter test names.
No functional non-cosmetic change intended.

XXX pullup-10
2023-06-01 22:26:51 +00:00
riastradh 6b7ae3bea1 ld.elf_so: Test TLS abuse of static def, dynamic use and vice versa.
XXX pullup-10
2023-06-01 22:26:40 +00:00
riastradh bc9d9d1143 ld.elf_so: Factor out logic in TLS tests to make writing more easier.
No functional change intended.

XXX pullup-10
2023-06-01 22:24:52 +00:00
lukem 1ebcf5670b mk.conf(5): update to reality
- Document:
	MKAMDGPUFIRMWARE, MKARGON2, MKARZERO, MKBSDGREP,
	MKCOMPATMODULES, MKCOMPATTESTS, MKCOMPATX11, MKCXX,
	MKDEPINCLUDES, MKDTB, MKDTC, MKFIRMWARE, MKGROFF,
	MKGROFFHTMLDOC, MKLIBCSANITIZER, MKLIBCXX, MKLIBSTDCXX,
	MKLLVM, MKLLVMRT, MKMAKEMANDB, MKMANDOC, MKNSD,
	MKRADEONFIRMWARE, MKRELRO, MKSANITIZER, MKSLJIT,
	MKSTATICPIE, MKTEGRAFIRMWARE, MKTPM, MKUNBOUND,
	MKXORG_SERVER, NETBSD_OFFICIAL_RELEASE,
	USE_LIBCSANITIZER, USE_PIGZGZIP, USE_SANITIZER,
	USE_XZ_SETS, X11MOTIFPATH
- Document obsolete/deprecated:
	EXTSRCSRCDIR, MKBFD, MKCRYPTO, MKEXTSRC, MKKDEBUG,
	MKKERBEROS4, MKLLD, MKLLDB, MKMCLINKER, MKPERFUSE,
	MKTOOLSDEBUG, SHAREDSTRINGS, USE_COMBINE
- Fix defaults: MKLINT=no MKPICINSTALL=no USE_SKEY=no
- Expand upon defaults that are platform specific.
- Sort variable entries.
- If a NOxxx variable disables a variable, describe it.
- Layout of each variable: supported values, description,
  any other variables that change this variable, optional note,
  default value.
- Consistent double quotes around default strings (even paths).
- Consistent "will be" instead of "is" or "are".
- Sort order of internal macro definitions.
- Add NODEF and NOVAR macros.
- Oxford comma and semi-colons where appropriate.
- Fix mandoc -Tlint.
2023-06-01 21:58:05 +00:00
lukem b2387f1a6b bsd.own.mk: describe recent convention in comments 2023-06-01 21:54:17 +00:00