-
-
Save chenxiaolong/dcda157428e60489efa7a2f9346e581e to your computer and use it in GitHub Desktop.
Repro for bazel libandroid_support.a linking issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
common:android_armeabi-v7a --crosstool_top=@androidndk//:default_crosstool | |
common:android_armeabi-v7a --cpu=armeabi-v7a | |
common:android_armeabi-v7a --host_crosstool_top=@bazel_tools//tools/cpp:toolchain | |
common:android_arm64-v8a --crosstool_top=@androidndk//:default_crosstool | |
common:android_arm64-v8a --cpu=arm64-v8a | |
common:android_arm64-v8a --host_crosstool_top=@bazel_tools//tools/cpp:toolchain | |
common:android_x86 --crosstool_top=@androidndk//:default_crosstool | |
common:android_x86 --cpu=x86 | |
common:android_x86 --host_crosstool_top=@bazel_tools//tools/cpp:toolchain | |
common:android_x86_64 --crosstool_top=@androidndk//:default_crosstool | |
common:android_x86_64 --cpu=x86_64 | |
common:android_x86_64 --host_crosstool_top=@bazel_tools//tools/cpp:toolchain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
load('@rules_cc//cc:defs.bzl', 'cc_binary') | |
cc_binary( | |
name = 'main', | |
srcs = glob(['main.cpp']), | |
features = ['fully_static_link'], | |
linkstatic = True, | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <locale.h> | |
int main(int argc, char *argv[]) | |
{ | |
// setlocale is present in both libc and libandroid_support on API 21+ and | |
// libandroid_support is pulled in unconditionally when using libc++, | |
// leading to multiple definition errors. | |
setlocale(LC_ALL, ""); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
android_ndk_repository( | |
name = "androidndk", | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment