| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Certain tools which allow disk image files and RAM disks to be
mounted were found to lack a feature used to implement realpath(3).
This resulted in a segfault in the 'su' applet when it was run in
such a virtual filesystem.
'su' uses realpath(3) to canonicalise the current directory. This
is only really required to handle network shares mapped to a drive
letter. (GitHub issue #148)
- If the call to realpath(3) fails for some reason fall back to
using the current directory determined by calling getcwd(3).
- If getcwd(3) fails simply don't pass any directory to the shell
being started by 'su'.
Also, ensure all allocated memory is freed, if required.
(GitHub issue #389)
Adds 16-32 bytes.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Commits 8e6991733 and b2901ce8e fixed problems with the 'read'
shell built-in when the '-t' option was used. However, they
result in a performance penalty. This pipeline:
seq -w 0 999999 | while read line; do :; done
takes 10 times longer than prior to the changes.
If no timeout is specified don't call poll(2).
Costs 16 bytes in a 32-bit build; 0 in 64-bit.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
There's an upstream bug report:
https://bugs.busybox.net/show_bug.cgi?id=15679
that if BusyBox is built for x86_64 with gcc and the use of OpenSSL
for wget is disabled, failures ensue. A similar issue also affects
the busybox-w32 build with the comparable configuration.
The problem appears to be in the assembly code for the function
sp_256_sub_8_p256_mod(), as forcing the use of the provided C code
seems to fix both upstream and busybox-w32. Since my knowledge of
x64_64 assembler is non-existent, someone else will need to determine
the actual issue. For the moment, just avoid the faulty code.
Saves 32 bytes in the 64-bit build.
(GitHub issue #263)
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
Older versions of mingw don't define PROCESSOR_ARCHITECTURE_ARM64.
Don't let this stop the build.
|
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The last two commits allow EXTRAVERSION to track the current state
of a git repository. The build system was unable to determine
which files were affected by changes to EXTRAVERSION and caused
a full rebuild when it changed.
Alter how the version information is passed to the code so only
a handful of files need to be rebuilt when it changes.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The previous commit to detect EXTRAVERSION more accurately was
lacking in some respects:
- Only attempt to detect EXTRAVERSION if it's currently set to the
default value '.git'.
- Use immediate-expansion macro assignments to avoid time-consuming
repeated evaluations.
- Remove a useless use of cat.
- Correctly allow for the output being sent to a separate directory.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The default EXTRAVERSION is .git. Use some clues to determine a
more precise EXTRAVERSION:
- git describe
- A .frp_describe file embedded in the release tarball
- The name of the build directory: tarballs of release tags from
GitLab and GitHub include the version in the directory name.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The web server in BusyBox has an optional feature to allow pages
with a given suffix to be processed by a script interpreter: PHP,
for example.
Enable this in the busybox-w32 build.
Costs 256-320 bytes.
(GitHub issue #266)
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When setting up the arguments for the CGI handler:
- Use '-I0' rather than two separate arguments.
- Use memcpy() to copy the server arguments.
Saves 32 bytes.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The httpd server made unnecessary calls to detach from the console.
Avoiding this saves one process creation when a file is being
served and two for a CGI script.
Then again, commit ad4bd5bbd (win32: avoid console windows from CGI
scripts) results in a console host always being created for a CGI
script even if it turns out to be unnecessary. So the net saving
is only one process for CGI scripts.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Commit ea8742bc16 (ash: workaround environment issue in Windows
on ARM) prevented nofork applets from being run without a fork
in standalone shell mode in Windows on ARM. This was due to a
deficiency in the handling of the 'environ' global.
However, the problem is specific to MSVCRT. If the target is
UCRT nofork applets can be made to work without a fork.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When httpd is run in the background its processes are detached
from the console. CGI scripts could create subprocesses which
needed a console, resulting in annoying console windows appearing.
Prevent this by changing the creation flags for CGI scripts to
CREATE_NO_WINDOW.
|
| |
| |
| |
| |
| | |
Update the mkrelease script to include cross-compilation of the
Windows on ARM binary on Linux using llvm-mingw.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In the Microsoft Windows build stat(1) requires find_mount_point()
from libbb. This won't be available unless df(1) is also enabled.
Add a dependency so stat(1) can be built without df(1). This may
result in find_mount_point() being compiled needlessly in some
upstream builds, but we can live with that.
(GitHub issue #385)
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- Rename some functions to be more meaningful.
- Adjust conditional compilation to clarify which code is required
for 'standalone shell' and 'exec prefers applets' settings.
This shouldn't result in any change to the behaviour or size of
default builds.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When an unexpected value is detected in UTF-8, we should print the
placeholder codepoint, and then recover whenever we detect a value
which is valid for starting a new UTF-8 codepoint (including ASCII7).
However, previously, we only tested recovery at the bytes following
the unexpected one, and so if the first unexpected value was also
valid for a new codepoint, then didn't rcover it.
Now we check for recovery from the first unexpected byte, which,
if recoverable, requires both placeholder printout and recovery,
so the recovery "unwinding" is modified a bit to allow placeholder.
Example of of a sequence which now recovers quicker than before:
(where UTF-8 for U+1F600 "😀" is: 0xF0 0x9F 0x98 0x80)
printf "\xF0\xF0\x9F\x98\x80A"
Previously: ?A
Now: ?😀A
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The mingw-w64 project has updated its implementation of dirname(3).
In some circumstances the new version doesn't preserve the type of
the user-supplied top-level directory separator. As a result of
this the dirname-handles-root test case failed.
Import the new implementation and tweak it to preserve the type of
the separator.
This only affects mingw-w64 versions 12 and above. Currently only
the aarch64 build using llvm-mingw is affected.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If the NO_COLOR environment variable is set and is not empty 'ls'
won't output ANSI colour codes. This is an alternative to the
existing approach of setting 'LS_COLORS=none'.
See https://no-color.org/.
Costs 24-32 bytes.
(GitHub issue #382)
|
| |
| |
| |
| |
| |
| | |
In external_exists() in appletlib.c it's necessary to take a copy
of the pointer to the allocated variable path1 so it can be freed:
find_executable() will change its value.
|
| |
| |
| |
| |
| | |
It seems windres in llvm doesn't understand MANIFEST resources.
Use the numeric value 24 instead.
|
| |
| |
| |
| |
| |
| |
| | |
The conditional compilation to control standalone shell mode was
incorrect when building for POSIX. This hadn't been noticed before
as it had only been tested in the default configuration where
standalone shell mode is disabled.
|
| |
| |
| |
| | |
Use -fsjls-exceptions with clang.
|
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| | |
For Windows on ARM we need to report the aarch64 processor
architecture.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The top-level makefile attempted to detect if make was being run
in silent mode (-s option). It then turned off reporting of
commands as they were run. There were false positives where
unrelated 's' characters in the command line were detected as
silent mode.
Import the relevant section from the latest Linux build system to
improve matters.
|
| |
| |
| |
| |
| | |
Update the mkprerelease script to include cross-compilation of
the Windows on ARM binary on Linux using llvm-mingw.
|
| |
| |
| |
| |
| |
| |
| | |
The top-level Makefile hardcoded the host and cross compiler name
to "gcc". Make it possible to set different values either on the
command line (make CROSS_COMPILER=clang) or in the configuration
file.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
A 32-bit build of BusyBox using clang segfaulted in the test
"awk assign while assign". Specifically, on line 7 of the test
input where the adjustment of the L.v pointer when the Fields
array was reallocated:
L.v += Fields - old_Fields_ptr;
was out by 4 bytes.
Rearrange to code so both gcc and clang generate code that works.
This patch has been submitted upstream. Until it's accepted there
the new code is only used in builds for Windows.
|
| |
| |
| |
| |
| |
| |
| | |
The environment is handled differently in ARM64 Windows.
Assignments to 'environ' result in a compiler error. Omit the
offending code for now. NOFORK applets will cause a fork.
|
| |
| |
| |
| |
| |
| | |
Add a default configuration for ARM64. This just changes the cross
toolchain prefix and disables CONFIG_STATIC_LIBGCC. The latter is
harmless but results in many warnings.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The GCC documentation points out that the stdcall attribute doesn't
apply to functions which take a variable number of arguments. GCC
is silent about this during compilation but clang complains noisily.
Remove FAST_FUNC from all variadic functions. This has no effect
whatsoever on the binary resulting from a default 32-bit build.
Signed-off-by: Ron Yorston <rmy@pobox.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Extend the changes introduced by commit b4ef2e3467 (Makefile.flags:
suppress some clang-9 warnings) so they also cover the case where
clang is used as a cross-compiler.
Signed-off-by: Ron Yorston <rmy@pobox.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Following on from commit c84b81ce4 (ash: reduce size of forkshell
relocation block):
- Store the flags to indicate if annotations should be freed in a
separate array. This only affects builds with forkshell debug
enabled.
- Use a bitmap to indicate which pointers need relocation (instead
of an array of bytes).
This reduces the size of the forkshell data block by a few hundred
bytes.
Adds 32-64 bytes.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The forkshell relocation block had one byte for each byte of the
forkshell structure and funcblock. It's only necessary to allow
one byte for each pointer. (One or two bits would be enough, but
would make the code more complex.)
The impact of this change depends on the data and whether the CPU
is 32- or 64-bit. It typically saves a few Kbytes.
Costs 16-52 bytes.
|
| |
| |
| |
| |
| |
| |
| |
| | |
Remove a check that there are no relocations for addresses in the
funcstring block. At one point during development the relocation
block had entries for that area, but not any more.
This only affects non-default builds with forkshell debug enabled.
|
| |
| |
| |
| |
| |
| | |
Rearrange the handling of pointer relocation during forkshell and
add a couple of additional sanity checks. There's no functional
change to non-debug builds.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When a pipeline is created the parent allocates an array of procstat
structures sufficient for the number of members of the pipeline.
The child processes, however, only see the number of processes
created so far. Thus, the first child sees that a procstat array
has been created but contains no processes.
This resulted in an invalid pointer to the procstat array in the
first child. This probably doesn't matter: if the number of
processes is zero there should be no need to access the array.
Set the pointer to NULL so if it is accessed we'll know about it.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Commit 8ade494aeb (win32: add support for virtual terminal input)
made some changes to how input is handled in the line editing code.
In some circumstances (e.g. 'cat | sh -i') this results in input
being read using fgets(3) rather than from the keyboard. Remove
CRs from input in this case.
Also, use fgets(3) if stdin is not a tty, but not stdout.
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
The '-f' option allows the user to specify a format string to
control which data is reported.
Adds 224-240 bytes.
|
|\| |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
sed would currently not error if write failed when modifying a file.
This can be reproduced with the following 'script':
$ sudo mount -t tmpfs tmpfs -o size=1M /tmp/m
$ sudo chmod 777 /tmp/m
$ echo foo > /tmp/m/foo
$ dd if=/dev/zero of=/tmp/m/fill bs=4k
dd: error writing '/tmp/m/fill': No space left on device
256+0 records in
255+0 records out
1044480 bytes (1.0 MB, 1020 KiB) copied, 0.00234567 s, 445 MB/s
$ busybox sed -i -e 's/.*/bar/' /tmp/m/foo
$ echo $?
0
$ cat /tmp/m/foo
<empty>
new behaviour:
$ echo foo > /tmp/m/foo
$ ./busybox sed -i -e 's/.*/bar/' /tmp/m/foo
sed: write error
$ echo $?
4
$ cat /tmp/m/foo
foo
function old new delta
sed_main 754 801 +47
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/0 up/down: 47/0) Total: 47 bytes
text data bss dec hex filename
75727 2510 1552 79789 137ad busybox_old
75774 2510 1552 79836 137dc busybox_unstripped
Signed-off-by: Dominique Martinet <dominique.martinet@atmark-techno.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| | |
function old new delta
time_main 1217 1316 +99
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The ru_maxrss is already in Kbytes and not pages.
function old new delta
ptok 21 - -21
time_main 1261 1217 -44
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 0/1 up/down: 0/-65) Total: -65 bytes
fixes: https://bugs.busybox.net/show_bug.cgi?id=15751
Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|