Mercurial > hg > CbC > CbC_gcc
diff gcc/config/mips/linux.h @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | f6334be47118 |
children | 84e7813d76e9 |
line wrap: on
line diff
--- a/gcc/config/mips/linux.h Sun Aug 21 07:07:55 2011 +0900 +++ b/gcc/config/mips/linux.h Fri Oct 27 22:46:09 2017 +0900 @@ -1,6 +1,5 @@ /* Definitions for MIPS running Linux-based GNU systems with ELF format. - Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, - 2007, 2008, 2010, 2011 Free Software Foundation, Inc. + Copyright (C) 1998-2017 Free Software Foundation, Inc. This file is part of GCC. @@ -18,134 +17,36 @@ along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ -#undef WCHAR_TYPE -#define WCHAR_TYPE "int" - -#undef WCHAR_TYPE_SIZE -#define WCHAR_TYPE_SIZE 32 - -#undef ASM_DECLARE_OBJECT_NAME -#define ASM_DECLARE_OBJECT_NAME mips_declare_object_name - -#undef TARGET_VERSION -#if TARGET_ENDIAN_DEFAULT == 0 -#define TARGET_VERSION fprintf (stderr, " (MIPSel GNU/Linux with ELF)"); -#else -#define TARGET_VERSION fprintf (stderr, " (MIPS GNU/Linux with ELF)"); -#endif - -/* If we don't set MASK_ABICALLS, we can't default to PIC. */ -#undef TARGET_DEFAULT -#define TARGET_DEFAULT MASK_ABICALLS - -#define TARGET_OS_CPP_BUILTINS() \ - do { \ - LINUX_TARGET_OS_CPP_BUILTINS(); \ - /* The GNU C++ standard library requires this. */ \ - if (c_dialect_cxx ()) \ - builtin_define ("_GNU_SOURCE"); \ - } while (0) - -#undef SUBTARGET_CPP_SPEC -#define SUBTARGET_CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}" +#define GNU_USER_LINK_EMULATION32 "elf32%{EB:b}%{EL:l}tsmip" +#define GNU_USER_LINK_EMULATION64 "elf64%{EB:b}%{EL:l}tsmip" +#define GNU_USER_LINK_EMULATIONN32 "elf32%{EB:b}%{EL:l}tsmipn32" -/* A standard GNU/Linux mapping. On most targets, it is included in - CC1_SPEC itself by config/linux.h, but mips.h overrides CC1_SPEC - and provides this hook instead. */ -#undef SUBTARGET_CC1_SPEC -#define SUBTARGET_CC1_SPEC "%{profile:-p}" - -/* From iris5.h */ -/* -G is incompatible with -KPIC which is the default, so only allow objects - in the small data section if the user explicitly asks for it. */ -#undef MIPS_DEFAULT_GVALUE -#define MIPS_DEFAULT_GVALUE 0 - -#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" - -/* Borrowed from sparc/linux.h */ -#undef LINK_SPEC -#define LINK_SPEC \ - "%(endian_spec) \ - %{shared:-shared} \ - %{!shared: \ - %{!static: \ - %{rdynamic:-export-dynamic} \ - -dynamic-linker " LINUX_DYNAMIC_LINKER "} \ - %{static:-static}}" - -#undef SUBTARGET_ASM_SPEC -#define SUBTARGET_ASM_SPEC \ - "%{!mno-abicalls:%{mplt:-call_nonpic;:-KPIC}}" - -/* The MIPS assembler has different syntax for .set. We set it to - .dummy to trap any errors. */ -#undef SET_ASM_OP -#define SET_ASM_OP "\t.dummy\t" +#define GLIBC_DYNAMIC_LINKER32 \ + "%{mnan=2008:/lib/ld-linux-mipsn8.so.1;:/lib/ld.so.1}" +#define GLIBC_DYNAMIC_LINKER64 \ + "%{mnan=2008:/lib64/ld-linux-mipsn8.so.1;:/lib64/ld.so.1}" +#define GLIBC_DYNAMIC_LINKERN32 \ + "%{mnan=2008:/lib32/ld-linux-mipsn8.so.1;:/lib32/ld.so.1}" -#undef ASM_OUTPUT_DEF -#define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \ - do { \ - fputc ( '\t', FILE); \ - assemble_name (FILE, LABEL1); \ - fputs ( " = ", FILE); \ - assemble_name (FILE, LABEL2); \ - fputc ( '\n', FILE); \ - } while (0) - -/* The glibc _mcount stub will save $v0 for us. Don't mess with saving - it, since ASM_OUTPUT_REG_PUSH/ASM_OUTPUT_REG_POP do not work in the - presence of $gp-relative calls. */ -#undef ASM_OUTPUT_REG_PUSH -#undef ASM_OUTPUT_REG_POP - -#undef LIB_SPEC -#define LIB_SPEC "\ -%{pthread:-lpthread} \ -%{shared:-lc} \ -%{!shared: \ - %{profile:-lc_p} %{!profile:-lc}}" - -#define MD_UNWIND_SUPPORT "config/mips/linux-unwind.h" - -#ifdef HAVE_AS_NO_SHARED -/* Default to -mno-shared for non-PIC. */ -# define NO_SHARED_SPECS \ - "%{mshared|mno-shared|fpic|fPIC|fpie|fPIE:;:-mno-shared}" -#else -# define NO_SHARED_SPECS "" -#endif +#undef UCLIBC_DYNAMIC_LINKER32 +#define UCLIBC_DYNAMIC_LINKER32 \ + "%{mnan=2008:/lib/ld-uClibc-mipsn8.so.0;:/lib/ld-uClibc.so.0}" +#undef UCLIBC_DYNAMIC_LINKER64 +#define UCLIBC_DYNAMIC_LINKER64 \ + "%{mnan=2008:/lib/ld64-uClibc-mipsn8.so.0;:/lib/ld64-uClibc.so.0}" +#define UCLIBC_DYNAMIC_LINKERN32 \ + "%{mnan=2008:/lib32/ld-uClibc-mipsn8.so.0;:/lib32/ld-uClibc.so.0}" -/* -march=native handling only makes sense with compiler running on - a MIPS chip. */ -#if defined(__mips__) -extern const char *host_detect_local_cpu (int argc, const char **argv); -# define EXTRA_SPEC_FUNCTIONS \ - { "local_cpu_detect", host_detect_local_cpu }, - -# define MARCH_MTUNE_NATIVE_SPECS \ - " %{march=native:%<march=native %:local_cpu_detect(arch)}" \ - " %{mtune=native:%<mtune=native %:local_cpu_detect(tune)}" -#else -# define MARCH_MTUNE_NATIVE_SPECS "" -#endif +#undef MUSL_DYNAMIC_LINKER32 +#define MUSL_DYNAMIC_LINKER32 \ + "/lib/ld-musl-mips%{mips32r6|mips64r6:r6}%{EL:el}%{msoft-float:-sf}.so.1" +#undef MUSL_DYNAMIC_LINKER64 +#define MUSL_DYNAMIC_LINKER64 \ + "/lib/ld-musl-mips64%{mips64r6:r6}%{EL:el}%{msoft-float:-sf}.so.1" +#define MUSL_DYNAMIC_LINKERN32 \ + "/lib/ld-musl-mipsn32%{mips64r6:r6}%{EL:el}%{msoft-float:-sf}.so.1" -#define LINUX_DRIVER_SELF_SPECS \ - NO_SHARED_SPECS \ - MARCH_MTUNE_NATIVE_SPECS, \ - /* -mplt has no effect without -mno-shared. Simplify later \ - specs handling by removing a redundant option. */ \ - "%{!mno-shared:%<mplt}", \ - /* -mplt likewise has no effect for -mabi=64 without -msym32. */ \ - "%{mabi=64:%{!msym32:%<mplt}}" - -#undef DRIVER_SELF_SPECS -#define DRIVER_SELF_SPECS \ - BASE_DRIVER_SELF_SPECS, \ - LINUX_DRIVER_SELF_SPECS - -/* Similar to standard Linux, but adding -ffast-math support. */ -#undef ENDFILE_SPEC -#define ENDFILE_SPEC \ - "%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \ - %{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s" +#define BIONIC_DYNAMIC_LINKERN32 "/system/bin/linker32" +#define GNU_USER_DYNAMIC_LINKERN32 \ + CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERN32, UCLIBC_DYNAMIC_LINKERN32, \ + BIONIC_DYNAMIC_LINKERN32, MUSL_DYNAMIC_LINKERN32)