aboutsummaryrefslogtreecommitdiff
path: root/Makefile.flags (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge busybox into mergeRon Yorston2021-12-271-2/+2
|\ | | | | | | Fix merge conflict in coreutils/timeout.c.
| * Makefile.flags: use all cflags for crypt and rt checksMartin Kaiser2021-12-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To check if libcrypt and librt are available, we check if we can compile and link a simple test program. These checks do not match the actual linking if CONFIG_STATIC is enabled. For CONFIG_STATIC, CFLAGS_busybox is set to -static. The checks don't use CFLAGS_busybox and detect a shared libcrypt or librt. If we link busybox later and we have no static libcrypt or librt, linking will fail. Update the libcrypt and librt checks to use CFLAGS_busybox. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | win32: add local dirent implementationRon Yorston2021-06-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Add a cut down version of the dirent implementation from git. The git developers said: The mingw-runtime implemenation of opendir, readdir and closedir sets errno to 0 on success, something that POSIX explicitly forbids. This also avoids having to link against libssp.a (commit 13eb34205) and reduces the size of the binary by 2KB.
* | Merge branch 'busybox' into mergeRon Yorston2021-05-141-5/+8
|\|
| * Makefile.flags: add a test for -lrt availabilityDenys Vlasenko2021-04-141-5/+8
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Post-merge build fixesRon Yorston2021-03-011-1/+1
| |
* | Merge branch 'busybox' into mergeRon Yorston2021-03-011-6/+1
|\|
| * trylink: do not drop libs from CONFIG_EXTRA_LDLIBSDenys Vlasenko2021-02-231-5/+0
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * Makefile.flags: fix the OS detection for libresolvMartin Kaiser2021-02-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 054493350 ("Do not add -lresolv on non-Linux systems") adds a condition to link with libresolv only on linux systems. The check requires that CONFIG_UNAME_OSNAME equals Linux. This works only if the uname applet is enabled. Otherwise, CONFIG_UNAME_OSNAME is empty, regardless of the platform. By default, CONFIG_UNAME_OSNAME is the output of uname -o. For most linux systems, uname -o returns "GNU/Linux" and the check fails. In this case, linking a static busybox fails because of missing symbols from libresolv. networking/lib.a(nslookup.o): In function `add_query': nslookup.c:789: undefined reference to `__res_mkquery' networking/lib.a(nslookup.o): In function `parse_reply': nslookup.c:355: undefined reference to `ns_initparse' nslookup.c:361: undefined reference to `ns_parserr' nslookup.c:404: undefined reference to `ns_name_uncompress' nslookup.c:418: undefined reference to `ns_get16' nslookup.c:419: undefined reference to `ns_name_uncompress' .. nslookup.c:456: undefined reference to `ns_get16' ... nslookup.c:469: undefined reference to `ns_name_uncompress' ... nslookup.c:489: undefined reference to `ns_get32' ... collect2: error: ld returned 1 exit status This patch uses the output of $CC -dumpmachine to detect the target platform for which we compile. Both gcc and clang support -dumpmachine. Like the original patch, we link against libresolv only if our target platform is linux-based. Fixes: 054493350 ("Do not add -lresolv on non-Linux systems") Signed-off-by: Martin Kaiser <martin@kaiser.cx> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* | Merge branch 'busybox' into mergeRon Yorston2021-01-141-1/+4
|\|
| * Do not add -lresolv on non-Linux systemsAlex Samorukov2021-01-041-0/+2
| | | | | | | | | | | | | | | | On FreeBSD getaddrinfo and friends are part of libc. Other OS-es will also have own dependencies Signed-off-by: Alex Samorukov <samm@os2.kiev.ua> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * build system: make -static-libgcc selectable in configDenys Vlasenko2020-12-161-1/+2
| | | | | | | | | | | | OpenWrt wants this off. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | build system: use static ssp libraryRon Yorston2020-11-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The previous commit got rid of a link error but generates a binary that isn't standalone: it requires libssp-0.dll. Force the use of the static ssp library. This also requires mingwex to be added to LDLIBS, since that's what has a dependency on ssp. Other workarounds are to compile with non-zero _FORTIFY_SOURCE (which increases the size of the binary) or to add '-u ___strcpy_chk' to LDFLAGS (likely to be fragile).
* | build: add ssp libraryRon Yorston2020-11-111-1/+1
| | | | | | | | | | | | | | With recent MinGW-w64 we get an undefined reference to __strcpy_chk if we don't include ssp. https://sourceforge.net/p/mingw-w64/bugs/818/
* | win32: alter build flagsFRP-3532-g01a256149Ron Yorston2020-07-091-1/+1
| | | | | | | | | | Add -fno-builtin-strndup to the build flags, otherwise builds with link-time optimisation can't find strndup.
* | Merge branch 'busybox' into mergeRon Yorston2020-07-091-0/+2
|\|
| * Makefile.flags: restrict Wno-constant-logical-operand and ↵Biswapriyo Nath2020-06-101-0/+2
| | | | | | | | | | | | | | | | | | | | Wno-string-plus-int options for clang these options were added in b4ef2e3467d8e980ccf13c9dd342459c013b455f commit gcc shows unrecognized command-line option warnings Signed-off-by: Biswapriyo Nath <nathbappai@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | win32: use lazy loading for certain DLLsRon Yorston2020-06-021-1/+1
| | | | | | | | | | | | | | | | | | Only a handful of functions are used from shell32.dll, userenv.dll and psapi.dll. Mostly these functions are in out of the way places. By loading the functions only when required we can avoid the startup cost of linking the three DLLs in the common case that they aren't needed.
* | Merge branch 'busybox' into mergeFRP-3466-g53c09d0e1Ron Yorston2020-05-291-1/+2
|\|
| * build system: remove KBUILD_STR()Jean-Philippe Brucker2020-04-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using GNU Make >=4.3, the KBUILD_STR() definition interferes badly with dependency checks during build, and forces a complete rebuild every time Make runs. In if_changed_rule, Kconfig checks if the command used to build a file has changed since last execution. The previous command is stored in the generated .<file>.o.cmd file. For example applets/.applets.o.cmd defines a "cmd_applets/applets.o" variable: cmd_applets/applets.o := gcc ... -D"KBUILD_STR(s)=#s" ... Here the '#' should be escaped with a backslash, otherwise GNU Make interprets it as starting a comment, and ignore the rest of the variable. As a result of this truncation, the previous command doesn't equal the new command and Make rebuilds each target. The problem started to appear when GNU Make 4.3 (released January 2020), introduced a backward-incompatible fix to macros containing a '#'. While the above use of '#', a simple Make variable, still needs to be escaped, a '#' within a function invocation doesn't need to be escaped anymore. As Martin Dorey explained on the GNU Make discussion [1], the above declaration is generated from make-cmd, defined as: make-cmd = $(subst \#,\\\#,$(subst $$,$$$$,$(call escsq,$(cmd_$(1)))) Since GNU Make 4.3, the first argument of subst should not have a backslash. make-cmd now looks for literally \# and doesn't find it, and as a result doesn't add the backslash when generating .o.cmd files. [1] http://savannah.gnu.org/bugs/?20513 We could fix it by changing make-cmd to "$(subst #,\#,...)", but to avoid compatibility headaches, simply get rid of the KBUILD_STR definition, as done in Linux by b42841b7bb62 ("kbuild: Get rid of KBUILD_STR"). Quote the string arguments directly rather than asking the preprocessor to quote them. Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Build fixesFRP-3329-gcf0fa4d13Ron Yorston2020-01-081-0/+2
| | | | | | | | | | | | - Update configuration files - Omit unnecessary libraries - Replace fake stime(2) with fake clock_settime(2)
* | Merge branch 'busybox' into mergeRon Yorston2020-01-081-5/+26
|\|
| * Makefile.flags: suppress some clang-9 warningsDenys Vlasenko2019-10-251-3/+22
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * Remove syscall wrappers around clock_gettime, closes 12091Denys Vlasenko2019-10-241-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 12091 "Direct use of __NR_clock_gettime is not time64-safe". function old new delta runsv_main 1698 1712 +14 startservice 378 383 +5 get_mono 31 25 -6 date_main 932 926 -6 gettimeofday_ns 17 - -17 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 2/2 up/down: 19/-29) Total: -10 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2018-05-131-0/+4
|\|
| * build system: FEATURE_NSLOOKUP_BIG needs -lresolvDenys Vlasenko2018-04-161-0/+4
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | ps: obtain applet names from other BusyBox processesRon Yorston2018-04-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the code which passed applet names to child processes using environment variables. This only allowed ps to display names for its ancestors. Instead attempt to read applet names from the memory of unrelated processes. The Microsoft documentation alone wasn't enough to figure out how to do this. Additional hints from: https://stackoverflow.com/questions/4298331/exe-or-dll-image-base-address https://stackoverflow.com/questions/14467229/get-base-address-of-process
* | Merge branch 'busybox' into mergeRon Yorston2017-07-181-2/+1
|\|
| * Change BB_EXTRA_VERSION: now it needs to contain any spaces/parenthesisDenys Vlasenko2017-07-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this change, BB_EXTRA_VERSION of "" resulted in: "BusyBox v1.28.0.git () multi-call binary" message, after the fix it is: "BusyBox v1.28.0.git multi-call binary" While at it, eliminate BB_BT and BANNER single-use macros. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | mingw: add -fno-ident to CFLAGSRon Yorston2016-02-221-2/+1
| | | | | | | | | | | | | | | | Without this flag a compiler version string is injected into each binary object. The linker doesn't deduplicate the strings, leading to bloat. This enhancement was suggested by Viktor Szakats. It saves 13KB.
* | Merge branch 'busybox' into mergeRon Yorston2016-02-221-0/+5
|\|
| * build: add a sanitizer debug optionMike Frysinger2016-02-121-0/+5
| | | | | | | | | | | | | | | | | | Building & running with ASAN is super helpful, so add a dedicated config knob for it. This way people don't have to guess at the right compiler settings in order to get a good build. We can just tell people to enable this one option. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* | Merge branch 'busybox' into mergeRon Yorston2015-10-131-8/+15
|\|
| * build system: remove special-casing for extra libsDenys Vlasenko2015-10-121-14/+11
| | | | | | | | | | | | It is not reliable (tried on three systems, multiple problems). Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * build system: -fno-builtin-printfDenys Vlasenko2015-10-071-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Benefits are: drops reference to out-of-line putchar(), fixes a few cases of failed string merge. function old new delta i2cdump_main 1488 1502 +14 sha256_process_block64 423 433 +10 sendmail_main 1183 1185 +2 list_table 1114 1116 +2 i2cdetect_main 1235 1237 +2 fdisk_main 2852 2854 +2 builtin_type 119 121 +2 unicode_conv_to_printable2 325 324 -1 scan_recursive 380 378 -2 mkfs_minix_main 2687 2684 -3 buffer_fill_and_print 178 169 -9 putchar 152 - -152 ------------------------------------------------------------------------------ (add/remove: 0/2 grow/shrink: 7/4 up/down: 34/-167) Total: -133 bytes text data bss dec hex filename 937788 932 17676 956396 e97ec busybox_old 937564 932 17676 956172 e970c busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * Aboriginal linux/musl build fixesDenys Vlasenko2015-10-051-0/+2
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * Makefile.flags: survive a build system which has no pthreadDenys Vlasenko2015-09-041-1/+6
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * Makefile: add missing libraries to LDLIBSBartosz Golaszewski2015-08-171-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Static build with CONFIG_PAM fails on Debian Jessie due to undefined references to libdl and libaudit. Static build without pam, but with libcrypt required fails as well due to undefined references to libpthread. Fix these two cases by adding the missing libraries to LDLIBS when appropriate. Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | libbb: really add build details to bannerRon Yorston2015-06-231-1/+2
| | | | | | | | Look at the environment variable during compilation, not runtime.
* | Merge branch 'busybox' into mergeFRPRon Yorston2015-05-181-1/+1
|\|
| * build system: make CONFIG_EXTRA_LDFLAGS go to LDFLAGS, not EXTRA_LDFLAGSDenys Vlasenko2015-04-141-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Drop CONFIG_WIN32_NET settingRon Yorston2014-03-171-4/+1
| |
* | Merge branch 'busybox' into mergeRon Yorston2012-12-111-1/+11
|\|
| * build system: use pkg-config to look up selinux libsMike Frysinger2012-10-201-1/+11
| | | | | | | | | | | | | | | | Newer versions of libselinux has started linking against more libs. Rather than continuing hardcoding things, switch to using pkg-config to query for its dependencies. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* | Merge branch 'busybox' into mergeRon Yorston2012-09-071-0/+4
|\| | | | | | | | | | | Conflicts: include/libbb.h shell/ash.c
| * build system: stop .eh_frame generationDenys Vlasenko2012-09-041-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From Rich Felker: By default, modern GCC generates DWARF2 debug/unwind tables in the .eh_frame section of the object files/binaries. This adds significant bloat (as much as 15%) to the size of the busybox binary, including the portion mapped/loaded into memory at runtime (possibly a big issue for NOMMU targets), and the section is not strippable with the strip command due to being part of the loaded program text. I've since done some further checking - both testing and asking the GCC developers about it - and it seems the solution is to add to the CFLAGS -fno-unwind-tables and -fno-asynchronous-unwind-tables. If debugging is disabled, this will prevent GCC from outputting DWARF2 tables entirely. But since busybox builds with -g by default, the interesting case is what happens then. I originally thought these options would break debugging, but they don't; instead, they tell GCC to output the DWARF2 tables in the .debug_frame section instead of the newish .eh_frame section (used for exception handling). With these options added, busybox_unstripped is still fully debuggable, and the final busybox binary loses the 15% bloat factor from the DWARF2 tables. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * disable format security warningsMike Frysinger2012-08-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We pass strings to printf directly a lot. Some distros enable some flags in their gcc by default like -Wformat-security. With these two things, we end up with a lot of build warnings like so: loginutils/chpasswd.c:42:3: warning: format not a string literal and no format arguments [-Wformat-security] But we don't care. Our focus is first and foremost on size, so adding a lot of dummy calls like: - printf(some_constant_string); + printf("%s", some_constant_string); is pointless bloat. Disable this warning flag if the compiler supports it. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* | win32: support fancy prompts and (limited) tilde expansionRon Yorston2012-04-231-0/+1
| |
* | Merge commit '1_20_0' into mergeRon Yorston2012-04-231-1/+4
|\|
| * fix build breakage with gcc 4.2.1Denys Vlasenko2012-04-201-1/+4
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>