aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* | win32: fix ESC/CR handling in 'make menuconfig'Ron Yorston2022-11-071-1/+1
| | | | | | | | | | | | | | 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.
* | Provide PDCurses source for w64devkit buildRon Yorston2022-11-0740-0/+10615
| | | | | | | | | | | | 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.
* | win32: allow 'make menuconfig' in native buildsRon Yorston2022-11-071-6/+223
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | '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
* | make: fix typo in inference rule handlingRon Yorston2022-11-042-24/+25
| | | | | | | | | | | | | | A typo in the previous commit caused dyndep() to process inference rules incorrectly. This didn't affect the results of the test suite when extensions were allowed but it caused the test 'Inference rule with explicit rule for prerequisite' to fail in POSIX mode.
* | make: fixes to inference rulesRon Yorston2022-11-032-18/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Austin Group defect report 875 clarifies some aspects of inference rules. The crux of the issue is related to chained inference rules so it doesn't affect POSIX mode. The test makefile looks like this: .SUFFIXES: .a .b .c .a.c: @echo .a.c .b.c: @echo .b.c test.c: test.b test.a: test.b: The correct output is deemed to be '.a.c'. Additional complications are: - whether or not the prerequisite files are present; - the use of the suffixes '.a' and '.c' may result in the builtin inference rule '.c.a' being considered. In favourable circumstances pdpmake managed to give the correct result, in unfavourable it reported circular dependencies or segfaulted. Changes to fix these issues are: - When prerequisites are being recursively built the standard says: 'Upon recursion, each prerequisite shall become a target itself.' Follow this requirement. - At the end of make() the target being built should have its time (as represented by n_tim in struct name) updated when any action has been taken. - When dyndep() is looking for prerequisites it should: * skip candidates that are in the process of being built; * consider whether an explicit candidate is a target, not whether it has any commands associated with it. pdpmake now behaves similarly to GNU make when presented with makefiles like the above. bmake gives the incorrect output '.b.c'.
* | make: comments in macro expansions and command linesRon Yorston2022-11-012-3/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The POSIX specification says: There are three kinds of comments: blank lines, empty lines, and a <number-sign> ('#') and all following characters up to the first unescaped <newline> character. Most implementations don't treat '#' in a macro expansion or a command line as the start of a comment. POSIX doesn't mention either of these exceptions. Permit the exceptions as a non-POSIX extension.
* | make: fix test for .WAIT so bmake passesRon Yorston2022-11-011-1/+1
| | | | | | | | | | Use $? instead of $^ in the test for .WAIT. bmake supports .WAIT but not $^.
* | win32: remove declaration of vfork(2)Ron Yorston2022-10-311-1/+0
| | | | | | | | | | | | | | Since vfork(2) is never used in busybox-w32 there's no need to declare it. Doing so provokes clang to issue a warning. (GitHub issue #239)
* | make: different treatment for escaped NL in macro in commandRon Yorston2022-10-302-6/+37
| | | | | | | | | | | | | | Austin Group defect report 1549 has been accepted. It requires that an escaped newline inside a macro expansion in a command is replaced by a space. Other escaped newlines in commands are left in place, as before.
* | build system: fix breakage affecting MSYS2 buildRon Yorston2022-10-302-4/+4
| | | | | | | | | | | | | | | | | | | | 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.
* | build system: allow building with w64devkitRon Yorston2022-10-306-7/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
* | win32: revert special treatment of Unix-style absolute pathsRon Yorston2022-10-267-49/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 605972390 (win32: handle Unix-style absolute paths for executables) added special treatment of paths for executables starting with a slash. Such paths are absolute on Unix but are relative to the current drive on Windows. On reflection this commit did more than necessary. Later commits provided special treatment only for paths starting with locations traditionally used to contain binaries on Unix. This is probably sufficient. Problems introduced by commit 605972390 include: - If the current drive isn't the system drive tab completion of a command starting with a slash confusingly references the system drive. - Building busybox-w32 with w64devkit fails on drives other than the system drive. Revert the changes introduced by commit 605972390. This saves 192 bytes. (GitHub issue #239)
* | win32: fix warning in timegm(3)Ron Yorston2022-10-251-1/+0
| | | | | | | | | | | | | | | | | | | | | | Building on Windows using w64devkit resulted in a new warning in timegm(3). The compiler didn't like a reference to the unnamed temporary in: if (!is_leap) is_leap = &(int){0}; is_leap is always non-NULL in the limited version of the code used here so the offending line can simply be removed.
* | win32: revise creation of resourcesRon Yorston2022-10-252-3/+5
| | | | | | | | | | | | | | | | | | | | | | As reported in https://github.com/skeeto/w64devkit/issues/35 there's a problem creating Windows resources using the native version of `windres`. Avoid passing arguments to `windres` that it can't handle by stringizing the version string locally in resource.rc. (GitHub issue #239)
* | make: add a comment, no functional changeRon Yorston2022-10-211-3/+8
| |
* | make: $+ should support D/F modifiersRon Yorston2022-10-201-0/+1
| | | | | | | | | | The code to handle the modifiers for 'directory part' and 'filename part' has been updated to support the $+ internal macro.
* | make: .NOTPARALLEL and .WAIT are special targetsRon Yorston2022-10-192-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | Austin Group defect report 1437 has been accepted. It describes the special targets .NOTPARALLEL and .WAIT which are used to influence the behaviour of parallel builds. Since parallel builds aren't implemented in here they actually don't 't have much effect. - For completeness they're flagged as special targets. - .WAIT should be allowed as a prerequisite.
* | make: shell assignment is a POSIX 202X featureRon Yorston2022-10-182-16/+16
| | | | | | | | | | | | | | | | Austin Group defect report 337 has been accepted, thus making macro assignment from the output of a shell command (!=) a POSIX 202X feature. This was previously implemented as a non-POSIX extension.
* | make: support $+ and $^ as POSIX 202X featuresRon Yorston2022-10-182-14/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Austin Group defect reports 514 and 1520 have both been accepted. Together these introduce the internal macros $+ and $^: - $+ lists all prerequisites, with duplicates retained; - $^ lists all prerequisites, with duplicates removed. $^ had already been implemented as a non-POSIX extension, it now becomes a POSIX 202X extension. $+ has been added as a POSIX 202X extension. Neither of the above defect reports mentions how $? should handle duplicate prerequisites. In POSIX mode duplicates are retained. Removal of duplicates is implemented as a non-POSIX extension to match existing practice in other versions of make.
* | make: clarify output of testsRon Yorston2022-10-161-31/+31
| |
* | ash: disable the 'sleep' builtin in the default configurationRon Yorston2022-10-132-2/+2
| | | | | | | | | | | | The sleep applet can call xfunc_die() in a variety of circumstances. This makes the code unsuitable for use as a shell builtin. Disable it in the default configuration.
* | ash: enable 'read -t N.NNN'Ron Yorston2022-10-132-2/+2
| | | | | | | | | | | | | | | | | | Upstream BusyBox has supported fractional arguments to 'read -t' since 2017. For some reason it was never enabled in busybox-w32. Costs 48-80 bytes. (GitHub issue #269)
* | xxd: avoid use of uninitialised variableRon Yorston2022-10-121-0/+4
| | | | | | | | | | | | | | If xxd is run with '-r' but no '-s' the value of opt_s passed to reverse() is uninitialised. This patch has been submitted upstream but hasn't been applied yet.
* | Update default configurationRon Yorston2022-10-122-2/+6
| | | | | | | | The new 'tree' applet uses scandir(3) and has been disabled by default.
* | Merge branch 'busybox' into mergeRon Yorston2022-10-1246-186/+678
|\|
| * tls: move definitions around, no code changesDenys Vlasenko2022-09-081-22/+12
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * tls: include signature_algorithms extension in client hello messageDenys Vlasenko2022-09-081-18/+73
| | | | | | | | | | | | | | | | | | | | function old new delta tls_xread_record 629 645 +16 .rodata 105167 105179 +12 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 28/0) Total: 28 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: mark stack in assembly files read-onlyLudwig Nussel2022-08-306-0/+18
| | | | | | | | | | Signed-off-by: Ludwig Nussel <ludwig.nussel@suse.de> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * fix [ --help ] and [[ --help ]]Denys Vlasenko2022-08-301-0/+3
| | | | | | | | | | | | | | function old new delta show_usage_if_dash_dash_help 72 79 +7 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * *: style fixDenys Vlasenko2022-08-3013-52/+52
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ash: optional sleep builtinShawn Landden2022-08-274-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | function old new delta sleepcmd - 10 +10 builtintab 352 360 +8 .rodata 105264 105271 +7 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 2/0 up/down: 25/0) Total: 25 bytes Signed-off-by: Shawn Landden <shawnlandden@tutanota.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * devmem: add 128-bit widthAaro Koskinen2022-08-261-24/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add 128-bit width if the compiler provides the needed type. function old new delta devmem_main 405 464 +59 .rodata 109025 109043 +18 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 77/0) Total: 77 bytes Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com> Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * tree: unicode tweak (use normal space char, 0x20)Denys Vlasenko2022-08-261-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * tree: make it unicode-awareDenys Vlasenko2022-08-261-3/+16
| | | | | | | | | | | | | | | | | | | | | | function old new delta tree_print 396 420 +24 .rodata 105251 105266 +15 tree_main 86 91 +5 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/0 up/down: 44/0) Total: 44 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * xxd -r: handle offsetsDenys Vlasenko2022-08-221-8/+50
| | | | | | | | | | | | | | | | | | | | function old new delta xxd_main 1076 1439 +363 .rodata 105239 105251 +12 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 375/0) Total: 375 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * xxd: add two more testcasesDenys Vlasenko2022-08-221-2/+16
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * xxd -r: without -p, stop at more than one whitespace, closes 14786Denys Vlasenko2022-08-222-17/+48
| | | | | | | | | | | | | | function old new delta xxd_main 888 1076 +188 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: make '--help' handling more consistentRon Yorston2022-08-221-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Running an applet with '--help' as its only argument is treated as a special case. If additional arguments follow '--help' the behaviour is inconsistent: - applets which call single_argv() print help and do nothing else; - applets which call getopt() report "unrecognized option '--help'" and print help anyway; - expr says "expr: syntax error" and doesn't print help; - printenv silently ignores '--help', prints any other variables and doesn't print help; - realpath says "--help: No such file or directory", prints the path of any other files and doesn't print help. If the first argument is '--help' ignore any other arguments and print help. This is more consistent and most likely what the user wanted. See also commit 6bdfbc4cb (libbb: fix '--help' handling in FEATURE_SH_NOFORK=y). function old new delta show_usage_if_dash_dash_help 75 69 -6 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-6) Total: -6 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * bc: hopefully fix bug 14956 (use-after-free)Denys Vlasenko2022-08-181-0/+2
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ash: fix use-after-free in bash pattern substitutionSören Tempel2022-08-021-0/+7
| | | | | | | | | | | | | | | | function old new delta subevalvar 1566 1564 -2 Signed-off-by: Sören Tempel <soeren@soeren-tempel.net> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * udhcpc6: downgrade "opening listen socket" log level to 2Denys Vlasenko2022-08-022-2/+2
| | | | | | | | | | | | This matches udhcpc for IPv4. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * udhcpc6: fix sending of renew messagesDenys Vlasenko2022-08-021-2/+3
| | | | | | | | | | | | | | function old new delta d6_listen_socket - 150 +150 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: add 'ZQ' quitting commandGrob Grobmann2022-08-021-1/+7
| | | | | | | | | | | | | | | | | | | | | | Busybox vi provides the 'ZZ' command to save and close the similar 'ZQ' command just exits without saving. function old new delta do_cmd 4222 4244 +22 Signed-off-by: Grob Grobmann <grobgrobmann@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ping: fix typo in --help textHenrique Rodrigues2022-08-021-2/+2
| | | | | | | | | | Signed-off-by: Henrique Rodrigues <henrique.rodrigues@ist.utl.pt> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ash: fix use-after-free in pattern substituon codeDenys Vlasenko2022-08-021-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Patch by soeren@soeren-tempel.net The idx variable points to a value in the stack string (as managed by STPUTC). STPUTC may resize this stack string via realloc(3). If this happens, the idx pointer needs to be updated. Otherwise, dereferencing idx may result in a use-after free. function old new delta subevalvar 1562 1566 +4 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ash: fix ifs cleanup on error pathsDenys Vlasenko2022-08-025-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | Patch by Alex Gorinson <algore3698@gmail.com> function old new delta evalvar 477 495 +18 varvalue 603 618 +15 subevalvar 1557 1572 +15 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/0 up/down: 48/0) Total: 48 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * sort: fix sort -s -u, closes 14871Denys Vlasenko2022-07-292-4/+15
| | | | | | | | | | | | | | function old new delta sort_main 851 856 +5 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * sort: fix -k2M (wasn't skipping leading whitespace)Denys Vlasenko2022-07-292-2/+13
| | | | | | | | | | | | | | function old new delta compare_keys 848 862 +14 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * udhcpc6: add missed big-endian conversionsDenys Vlasenko2022-07-131-0/+2
| | | | | | | | | | | | | | function old new delta option_to_env 686 694 +8 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * tls: P256: remove NOP macro sp_256_norm_8()Denys Vlasenko2022-07-131-30/+5
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>