linux-android.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* Configuration file for Linux Android targets.
  2. Copyright (C) 2008-2015 Free Software Foundation, Inc.
  3. Contributed by Doug Kwan (dougkwan@google.com)
  4. Rewritten by CodeSourcery, Inc.
  5. This file is part of GCC.
  6. GCC is free software; you can redistribute it and/or modify it
  7. under the terms of the GNU General Public License as published
  8. by the Free Software Foundation; either version 3, or (at your
  9. option) any later version.
  10. GCC is distributed in the hope that it will be useful, but WITHOUT
  11. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  12. or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
  13. License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with GCC; see the file COPYING3. If not see
  16. <http://www.gnu.org/licenses/>. */
  17. #define ANDROID_TARGET_OS_CPP_BUILTINS() \
  18. do { \
  19. if (TARGET_ANDROID) \
  20. builtin_define ("__ANDROID__"); \
  21. } while (0)
  22. #if ANDROID_DEFAULT
  23. # define NOANDROID "mno-android"
  24. #else
  25. # define NOANDROID "!mandroid"
  26. #endif
  27. #define LINUX_OR_ANDROID_CC(LINUX_SPEC, ANDROID_SPEC) \
  28. "%{" NOANDROID "|tno-android-cc:" LINUX_SPEC ";:" ANDROID_SPEC "}"
  29. #define LINUX_OR_ANDROID_LD(LINUX_SPEC, ANDROID_SPEC) \
  30. "%{" NOANDROID "|tno-android-ld:" LINUX_SPEC ";:" ANDROID_SPEC "}"
  31. #define ANDROID_LINK_SPEC \
  32. "%{shared: -Bsymbolic}"
  33. #define ANDROID_CC1_SPEC \
  34. "%{!mglibc:%{!muclibc:%{!mbionic: -mbionic}}} " \
  35. "%{!fno-pic:%{!fno-PIC:%{!fpic:%{!fPIC: -fPIC}}}}"
  36. #define ANDROID_CC1PLUS_SPEC \
  37. "%{!fexceptions:%{!fno-exceptions: -fno-exceptions}} " \
  38. "%{!frtti:%{!fno-rtti: -fno-rtti}}"
  39. #define ANDROID_LIB_SPEC \
  40. "%{!static: -ldl}"
  41. #define ANDROID_STARTFILE_SPEC \
  42. "%{shared: crtbegin_so%O%s;:" \
  43. " %{static: crtbegin_static%O%s;: crtbegin_dynamic%O%s}}"
  44. #define ANDROID_ENDFILE_SPEC \
  45. "%{shared: crtend_so%O%s;: crtend_android%O%s}"