Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux: Build with use_static_cpp=yes by default #45629

Merged
merged 1 commit into from
Feb 1, 2021

Conversation

akien-mga
Copy link
Member

@akien-mga akien-mga commented Feb 1, 2021

This enables -static-libgcc -static-libstdc++ which help make custom Linux
builds more portable (official builds have been using this option for years).


Note: I need to do some tests before merging as for official builds on Ubuntu 14.04 i386 I'm actually not using those, I probably ran into issues in the past and forgot to document them...
https://github.com/godotengine/godot-build-scripts/blob/master/build-linux/build.sh#L15-L17

Edit: "Solved", see below.


Note: Distro packagers should typically set this option to no to keep using the distro-provided shared libgcc and libstdc++. This option is only for builds that need to be shared with users on other distros (which is the main use case for custom Godot builds, but not the one Linux distro packages).

@akien-mga akien-mga added enhancement platform:linuxbsd topic:buildsystem cherrypick:3.x Considered for cherry-picking into a future 3.x release labels Feb 1, 2021
@akien-mga akien-mga added this to the 4.0 milestone Feb 1, 2021
@akien-mga akien-mga requested a review from a team February 1, 2021 13:32
Copy link
Member

@hpvb hpvb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@akien-mga
Copy link
Member Author

Note: I need to do some tests before merging as for official builds on Ubuntu 14.04 i386 I'm actually not using those, I probably ran into issues in the past and forgot to document them...

Ah I did document the issue in the commit log: godotengine/godot-build-scripts@3319757

The problem is that it seemed to cause crashes on Ubuntu 18.04 i386 for some reason: #31743 (comment).

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.
@akien-mga
Copy link
Member Author

I amended the commit to apply that change only to 64-bit, as we still need to figure out why it would crash on Ubuntu 18.04 i386 with that option. Likely a Ubuntu bug, but nasty enough not to make this the default for i386.

I was lazy so this outright forces use_static_cpp off for 32-bit, but making an architecture-specific option with different default values and still the possibility to override it is a bit of a pain.

@akien-mga akien-mga merged commit 621b4e4 into godotengine:master Feb 1, 2021
@akien-mga akien-mga deleted the linux-static-cpp branch February 1, 2021 14:17
@akien-mga
Copy link
Member Author

Cherry-picked for 3.2.4.

@akien-mga akien-mga removed the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Feb 2, 2021
akien-mga added a commit to akien-mga/godot that referenced this pull request Apr 26, 2021
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 godotengine#45629.
akien-mga added a commit that referenced this pull request Apr 27, 2021
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.

(cherry picked from commit aa15ad7)
akien-mga added a commit that referenced this pull request Apr 27, 2021
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.

(cherry picked from commit aa15ad7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants