summaryrefslogtreecommitdiffstats
path: root/platform/linuxbsd
Commit message (Collapse)AuthorAgeFilesLines
* Linux: Remove use_static_cpp override on x86_32Rémi Verschelde2021-04-261-4/+1
| | | | | | | After further testing it seems to work fine now when building binaries with GCC 5 on Ubuntu 16.04 (previously we were using GCC 9 on Ubuntu 14.04). Follow-up to #45629.
* Fix macOS build with all sanitizers enabled.bruvzg2021-04-161-1/+1
|
* Add more sanitizer flags to shows more bugsRafał Mikrut2021-04-151-7/+21
|
* Style: Apply clang-tidy's `readability-braces-around-statements`Rémi Verschelde2021-04-051-2/+3
|
* Style: Apply clang-tidy's `modernize-use-nullptr`Rémi Verschelde2021-04-052-6/+6
|
* Rename Texture.get_data() to get_image()Marcel Admiraal2021-03-281-2/+2
|
* Rename some more global enums (Key, Joy, MIDI)Aaron Franke2021-03-232-6/+6
|
* Rename ButtonList enum and members to MouseButtonAaron Franke2021-03-231-1/+1
|
* Allow to not optimize release buildRafał Mikrut2021-03-141-2/+2
|
* Linux: Fix PRIME detection on SteamRémi Verschelde2021-03-081-1/+4
| | | | | | | | | | | To avoid trying to do PRIME detection on fake `libGL.so` as used by e.g. Renderdoc or Primus, we skip detection if there's a `libGL.so` in `LD_LIBRARY_PATH`... and our luck is that Steam defines it and includes system paths too, thus the actual system `libGL`... 🤦 So if we detect Steam, we skip this check. Co-authored-by: Hein-Pieter van Braam-Stewart <hp@tmm.cx>
* add msan sanitizer option for linus/bsd, lsan option for osxJordan Schidlowsky2021-03-021-1/+6
|
* Fix out of bounds array access on DisplayServerX11 codePedro Rodrigues2021-02-281-9/+11
| | | | | | | | | | | The problem happened on methods `screen_get_position`, `screen_get_usable_rect` and `window_set_current_screen` when they were passed a negative screen value. Fixes: - #46184 - #46185 - #46186
* Allow static linking with libatomic using clangHein-Pieter van Braam-Stewart2021-02-231-1/+6
| | | | | | | When using use_static_cpp we want to statically link with atomic as well to make sure we don't incur any new runtime dependencies. Scons doesn't quite support this so we do this little trick.
* Merge pull request #46256 from hpvb/dri-prime-amd-masterHein-Pieter van Braam2021-02-201-1/+2
|\ | | | | Add 'AMD' GPU vendor name to PRIME detector
| * Add 'AMD' GPU vendor name to PRIME detectorHein-Pieter van Braam-Stewart2021-02-201-1/+2
| | | | | | | | | | Apparently some recent Mesa version also changed AMD's vendor string. In addition I found a small uninitialized variable that's corrected now.
* | Use -latomic when linking whe using clang on LinuxHein-Pieter van Braam-Stewart2021-02-201-0/+1
|/ | | | | | | | According to the LLVM documentation when using GNU's libstdc++ clang will not automatically link with -latomic. This is necessary since we merged c++11 atomics support. This fixes linking using Clang on Linux
* An update to the dylibloader for older inttypesHein-Pieter van Braam-Stewart2021-02-203-276/+467
| | | | | | | | This #define's older inttypes to their newer versions and #includes <stdint.h> in the generated files. This will help with older glibc/compiler versions using headers generated on newer systems. This closes #46223
* Modernize atomicsPedro J. Estébanez2021-02-184-7/+7
| | | | | | | | | | - Based on C++11's `atomic` - Reworked `SafeRefCount` (based on the rewrite by @hpvb) - Replaced free atomic functions by the new `SafeNumeric<T>` - Replaced wrong cases of `volatile bool` by the new `SafeFlag` - Platform-specific implementations no longer needed Co-authored-by: Hein-Pieter van Braam-Stewart <hp@tmm.cx>
* Linux: Fix fallback logic when udev fails creating a contextRémi Verschelde2021-02-181-4/+6
| | | | Thanks to Noshyaar for pointing out the bug.
* Don't clobber original library symbolsHein-Pieter van Braam-Stewart2021-02-182-459/+551
| | | | | | | | | | | It appears that we can get a fun circle dependency on a shared object on some system configurations causing issues with our 'fake' function pointer names. This can lead to a crash. The new wrapper generator renames all the symbols so this can't happen anymore. See https://github.com/hpvb/dynload-wrapper/commit/704135e This closes #46140
* Dynamically load libudev.so.1 on Linux if `udev=yes`Rémi Verschelde2021-02-176-14/+1149
| | | | | | | | | | | | | | | | | | | This makes it possibly to run Linux binaries compiled with udev support on Linux systems which do not provide udev (typically systemd-less distros). If udev is missing, we fall back to parsing `/dev/input` like when compiled without udev support (`udev=no`). Also adding some verbose debug statements to know which method we're using when debugging Linux joypad issues. The libudev so wrappers were generated on Mageia 8 with libudev 246.9 using https://github.com/hpvb/dynload-wrapper: ``` ./generate-wrapper.py --include /usr/include/libudev.h --sys-include '<libudev.h>' \ --soname libudev.so.1 --init-name libudev --omit-prefix gnu_ \ --output-header libudev-so_wrap.h --output-implementation libudev-so_wrap.c ```
* Dynamically load libpulse.so.0 and libasound.so.1 on LinuxHein-Pieter van Braam-Stewart2021-02-161-3/+2
| | | | | | | | | | | | By generating stubs using https://github.com/hpvb/dynload-wrapper we can dynamically load libpulse and libasound on systems where it is available. Both are still a build-time requirement but no longer a run-time dependency. For maintenance purposes the wrappers should not need to be re-generated unless we want to bump pulse or asound to an incompatible version. It is unlikely we will want to do this any time soon. This closes #20978
* SCons: Fix debug_symbols tests after switch to BoolVariableRémi Verschelde2021-02-082-3/+3
| | | | | | Bug introduced in #45679. Fixes part of #45816.
* SCons: Add `production=yes` option to use production defaultsRémi Verschelde2021-02-031-1/+1
| | | | | | | | | | | | | | | | | | | This is meant for users making custom builds to match the options used on optimized, official builds. This enables, on the platforms which support them: - `use_static_cpp=yes` (portable binaries for Linux and Windows) - `use_lto=yes` (link time optimizations - note: requires a lot of RAM!) - `debug_symbols=no` (no debug symbols, smaller binaries) Also abort when using MSVC with `production=yes`, as: - It cannot optimize the GDScript VM like GCC or Clang do, leading to significant performance drops. - Its LTO support is unreliable, at least used to trigger crashes last we tried it extensively. All options can still be overridden if specified, and the `dev=yes` option was changed to also support overrides.
* Merge pull request #45630 from akien-mga/linux-enable-udevRémi Verschelde2021-02-011-1/+1
|\ | | | | Linux: Enable udev support by default
| * Linux: Enable udev support by defaultRémi Verschelde2021-02-011-1/+1
| | | | | | | | | | | | | | | | | | This has been enabled for years in official binaries, and users making custom builds may end up not enabling it unknowingly, so it's best if we default to the same as what official builds do. The original reason for having it opt-in was likely the addition of a dependency on libudev, but that should be fairly ubiquitous by now.
* | Linux: Build with use_static_cpp=yes by default for x86_64Rémi Verschelde2021-02-011-2/+5
|/ | | | | | | | This enables `-static-libgcc -static-libstdc++` which help make custom Linux builds more portable (official builds have been using this option for years). For some obscure reason Ubuntu 18.04 i386 crashes when using the option for i386 builds, so let's play it safe and enable for x86_64 only for now.
* Merge pull request #45315 from RandomShaper/modernize_threadRémi Verschelde2021-01-314-9/+6
|\ | | | | Modernize Thread
| * Modernize ThreadPedro J. Estébanez2021-01-294-9/+6
| | | | | | | | | | | | | | | | | | - Based on C++11's `thread` and `thread_local` - No more need to allocate-deallocate or check for null - No pointer anymore, just a member variable - Platform-specific implementations no longer needed (except for the few cases of non-portable functions) - Simpler for `NO_THREADS` - Thread ids are now the same across platforms (main is 1; others follow)
* | Unify URI encoding/decoding and add to C#Aaron Franke2021-01-282-2/+2
| | | | | | | | http_escape and percent_encode have been unified into uri_encode, and http_unescape and percent_decode have been unified into uri_decode.
* | Go through all event devices, not just event[0-32]Jari Ronkainen2021-01-271-4/+15
|/ | | | | | | | | | | | | There are no guarantees that joypads are in event0-event32 range. Some devices, such as laptops with detachable keyboards and wacom can reserve events all the way up to 32. Some udev rules with e.g. custom controller firmwares may load the device as /dev/input/eventX, where X is greater than 32. This patch uses POSIX dirent to enumerate the event devices, so entries outside 0-32 range are not skipped.
* Split OS::execute into two methodsMarcel Admiraal2021-01-093-12/+12
| | | | | 1. execute(): Executes a command and returns the results. 2. create_process(): Creates a new process and returns the new process' id.
* Update copyright statements to 2021Rémi Verschelde2021-01-0120-40/+40
| | | | | | | | | | | | | | Happy new year to the wonderful Godot community! 2020 has been a tough year for most of us personally, but a good year for Godot development nonetheless with a huge amount of work done towards Godot 4.0 and great improvements backported to the long-lived 3.2 branch. We've had close to 400 contributors to engine code this year, authoring near 7,000 commit! (And that's only for the `master` branch and for the engine code, there's a lot more when counting docs, demos and other first-party repos.) Here's to a great year 2021 for all Godot users 🎆
* Merge pull request #44593 from madmiraal/rename-mainloop-methodsRémi Verschelde2020-12-281-2/+2
|\ | | | | Rename MainLoop methods to match Node methods
| * Rename MainLoop methods to match Node methodsMarcel Admiraal2020-12-221-2/+2
| |
* | Rename empty() to is_empty()Marcel Admiraal2020-12-282-4/+4
|/
* Add override keywords to core/os.h derived classes.Marcel Admiraal2020-12-171-17/+17
|
* SCons: Add only selected platform's opts to envRémi Verschelde2020-12-161-3/+0
| | | | | | | | | | | Otherwise we can get situations where platform-specific opts with the same name can override each other depending on the order at which platforms are parsed, as was the case with `use_static_cpp` in Linux/Windows. Fixes #44304. This also has the added benefit that the `scons --help` output will now only include the options which are relevant for the selected (or detected) platform.
* Fix named anonymous struct warningMarcel Admiraal2020-12-162-9/+9
|
* Merge pull request #43742 from qarmin/editor_modules_default_valuesRémi Verschelde2020-12-084-32/+22
|\ | | | | Initialize class/struct variables with default values in platform/ and editor/
| * Initialize class/struct variables with default values in platform/ and editor/Rafał Mikrut2020-12-024-32/+22
| |
* | Merge pull request #44021 from dakennedyd/personalRémi Verschelde2020-12-071-32/+114
|\ \ | | | | | | Fix implementation of move_to_trash() on Linux
| * | Fixes move_to_trash() on LinuxDavid Kennedy2020-12-071-32/+114
| |/ | | | | | | Fixes #42840 OS move_to_trash() on Linux is not compliant with the Freedesktop specification
* | RenderingServer reorganizationreduz2020-12-043-4/+4
| |
* | Reorganize rendering server.reduz2020-12-031-1/+1
| | | | | | | | | | -Made RenderingServerScene abstract, allowing reimplementation -RenderingServerRaster -> RenderingServerDefault, but this class is going away soon.
* | X11: Include limits.h for LONG_MAXRémi Verschelde2020-12-021-0/+1
|/ | | | Fixes #44030.
* Merge pull request #41100 from bruvzg/ctl_text_server_interfaceRémi Verschelde2020-11-281-1/+18
|\ | | | | [Complex Text Layouts] Implement TextServer interface.
| * [Complex Text Layouts] Add third-party TextServer dependencies (ICU, ↵bruvzg2020-11-261-1/+18
| | | | | | | | HarfBuzz, Graphite).
* | Implement INCR mechanism for Linux clipboardPouleyKetchoupp2020-11-272-25/+105
|/ | | | | Allows pasting from x11 clipboard to receive data incrementally, which is required when handling data size > 256KB.
* Merge pull request #42652 from nekomatata/x11-clipboard-save-targetsRémi Verschelde2020-11-262-50/+177
|\ | | | | Implement SAVE_TARGETS mechanism for Linux clipboard