| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* win32: fnmatch2 minor refinements (no-op)
With beacket, add '\' to the switch/case, and at fnmatch, pre-calc
the two most used flags (CASEFOLD and PATHNAME) once on init.
Negligible perf impact, and happens to save few bytes in x64.
* win32: actype: trivial refinments (no-op)
NULL was used in actype.h but requires stddef.h - which we don't
include, so use (int*)0 which also expresses it more clearly.
Remove "#include <string.h>" at actype.c, which we don't need anymore.
* scripts/patbench.sh: make executable (chmod +x)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Few minor improvements:
- Add few valid but edge-case patterns (start with ']' etc).
- Add the expected result for default lines, and report ok/err.
- Disable measurements with -mn (to be measured externally).
Also, the default lines were modified slightly so that the new
edge cases results are largely distinct, so it can be used as
correctness test with -d (and exit code is 1 on errors).
BENCHMARK RESULTS
Below are results of running this script using busybox-w32 on win10,
and using busybox on Alpine linux 3.23.
Observations of busybox-w32 results, which uses old glibc fnmatch:
[10] 129 ms OK (M:12345) '*[hello world, this is a test]*'
[42] 22491 ms OK (M:12-45) '*[0-9A-Za-z]*[0-9A-Za-z]*[0-9A-Za-z]'
The current busybox-w32 implementation is exponential, and while
tests of simple patterns complete in 100-200ms, patterns with 3 '*'
can take 30s or more to complete, way longer with 4 '*', etc.
[12] 192 ms E:1-3-- (M:-----) '*[*'
[13] 201 ms E:1---- (M:-----) '*[]*'
[14] 203 ms E:--3-- (M:-----) '*[!]*'
A bracket which doesn't start a bracket expression is regular char,
and all these are missing the closing bracket (by POSIX rules), and
should be matched literally, but the current fnmatch fails with that.
[35] 1305 ms OK (M:12-45) '*[0-9A-Za-z]*[0-9A-Za-z]'
[36] 1928 ms OK (M:12-45) '*[[:alnum:]]*[[:alnum:]]'
[38] 1446 ms OK (M:12-45) '*[a-bc-de-z]*[a-bc-de-z]'
[39] 3192 ms OK (M:12-45) '*[[:lower:]]*[[:lower:]]'
[40] 1586 ms OK (M:---4-) '*[0-9A-Fa-ef]*[0-9A-Fa-ef]'
[41] 4601 ms OK (M:---4-) '*[[:xdigit:]]*[[:xdigit:]]'
charclass [:alnum:] is x1.4 slower than an equivalent non-class range,
but [:lower:] is already x2 slower than the equivalent, and [:xdigit:]
is x3 slower than the equivalent. This is because the name is searched
in a list which starts with "alnum" and ends in "xdigit", and the
search duration (and the following switch in the same order) clearly
affects how quickly a pattern can be tested.
There are other issues in busybox-w32 fnmatch, like incorrect
case-insensitivity and more, but which don't manifest in case...esac.
Benchmark results with busybox-w32 on Windows 10 (compiled with gcc):
[ 1] 107 ms OK (M:-----) ''
[ 2] 108 ms OK (M:12345) '*'
[ 3] 104 ms OK (M:-----) '@'
[ 4] 112 ms OK (M:1----) 'Lorem*'
[ 5] 120 ms OK (M:-2---) '*quis'
[ 6] 127 ms OK (M:--3--) '*nisi*'
[ 7] 244 ms OK (M:--3--) '*[fobar]xyz*'
[ 8] 544 ms OK (M:--3--) '*[foobarfoobarfoobarfoobar]xyz*'
[ 9] 588 ms OK (M:-2---) '*[!foobarfoobarfoobarfoobar]xyz*'
[10] 129 ms OK (M:12345) '*[hello world, this is a test]*'
[11] 136 ms OK (M:12345) '*[!hello world, this is a test]*'
[12] 192 ms E:1-3-- (M:-----) '*[*'
[13] 201 ms E:1---- (M:-----) '*[]*'
[14] 203 ms E:--3-- (M:-----) '*[!]*'
[15] 182 ms OK (M:-23-5) '*[!]].*'
[16] 454 ms OK (M:1----) '*[![:print:]]*'
[17] 124 ms OK (M:-23--) '*z*'
[18] 123 ms OK (M:---4-) '*-*'
[19] 160 ms OK (M:---4-) '*[-]*'
[20] 175 ms OK (M:-234-) '*[-z]*'
[21] 177 ms OK (M:-234-) '*[z-]*'
[22] 197 ms OK (M:-234-) '*[-z-]*'
[23] 126 ms OK (M:1-3--) '*]*'
[24] 168 ms OK (M:1-3--) '*[]]*'
[25] 173 ms OK (M:1-34-) '*[]-]*'
[26] 168 ms OK (M:123--) '*[]-_]*'
[27] 170 ms OK (M:1234-) '*[]-_-]*'
[28] 365 ms OK (M:12-45) '*[0-9A-Za-z][0-9A-Za-z]'
[29] 513 ms OK (M:12-45) '*[[:alnum:]][[:alnum:]]'
[30] 263 ms OK (M:12-45) '*[a-z][a-z]'
[31] 376 ms OK (M:12-45) '*[a-bc-de-z][a-bc-de-z]'
[32] 815 ms OK (M:12-45) '*[[:lower:]][[:lower:]]'
[33] 311 ms OK (M:-----) '*[0-9A-Fa-ef][0-9A-Fa-ef]'
[34] 756 ms OK (M:-----) '*[[:xdigit:]][[:xdigit:]]'
[35] 1305 ms OK (M:12-45) '*[0-9A-Za-z]*[0-9A-Za-z]'
[36] 1928 ms OK (M:12-45) '*[[:alnum:]]*[[:alnum:]]'
[37] 919 ms OK (M:12-45) '*[a-z]*[a-z]'
[38] 1446 ms OK (M:12-45) '*[a-bc-de-z]*[a-bc-de-z]'
[39] 3192 ms OK (M:12-45) '*[[:lower:]]*[[:lower:]]'
[40] 1586 ms OK (M:---4-) '*[0-9A-Fa-ef]*[0-9A-Fa-ef]'
[41] 4601 ms OK (M:---4-) '*[[:xdigit:]]*[[:xdigit:]]'
[42] 22491 ms OK (M:12-45) '*[0-9A-Za-z]*[0-9A-Za-z]*[0-9A-Za-z]'
(aborted manually - exponential implementation becomes very slow)
results with busybox on Alpine linux 3.23 (musl-libc has linear-time
fnmatch, using wide-char wctype/iswctype - slightly slower than char):
[ 1] 135 ms OK (M:-----) ''
[ 2] 141 ms OK (M:12345) '*'
[ 3] 139 ms OK (M:-----) '@'
[ 4] 141 ms OK (M:1----) 'Lorem*'
[ 5] 148 ms OK (M:-2---) '*quis'
[ 6] 216 ms OK (M:--3--) '*nisi*'
[ 7] 410 ms OK (M:--3--) '*[fobar]xyz*'
[ 8] 787 ms OK (M:--3--) '*[foobarfoobarfoobarfoobar]xyz*'
[ 9] 844 ms OK (M:-2---) '*[!foobarfoobarfoobarfoobar]xyz*'
[10] 215 ms OK (M:12345) '*[hello world, this is a test]*'
[11] 237 ms OK (M:12345) '*[!hello world, this is a test]*'
[12] 206 ms OK (M:1-3--) '*[*'
[13] 242 ms OK (M:1----) '*[]*'
[14] 220 ms OK (M:--3--) '*[!]*'
[15] 306 ms OK (M:-23-5) '*[!]].*'
[16] 591 ms OK (M:1----) '*[![:print:]]*'
[17] 216 ms OK (M:-23--) '*z*'
[18] 198 ms OK (M:---4-) '*-*'
[19] 286 ms OK (M:---4-) '*[-]*'
[20] 285 ms OK (M:-234-) '*[-z]*'
[21] 291 ms OK (M:-234-) '*[z-]*'
[22] 299 ms OK (M:-234-) '*[-z-]*'
[23] 228 ms OK (M:1-3--) '*]*'
[24] 286 ms OK (M:1-3--) '*[]]*'
[25] 267 ms OK (M:1-34-) '*[]-]*'
[26] 349 ms OK (M:123--) '*[]-_]*'
[27] 292 ms OK (M:1234-) '*[]-_-]*'
[28] 198 ms OK (M:12-45) '*[0-9A-Za-z][0-9A-Za-z]'
[29] 201 ms OK (M:12-45) '*[[:alnum:]][[:alnum:]]'
[30] 179 ms OK (M:12-45) '*[a-z][a-z]'
[31] 217 ms OK (M:12-45) '*[a-bc-de-z][a-bc-de-z]'
[32] 205 ms OK (M:12-45) '*[[:lower:]][[:lower:]]'
[33] 202 ms OK (M:-----) '*[0-9A-Fa-ef][0-9A-Fa-ef]'
[34] 203 ms OK (M:-----) '*[[:xdigit:]][[:xdigit:]]'
[35] 215 ms OK (M:12-45) '*[0-9A-Za-z]*[0-9A-Za-z]'
[36] 213 ms OK (M:12-45) '*[[:alnum:]]*[[:alnum:]]'
[37] 191 ms OK (M:12-45) '*[a-z]*[a-z]'
[38] 219 ms OK (M:12-45) '*[a-bc-de-z]*[a-bc-de-z]'
[39] 224 ms OK (M:12-45) '*[[:lower:]]*[[:lower:]]'
[40] 217 ms OK (M:---4-) '*[0-9A-Fa-ef]*[0-9A-Fa-ef]'
[41] 199 ms OK (M:---4-) '*[[:xdigit:]]*[[:xdigit:]]'
[42] 227 ms OK (M:12-45) '*[0-9A-Za-z]*[0-9A-Za-z]*[0-9A-Za-z]'
[43] 239 ms OK (M:12-45) '*[[:alnum:]]*[[:alnum:]]*[[:alnum:]]'
[44] 204 ms OK (M:12-45) '*[a-z]*[a-z]*[a-z]'
[45] 258 ms OK (M:12-45) '*[a-bc-de-z]*[a-bc-de-z]*[a-bc-de-z]'
[46] 235 ms OK (M:12-45) '*[[:lower:]]*[[:lower:]]*[[:lower:]]'
[47] 247 ms OK (M:---4-) '*[0-9A-Fa-ef]*[0-9A-Fa-ef]*[0-9A-Fa-ef]'
[48] 247 ms OK (M:---4-) '*[[:xdigit:]]*[[:xdigit:]]*[[:xdigit:]]'
[49] 286 ms OK (M:12-45) '*[0-9A-Za-z]*[0-9A-Za-z]*[0-9A-Za-z]*[0-9A-Za-z]'
[50] 262 ms OK (M:12-45) '*[[:alnum:]]*[[:alnum:]]*[[:alnum:]]*[[:alnum:]]'
[51] 219 ms OK (M:12-45) '*[a-z]*[a-z]*[a-z]*[a-z]'
[52] 273 ms OK (M:12-45) '*[a-bc-de-z]*[a-bc-de-z]*[a-bc-de-z]*[a-bc-de-z]'
[53] 274 ms OK (M:12-45) '*[[:lower:]]*[[:lower:]]*[[:lower:]]*[[:lower:]]'
[54] 281 ms OK (M:---4-) '*[0-9A-Fa-ef]*[0-9A-Fa-ef]*[0-9A-Fa-ef]*[0-9A-Fa-ef]'
[55] 296 ms OK (M:---4-) '*[[:xdigit:]]*[[:xdigit:]]*[[:xdigit:]]*[[:xdigit:]]'
|
| |
|
|
|
| |
This script measures the performance of shell pattern matching,
with increasing pattern complexity (more '*' at the pattern).
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
Newer glibc is now smarter and can propagate const-ness from those!
function old new delta
readtoken1 3111 3108 -3
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Previously, scripts/mkwcwidth generated a wcwidth implementation based
on input from the python wcwidth: https://github.com/jquast/wcwidth .
However, that project is not updated frequently, and the less
dependencies - the better.
This new script instead prints an implementation based directly on the
original Unicode files - which it can also download.
It generates the same code as before (same data structures, etc).
It was then used to re-generate libbb/wcwidth_alt.c, as follows:
./scripts/mkwcwidth DL=15.1.0 FAST_FUNC > libbb/wcwidth_alt.c
This is the same Unicode version as the previous file, just to make
the codepoint differences visible easily.
These differences are very small, and the script itself explains where
and why it differs from https://github.com/jquast/wcwidth .
Next commits will update the tables to the latest unicode version.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add a new feature to libbb, FEATURE_USE_CNG_API, which enables the
use of the Cryptography API: Next Generation library to calculate
checksums. It is disabled by default except in the mingw64u default
config, as the API requires Windows 10+ to function. Usage of this
API provides a size benefit and delegates hardware optimizations to
the operating system cryptography library.
Based on GitHub PR #498 by rfl890.
Saves 4064 bytes in the mingw64u case.
|
| |\| |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Create new configure option for archival/libarchive based extractions to
disallow path traversals.
As this is a paranoid option and might introduce backward
incompatibility, default it to no.
Fixes: CVE-2023-39810
Based on the patch by Peter Kaestle <peter.kaestle@nokia.com>
function old new delta
data_extract_all 921 945 +24
strip_unsafe_prefix 101 102 +1
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 25/0) Total: 25 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | | |
|
| |\| |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When `fstat` fails, `st` is left uninitialised. In our case, Ben Kohler
noticed our release media builds were failing in Gentoo on x86 when building
busybox with occasional SIGBUS. This turned out to be EOVERFLOW (from 32-bit
ino_t) which wasn't being reported because nothing was checking the return value
from `fstat`.
Fix that to avoid UB (use of uninit var) and to give a more friendly
error to the user.
This actually turns out to be fixed already in the kernel from back in
2010 [0] and 2016 [1].
[0] https://github.com/torvalds/linux/commit/a3ba81131aca243bfecfa78c42edec0cd69f72d6
[1] https://github.com/torvalds/linux/commit/46fe94ad18aa7ce6b3dad8c035fb538942020f2b
Reported-by: Ben Kohler <bkohler@gentoo.org>
Signed-off-by: Sam James <sam@gentoo.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |\| |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
In the function find_export_symbols, since the fopen file does not
exit when it fails, there is a dereference problem in fclose(fp),
which will cause a segmentation fault.
Signed-off-by: Yan Zhu <zhuyan2015@foxmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| |
| | |
Recent versions of gcc fail to build the binary to test for
ncurses because main() is lacking a return type.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This commit adds a new wcwidth implementation at libbb/wcwidth_alt.c,
and uses it instead of the existing implementation when compiling for
windows and CONFIG_LAST_SUPPORTED_WCHAR >= 0x30000 - which is the case
with the unicode configs/mingw64u_defconfig.
The windows-target condition keeps non-windows build unmodified, and
the last supported wchar threshold is a semi-hack to allow switching
between implementations without adding a new config option (the old
code supports codepoints up to 0x2ffff).
The new file wcwidth_alt.c was generated by a new scripts/mkwcwidth,
which prints a wcwidth implementation using latest unicode data from
a local clone of https://github.com/jquast/wcwidth . This repo is the
main python wcwidth implementation, and is maintained and up to date.
Functional differences from the existing implementation:
- Unicode 15.1.0 (latest) with the new version (about 450 ranges of
wide and zero-width codepoints), compared to roughly Unicode 5.0
of the existing code (nearly 20 years old spec, about 150 ranges).
The new spec includes, among others, various wide icons and emojis,
which can now be edited correctly at the shell prompt, have correct
alignment in 'ls', etc.
- The old implementation returns -1 (non-printable) for surrogates,
while the new code returns 1, though this is inconsequential, and
POSIX doesn't care. Also libc implementations vary in this regard.
Technical differences:
- The old version compiles less code/data when the last supported
wchar is smaller, while the new version doesn't. This doesn't
matter because the new version is enabled only for the full range.
- The new version is smaller and relatively straight forward, and
fully automated (generated), so updates to newer spec is trivial.
The old version mixes data, ad-hoc code (tailored to the data),
and preprocessor checks, and is hard to automate updates.
The old version has various forms of 32 and 16 bit data ranges, in
several arrays, while the new version uses single data array with
unified form of 32 bits per range, with two rules:
- A data range can't span Unicode planes (enforced, but unlikely
required, and if yes, code to split ranges would be simple).
- A range can't hold more than 32768 codepoints, so bigger ranges
are split automatically (currently there are 2 such ranges).
Performance wise, the new version should be faster, even with three
times the data ranges. Both versions do effectively at most one binary
search in one Unicode plane data, but the new version finds both
zero-width and wide-width results in this one search, while the old
version only finds zero-width, and to detect wide-width it does an
additional linear series of manual range tests, but since most results
are width 1, this sequence is performed in most (non-ASCII) calls.
In a cursory comparison of the new wcwidth with glibc and musl-libc
(both use O(1) lookup tables), with few bodies of text, we're in the
same ballpark, with typical speed of 60% or better.
Bloat-wise, the new version is about 180 bytes code and 1800 bytes
data. If it had similar number of data ranges as the old code (150),
the new version would be about 200 bytes smaller, but because the
new version has 450 data ranges, it's about 1K bigger.
|
| | |
| |
| |
| |
| |
| |
| |
| | |
Commit 992387539 (build system: more clang/llvm tweaks) added a
test in scripts/Makefile.build which used the intcmp function.
This isn't present in GNU make prior to 4.4.
Rewrite the test so it works with older versions of GNU make.
|
| | |
| |
| |
| |
| |
| |
| |
| | |
Commit 992387539 (build system: more clang/llvm tweaks) falsely
claimed that the lack of the --warn-common linker option was being
detected.
It wasn't, but it is now.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Linkers associated with clang/llvm may not support the -r option.
This is used to create built-in.o object files. It turns out that
all such files in busybox-w32 are either empty or only contain one
object file. The first case is already supported and the second
can be handled by simply copying the object file to built-in.o.
The linker is therefore never invoked with the -r option.
One adjustment is required: the workaround adopted for GitHub
issue #200 linked the dummy C file with the resource object file.
This is no longer done so only one object file is used. Since it
was the linking that broke the resource file, copying it is an
equally effective fix for the issue.
Some old linkers don't support the --warn-common option. The lack
of this option was being detected but it was still sometimes used.
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Commit 7390f29cf (build system: allow building with w64devkit)
checked the target of the host compiler to determine if it was
Windows. This relied on the target being a triple of the form
*-*-mingw32.
Some compilers have a target of the form *-*-windows-gnu. Allow
for this too.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The default configurations now include the provided standard or
UTF-8 manifest.
This works best if the build toolchain doesn't provide a default
manifest (which Fedora and w64devkit don't, by default).
If the toolchain does have a default manifest some bloat will
result.
(GitHub issue #366)
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Previously, the unicode build required console (out) codepage of UTF8
in order for unicode output to be printed correctly - e.g. at the
shell command prompt or the output of `ls` for unicode file names.
This is inconvenient, because by default it's not UTF8, and so unless
the user invoked 'chcp 65001' - by default unicode output didn't work.
This feature (which is now enabled for the unicode build) makes it
print unicode output correctly regardless of the console CP, by
using a new stream-conversion funcion from UTF8 chars to wchar_t,
and writing those using WriteConsoleW.
If the console CP happens to be UTF8 - this conversion is disabled.
We could have instead changed the console CP to UTF8, but that's
a slippery slope, and some old program which expect the default CP
might get broken, so achieving the same result without touching
the console CP is hopefully better.
|
| | |
| |
| |
| |
| |
| | |
Run ./scripts/mk_mingw64u_defconfig to create (or update)
configs/mingw64u_defconfig from configs/mingw64_defconfig while
enabling UTF8 manifest, UTF8 input, and unicode editing.
|
| |\| |
|
| | |
| |
| |
| |
| |
| |
| | |
Bug: https://bugs.gentoo.org/893776
Closes: https://bugs.busybox.net/show_bug.cgi?id=15326
Signed-off-by: Arsen Arsenović <arsen@gentoo.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
'make menuconfig' uses a hardcoded colour palette which may be
difficult to read. Add support for the 'COLORS' environment
variable. Setting this to '0' will cause 'make menuconfig' to
be displayed in black and white.
(GitHub issue #273)
|
| | |
| |
| |
| |
| |
| |
| | |
Previously, pressing slash to search at the menu aborted the menu
program ('mconf'), because regexp is not available with native mingw.
Now it works, but the search is of plain string rather than regexp.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We need to build the supplied PDCurses code when using w64devkit.
This was being detected by checking for the W64DEVKIT environment
variable, but this is only defined if w64devkit is started via
w64devkit.exe.
Set W64DEVKIT ourselves if HOSTCC targets the mingw32 platform.
This won't be the case when cross-compiling on Linux but will
for w64devkit and MSYS2 MINGW32/64.
The build won't work properly for MSYS2 MINGW32/64, but it doesn't
work when using the supplied curses library either. 'make menuconfig'
requires the use of MSYS2 MSYS, and HOSTCC there targets msys.
|
| | |
| |
| |
| |
| |
| | |
The compiler in MSYS2 warns that strcasecmp(3) isn't declared in
scripts/kconfig/lxdialog/checklist.c. Add the appropriate include
to silence this warning.
|
| | |
| |
| |
| |
| |
| |
| | |
The WIN32 code in the 'mconf' build program should truncate the
exit status from dialogs as if it were passed through WEXITSTATUS.
The text dialog, for example, returns a status of -1 when ESC or
CR is pressed. 'mconf' expects to see this as 255.
|
| | |
| |
| |
| |
| |
| | |
w64devkit doesn't ship a curses library. Provide a cut-down copy
of PDCurses which is sufficient to allow 'make menuconfig' to work
in w64devkit.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
'make menuconfig' is a build option to allow changes to be made
to the BusyBox configuration. It's a bit friendlier than using
a text editor on the .config file.
Previously 'menuconfig' was only available when cross-compiling
on a Linux/Unix platform. The 'mconf' build program has been
ported to WIN32 so it's now able to run the 'lxdialog' program
which displays the configuration dialogs.
Building 'lxdialog' is somewhat awkward in MSYS2. The MINGW32/64
build environments generate WIN32 executables for 'lxdialog'.
These doesn't work properly in the MSYS2 console.
For 'menuconfig' to work it's necessary to run it in an MSYS
build environment. This generates an MSYS binary which works
in the MSYS2 console. busybox-w32 should then be built in a
MINGW32/64 build environment. Doing so will generate additional
copies of the build programs without a '.exe' suffix: the MSYS
build environment adds '.exe' to binaries it builds. This breaks
'menuconfig'.
To configure an MSYS build environment use:
pacman -S gcc ncurses-devel
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Upstream changes to the embedded_scripts and mkconfigs scripts
resulted in busybox-w32 failing to build with MSYS2.
bzip2 in MSYS2 detects stdout redirected to /dev/null as a terminal
and returns a non-zero exit status. Since the test is only for
the existence of bzip2, not its functionality, even an exit status
of 1 is OK. Only fail if the exit status is 127.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Make some adjustments to the build system to allow busybox-w32
to be built with w64devkit:
- Strip drive prefix from CURDIR in Makefile to avoid confusing
make with colons.
- Limit file redirection to a subshell in the usage_compressed and
embedded_scripts scripts. Otherwise it isn't possible to move
the open generated file on Windows.
- Change the option tests in Kbuild.include to allow for /dev/null
not existing on Windows.
- Create host binaries without a '.exe' extension. Otherwise they're
rebuilt more often than necessary.
- Modify split-include.c to allow for Windows' popen() not expanding
wildcards.
(GitHub issue #239)
|
| |\| |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Pass down the correct EXTRA_CFLAGS to the compiler driver when building
assembler source.
Otherwise building busybox for a multilib other than the default failed
to link since hash_md5_sha256_x86-64_shaNI.o and
hash_md5_sha_x86-64_shaNI.o were built for the default arch which might
not what we requested in the EXTRA_CFLAGS.
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
| |\|
| |
| |
| |
| |
| | |
Fix merge conflict in miscutils/less.c.
Use exit_SUCCESS() where possible.
|
| | |
| |
| |
| | |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| | |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |\| |
|
| | |
| |
| |
| | |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| | |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |\| |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The SOURCE_DATE_EPOCH is an effort of the Reproducible Builds
organization to make timestamps/build dates in compiled tools
deterministic over several repetitive builds.
Busybox shows by default the build date timestamp which changes whenever
compiled. To have a reasonable accurate build date while staying
reproducible, it's possible to use the *date of last source
modification* rather than the current time and date.
Further information on SOURCE_DATE_EPOCH are available online [1].
This patch modifies `confdata.c` so that the content of the
SOURCE_DATE_EPOCH env variable is used as timestamp.
To be independent of different timezones between builds, whenever
SOURCE_DATE_EPOCH is defined the GMT time is used.
[1]: https://reproducible-builds.org/docs/source-date-epoch/
Signed-off-by: Paul Spooren <mail@aparcar.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When include/applets.h is re-generated
it generates code macros in include/applets.h e.g.
IF_XZCAT(APPLET_ODDNAME(xzcat, unxz, BB_DIR_USR_BIN, BB_SUID_DROP, xzcat))
...
IF_CHVT(APPLET_NOEXEC(chvt, chvt, BB_DIR_USR_BIN, BB_SUID_DROP, chvt))
...
sed is used to process source files like below to feed into this header
generation
sed -n 's@^//applet:@@p' "$srctree"/*/*.c "$srctree"/*/*/*.c
this means we let shell decide the order of .c files being fed into sed
tool, applets.h has code snippets thats generated out of code fragments
from these .c files and the order of the generated code depends on the
order of .c files being fed to sed and then piped to generate tool, even
though the generated code is logically same, it does result in re-odered
code in applets.h based on which shell was used during build on exact busybox
sources since sort order is different based on chosen locale and also default shell
being bash or dash
This sets the environment variable LC_ALL to the value C, which will
enforce bytewise sorting, irrespective of the shell
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |\| |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
A CR in the gcc output would cause the following to show throughout build:
: invalid numberbox-1.32.1/scripts/gcc-version.sh: line 12: printf: 9
Signed-off-by: Chris Renshaw <osm0sis@outlook.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| |
| |
| |
| | |
On Cygwin, "echo __GNUC__ __GNUC_MINOR__ | gcc -E -xc -" can print
extra empty trailing line.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| | |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|