-
Notifications
You must be signed in to change notification settings - Fork 451
Fix cross-compiling for android with the NDK #252
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
base: master
Are you sure you want to change the base?
Changes from all commits
f256395
7ec3cc6
fe1b220
22c6890
013f966
cc343ea
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -770,23 +770,28 @@ Valid options are: yes, no, check, m32, mx32.]) | |
[enable_mpers=yes]) | ||
|
||
AS_IF([test x$arch = xaarch64], | ||
[# So far, only aarch64 needs a separate compiler for its compat | ||
# personality (which is AArch32, that is more or less ARMv7 EABI) | ||
< 8000 td class="blob-code blob-code-deletion js-file-line"> # | ||
# Some heuristics regarding possible compiler name: | ||
# Debian: arm-linux-gnueabi{,hf}-gcc | ||
# SuSE: arm7{,hl}-linux-gnueabi-gcc | ||
# Red Hat: arm-redhat-linux-gnu-gcc | ||
# Fedora: arm-linux-gnu-gcc | ||
# ALT: armh-alt-linux-gnueabi-gcc | ||
m4_foreach([triplet1], [arm, arm7, arm7hl, armh], dnl | ||
[m4_foreach([triplet2], [, $host_vendor-], dnl | ||
[m4_foreach([triplet3], [gnu, gnueabi, gnueabihf], dnl | ||
[m4_foreach([triplet_cc], [gcc, cc], dnl | ||
[m4_append([arm_compat_compilers], dnl | ||
triplet1[-]triplet2[linux-]triplet3[-]triplet_cc)])])])]) | ||
AC_CHECK_PROGS(CC_FOR_M32, arm_compat_compilers) | ||
AS_IF([test -n "$CC_FOR_M32"], | ||
[# So far, only aarch64 needs a separate compiler for its compat | ||
# personality (which is AArch32, that is more or less ARMv7 EABI) | ||
# First try $CC with 'aarch64' replaced with 'arm' and 'android' | ||
# replaced with 'androideabi' | ||
cc=${CC%/aarch64-*}/armv7a-${CC##*/aarch64-} | ||
cc=${cc%-android*}-androideabi${cc##*-android} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see |
||
AS_IF([$cc --version >/dev/null],[CC_FOR_M32=$cc],[ | ||
# Some heuristics regarding possible compiler name: | ||
# Debian: arm-linux-gnueabi{,hf}-gcc | ||
# SuSE: arm7{,hl}-linux-gnueabi-gcc | ||
# Red Hat: arm-redhat-linux-gnu-gcc | ||
# Fedora: arm-linux-gnu-gcc | ||
# ALT: armh-alt-linux-gnueabi-gcc | ||
m4_foreach([triplet1], [arm, arm7, arm7hl, armh], dnl | ||
[m4_foreach([triplet2], [, $host_vendor-], dnl | ||
[m4_foreach([triplet3], [gnu, gnueabi, gnueabihf], dnl | ||
[m4_foreach([triplet_cc], [gcc, cc], dnl | ||
[m4_append([arm_compat_compilers], dnl | ||
triplet1[-]triplet2[linux-]triplet3[-]triplet_cc)])])])]) | ||
AC_CHECK_PROGS(CC_FOR_M32, arm_compat_compilers)]) | ||
AS_UNSET(cc) | ||
AS_IF([test -n "$CC_FOR_M32"], | ||
[: ${CPP_FOR_M32=$CC_FOR_M32 -E} | ||
: ${CFLAGS_FOR_M32=-std=gnu99} | ||
: ${CPPFLAGS_FOR_M32=} | ||
|
@@ -803,7 +808,10 @@ m4_foreach([pers], [M32, MX32], dnl | |
AC_SUBST(var[_FOR_]pers)])]) | ||
|
||
st_MPERS([m32], [aarch64|powerpc64|s390x|sparc64|tile|x32|x86_64]) | ||
st_MPERS([mx32], [x86_64]) | ||
case $host_os in | ||
linux-android*) st_MPERS([mx32], [none]);; | ||
*) st_MPERS([mx32], [x86_64]) ;; | ||
esac | ||
|
||
AC_ARG_ENABLE([install-tests], | ||
[AS_HELP_STRING([--enable-install-tests=yes|no], | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -914,7 +914,7 @@ str_strip_prefix_len(const char *str, const char *prefix, size_t prefix_len) | |
* part. | ||
*/ | ||
# define QUOTE_HEXSTR_MASK (0x3 << QUOTE_HEXSTR_SHIFT) | ||
static_assert((NUM_HEXSTR_OPTS - 1) <= (QUOTE_HEXSTR_MASK >> QUOTE_HEXSTR_SHIFT), | ||
_Static_assert((NUM_HEXSTR_OPTS - 1) <= (QUOTE_HEXSTR_MASK >> QUOTE_HEXSTR_SHIFT), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why this change is needed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because the build will fail without it? The android headers only define
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We have static_assert.h (included by defs.h) to handle this on various platforms. |
||
"xflag options do not fit into QUOTE_HEXSTR_MASK"); | ||
|
||
# define QUOTE_HEXSTR_NONE (HEXSTR_NONE << QUOTE_HEXSTR_SHIFT) | ||
|
@@ -2158,4 +2158,15 @@ print_big_u64_addr(const uint64_t addr) | |
# include "syscall.h" | ||
# endif | ||
|
||
#ifdef __ANDROID__ | ||
/* pulled in by stdio.h, clash with bundled/linux/include/uapi/linux/fs.h */ | ||
#undef RENAME_EXCHANGE | ||
#undef RENAME_WHITEOUT | ||
#undef RENAME_NOREPLACE | ||
|
||
/* defined in linux/in.h on android; shadowed by its bundled/... counterpart */ | ||
typedef uint32_t in_addr_t; | ||
|
||
#endif | ||
|
||
#endif /* !STRACE_DEFS_H */ |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
#endif | ||
|
||
/* The following function might be unused, hence the inline qualifier. */ | ||
static inline void | ||
static inline void __attribute__((unused)) | ||
Comment on lines
18
to
+19
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suppose this change is not needed, the compiler shouldn't issue any warnings for static inline functions. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Your supposition is false:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Then this is a compiler bug, a lot of software relies on this static inline thing, please report it to compiler people instead. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. According to gcc documentation,
Sorry, I'm not going to workaround incorrect warnings reported by non-compliant compilers. |
||
print_sigmask_addr_size(const void *const addr, const unsigned int size) | ||
{ | ||
tprint_struct_begin(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why exactly should it take priority over all the other options? Also, since the
CC
differs from the one that ./configure would detect, I guess it is provided explicitly, why not provideCC_FOR_M32
explicitly as well?