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

Dynamically link with glibc. #1382

Merged
merged 1 commit into from
Apr 5, 2024
Merged

Conversation

BillyONeal
Copy link
Member

@BillyONeal BillyONeal commented Apr 4, 2024

Hopefully fixes: microsoft/vcpkg#37842

Special thanks to @TrueBrain for figuring out the actual problem in #1378 and @Osyotr for pointing out this mistake over Discord.

Hopefully fixes: microsoft/vcpkg#37842

Special thanks to @TrueBrain for figuring out the actual problem in microsoft#1378

Co-authored-by: Patric Stout <truebrain@openttd.org>
@BillyONeal
Copy link
Member Author

BillyONeal commented Apr 4, 2024

I checked that the new executable works on a machine where 2024-03-29 does not :)

set(C_HEADER_ARGS "-B/crossrootfs/x64/usr/lib/x86_64-linux-gnu/ -isystem /crossrootfs/x64/usr/lib/gcc/x86_64-linux-gnu/9/include-fixed -isystem /crossrootfs/x64/usr/lib/gcc/x86_64-linux-gnu/9/include -isystem /crossrootfs/x64/usr/include/x86_64-linux-gnu -isystem /crossrootfs/x64/usr/include")
set(CMAKE_C_FLAGS_INIT "${C_HEADER_ARGS} -static -s -static-libgcc -nostdinc")
set(CMAKE_CXX_FLAGS_INIT "-isystem /crossrootfs/x64/usr/include/x86_64-linux-gnu/c++/9 -isystem /crossrootfs/x64/usr/include/c++/9 ${C_HEADER_ARGS} -static -s -static-libgcc -nostdinc -static-libstdc++ -L/crossrootfs/x64/usr/lib/gcc/x86_64-linux-gnu/9/")
set(COMMON_ARGS "-B/crossrootfs/x64/usr/lib/x86_64-linux-gnu/ -isystem /crossrootfs/x64/usr/lib/gcc/x86_64-linux-gnu/9/include-fixed -isystem /crossrootfs/x64/usr/lib/gcc/x86_64-linux-gnu/9/include -isystem /crossrootfs/x64/usr/include/x86_64-linux-gnu -isystem /crossrootfs/x64/usr/include -static-libgcc -nostdinc")
Copy link
Contributor

@TrueBrain TrueBrain Apr 4, 2024

Choose a reason for hiding this comment

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

Be mindful you also removed -s (stripping). Not sure that is intentional, or whether it happens on a later moment in the pipeline. But might be good to validate you aren't now pushing a much larger binary :)

Copy link
Member Author

Choose a reason for hiding this comment

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

It was intentional based on @Osyotr 's observation that 2024-03-14 was not stripped

@BillyONeal BillyONeal merged commit 31d5996 into microsoft:main Apr 5, 2024
5 checks passed
@BillyONeal BillyONeal deleted the dynamic-glibc branch April 5, 2024 02:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[all] segfault on linux when installing any package
3 participants