/* Target definitions for PowerPC running Darwin (Mac OS X). Copyright (C) 1997, 2000, 2001, 2003 Free Software Foundation, Inc. Contributed by Apple Computer Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #undef TARGET_VERSION #define TARGET_VERSION fprintf (stderr, " (Darwin/PowerPC)"); /* The "Darwin ABI" is mostly like AIX, but with some key differences. */ #define DEFAULT_ABI ABI_DARWIN /* The object file format is Mach-O. */ #define TARGET_OBJECT_FORMAT OBJECT_MACHO /* We're not ever going to do TOCs. */ #define TARGET_TOC 0 #define TARGET_NO_TOC 1 /* Darwin switches. */ /* Use dynamic-no-pic codegen (no picbase reg; not suitable for shlibs.) */ #define MASK_MACHO_DYNAMIC_NO_PIC 0x00800000 #define TARGET_DYNAMIC_NO_PIC (target_flags & MASK_MACHO_DYNAMIC_NO_PIC) /* Handle #pragma weak and #pragma pack. */ #define HANDLE_SYSV_PRAGMA 1 #define TARGET_OS_CPP_BUILTINS() \ do \ { \ builtin_define ("__ppc__"); \ builtin_define ("__POWERPC__"); \ builtin_define ("__NATURAL_ALIGNMENT__"); \ builtin_define ("__MACH__"); \ builtin_define ("__APPLE__"); \ } \ while (0) /* */ #undef SUBTARGET_SWITCHES #define SUBTARGET_SWITCHES \ {"dynamic-no-pic", MASK_MACHO_DYNAMIC_NO_PIC, \ N_("Generate code suitable for executables (NOT shared libs)")}, \ {"no-dynamic-no-pic", -MASK_MACHO_DYNAMIC_NO_PIC, ""}, /* The Darwin ABI always includes AltiVec, can't be (validly) turned off. */ #define SUBTARGET_OVERRIDE_OPTIONS \ do { \ rs6000_altivec_abi = 1; \ rs6000_altivec_vrsave = 1; \ if (DEFAULT_ABI == ABI_DARWIN) \ { \ if (MACHO_DYNAMIC_NO_PIC_P) \ { \ if (flag_pic) \ warning ("-mdynamic-no-pic overrides -fpic or -fPIC"); \ flag_pic = 0; \ } \ else if (flag_pic == 1) \ { \ /* Darwin doesn't support -fpic. */ \ warning ("-fpic is not supported; -fPIC assumed"); \ flag_pic = 2; \ } \ } \ }while(0) /* We want -fPIC by default, unless we're using -static to compile for the kernel or some such. */ #define CC1_SPEC "\ %{gused: -feliminate-unused-debug-symbols %