summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Discard -Xpreprocessor and following argument for remote compilation, as ↵dfink2022-06-101-1/+2
| | | | this switch is recognized by gcc and clang, and clang warns about unused command-line args: -Wunused-command-line-argument warning
* typo fixRasmus2022-05-201-1/+1
|
* src/dopt.c: increase arg_max_jobs limit to max int00gh2022-03-311-2/+2
| | | | Issue #452. jobs limit
* Fix varous source documentation typosluz paz2022-02-182-2/+2
| | | Found via `codespell -q 3 -S ./ChangeLog -L ake,ba,msdos,paralel,te`
* Improved cross-rewriting on non-x86 systemsAlexey Sheplyakov2021-09-301-7/+3
| | | | | | | | | | | | | | | Unfortunately autoconf and GCC don't agree on the system name: - On arm (aarch64): `GNU_HOST` is `aarch64-unknown-linux-gnu`, and GCC triple is `aarch64-linux-gnu` instead. - On rpm-based x86_64 distros: `GNU_HOST` is `x86_64-pc-linux-gnu`, and GCC triple is `x86_64-redhat-linux` Therefore ask the compiler (when running distcc configure script) how to correctly identify it. Closes: #440 ALTBUG: 40425
* Merge pull request #438 from asheplyakov/fix-434Shawn Landden2021-09-273-17/+41
|\ | | | | Restrict number of retries when backoff is disabled
| * Restrict the number of retries when DISTCC_BACKOFF is disabledAlexey Sheplyakov2021-08-301-1/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | Since the commit a7dd5cf90e8c ("Try a new host after failing to connect instead of immediately falling back to localhost") distcc tries to choose a different host on connection/protocol errors. However when backoff is disabled (DISTCC_BACKOFF_PERIOD=0) distcc keeps retrying forever. To avoid the problem limit the number of retries (currently to 3) when backoff is disabled. Closes: #434
| * backoff.c: added dcc_backof_is_enabled() helper functionAlexey Sheplyakov2021-08-302-16/+18
| |
* | Merge pull request #417 from asheplyakov/clang-distcc-linuxkernel-compileShawn Landden2021-09-273-0/+19
|\ \ | | | | | | Improved cross-compilation with clang
| * | Improved cross-compilation with clangAlexey Sheplyakov2021-02-243-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With this patch I can cross-compile Linux kernel with clang and distcc. Otherwise both remote compilation and local fallback fail like this: cat > foo.c <<-EOF int main(int argc, char **argv) { return 0; } EOF env DISTCC_HOSTS=127.0.0.1 distcc clang -c --target=aarch64-linux-gnu- -o foo.o foo.c error: unknown target triple 'unknown', please use -triple or -arch distcc[304773] ERROR: compile foo.c on 127.0.0.1 failed distcc[304773] (dcc_build_somewhere) Warning: remote compilation of 'foo.c' failed, retrying locally distcc[304773] Warning: failed to distribute foo.c to 127.0.0.1, running locally instead error: unknown target triple 'unknown', please use -triple or -arch distcc[304773] ERROR: compile foo.c on localhost failed Linux' kernel makefiles specify the target arch with `--target=foo`, and distcc expects `-target foo`, hence the problem. Closes: #416
* | | distccd: add --oom-score-adj option (Linux only)Matt Whitlock2021-09-044-0/+35
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | This new option sets /proc/self/oom_score_adj in prefork worker child processes. This can afford users a bit of protection against a scenario in which many concurrent compilation jobs cause an out-of-memory condition that prompts the kernel's OOM killer to kill a process that is not so "disposable" as a distccd worker. This commit adds a new Autoconf test to check whether the host system type (that is, the type of the system on which the compiled binaries are to be run) is Linux. The new --oom-score-adj option is implemented only if the host system type is Linux.
* | distccd: check for approved compilers in /usr/lib/distccAlexey Sheplyakov2021-07-211-6/+1
| | | | | | | | | | | | | | | | `dcc_check_compiler_whitelist` bails out if $prefix/lib/distcc directory does not exists. With this patch it keeps looking in /usr/lib/distcc instead. Closes: #431
* | Merge pull request #429 from asheplyakov/distribute-lto-againShawn Landden2021-07-161-3/+0
|\ \ | | | | | | Revert "Skip distributing LTO cc invocations"
| * | Revert "Skip distributing LTO cc invocations"Alexey Sheplyakov2021-07-121-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 8dacd28d888210753e9457eb31175d8e2a1c348e. The "LTO invocations are not worth distributing" statement is in general wrong. GCC generates the (target) machine code for every compilation unit even with `-flto` (so it makes sense to distribute these). And the whole program analysis is not guaranteed to be the bottleneck of the build. As a matter of fact distributing LTO compilations reduces the build time of LLVM/clang, GCC, and other programs (especially C++ ones). Closes: #428
* | | dcc_gcc_rewrite_fqn: avoid heap corruptionAlexey Sheplyakov2021-07-101-1/+1
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On ALT Linux I've run into the following bug: distcc gcc -Wall -std=gnu89 -I. -O2 -o hello.o -c hello.c free(): invalid next size (fast) Aborted (core dumped) Apparently dcc_gcc_rewrite writes beyond the allocated memory: valgrind --leak-check=full -v ./distcc gcc -Wall -std=gnu89 -I. -O2 -o hello.o -c hello.c ==11382== ERROR SUMMARY: 53 errors from 5 contexts (suppressed: 0 from 0) ==11382== ==11382== 1 errors in context 1 of 5: ==11382== Invalid write of size 1 ==11382== at 0x4C349D8: strcat (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==11382== by 0x10D165: dcc_gcc_rewrite_fqn (compile.c:611) ==11382== by 0x10D4B4: dcc_build_somewhere (compile.c:725) ==11382== by 0x10DC01: dcc_build_somewhere_timed (compile.c:1014) ==11382== by 0x10E380: main (distcc.c:352) ==11382== Address 0x544e828 is 1 bytes after a block of size 23 alloc'd ==11382== at 0x4C31B0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==11382== by 0x10D087: dcc_gcc_rewrite_fqn (compile.c:588) ==11382== by 0x10D4B4: dcc_build_somewhere (compile.c:725) ==11382== by 0x10DC01: dcc_build_somewhere_timed (compile.c:1014) ==11382== by 0x10E380: main (distcc.c:352) ==11382== ==11382== ==11382== 1 errors in context 2 of 5: ==11382== Invalid write of size 1 ==11382== at 0x4C349C8: strcat (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==11382== by 0x10D165: dcc_gcc_rewrite_fqn (compile.c:611) ==11382== by 0x10D4B4: dcc_build_somewhere (compile.c:725) ==11382== by 0x10DC01: dcc_build_somewhere_timed (compile.c:1014) ==11382== by 0x10E380: main (distcc.c:352) ==11382== Address 0x544e827 is 0 bytes after a block of size 23 alloc'd ==11382== at 0x4C31B0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==11382== by 0x10D087: dcc_gcc_rewrite_fqn (compile.c:588) ==11382== by 0x10D4B4: dcc_build_somewhere (compile.c:725) ==11382== by 0x10DC01: dcc_build_somewhere_timed (compile.c:1014) ==11382== by 0x10E380: main (distcc.c:352) and ALT Linux' hardened glibc does not quite like that. Correctly compute the `newcmd_len` to avoid the problem. ALTBUG: #40425
* | prefork: use available cores more efficientlyAlexey Sheplyakov2021-04-271-10/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Observed behavior ----------------- When compiling a big C project (Linux kernel) with distcc compilation nodes never use 100% of CPU time, instead a system is 25 -- 40% idle (despite --jobs is set to 3x the number of cores). Analysis -------- Linux kernel consists of many relatively small C sources and header files. Compiling a single source file typically takes a fraction of a second (although there are quite a number of "heavier" sources). `dcc_preforked_child` exits after 50 requests. Thus a typical lifetime of a worker process is just a few seconds. However `dcc_create_kids` sleeps for a second after every fork. Also `dcc_preforked_child` sleeps for yet another second. Which is >= 25% of a typical child lifetime. As a result distccd is unable to use available CPU time (system load is always <= 75% during the compilation). Fix --- Removed `sleep` from `dcc_preforking_parent` and `dcc_create_kids`. Also made `dcc_preforked_child` process compilation jobs for at least 60 seconds. Result ------ Kernel compilation time (two 6-core nodes) reduced almost 2x: before: 20 minutes, after: 12 minutes Closes: #420
* | Skip distributing LTO cc invocationsStephanie Wilde-Hobbs2021-02-071-0/+3
|/
* Merge pull request #404 from swegener/memory-and-file-descriptor-leaksShawn Landden2021-01-062-8/+18
|\ | | | | Fix memory and file descriptor leaks
| * serve: Correctly check asprintf() result and free memorySven Wegener2020-11-261-8/+9
| | | | | | | | | | asprintf() returns -1 on failure, which evaluates to true, and the resulting string is undefined in this case.
| * Close directories after checkingSven Wegener2020-11-262-0/+9
| |
* | Get rid of very "retro" and dead codeNick Østergaard2021-01-051-8/+0
| | | | | | | | | | | | | | At least that is what the experts in #gtk are telling me. "Unless you want to support libgnome, which was deprecated long before GNOME3 was released: yes, you can drop it."
* | Remove debug print that is no longer neededNick Østergaard2021-01-051-1/+0
| |
* | Merge pull request #407 from nickoe/gtk3Shawn Landden2021-01-053-115/+74
|\ \ | | | | | | Port distccmon-gnome from gtk2 to gtk3
| * | Fix incompatible type caseNick Østergaard2021-01-031-2/+4
| | |
| * | Fixup whitespace alignmentNick Østergaard2021-01-031-11/+11
| | |
| * | Replace gdk_cairo_set_source_color with gdk_cairo_set_source_rgbaNick Østergaard2021-01-033-27/+30
| | |
| * | Remove manual alignmentNick Østergaard2021-01-031-7/+3
| | | | | | | | | | | | | | | | | | This does not seem to be needed anymore, if it ever was... This removes deprecated gtk_alignment_new function.
| * | Replace deprecated gtk_vbox_new with gtk_box_newNick Østergaard2021-01-031-2/+10
| | |
| * | Slim down the ridiculous tall gtk3 statusbarNick Østergaard2021-01-031-0/+2
| | |
| * | Remove get_size stuffNick Østergaard2021-01-031-18/+0
| | | | | | | | | | | | | | | This seems to work and look the same as before, except that it does not crash and I don't see the wierd big bars anymore.
| * | Remvove more unneeded graphics contextNick Østergaard2021-01-033-23/+0
| | |
| * | Reomve color initializationNick Østergaard2021-01-033-48/+5
| | | | | | | | | | | | As it seems that this is not needed for gtk3 with the cairo stuff.
| * | Initial work on a gtk3 portNick Østergaard2021-01-033-17/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Try to align function prototypes Actually works, but is a bit unstable. Bar can appear in left pane or right pane and fill the whole window height, or it can outright crash randomly. Maybe mostly when resizing the window? Or certainly when you click the area with the bars.
* | | Fix ddbb9454ad (rename function to avoid collision with libsystemd)Shawn Landden2021-01-031-2/+2
| | |
* | | rename conflicting functionShawn Landden2021-01-033-4/+4
| | | | | | | | | | | | Closes: #402
* | | Fix various typosluz paz2020-12-173-3/+3
|/ / | | | | Found via `codespell v2.1.dev0`
* | loadfile: Fix wrong errno for missing fileSven Wegener2020-11-251-1/+1
| | | | | | | | | | | | | | EEXIST is for existing files on exclusive creation, the correct one for missing files is ENOENT. Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
* | argutil: Quote the empty string in dcc_argv_tostr()Sven Wegener2020-11-251-1/+1
|/ | | | | | | | I have debugged an issue where the command line contained an empty argument. It was quite hard to debug, because the debug log did not show the empty argument properly. Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
* Fix bug indicated by clang warning:Mitchell Blank Jr2020-10-131-1/+2
| | | | | | | | src/clirpc.c:126:9: warning: code will never be executed [-Wunreachable-code] It looks like ~12 years ago someone added a log statement to this if() block while they had Python on their mind. This means that the "expected version" check has been broken that entire time.
* initialize memory before strcat to avoid heap overflowpage42020-08-081-1/+4
|
* fixup 2Shawn Landden2020-07-131-0/+1
|
* Fix up last commitShawn Landden2020-07-101-0/+1
|
* Fix compiler warnings on Cygwin/MSYS2Orgad Shaneh2020-07-103-6/+6
| | | | | Cygwin uses macros for isspace, isdigit etc. that intentionally issue a warning when the argument is char (-Wchar-subscripts).
* tempfile: Fix build on Cygwin/MSYS2Orgad Shaneh2020-07-091-0/+1
| | | | | | | | src is in the include paths (the Makefile has -Isrc), and it contains rpc.h, which collides with an internal header with the same name inside /usr/include/w32api. This leads to compiler errors. Fix by defining WIN32_LEAN_AND_MEAN, which prevents inclusion of rpc stuff.
* Only add -MMD for pump mode if not present alreadyRosen Matev2020-06-301-1/+3
| | | | | | | | | | | | | | | | | | Currently, distccd unconditionally adds `-MMD` to the compiler invocation in pump mode. This leads to undesired behaviour if one passes `-MD` to the compiler. For GCC, this leads to prefering `-MMD`, which is more restrictive and might cause incorrect builds due to missed system header dependensies. OTOH, Clang prefers `-MD`, which is safer but emits the following warning: ``` clang-8: warning: argument unused during compilation: '-MMD' [-Wunused-command-line-argument] ``` The changes here fix this by only adding `-MMD` if neither `-MMD` nor `-MD` is already present. Some exceptions in the tests, related to this bug, are removed and the corresponding tests are now passing for Clang and GCC.
* Fix build with gcc 10 which defaults to -fno-common (cf ↵Romain Geissler2020-01-271-1/+1
| | | | | | | | | | https://gcc.gnu.org/gcc-10/porting_to.html) This fixes the following link error I see when I use the latest gcc 10 git branch: /opt/1A/toolchain/x86_64-v20.0.7/lib/gcc/x86_64-1a-linux-gnu/10.0.1/../../../../x86_64-1a-linux-gnu/bin/ld: src/serve.o:(.bss+0x0): multiple definition of `stats_text'; src/prefork.o:(.bss+0x0): first defined here /opt/1A/toolchain/x86_64-v20.0.7/lib/gcc/x86_64-1a-linux-gnu/10.0.1/../../../../x86_64-1a-linux-gnu/bin/ld: src/stats.o:(.data+0x20): multiple definition of `stats_text'; src/prefork.o:(.bss+0x0): first defined here collect2: error: ld returned 1 exit status
* Merge pull request #365 from nadiasvertex/masterShawn Landden2020-01-221-1/+2
|\ | | | | Ignore -stdlib c++ command-line parameter
| * Ignore -stdlib c++ command-line parameterChristopher Nelson2019-10-291-1/+2
| |
* | Allow daemon DNS lookup of allowed hostnamesDana Sorensen2019-11-281-1/+1
| | | | | | | | | | | | Removed the flag that only allows numeric IP addresses for the allowed clients. DNS lookup will only be performed if configured with --enable-rfc2553.
* | Try a new host after failing to connect instead of immediately falling back ↵Anthony Bilinski2019-11-231-13/+19
|/ | | | to localhost