aboutsummaryrefslogtreecommitdiff
path: root/scripts/basic (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'busybox' into mergeRon Yorston2024-09-281-2/+9
|\
| * fixdep: add fstat error handlingSam James2024-09-271-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge branch 'busybox' into mergeRon Yorston2024-06-231-0/+1
|\|
| * docproc: avoid segfault during file closingYan Zhu2024-04-131-0/+1
| | | | | | | | | | | | | | | | | | 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>
* | Merge branch 'busybox' into mergeRon Yorston2023-04-091-1/+5
|\|
| * fixdep: avoid underflow when end of entry doesn't coincide with EOFArsen Arsenović2023-02-271-0/+5
| | | | | | | | | | | | | | 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>
* | build system: allow building with w64devkitRon Yorston2022-10-301-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
* | Merge branch 'busybox' into mergeRon Yorston2021-05-143-17/+17
|\|
| * fix "warning array subscript has type 'char'"Denys Vlasenko2021-04-143-16/+16
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * build system: avoid build failure during bisectionRon Yorston2021-04-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 4bdc914ff (build system: fix compiler warnings) added a test on the return value of fgets() in split-include.c. During bisection it's possible to go back to a state where a configuration value didn't exist. This results in an empty include file corresponding to the missing feature. If a subsequent bisection returns to a state where the feature exists split-include treats the empty file as an error and the build fails. Add a call to ferror() to distinguish between fgets() failing due to an error and due to there being no data to read. Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | .gitignore: support building on WindowsJohannes Schindelin2021-02-211-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | These items are already listed, albeit without `.exe` suffix. Presumably, this is because BusyBox-w32 is traditionally cross-compiled on Linux. However, we are about to introduce a CI build definition that builds BusyBox-w32 in MSYS2 (using mingw-w64-gcc), meaning that those executables might very well exist _with_ `.exe` suffix. Let's ignore those, too. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
* | Merge branch 'busybox' into mergeRon Yorston2019-01-101-1/+2
|\|
| * build system: fix compiler warningsDenys Vlasenko2019-01-061-1/+2
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | kbuild: support at least non-interactive mode on WindowsJohannes Schindelin2017-07-142-3/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | without POSIX, kbuild has some trouble compiling its support executables. Luckily, the parts that really lean on POSIX functionality are pretty much all only needed when configuring the build interactively. When compiling BusyBox for Win32, we do not actually need interactive configuration at all: we simply choose the default. Therefore, a lot of the stuff that is typically built for the Kconfig system is totally unnecessary (such as: compiling documentation via fork()&exec(), changing the window size, etc). Liberally put all of the problematic code behind #ifndef __MINGW32__ guards, just to get `make mingw64_defconfig` going in Git for Windows' SDK (which is a special-purpose version of MSYS2). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
* | fixdep: fix assumption that `long` is as large as `void *`Johannes Schindelin2017-07-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | It is not. At least not in general. And in particular not on 64-bit Windows, where sizeof(long) == 4. What the code wanted to use is actually called intptr_t. Note: `intptr_t` is a C99 feature. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
* | fixdep: be careful about handling empty lines correctlyJohannes Schindelin2017-07-141-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current code without this patch is seriously flawed, as it can easily overrun the buffer while looking for the *beginning* of the line. The symptom when trying to build without this patch in Git for Windows' SDK (which is a special-purpose version of MSYS2) is: $ make mingw64_defconfig && make -j15 HOSTCC scripts/basic/fixdep make[1]: *** [scripts/Makefile.host:104: scripts/basic/fixdep] Error 127 make: *** [Makefile:358: scripts_basic] Error 2 make: *** [Makefile:358: scripts_basic] Error 2 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
* | fixdep: read the dependency files in binary modeJohannes Schindelin2017-07-141-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We want to make sure that the original line endings are preserved, as fixdep hardcodes the assumption of Unix-type line endings. The symptom is this (kinda hard to understand) error when building in Git for Windows' SDK (which is a special-purpose version of MSYS2): $ make mingw64_defconfig && make -j15 HOSTCC scripts/basic/fixdep C:/git-sdk-64/mingw64/x86_64-w64-mingw32/include/ctype.h 64-w64-mingw32/include/ctype.h: Invalid argument fixdep: make[1]: *** [scripts/Makefile.host:104: scripts/basic/fixdep] Error 2 make: *** [Makefile:358: scripts_basic] Error 2 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
* | Merge branch 'busybox' into mergeRon Yorston2015-07-141-1/+1
|\|
| * typo fixesManinder Singh2015-05-251-1/+1
| | | | | | | | | | Signed-off-by: Maninder Singh <maninder1.s@samsung.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2014-01-132-2/+2
|\| | | | | | | | | | | Conflicts: include/platform.h scripts/basic/fixdep.c
| * build system: stop including alloca.h, stdlib.h provides itDenys Vlasenko2014-01-092-2/+2
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge commit 'c0cae52662ccced9df19f19ec94238d1b1e3bd71' into mergeRon Yorston2012-03-232-0/+2
|\| | | | | | | | | | | Conflicts: Makefile.flags scripts/basic/fixdep.c
| * suppress "warning: implicit declaration of function 'alloca'"Denys Vlasenko2011-09-152-0/+2
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge commit 'b83c9704128dd106071184e4b00335a3b8486857' into mergeRon Yorston2012-03-221-1/+1
|\|
| * Fix double words in comments. No code changesMarek Polacek2011-04-161-1/+1
| | | | | | | | | | Signed-off-by: Marek Polacek <mpolacek@redhat.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | fixdep: fix mmap() on msysKlessing, Daniel2011-10-301-6/+28
| |
* | win32: fixdep: workaround mmap()Nguyễn Thái Ngọc Duy2011-01-231-0/+29
|/
* scripts: fix fixdep.c to let it workable in cygwinMacpaul Lin2010-12-181-1/+1
| | | | | | | | | Update retrun character detection in the fixdep.c to let it work in cygwin. Signed-off-by: Macpaul Lin <macpaul@andestech.com> Signed-off-by: Greentime <green.hu@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Revert "scripts: fix fixdep.c to let it workable in cygwin"Denys Vlasenko2010-12-181-1/+1
| | | | This reverts commit 10c36b86574133bb1cd29ad04db64c7953b94ab5.
* scripts: fix fixdep.c to let it workable in cygwinGreentime2010-12-181-1/+1
| | | | | | | | | Update return character detection in the fixdep.c to let it workable in cygwin. Signed-off-by: Macpaul Lin <macpaul@andestech.com> Signed-off-by: Greentime <green.hu@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: trailing empty lines removedDenys Vlasenko2010-07-261-1/+0
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: introduce and use xfork() and xvfork()Pascal Bellard2010-07-041-1/+1
| | | | | | | | | | | | | | | | function old new delta launch_helper 170 169 -1 setup_heredoc 312 302 -10 handle_dir_common 367 354 -13 expand_vars_to_list 2456 2443 -13 open_transformer 89 74 -15 data_extract_to_command 439 423 -16 do_ipaddr 1406 1389 -17 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/7 up/down: 0/-85) Total: -85 bytes Signed-off-by: Pascal Bellard <pascal.bellard@ads-lu.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* fix extra bogus files generation in include/config/*Denys Vlasenko2010-06-172-7/+13
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Hurd compat fixes. Mostly dealing with absent PATH_MAXJérémie Koenig2010-03-262-12/+14
| | | | | Signed-off-by: Jérémie Koenig <jk@jk.fr.eu.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* scripts/basic/docproc.c: remove stray NUL byte from the sourceDenys Vlasenko2010-01-121-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* add .gitignore filesMike Frysinger2009-05-051-0/+4
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* *: mass renaming of USE_XXXX to IF_XXXXDenis Vlasenko2009-04-211-13/+17
| | | | | | and SKIP_XXXX to IF_NOT_XXXX - the second one was especially badly named. It was not skipping anything!
* libbb: [x]fopen_for_{read,write} introduced and used.Denis Vlasenko2008-07-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (by Valdimir) function old new delta config_open2 - 41 +41 config_read 507 542 +35 find_pair 169 187 +18 fopen_for_write - 14 +14 fopen_for_read - 14 +14 find_main 406 418 +12 xfopen_for_write - 10 +10 xfopen_for_read - 10 +10 popstring 134 140 +6 parse_inittab 396 401 +5 next_token 923 928 +5 pack_gzip 1659 1661 +2 bb__parsespent 117 119 +2 fallbackSort 1719 1717 -2 evalvar 1376 1374 -2 qrealloc 36 33 -3 ... ... ... ... singlemount 4579 4569 -10 process_stdin 443 433 -10 patch_main 1111 1101 -10 ifupdown_main 2175 2165 -10 file_action_grep 90 80 -10 uuidcache_init 649 637 -12 hush_main 797 785 -12 read_config 230 217 -13 dpkg_main 3835 3820 -15 read_line_input 3134 3110 -24 sysctl_main 232 203 -29 config_open 40 10 -30 WARN_BAD_LINE 44 - -44 login_main 1714 1575 -139 ------------------------------------------------------------------------------ (add/remove: 5/1 grow/shrink: 8/74 up/down: 174/-737) Total: -563 bytes
* whitespace fixesDenis Vlasenko2007-05-301-26/+26
|
* style fixes. No code changesDenis Vlasenko2007-04-121-2/+2
|
* - sed -e "s/char[[:space:]]*\*[[:space:]]*argv\[\]/char **argv/g"Bernhard Reutner-Fischer2007-04-042-2/+2
|
* fixdep.c: avoit doing memcmp in most casesDenis Vlasenko2006-12-301-3/+3
| | | | | uidgid_get.c: add forgotten copyright notice pwd/grp/shadow: avoid collisions with libc names
* saw commit of vapier@busybox.net (thanks!),Denis Vlasenko2006-12-301-17/+22
| | | | | decided to stop doing FOUR memcmp's per each input character. I should have fixed this much earlier...
* prevent accessing memory that we dont ownMike Frysinger2006-12-301-5/+5
|
* "kernel config" -> "busybox config"Denis Vlasenko2006-11-301-1/+1
| | | | suggested by Roberto A. Foglietta <roberto.foglietta@gmail.com>
* build system: check for ENABLE_, USE_ and SKIP_ (not only for CONFIG_)Denis Vlasenko2006-10-191-15/+21
|
* build system overhaulDenis Vlasenko2006-10-054-0/+1035