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