283592 Commits

Author SHA1 Message Date
rillig
c8309d07f3 make(1): normalize output of test sh-dots for non-native mode 2020-12-07 22:27:56 +00:00
rillig
1e55774c0d make(1): add tests and tutorial for the ?= assignment operator 2020-12-07 21:35:43 +00:00
christos
16f88d4a62 make function static (fixes crossgdb build, reported by martin@) 2020-12-07 20:28:53 +00:00
jdc
fd3cc354e8 Add some debugging output to check sensor addition and refresh. 2020-12-07 13:24:15 +00:00
jmcneill
772dec48b4 acpicpu(4): Add support for Arm CPUs. 2020-12-07 10:59:26 +00:00
jmcneill
30d28f2000 acpicpu: Add support for ACPI P-states and T-states on Arm. 2020-12-07 10:57:41 +00:00
jmcneill
2f0b7cb5a1 ACPI Processor UID is 32-bits (ci_acpiid). 2020-12-07 10:56:12 +00:00
mrg
a63aaf55a5 micron SMART 202 is percent lifetime used not remaining.
almost gave myself a heart attack when my server said 7% remaining!
2020-12-07 10:36:19 +00:00
jmcneill
569b81e664 Fix 32-bit build. 2020-12-07 10:02:51 +00:00
rin
393045b225 mknative for aarch64eb. 2020-12-07 08:31:05 +00:00
rin
db812a1d3b Add elf32-aarch64.c to DPSRCS and CLEANFILES. 2020-12-07 08:24:09 +00:00
rillig
bcc992c684 make(1): add new unit test opt-keep-going-multiple.mk to file lists 2020-12-07 07:51:25 +00:00
christos
60235de0f1 fix the build; gcc does not always see that it can't happen. 2020-12-07 03:01:15 +00:00
rillig
ee5b8583e3 make(1): rename Var_Export1 to ExportVar
Since Var_Export1 is neither exported by the module nor does it belong
to the Var type, the previous function name was misleading.  The 1 in
the function name was not as expressive as possible.  The new name
aligns nicely with UnexportVar, which is a very young name as well.
2020-12-07 01:50:19 +00:00
rillig
ab66f2c17b make(1): fix wrong exit status for multiple failed main targets 2020-12-07 01:35:33 +00:00
rillig
42387fd8d5 make(1): add test for wrong exit status 0 after failed targets with -k 2020-12-07 01:32:04 +00:00
rillig
01c0fcab45 make(1): actually fix the use-after-free bug and the double-free
The use-after-free bug had been there since 2020-11-22, the double-free
bug since a few minutes.
2020-12-07 01:27:08 +00:00
rillig
dc1759932a make(1): fix use-after-free in -DDEBUG_SRC mode (since 2020-11-22) 2020-12-07 01:24:41 +00:00
rillig
e6b596f6c6 make(1): merge local variables in Compat_Run 2020-12-07 01:10:03 +00:00
rillig
8ec6d47a7d make(1): clean up Compat_Run
Now that errors in the main targets and in their dependencies have the
same effect on the .END node and its dependencies, the two variables can
be merged.
2020-12-07 01:07:13 +00:00
rillig
ea51e814f2 make(1): don't make .END if the main targets already failed
This only applies to -k mode.  By default, make exits earlier and skips
the .END node as well if an error occurs.
2020-12-07 01:04:06 +00:00
rillig
e48e1a2882 make(1): fix exit status in -k mode if a dependency fails
Whether in -k mode or not, the exit status tells whether all requested
targets were made or not.  If a dependency could not be made, the main
target was not made as well, therefore the exit status must be nonzero
in such a case.

This part of the code lacked proper unit tests until today.  The unit
test deptgt-end-fail.mk is compatible with make>=2003 at least, allowing
to compare the output over time.

In 2003, in the ok-ok-ok-ok case, "Making all from all-dep." was printed
twice in a row, for whatever reason  ... (40 minutes later) ... If I had
just made the two commands for 'all' and '.END' more distinguishable.
Back in 2003, the local variables for .END had not been initialized,
instead the .END node was run with the local variables of the last
preceding node.  In this case, that node was 'all', therefore ${.TARGET}
had obviously expanded to 'all'.

Somewhere in 2004, the shell commands were no longer run with the -e
flag, which resulted in the "exit status $?" line to be printed in cases
that had stopped early before.

Somewhere in 2005, the local variables for the .END node had been fixed.
The variable ${.TARGET} now had the value '.END', just as expected.  In
addition, the dependencies for the .END node were made, although without
getting their proper local variables.  This resulted in the output
"Making  out of nothing" instead of the expected "Making end-dep out of
nothing".

Still in 2005, in the test case "all=ok all-dep=ok end=ok end-dep=ERR",
the error code of the failed 'end-dep' was first reported as "*** Error
code 1 (continuing)".  To compensate for this improvement, a new bug had
been introduced.  The test case "all=ok all-dep=ok end=ERR end-dep=ERR"
had properly exited with status 1 on 2005-01-01, but on 2006-01-01 it
exited with status 0, thereby ignoring errors in the .END node.

Somewhere in 2008, some of the error messages (but not all) were
directed to stderr instead of stdout.  The actual output stayed the same
though.

Somewhere in 2011, the dependency of the .END node got its own local
variables, and ${.TARGET} now expanded to 'end-dep', as expected.

Somewhere in 2016, the two empty lines between the "*** Error code 1
(continuing)" and the "Stop." got compressed into a single empty line.

On 2020-12-07 (that is, today), the exit status 1 has been restored in
the error cases, after it had been wrong for at least 14 years.
2020-12-07 00:53:30 +00:00
rillig
4de25ee2cb make(1): refactor Compat_Run to show the error condition more clearly
This refactoring allows to gradually change the conditions for the
"Stop." error message, to demonstrate which cases are affected by each
tiny change.
2020-12-06 23:02:56 +00:00
rillig
2b76f94f3e make(1): refactor error handling in Compat_Run
This is in preparation for the upcoming bug fixes.
2020-12-06 22:49:40 +00:00
rillig
91dd52293d make(1): test all combinations of failed main and .END targets
Adding an individual test for each of the 16 combinations would have
been too much manual work, and it's not easy to come up with a good
naming scheme for all the tests, keeping them short and expressive at
the same time.
2020-12-06 22:36:58 +00:00
rillig
abd175cf7f make(1): add test for .END after failed main node 2020-12-06 21:22:04 +00:00
rillig
571df9215e make(1): document undefined behavior from 2014
Earlier versions of make didn't know the -v option to print the expanded
value of a variable.  To make the test runnable by older makes as well,
switch to -V instead, which has been available much longer.
2020-12-06 20:55:30 +00:00
rillig
8ceba29732 make(1): error out on null bytes in makefiles
Makefiles are text files, they must not contain null bytes.

The previous code in this area was rotten anyway.  It assumed that
buf_end could be NULL even if buf_ptr was a valid pointer, which is no
longer true, probably since a few years already.

Continuing parsing after a null byte does not make sense.  If there's a
null byte in a text file, that file is corrupted, and parsing it leads
to unintended effects easily.  Therefore the only sensible action is to
stop parsing immediately.

The check whether cf->readMore could be null was outdated as well, which
previously made the fatal error impossible to reach.  Because of the
missing unit tests, nobody noticed this though.

The "exit status 0" in opt-file.exp is worring but that's due to another
bug and will be fixed in a follow-up commit.
2020-12-06 20:33:44 +00:00
rillig
227529d0a8 make(1): rename IFile.nextbuf to readMore
The previous name sounded too much like a noun, which was too confusing.
See unit-tests/opt-file.mk for the history of this part of the code.
2020-12-06 20:09:01 +00:00
rillig
1516c90ccf make(1): document how make behaved for null bytes in the makefile 2020-12-06 20:07:25 +00:00
rillig
ee90815510 make(1): add test for makefile containing null bytes 2020-12-06 19:18:26 +00:00
rillig
4e133ccc5e make(1): test parsing a makefile that ends in a backslash 2020-12-06 19:00:48 +00:00
jmcneill
962d94c5c4 acpidump: Do not print FACS if HW_REDUCED flag is set.
According to ACPI 6.3 spec, FACS is optional when HW_REDUCED is set. ACPICA
ignores the FACS completely when HW_REDUCED is set, so we need to follow
suit since it is not available through /dev/acpi as the table is not
installed.
2020-12-06 18:38:58 +00:00
rillig
856f84743d make(1): fix undefined behavior in ParseEOF
Adding a number to a null pointer should have been caught by any
Undefined Behavior Sanitizer, but apparently neither GCC nor Clang do
this.
2020-12-06 18:37:04 +00:00
rillig
2069cc7bbf make(1): remove comment decoration 2020-12-06 18:13:17 +00:00
rillig
16ad1eafba make(1): move CleanEnv to UnexportVars
It clearly didn't belong in the GetVarnamesToUnexport part of the code.
2020-12-06 17:41:52 +00:00
rillig
b5432954a4 make(1): extract UnexportVars from Var_UnExport 2020-12-06 17:35:51 +00:00
rillig
73f3a22b54 make(1): fix comment in test for directive unexport-env 2020-12-06 17:29:27 +00:00
rillig
2b33648640 make(1): clean up GetVarnamesToUnexport 2020-12-06 17:27:10 +00:00
rillig
afef166f61 make(1): extract GetVarnamesToUnexport from Var_UnExport 2020-12-06 17:22:44 +00:00
rillig
d97dc758c9 make(1): replace pointer comparisons with enum
Keeping track of what it means if varname.str == str is not as
expressive as declaring what exactly to unexport.
2020-12-06 16:24:30 +00:00
rillig
d179c16de4 make(1): add test for directive unexport-env 2020-12-06 16:06:11 +00:00
rillig
874b4121ce make(1): use FStr in Var_UnExport 2020-12-06 15:40:46 +00:00
christos
85d1299109 Don't descend to gdbserver for now 2020-12-06 15:00:25 +00:00
rillig
ccced12be8 make(1): add FStr to var.c to make memory handling simpler
The pattern of having a variable and a corresponding freeIt variable
appears over and over again in make, so cast it into a struct.
2020-12-06 14:50:09 +00:00
christos
ab6cf0a944 Move everyone to gdb-11 2020-12-06 14:28:34 +00:00
christos
2d450a0b24 fix powerpc 2020-12-06 14:26:40 +00:00
rillig
cb394f3681 make(1): move type definitions in var.c to the top 2020-12-06 14:20:20 +00:00
jmcneill
e4cf01d087 acpi: Cleanup SPCR setup and style fixes. 2020-12-06 14:01:40 +00:00
rillig
5fe7744e54 make(1): extract FreeEnvVar from Var_Parse 2020-12-06 13:51:06 +00:00