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: Remove hardcoded lib path for x86 cross-compilation #84307

Conversation

akien-mga
Copy link
Member

@akien-mga akien-mga commented Nov 1, 2023

This breaks the build with our updated i686 Linux SDK which doesn't contain this path, and may not be needed at all.

This might need further work to be robust, and there's an open PR (#64366) already adding -march flags for all supported architectures, but for now we're playing it safe for 4.2.

I moved the code up to where #64366 puts it as it's more consistent with the rest of the config indeed.

#64366 is probably "better" but @hpvb and I need to double check what are the implications of adding those flags compared to letting the toolchain wrappers do the right thing, so that stays in scope for 4.3.


To be clear the only change here is the removal of "-L/usr/lib/i386-linux-gnu" and "-L/usr/lib/i686-linux-gnu" linkflags when cross-compiling. Those date back to GODOT IS OPEN SOURCE, and I assume they were for cross-compiling to i386 from x86_64 Ubuntu. The one with i686 seems bogus when cross-compiling from i386 Linux to x86_64.

With these removals, I'm still able to cross-compile from x86_64 to i686 on Mageia 9:

$ file bin/godot.linuxbsd.editor.dev.x86_32
bin/godot.linuxbsd.editor.dev.x86_32: ELF 32-bit LSB executable, Intel 80386, version 1 (GNU/Linux), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=a0475756f8cba350e35120218132038ea0f480b0, with debug_info, not stripped

This may break for some Debian/Ubuntu distros, would need testing. But the old flags can be restored manually by passing LINKFLAGS="-L/usr/lib/i386-linux-gnu to scons.

This breaks the build with our updated i686 Linux SDK which doesn't contain
this path, and may not be needed at all.

This might need further work to be robust, and there's an open PR already
adding -march flags for all supported architectures, but for now we're
playing it safe for 4.2.
@akien-mga akien-mga added enhancement platform:linuxbsd topic:buildsystem cherrypick:3.x Considered for cherry-picking into a future 3.x release labels Nov 1, 2023
@akien-mga akien-mga added this to the 4.2 milestone Nov 1, 2023
@akien-mga akien-mga requested a review from a team as a code owner November 1, 2023 13:17
@hpvb
Copy link
Member

hpvb commented Nov 1, 2023

lgtm

@akien-mga akien-mga merged commit e07b3ee into godotengine:master Nov 1, 2023
15 checks passed
@akien-mga akien-mga deleted the linux-crosscompile-remove-hardcoded-lib-path branch November 1, 2023 14:17
@akien-mga
Copy link
Member Author

Cherry-picked for 3.6.

@akien-mga akien-mga removed the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Jan 16, 2024
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.

2 participants