mirror of
https://github.com/odin-lang/Odin.git
synced 2026-04-19 21:10:30 +00:00
fix: cross-compilation for android on linux
add `-nodefaultlibs` when cross-linking for android to prevent clang from linking with libgcc check build mode first before calling `init_android_values` to prevent printing a message that tells the user to set `-android-keystore` if its not set and build mode is exe
This commit is contained in:
@@ -143,7 +143,7 @@ gb_internal i32 linker_stage(LinkerData *gen) {
|
||||
LIT(target_arch_names[build_context.metrics.arch])
|
||||
);
|
||||
#endif
|
||||
} else if (build_context.cross_compiling && build_context.different_os) {
|
||||
} else if (build_context.cross_compiling) {
|
||||
switch (selected_subtarget) {
|
||||
case Subtarget_Android:
|
||||
is_cross_linking = true;
|
||||
@@ -840,6 +840,7 @@ try_cross_linking:;
|
||||
|
||||
if (is_android) {
|
||||
link_command_line = gb_string_append_fmt(link_command_line, " --target=aarch64-linux-android%d ", ODIN_ANDROID_API_LEVEL);
|
||||
link_command_line = gb_string_appendc(link_command_line, " -nodefaultlibs");
|
||||
}
|
||||
link_command_line = gb_string_appendc(link_command_line, " -Wno-unused-command-line-argument ");
|
||||
link_command_line = gb_string_appendc(link_command_line, object_files);
|
||||
|
||||
Reference in New Issue
Block a user