summaryrefslogtreecommitdiff
path: root/gcc/config/i386/sol2.h
diff options
context:
space:
mode:
authorro <ro@138bc75d-0d04-0410-961f-82ee72b054a4>2014-04-30 14:10:44 +0000
committerro <ro@138bc75d-0d04-0410-961f-82ee72b054a4>2014-04-30 14:10:44 +0000
commitfc99725b5d064bb3d49bbd47c014ed1d0cfb160a (patch)
treee993c7a0834ed9227be305f1d1ce69dab71d8321 /gcc/config/i386/sol2.h
parent9e291c2595f80f2f11722afac49020213590adc1 (diff)
downloadgcc-fc99725b5d064bb3d49bbd47c014ed1d0cfb160a.tar.gz
Simplify Solaris 2 configuration
* config/sol2-10.h (TARGET_LIBC_HAS_FUNCTION): Move ... * config/sol2.h: ... here. * config/sol2-10.h: Remove. * config/sol2-bi.h (WCHAR_TYPE, WCHAR_TYPE_SIZE, WINT_TYPE) (WINT_TYPE_SIZE, MULTILIB_DEFAULTS, DEF_ARCH32_SPEC) (DEF_ARCH64_SPEC, ASM_CPU_DEFAULT_SPEC, LINK_ARCH64_SPEC_BASE) (LINK_ARCH64_SPEC, ARCH_DEFAULT_EMULATION, TARGET_LD_EMULATION) (LINK_ARCH_SPEC, SUBTARGET_EXTRA_SPECS): Move ... * config/sol2.h: ... here. (SECTION_NAME_FORMAT): Don't redefine. (STARTFILE_ARCH32_SPEC): Rename to ... (STARTFILE_ARCH_SPEC): ... this. (ASM_OUTPUT_ALIGNED_COMMON): Move ... * config/sparc/sol2.h: ... here. (SECTION_NAME_FORMAT): Don't undef. * config/i386/sol2.h (ASM_CPU_DEFAULT_SPEC) (SUBTARGET_EXTRA_SPECS): Remove. * config/sparc/sol2.h (ASM_CPU_DEFAULT_SPEC): Remove. * config/i386/sol2-bi.h (TARGET_SUBTARGET_DEFAULT) (MD_STARTFILE_PREFIX): Remove. (SUBTARGET_OPTIMIZATION_OPTIONS, ASM_CPU32_DEFAULT_SPEC) (ASM_CPU64_DEFAULT_SPEC, ASM_CPU_SPEC, ASM_SPEC, DEFAULT_ARCH32_P) (ARCH64_SUBDIR, ARCH32_EMULATION, ARCH64_EMULATION) (ASM_COMMENT_START, JUMP_TABLES_IN_TEXT_SECTION) (ASM_OUTPUT_DWARF_PCREL, ASM_OUTPUT_ALIGNED_COMMON) (USE_IX86_FRAME_POINTER, USE_X86_64_FRAME_POINTER): Move ... * config/i386/sol2.h: ... here. (TARGET_SUBTARGET_DEFAULT, SIZE_TYPE, PTRDIFF_TYPE): Remove. * config/i386/sol2-bi.h: Remove. * config/sol2.h (MD_STARTFILE_PREFIX): Remove. (LINK_ARCH32_SPEC_BASE): Remove /usr/ccs/lib/libp, /usr/ccs/lib. * config/i386/t-sol2-64: Rename to ... * config/i386/t-sol2: ... this. * config/sparc/t-sol2-64: Rename to ... * config/sparc/t-sol2: ... this. * config.gcc (*-*-solaris2*): Split sol2_tm_file into sol2_tm_file_head, sol2_tm_file_tail. Include ${cpu_type}/sol2.h before sol2.h. Remove sol2-10.h. (i[34567]86-*-solaris2* | x86_64-*-solaris2.1[0-9]*): Include i386/x86-64.h between sol2_tm_file_head and sol2_tm_file_tail. Remove i386/sol2-bi.h, sol2-bi.h from tm_file. Reflect i386/t-sol2-64 renaming. (sparc*-*-solaris2*): Remove sol2-bi.h from tm_file. Reflect sparc/t-sol2-64 renaming. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@209931 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/i386/sol2.h')
-rw-r--r--gcc/config/i386/sol2.h101
1 files changed, 77 insertions, 24 deletions
diff --git a/gcc/config/i386/sol2.h b/gcc/config/i386/sol2.h
index 6676941f67a..9c3a6f49662 100644
--- a/gcc/config/i386/sol2.h
+++ b/gcc/config/i386/sol2.h
@@ -18,12 +18,8 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
-/* Augment i386/unix.h version to return 8-byte vectors in memory, matching
- Sun Studio compilers until version 12, the only ones supported on
- Solaris 9. */
-#undef TARGET_SUBTARGET_DEFAULT
-#define TARGET_SUBTARGET_DEFAULT \
- (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS | MASK_VECT8_RETURNS)
+#define SUBTARGET_OPTIMIZATION_OPTIONS \
+ { OPT_LEVELS_1_PLUS, OPT_momit_leaf_frame_pointer, NULL, 1 }
/* Old versions of the Solaris assembler can not handle the difference of
labels in different sections, so force DW_EH_PE_datarel if so. */
@@ -50,27 +46,46 @@ along with GCC; see the file COPYING3. If not see
#undef TARGET_SUN_TLS
#define TARGET_SUN_TLS 1
-#undef SIZE_TYPE
-#define SIZE_TYPE "unsigned int"
-
-#undef PTRDIFF_TYPE
-#define PTRDIFF_TYPE "int"
-
/* Solaris 2/Intel as chokes on #line directives before Solaris 10. */
#undef CPP_SPEC
#define CPP_SPEC "%{,assembler-with-cpp:-P} %(cpp_subtarget)"
-#define ASM_CPU_DEFAULT_SPEC ""
+/* GNU as understands --32 and --64, but the native Solaris
+ assembler requires -xarch=generic or -xarch=generic64 instead. */
+#ifdef USE_GAS
+#define ASM_CPU32_DEFAULT_SPEC "--32"
+#define ASM_CPU64_DEFAULT_SPEC "--64"
+#else
+#define ASM_CPU32_DEFAULT_SPEC "-xarch=generic"
+#define ASM_CPU64_DEFAULT_SPEC "-xarch=generic64"
+#endif
+
+#undef ASM_CPU_SPEC
+#define ASM_CPU_SPEC "%(asm_cpu_default)"
-#define ASM_CPU_SPEC ""
-
-/* Don't include ASM_PIC_SPEC. While the Solaris 9 assembler accepts
- -K PIC, it gives many warnings:
- R_386_32 relocation is used for symbol "<symbol>"
+/* Don't include ASM_PIC_SPEC. While the Solaris 10+ assembler accepts -K PIC,
+ it gives many warnings:
+ Absolute relocation is used for symbol "<symbol>"
GNU as doesn't recognize -K at all. */
#undef ASM_SPEC
#define ASM_SPEC ASM_SPEC_BASE
+#define DEFAULT_ARCH32_P !TARGET_64BIT_DEFAULT
+
+#define ARCH64_SUBDIR "amd64"
+
+#ifdef USE_GLD
+/* Since binutils 2.21, GNU ld supports new *_sol2 emulations to strictly
+ follow the Solaris 2 ABI. Prefer them if present. */
+#ifdef HAVE_LD_SOL2_EMULATION
+#define ARCH32_EMULATION "elf_i386_sol2"
+#define ARCH64_EMULATION "elf_x86_64_sol2"
+#else
+#define ARCH32_EMULATION "elf_i386"
+#define ARCH64_EMULATION "elf_x86_64"
+#endif
+#endif
+
#undef ENDFILE_SPEC
#define ENDFILE_SPEC \
"%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
@@ -84,23 +99,39 @@ along with GCC; see the file COPYING3. If not see
{ "asm_cpu", ASM_CPU_SPEC }, \
{ "asm_cpu_default", ASM_CPU_DEFAULT_SPEC }, \
-#undef SUBTARGET_EXTRA_SPECS
-#define SUBTARGET_EXTRA_SPECS \
- { "startfile_arch", STARTFILE_ARCH_SPEC }, \
- { "link_arch", LINK_ARCH_SPEC }, \
- SUBTARGET_CPU_EXTRA_SPECS
-
/* Register the Solaris-specific #pragma directives. */
#define REGISTER_SUBTARGET_PRAGMAS() solaris_register_pragmas ()
#undef LOCAL_LABEL_PREFIX
#define LOCAL_LABEL_PREFIX "."
+/* The Solaris 10 FCS as doesn't accept "#" comments, while later versions
+ do. */
+#undef ASM_COMMENT_START
+#define ASM_COMMENT_START "/"
+
/* The 32-bit Solaris assembler does not support .quad. Do not use it. */
#ifndef HAVE_AS_IX86_QUAD
#undef ASM_QUAD
#endif
+/* The native Solaris assembler can't calculate the difference between
+ symbols in different sections, which causes problems for -fPIC jump
+ tables in .rodata. */
+#ifndef HAVE_AS_IX86_DIFF_SECT_DELTA
+#undef JUMP_TABLES_IN_TEXT_SECTION
+#define JUMP_TABLES_IN_TEXT_SECTION 1
+
+/* The native Solaris assembler cannot handle the SYMBOL-. syntax, but
+ requires SYMBOL@rel/@rel64 instead. */
+#define ASM_OUTPUT_DWARF_PCREL(FILE, SIZE, LABEL) \
+ do { \
+ fputs (integer_asm_op (SIZE, FALSE), FILE); \
+ assemble_name (FILE, LABEL); \
+ fputs (SIZE == 8 ? "@rel64" : "@rel", FILE); \
+ } while (0)
+#endif
+
/* The Solaris assembler wants a .local for non-exported aliases. */
#define ASM_OUTPUT_DEF_FROM_DECLS(FILE, DECL, TARGET) \
do { \
@@ -148,6 +179,20 @@ along with GCC; see the file COPYING3. If not see
while (0)
#endif /* !USE_GAS */
+/* As in sparc/sol2.h, override the default from i386/x86-64.h to work
+ around Sun as TLS bug. */
+#undef ASM_OUTPUT_ALIGNED_COMMON
+#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \
+ do \
+ { \
+ if (TARGET_SUN_TLS \
+ && in_section \
+ && ((in_section->common.flags & SECTION_TLS) == SECTION_TLS)) \
+ switch_to_section (bss_section); \
+ x86_elf_aligned_common (FILE, NAME, SIZE, ALIGN); \
+ } \
+ while (0)
+
/* Output a simple call for .init/.fini. */
#define ASM_OUTPUT_CALL(FILE, FN) \
do \
@@ -174,6 +219,14 @@ along with GCC; see the file COPYING3. If not see
#define DTORS_SECTION_ASM_OP "\t.section\t.dtors, \"aw\""
#endif
+#define USE_IX86_FRAME_POINTER 1
+#define USE_X86_64_FRAME_POINTER 1
+
+#undef NO_PROFILE_COUNTERS
+
+#undef MCOUNT_NAME
+#define MCOUNT_NAME "_mcount"
+
/* We do not need NT_VERSION notes. */
#undef X86_FILE_START_VERSION_DIRECTIVE
#define X86_FILE_START_VERSION_DIRECTIVE false