Commit c81bebd7 by Michael Meissner

Solaris, Linux changes

From-SVN: r11874
parent 9cf318b5
...@@ -39,7 +39,9 @@ ...@@ -39,7 +39,9 @@
.file "crti.s" .file "crti.s"
.ident "GNU C crti.s" .ident "GNU C crti.s"
.section ".got","w" #include <ppc-asm.h>
.section ".got","aw"
.globl __GOT_START__ .globl __GOT_START__
.type __GOT_START__,@object .type __GOT_START__,@object
.weak _GLOBAL_OFFSET_TABLE_ .weak _GLOBAL_OFFSET_TABLE_
...@@ -102,3 +104,19 @@ __SBSS2_START__: ...@@ -102,3 +104,19 @@ __SBSS2_START__:
.globl __EXCEPT_START__ .globl __EXCEPT_START__
.type __EXCEPT_START__,@object .type __EXCEPT_START__,@object
__EXCEPT_START__: __EXCEPT_START__:
# Head of __init function used for static constructors in Solaris
.section ".init","ax"
.align 2
FUNC_START(__init)
stwu 1,-8(1)
mflr 0
stw 0,12(1)
# Head of __fini function used for static destructors in Solaris
.section ".fini","ax"
.align 2
FUNC_START(__fini)
stwu 1,-8(1)
mflr 0
stw 0,12(1)
...@@ -93,3 +93,17 @@ __SBSS2_END__: ...@@ -93,3 +93,17 @@ __SBSS2_END__:
.globl __EXCEPT_END__ .globl __EXCEPT_END__
.type __EXCEPT_END__,@object .type __EXCEPT_END__,@object
__EXCEPT_END__: __EXCEPT_END__:
# Tail of __init used for static constructors in Solaris
.section ".init","ax"
lwz 0,12(1)
mtlr 0
addi 1,1,8
blr
# Tail of __fini used for static destructors in Solaris
.section ".fini","ax"
lwz 0,12(1)
mtlr 0
addi 1,1,8
blr
...@@ -21,6 +21,13 @@ along with GNU CC; see the file COPYING. If not, write to ...@@ -21,6 +21,13 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330, the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */ Boston, MA 02111-1307, USA. */
/* As a special exception, if you link this library with other files,
some of which are compiled with GCC, to produce an executable,
this library does not by itself cause the resulting executable
to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why
the executable file might be covered by the GNU General Public License. */
/* Declare a pointer to void function type. */ /* Declare a pointer to void function type. */
...@@ -37,6 +44,14 @@ extern func_ptr __DTOR_END__ []; ...@@ -37,6 +44,14 @@ extern func_ptr __DTOR_END__ [];
extern void __do_global_ctors (void); extern void __do_global_ctors (void);
extern void __do_global_dtors (void); extern void __do_global_dtors (void);
extern void __init (), __fini ();
/* The Solaris linker seems to incorrectly relocate PC relative relocations
to a different section (ie, calls to __init, __fini), so avoid it by
using a function pointer. */
static void (*init_ptr) (void) = __init;
static void (*fini_ptr) (void) = __fini;
void (*__atexit)(func_ptr); void (*__atexit)(func_ptr);
/* Call all global constructors */ /* Call all global constructors */
...@@ -49,19 +64,28 @@ __do_global_ctors (void) ...@@ -49,19 +64,28 @@ __do_global_ctors (void)
if (__atexit) if (__atexit)
__atexit (__do_global_dtors); __atexit (__do_global_dtors);
/* Call the constructors collected in the .ctors section. */
for ( ; ptr != end; ptr++) for ( ; ptr != end; ptr++)
if (*ptr) if (*ptr)
(*ptr)(); (*ptr)();
/* Call the initialization function in the .init section. */
(*init_ptr) ();
} }
/* Call all global destructors */ /* Call all global destructors */
void void
__do_global_dtors (void) __do_global_dtors (void)
{ {
func_ptr *ptr = &__DTOR_LIST__[0]; func_ptr *ptr = &__DTOR_END__[0] - 1;
func_ptr *end = &__DTOR_END__[0]; func_ptr *start = &__DTOR_LIST__[0];
for ( ; ptr != end; ptr++) /* Call the termination function in the .fini section. */
(*fini_ptr) ();
/* Call the destructors collected in the .dtors section. Run
the destructors in reverse order. */
for ( ; ptr >= start; ptr--)
if (*ptr) if (*ptr)
(*ptr)(); (*ptr)();
} }
......
...@@ -22,41 +22,9 @@ Boston, MA 02111-1307, USA. */ ...@@ -22,41 +22,9 @@ Boston, MA 02111-1307, USA. */
#include "rs6000/sysv4.h" #include "rs6000/sysv4.h"
/* For now, make stabs the default debugging type, not dwarf. */ /* Add -meabi to target flags */
#undef PREFERRED_DEBUGGING_TYPE #undef TARGET_DEFAULT
#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG #define TARGET_DEFAULT (MASK_POWERPC | MASK_NEW_MNEMONICS | MASK_EABI)
/* Make int foo : 8 not cause structures to be aligned to an int boundary */
#undef PCC_BITFIELD_TYPE_MATTERS
#define PCC_BITFIELD_TYPE_MATTERS (TARGET_BITFIELD_TYPE)
/* Define this macro to be the value 1 if instructions will fail to
work if given data not on the nominal alignment. If instructions
will merely go slower in that case, define this macro as 0.
Note, little endian systems trap on unaligned addresses, so never
turn off strict alignment in that case. */
#undef STRICT_ALIGNMENT
#define STRICT_ALIGNMENT (TARGET_STRICT_ALIGN || TARGET_LITTLE_ENDIAN)
/* Align stack to 8 byte boundaries, rather than 16 bytes Sys V.4 uses */
#undef STACK_BOUNDARY
#define STACK_BOUNDARY 64
/* No data type wants to be aligned rounder than this. */
#undef BIGGEST_ALIGNMENT
#define BIGGEST_ALIGNMENT 64
/* Put PC relative got entries in .got2 */
#undef MINIMAL_TOC_SECTION_ASM_OP
#define MINIMAL_TOC_SECTION_ASM_OP \
((TARGET_RELOCATABLE) ? "\t.section\t\".got2\",\"aw\"" : "\t.section\t\".got1\",\"aw\"")
/* Put relocatable data in .data, not .rodata so initialized pointers can be updated */
#undef CONST_SECTION_ASM_OP
#define CONST_SECTION_ASM_OP \
((TARGET_RELOCATABLE) ? "\t.section\t\".data\"\t# .rodata" : "\t.section\t\".rodata\"")
/* Invoke an initializer function to set up the GOT */ /* Invoke an initializer function to set up the GOT */
#define NAME__MAIN "__eabi" #define NAME__MAIN "__eabi"
...@@ -68,23 +36,5 @@ Boston, MA 02111-1307, USA. */ ...@@ -68,23 +36,5 @@ Boston, MA 02111-1307, USA. */
#define CPP_PREDEFINES \ #define CPP_PREDEFINES \
"-DPPC -D__embedded__ -Asystem(embedded) -Acpu(powerpc) -Amachine(powerpc)" "-DPPC -D__embedded__ -Asystem(embedded) -Acpu(powerpc) -Amachine(powerpc)"
/* Clue the simulator in to use netbsd */ #undef MULTILIB_DEFAULTS
#undef LINK_START_SPEC #define MULTILIB_DEFAULTS { "mbig", "mbig-endian", "mcall-sysv-eabi", "mno-sdata" }
#define LINK_START_SPEC "%{msim: %{!Ttext*: -Ttext 0x10000074}}"
/* Use the simulator crt0 or mvme and libgloss/newlib libraries if desired */
#undef STARTFILE_SPEC
#define STARTFILE_SPEC "crti.o%s \
%{mmvme: mvme-crt0.o%s} \
%{msim: sim-crt0.o%s}"
#undef LIB_SPEC
#define LIB_SPEC "\
%{mmvme: -lmvme -lc -lmvme} \
%{msim: -lsim -lc -lsim}"
#undef LIBGCC_SPEC
#define LIBGCC_SPEC "libgcc.a%s"
#undef ENDFILE_SPEC
#define ENDFILE_SPEC "crtn.o%s"
...@@ -21,8 +21,9 @@ Boston, MA 02111-1307, USA. */ ...@@ -21,8 +21,9 @@ Boston, MA 02111-1307, USA. */
#include "rs6000/eabi.h" #include "rs6000/eabi.h"
#undef TARGET_DEFAULT /* Default ABI to use */
#define TARGET_DEFAULT (MASK_POWERPC | MASK_NEW_MNEMONICS | MASK_AIX_CALLS) #undef RS6000_ABI_NAME
#define RS6000_ABI_NAME "aix"
#undef CPP_SYSV_DEFAULT_SPEC #undef CPP_SYSV_DEFAULT_SPEC
#define CPP_SYSV_DEFAULT_SPEC "-D_CALL_AIX" #define CPP_SYSV_DEFAULT_SPEC "-D_CALL_AIX"
......
...@@ -23,13 +23,10 @@ Boston, MA 02111-1307, USA. */ ...@@ -23,13 +23,10 @@ Boston, MA 02111-1307, USA. */
#include "rs6000/eabi.h" #include "rs6000/eabi.h"
#undef TARGET_DEFAULT #undef TARGET_DEFAULT
#define TARGET_DEFAULT (MASK_POWERPC | MASK_NEW_MNEMONICS | MASK_LITTLE_ENDIAN) #define TARGET_DEFAULT (MASK_POWERPC | MASK_NEW_MNEMONICS | MASK_LITTLE_ENDIAN | MASK_EABI)
#undef CPP_ENDIAN_SPEC #undef CPP_ENDIAN_DEFAULT_SPEC
#define CPP_ENDIAN_SPEC \ #define CPP_ENDIAN_DEFAULT_SPEC "-D_LITTLE_ENDIAN -Amachine(littleendian)"
"%{mbig: -D_BIG_ENDIAN -Amachine(bigendian)} \
%{mbig-endian: -D_BIG_ENDIAN -Amachine(bigendian)} \
%{!mbig: %{!mbig-endian: -D_LITTLE_ENDIAN -Amachine(littleendian)}}"
/* Define this macro as a C expression for the initializer of an /* Define this macro as a C expression for the initializer of an
array of string to tell the driver program which options are array of string to tell the driver program which options are
...@@ -41,4 +38,4 @@ Boston, MA 02111-1307, USA. */ ...@@ -41,4 +38,4 @@ Boston, MA 02111-1307, USA. */
`MULTILIB_OPTIONS' are set by default. *Note Target Fragment::. */ `MULTILIB_OPTIONS' are set by default. *Note Target Fragment::. */
#undef MULTILIB_DEFAULTS #undef MULTILIB_DEFAULTS
#define MULTILIB_DEFAULTS { "mlittle", "mlittle-endian", "mcall-sysv", "mno-sdata" } #define MULTILIB_DEFAULTS { "mlittle", "mlittle-endian", "mcall-sysv-eabi", "mno-sdata" }
...@@ -29,19 +29,15 @@ Boston, MA 02111-1307, USA. */ ...@@ -29,19 +29,15 @@ Boston, MA 02111-1307, USA. */
#define CPP_PREDEFINES \ #define CPP_PREDEFINES \
"-DPPC -D__embedded__ -D__simulator__ -Asystem(embedded) -Asystem(simulator) -Acpu(powerpc) -Amachine(powerpc)" "-DPPC -D__embedded__ -D__simulator__ -Asystem(embedded) -Asystem(simulator) -Acpu(powerpc) -Amachine(powerpc)"
/* Use the simulator crt0 or mvme and libgloss/newlib libraries if desired */ /* Make the simulator the default */
#undef STARTFILE_SPEC #undef LIB_DEFAULT_SPEC
#define STARTFILE_SPEC "\ #define LIB_DEFAULT_SPEC LIB_SIM_SPEC
%{mmvme: mvme-crt0.o%s} \
%{!mmvme: sim-crt0.o%s}" #undef STARTFILE_DEFAULT_SPEC
#define STARTFILE_DEFAULT_SPEC STARTFILE_SIM_SPEC
#undef LIB_SPEC
#define LIB_SPEC "\ #undef ENDFILE_DEFAULT_SPEC
%{mmvme: -lmvme -lc -lmvme} \ #define ENDFILE_DEFAULT_SPEC ENDFILE_SIM_SPEC
%{!mmvme: -lsim -lc -lsim}"
#undef LINK_START_DEFAULT_SPEC
#undef LIBGCC_SPEC #define LINK_START_DEFAULT_SPEC LINK_START_SIM_SPEC
#define LIBGCC_SPEC "libgcc.a%s"
#undef ENDFILE_SPEC
#define ENDFILE_SPEC ""
...@@ -29,23 +29,15 @@ Boston, MA 02111-1307, USA. */ ...@@ -29,23 +29,15 @@ Boston, MA 02111-1307, USA. */
#define CPP_PREDEFINES \ #define CPP_PREDEFINES \
"-DPPC -D__embedded__ -D__simulator__ -Asystem(embedded) -Asystem(simulator) -Acpu(powerpc) -Amachine(powerpc)" "-DPPC -D__embedded__ -D__simulator__ -Asystem(embedded) -Asystem(simulator) -Acpu(powerpc) -Amachine(powerpc)"
/* Clue the simulator in to use netbsd */ /* Make the simulator the default */
#undef LINK_START_SPEC #undef LIB_DEFAULT_SPEC
#define LINK_START_SPEC "%{!mmvme: %{!Ttext*: -Ttext 0x10000074}}" #define LIB_DEFAULT_SPEC LIB_SIM_SPEC
/* Use the simulator crt0 or mvme and libgloss/newlib libraries if desired */ #undef STARTFILE_DEFAULT_SPEC
#undef STARTFILE_SPEC #define STARTFILE_DEFAULT_SPEC STARTFILE_SIM_SPEC
#define STARTFILE_SPEC "crti.o%s \
%{mmvme: mvme-crt0.o%s} \ #undef ENDFILE_DEFAULT_SPEC
%{!mmvme: sim-crt0.o%s}" #define ENDFILE_DEFAULT_SPEC ENDFILE_SIM_SPEC
#undef LIB_SPEC #undef LINK_START_DEFAULT_SPEC
#define LIB_SPEC "\ #define LINK_START_DEFAULT_SPEC LINK_START_SIM_SPEC
%{mmvme: -lmvme -lc -lmvme} \
%{!mmvme: -lsim -lc -lsim}"
#undef LIBGCC_SPEC
#define LIBGCC_SPEC "libgcc.a%s"
#undef ENDFILE_SPEC
#define ENDFILE_SPEC "crtn.o%s"
...@@ -4821,7 +4821,7 @@ ...@@ -4821,7 +4821,7 @@
[(set (match_operand:SI 0 "register_operand" "") [(set (match_operand:SI 0 "register_operand" "")
(unspec [(match_operand:SI 1 "got_operand" "") (unspec [(match_operand:SI 1 "got_operand" "")
(match_dup 2)] 8))] (match_dup 2)] 8))]
"DEFAULT_ABI == ABI_V4 && flag_pic" "(DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_SOLARIS) && flag_pic"
" "
{ {
if (!rs6000_pic_register) if (!rs6000_pic_register)
...@@ -4842,7 +4842,7 @@ ...@@ -4842,7 +4842,7 @@
[(set (match_operand:SI 0 "register_operand" "=r") [(set (match_operand:SI 0 "register_operand" "=r")
(unspec [(match_operand:SI 1 "got_operand" "") (unspec [(match_operand:SI 1 "got_operand" "")
(match_operand:SI 2 "register_operand" "b")] 8))] (match_operand:SI 2 "register_operand" "b")] 8))]
"DEFAULT_ABI == ABI_V4 && flag_pic == 1" "(DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_SOLARIS) && flag_pic == 1"
"{l|lwz} %0,%a1@got(%2)" "{l|lwz} %0,%a1@got(%2)"
[(set_attr "type" "load")]) [(set_attr "type" "load")])
...@@ -4855,7 +4855,7 @@ ...@@ -4855,7 +4855,7 @@
(set (match_operand:SI 0 "register_operand" "") (set (match_operand:SI 0 "register_operand" "")
(mem:SI (plus:SI (match_dup 3) (mem:SI (plus:SI (match_dup 3)
(match_operand:SI 2 "register_operand" ""))))] (match_operand:SI 2 "register_operand" ""))))]
"DEFAULT_ABI == ABI_V4 && flag_pic > 1" "(DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_SOLARIS) && flag_pic > 1"
" "
{ {
if (reload_completed || reload_in_progress) if (reload_completed || reload_in_progress)
...@@ -4867,14 +4867,14 @@ ...@@ -4867,14 +4867,14 @@
(define_insn "*movsi_got_internal2_high" (define_insn "*movsi_got_internal2_high"
[(set (match_operand:SI 0 "register_operand" "=b") [(set (match_operand:SI 0 "register_operand" "=b")
(unspec [(match_operand:SI 1 "got_operand" "")] 9))] (unspec [(match_operand:SI 1 "got_operand" "")] 9))]
"DEFAULT_ABI == ABI_V4 && flag_pic > 1" "(DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_SOLARIS) && flag_pic > 1"
"{cau|addis} %0,0,%1@got@ha") "{cau|addis} %0,0,%1@got@ha")
(define_insn "*movsi_got_internal2_losum" (define_insn "*movsi_got_internal2_losum"
[(set (match_operand:SI 0 "register_operand" "=r") [(set (match_operand:SI 0 "register_operand" "=r")
(unspec [(match_operand:SI 1 "got_operand" "") (unspec [(match_operand:SI 1 "got_operand" "")
(match_operand:SI 2 "register_operand" "b")] 10))] (match_operand:SI 2 "register_operand" "b")] 10))]
"DEFAULT_ABI == ABI_V4 && flag_pic > 1" "(DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_SOLARIS) && flag_pic > 1"
"{cal %0,%a1@got@l(%2)|addi %0,%2,%a1@got@l}") "{cal %0,%a1@got@l(%2)|addi %0,%2,%a1@got@l}")
;; For SI, we special-case integers that can't be loaded in one insn. We ;; For SI, we special-case integers that can't be loaded in one insn. We
...@@ -4896,7 +4896,7 @@ ...@@ -4896,7 +4896,7 @@
/* Use default pattern for address of ELF small data */ /* Use default pattern for address of ELF small data */
if (TARGET_ELF if (TARGET_ELF
&& DEFAULT_ABI == ABI_V4 && (DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_SOLARIS)
&& (GET_CODE (operands[1]) == SYMBOL_REF || GET_CODE (operands[1]) == CONST) && (GET_CODE (operands[1]) == SYMBOL_REF || GET_CODE (operands[1]) == CONST)
&& small_data_operand (operands[1], SImode)) && small_data_operand (operands[1], SImode))
{ {
...@@ -4904,7 +4904,8 @@ ...@@ -4904,7 +4904,8 @@
DONE; DONE;
} }
if (DEFAULT_ABI == ABI_V4 && flag_pic && got_operand (operands[1], SImode)) if ((DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_SOLARIS)
&& flag_pic && got_operand (operands[1], SImode))
{ {
emit_insn (gen_movsi_got (operands[0], operands[1])); emit_insn (gen_movsi_got (operands[0], operands[1]));
DONE; DONE;
...@@ -6821,7 +6822,7 @@ ...@@ -6821,7 +6822,7 @@
(match_operand 1 "const_int_operand" "n,n")) (match_operand 1 "const_int_operand" "n,n"))
(use (match_operand 2 "const_int_operand" "O,n")) (use (match_operand 2 "const_int_operand" "O,n"))
(clobber (match_scratch:SI 3 "=l,l"))] (clobber (match_scratch:SI 3 "=l,l"))]
"DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_AIX_NODESC" "DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_SOLARIS || DEFAULT_ABI == ABI_AIX_NODESC"
"* "*
{ {
if (INTVAL (operands[2]) & CALL_V4_SET_FP_ARGS) if (INTVAL (operands[2]) & CALL_V4_SET_FP_ARGS)
...@@ -6841,7 +6842,7 @@ ...@@ -6841,7 +6842,7 @@
(match_operand 2 "const_int_operand" "n,n"))) (match_operand 2 "const_int_operand" "n,n")))
(use (match_operand 3 "const_int_operand" "O,n")) (use (match_operand 3 "const_int_operand" "O,n"))
(clobber (match_scratch:SI 4 "=l,l"))] (clobber (match_scratch:SI 4 "=l,l"))]
"DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_AIX_NODESC" "DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_SOLARIS || DEFAULT_ABI == ABI_AIX_NODESC"
"* "*
{ {
if (INTVAL (operands[3]) & CALL_V4_SET_FP_ARGS) if (INTVAL (operands[3]) & CALL_V4_SET_FP_ARGS)
...@@ -6883,7 +6884,7 @@ ...@@ -6883,7 +6884,7 @@
if (INTVAL (operands[2]) & CALL_LONG) if (INTVAL (operands[2]) & CALL_LONG)
operands[0] = rs6000_longcall_ref (operands[0]); operands[0] = rs6000_longcall_ref (operands[0]);
if (DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_AIX_NODESC) if (DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_AIX_NODESC || DEFAULT_ABI == ABI_SOLARIS)
emit_call_insn (gen_call_indirect_sysv (force_reg (Pmode, operands[0]), emit_call_insn (gen_call_indirect_sysv (force_reg (Pmode, operands[0]),
operands[1], operands[2])); operands[1], operands[2]));
else else
...@@ -6942,7 +6943,7 @@ ...@@ -6942,7 +6943,7 @@
if (INTVAL (operands[2]) & CALL_LONG) if (INTVAL (operands[2]) & CALL_LONG)
operands[1] = rs6000_longcall_ref (operands[1]); operands[1] = rs6000_longcall_ref (operands[1]);
if (DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_AIX_NODESC) if (DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_AIX_NODESC || DEFAULT_ABI == ABI_SOLARIS)
emit_call_insn (gen_call_value_indirect_sysv (operands[0], operands[1], emit_call_insn (gen_call_value_indirect_sysv (operands[0], operands[1],
operands[2], operands[3])); operands[2], operands[3]));
else else
...@@ -7036,7 +7037,7 @@ ...@@ -7036,7 +7037,7 @@
(match_operand 1 "" "fg,fg")) (match_operand 1 "" "fg,fg"))
(use (match_operand:SI 2 "immediate_operand" "O,n")) (use (match_operand:SI 2 "immediate_operand" "O,n"))
(clobber (match_scratch:SI 3 "=l,l"))] (clobber (match_scratch:SI 3 "=l,l"))]
"(DEFAULT_ABI == ABI_AIX_NODESC || DEFAULT_ABI == ABI_V4) "(DEFAULT_ABI == ABI_AIX_NODESC || DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_SOLARIS)
&& (INTVAL (operands[2]) & CALL_LONG) == 0" && (INTVAL (operands[2]) & CALL_LONG) == 0"
"* "*
{ {
...@@ -7106,7 +7107,7 @@ ...@@ -7106,7 +7107,7 @@
(match_operand 2 "" "fg,fg"))) (match_operand 2 "" "fg,fg")))
(use (match_operand:SI 3 "immediate_operand" "O,n")) (use (match_operand:SI 3 "immediate_operand" "O,n"))
(clobber (match_scratch:SI 4 "=l,l"))] (clobber (match_scratch:SI 4 "=l,l"))]
"(DEFAULT_ABI == ABI_AIX_NODESC || DEFAULT_ABI == ABI_V4) "(DEFAULT_ABI == ABI_AIX_NODESC || DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_SOLARIS)
&& (INTVAL (operands[3]) & CALL_LONG) == 0" && (INTVAL (operands[3]) & CALL_LONG) == 0"
"* "*
{ {
...@@ -7194,7 +7195,7 @@ ...@@ -7194,7 +7195,7 @@
(define_insn "init_v4_pic" (define_insn "init_v4_pic"
[(set (match_operand:SI 0 "register_operand" "=l") [(set (match_operand:SI 0 "register_operand" "=l")
(unspec [(const_int 0)] 7))] (unspec [(const_int 0)] 7))]
"DEFAULT_ABI == ABI_V4" "DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_SOLARIS"
"bl _GLOBAL_OFFSET_TABLE_-4" "bl _GLOBAL_OFFSET_TABLE_-4"
[(set_attr "type" "branch")]) [(set_attr "type" "branch")])
...@@ -8795,7 +8796,8 @@ ...@@ -8795,7 +8796,8 @@
if (get_attr_length (insn) == 8) if (get_attr_length (insn) == 8)
return \"%C1bc %t1,%j1,%l0\"; return \"%C1bc %t1,%j1,%l0\";
else else
return \"%C1bc %T1,%j1,$+8\;b %l0\"; return \"%C1bc %T1,%j1,%$+8\;b %l0\";
}" }"
[(set_attr "type" "branch")]) [(set_attr "type" "branch")])
...@@ -8826,7 +8828,7 @@ ...@@ -8826,7 +8828,7 @@
if (get_attr_length (insn) == 8) if (get_attr_length (insn) == 8)
return \"%C1bc %T1,%j1,%l0\"; return \"%C1bc %T1,%j1,%l0\";
else else
return \"%C1bc %t1,%j1,$+8\;b %l0\"; return \"%C1bc %t1,%j1,%$+8\;b %l0\";
}" }"
[(set_attr "type" "branch")]) [(set_attr "type" "branch")])
...@@ -8980,7 +8982,7 @@ ...@@ -8980,7 +8982,7 @@
else if (get_attr_length (insn) == 8) else if (get_attr_length (insn) == 8)
return \"{bdn|bdnz} %l0\"; return \"{bdn|bdnz} %l0\";
else else
return \"bdz $+8\;b %l0\"; return \"bdz %$+8\;b %l0\";
}" }"
[(set_attr "type" "branch") [(set_attr "type" "branch")
(set_attr "length" "*,12,16")]) (set_attr "length" "*,12,16")])
...@@ -9004,7 +9006,7 @@ ...@@ -9004,7 +9006,7 @@
else if (get_attr_length (insn) == 8) else if (get_attr_length (insn) == 8)
return \"bdz %l0\"; return \"bdz %l0\";
else else
return \"{bdn|bdnz} $+8\;b %l0\"; return \"{bdn|bdnz} %$+8\;b %l0\";
}" }"
[(set_attr "type" "branch") [(set_attr "type" "branch")
(set_attr "length" "*,12,16")]) (set_attr "length" "*,12,16")])
...@@ -9029,7 +9031,7 @@ ...@@ -9029,7 +9031,7 @@
else if (get_attr_length (insn) == 8) else if (get_attr_length (insn) == 8)
return \"{bdn|bdnz} %l0\"; return \"{bdn|bdnz} %l0\";
else else
return \"bdz $+8\;b %l0\"; return \"bdz %$+8\;b %l0\";
}" }"
[(set_attr "type" "branch") [(set_attr "type" "branch")
(set_attr "length" "*,12,16")]) (set_attr "length" "*,12,16")])
...@@ -9053,7 +9055,7 @@ ...@@ -9053,7 +9055,7 @@
else if (get_attr_length (insn) == 8) else if (get_attr_length (insn) == 8)
return \"bdz %l0\"; return \"bdz %l0\";
else else
return \"{bdn|bdnz} $+8\;b %l0\"; return \"{bdn|bdnz} %$+8\;b %l0\";
}" }"
[(set_attr "type" "branch") [(set_attr "type" "branch")
(set_attr "length" "*,12,16")]) (set_attr "length" "*,12,16")])
...@@ -9077,7 +9079,7 @@ ...@@ -9077,7 +9079,7 @@
else if (get_attr_length (insn) == 8) else if (get_attr_length (insn) == 8)
return \"bdz %l0\"; return \"bdz %l0\";
else else
return \"{bdn|bdnz} $+8\;b %l0\"; return \"{bdn|bdnz} %$+8\;b %l0\";
}" }"
[(set_attr "type" "branch") [(set_attr "type" "branch")
(set_attr "length" "*,12,16")]) (set_attr "length" "*,12,16")])
...@@ -9101,7 +9103,7 @@ ...@@ -9101,7 +9103,7 @@
else if (get_attr_length (insn) == 8) else if (get_attr_length (insn) == 8)
return \"{bdn|bdnz} %l0\"; return \"{bdn|bdnz} %l0\";
else else
return \"bdz $+8\;b %l0\"; return \"bdz %$+8\;b %l0\";
}" }"
[(set_attr "type" "branch") [(set_attr "type" "branch")
(set_attr "length" "*,12,16")]) (set_attr "length" "*,12,16")])
......
/* Solaris PowerPC startfile. */
/* Copyright (C) 1996 Free Software Foundation, Inc.
This file is part of GNU CC.
GNU CC 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.
GNU CC 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 GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* As a special exception, if you link this library with other files,
some of which are compiled with GCC, to produce an executable,
this library does not by itself cause the resulting executable
to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why
the executable file might be covered by the GNU General Public License. */
extern char **_environ;
extern int atexit (void (*__func) (void));
extern void __init (void);
extern void __fini (void);
extern void __do_global_ctors (void);
typedef void (*func_ptr) (void);
int (*__atexit)(func_ptr) = atexit;
/* Start function. */
void
_start(int argc, char *argv[], char *envp[], void *auxp, void (*termfunc)())
{
int ret;
_environ = envp;
/* Register loader termination function */
if (termfunc)
atexit (termfunc);
/* Call any global constructors and destructors. */
__do_global_ctors ();
/* Call the main program now */
ret = main (argc, argv, envp, auxp);
/* Return to the os */
exit (ret);
}
/* Provide a dummy __eabi in case main got compiled without -mcall-solaris. */
void
__eabi ()
{
}
# crti.s for solaris
# Copyright (C) 1996 Free Software Foundation, Inc.
# Written By Michael Meissner
#
# This file 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.
#
# In addition to the permissions in the GNU General Public License, the
# Free Software Foundation gives you unlimited permission to link the
# compiled version of this file with other programs, and to distribute
# those programs without any restriction coming from the use of this
# file. (The General Public License restrictions do apply in other
# respects; for example, they cover modification of the file, and
# distribution when not linked into another program.)
#
# This file 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 this program; see the file COPYING. If not, write to
# the Free Software Foundation, 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
#
# As a special exception, if you link this library with files
# compiled with GCC to produce an executable, this does not cause
# the resulting executable to be covered by the GNU General Public License.
# This exception does not however invalidate any other reasons why
# the executable file might be covered by the GNU General Public License.
#
# This file just supplies labeled starting points for the .got* and other
# special sections. It is linked in first before other modules.
.file "scrti.s"
.ident "GNU C scrti.s"
# List of C++ constructors
.section ".ctors","aw"
.globl __CTOR_LIST__
.type __CTOR_LIST__,@object
__CTOR_LIST__:
# List of C++ destructors
.section ".dtors","aw"
.globl __DTOR_LIST__
.type __DTOR_LIST__,@object
__DTOR_LIST__:
# Head of __init function used for static constructors in Solaris
.section ".init","ax"
.align 2
.globl __init
.type __init,@function
__init: stwu %r1,-16(%r1)
mflr %r0
stw %r0,12(%r1)
# Head of __fini function used for static destructors in Solaris
.section ".fini","ax"
.align 2
.globl __fini
.type __fini,@function
__fini: stwu %r1,-16(%r1)
mflr %r0
stw %r0,12(%r1)
# crtn.s for solaris
# Copyright (C) 1996 Free Software Foundation, Inc.
# Written By Michael Meissner
#
# This file 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.
#
# In addition to the permissions in the GNU General Public License, the
# Free Software Foundation gives you unlimited permission to link the
# compiled version of this file with other programs, and to distribute
# those programs without any restriction coming from the use of this
# file. (The General Public License restrictions do apply in other
# respects; for example, they cover modification of the file, and
# distribution when not linked into another program.)
#
# This file 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 this program; see the file COPYING. If not, write to
# the Free Software Foundation, 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
#
# As a special exception, if you link this library with files
# compiled with GCC to produce an executable, this does not cause
# the resulting executable to be covered by the GNU General Public License.
# This exception does not however invalidate any other reasons why
# the executable file might be covered by the GNU General Public License.
#
# This file just supplies labeled ending points for the .got* and other
# special sections. It is linked in last after other modules.
.file "scrtn.s"
.ident "GNU C scrtn.s"
# End list of C++ constructors
.section ".ctors","aw"
.globl __CTOR_END__
.type __CTOR_END__,@object
__CTOR_END__:
# End list of C++ destructors
.section ".dtors","aw"
.globl __DTOR_END__
.type __DTOR_END__,@object
__DTOR_END__:
# Tail of __init used for static constructors in Solaris
.section ".init","ax"
lwz %r0,12(%r1)
mtlr %r0
addi %r1,%r1,16
blr
# Tail of __fini used for static destructors in Solaris
.section ".fini","ax"
lwz %r0,12(%r1)
mtlr %r0
addi %r1,%r1,16
blr
/* Definitions of target machine for GNU compiler,
for IBM RS/6000 running AIX version 3.1.
Copyright (C) 1993 Free Software Foundation, Inc.
Contributed by Richard Kenner (kenner@nyu.edu)
This file is part of GNU CC.
GNU CC 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.
GNU CC 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 GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "rs6000/sysv4le.h"
#undef CPP_PREDEFINES
#define CPP_PREDEFINES \
"-Dsun=1 -Dunix -D__svr4__ -DSVR4 -DPPC \
-D__ppc -Asystem(unix) -Asystem(svr4) -Acpu(powerpc) -Amachine(prep)"
#undef ASM_CPU_SPEC
#define ASM_CPU_SPEC "%{fpic:-K PIC} %{fPIC:-K PIC} -le -s"
/* This should be the same as in svr4.h, except with -R added. */
#undef LINK_SPEC
#define LINK_SPEC \
"%{h*} %{v:-V} %{G*} \
%{b} %{Wl,*:%*} \
%{static:-dn -Bstatic} \
%{shared:-G -dy -z text %{!h*:%{o*:-h %*}}} \
%{symbolic:-Bsymbolic -G -dy -z text %{!h*:%{o*:-h %*}}} \
%{G:-G} \
%{YP,*} \
%{R*} %{!static:%{!R*:%{L*:-R %*}}} \
%{compat-bsd: \
%{!YP,*:%{p:-Y P,/usr/ucblib:/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
%{!p:-Y P,/usr/ucblib:/usr/ccs/lib:/usr/lib}} \
-R /usr/ucblib} \
%{!compat-bsd: \
%{!YP,*:%{p:-Y P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
%{!p:-Y P,/usr/ccs/lib:/usr/lib}}} \
%{Qy:} %{!Qn:-Qy}"
/* This defines which switch letters take arguments.
It is as in svr4.h but with -R added. */
#undef TARGET_DEFAULT
#define TARGET_DEFAULT (MASK_POWERPC | \
MASK_NEW_MNEMONICS | \
MASK_LITTLE_ENDIAN | \
MASK_NO_MAIN_INIT | \
MASK_REGNAMES)
#undef LIB_DEFAULT_SPEC
#define LIB_DEFAULT_SPEC LIB_SOLARIS_SPEC
#undef STARTFILE_DEFAULT_SPEC
#define STARTFILE_DEFAULT_SPEC STARTFILE_SOLARIS_SPEC
#undef ENDFILE_DEFAULT_SPEC
#define ENDFILE_DEFAULT_SPEC ENDFILE_SOLARIS_SPEC
#undef LINK_START_DEFAULT_SPEC
#define LINK_START_DEFAULT_SPEC LINK_START_SOLARIS_SPEC
/* Don't turn -B into -L if the argument specifies a relative file name. */
#undef RELATIVE_PREFIX_NOT_LINKDIR
#define DEFAULT_PCC_STRUCT_RETURN 0
#undef TARGET_VERSION
#define TARGET_VERSION fprintf (stderr, " (PowerPC Solaris)");
/* Macros to check register numbers against specific register classes. */
#undef PREFERRED_DEBUGGING_TYPE
#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
#undef ASM_OUTPUT_ALIGNED_LOCAL
#define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \
do { \
fprintf ((FILE), "\t%s\t", ".lcomm"); \
assemble_name ((FILE), (NAME)); \
fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \
} while (0)
/* Like block addresses, stabs line numbers are relative to the
current function. */
/* use .stabd instead of .stabn */
#define ASM_STABN_OP ".stabd"
#undef SKIP_ASM_OP
#define SKIP_ASM_OP ".skip"
#undef ASM_OUTPUT_SOURCE_LINE
#define ASM_OUTPUT_SOURCE_LINE(file, line) \
do \
{ \
static int sym_lineno = 1; \
char *_p; \
fprintf (file, "\t.stabd 68,0,%d,.LM%d-", \
line, sym_lineno); \
STRIP_NAME_ENCODING (_p, XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0)); \
assemble_name (file, _p); \
fprintf (file, "\n.LM%d:\n", sym_lineno); \
sym_lineno += 1; \
} \
while (0)
/* This is how to output an assembler line defining a `double' constant. */
#undef ASM_OUTPUT_DOUBLE
#define ASM_OUTPUT_DOUBLE(FILE, VALUE) \
{ \
if (REAL_VALUE_ISINF (VALUE) \
|| REAL_VALUE_ISNAN (VALUE) \
|| REAL_VALUE_MINUS_ZERO (VALUE)) \
{ \
long t[2]; \
REAL_VALUE_TO_TARGET_DOUBLE ((VALUE), t); \
fprintf (FILE, "\t.long 0x%lx\n\t.long 0x%lx\n", \
t[0] & 0xffffffff, t[1] & 0xffffffff); \
} \
else \
{ \
char str[30]; \
REAL_VALUE_TO_DECIMAL (VALUE, "%.20e", str); \
fprintf (FILE, "\t.double %s\n", str); \
} \
}
/* This is how to output an assembler line defining a `float' constant. */
#undef ASM_OUTPUT_FLOAT
#define ASM_OUTPUT_FLOAT(FILE, VALUE) \
{ \
if (REAL_VALUE_ISINF (VALUE) \
|| REAL_VALUE_ISNAN (VALUE) \
|| REAL_VALUE_MINUS_ZERO (VALUE)) \
{ \
long t; \
REAL_VALUE_TO_TARGET_SINGLE ((VALUE), t); \
fprintf (FILE, "\t.long 0x%lx\n", t & 0xffffffff); \
} \
else \
{ \
char str[30]; \
REAL_VALUE_TO_DECIMAL ((VALUE), "%.20e", str); \
fprintf (FILE, "\t.float %s\n", str); \
} \
}
/* Sun-ppc assembler does not permit '.' in some symbol names.
Use 'name_.labelno' instead. */
#undef ASM_FORMAT_PRIVATE_NAME
#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
sprintf ((OUTPUT), "%s_.%d", (NAME), (LABELNO)))
#define ASM_RELOCATION_EXPRESSIONS 1
...@@ -25,12 +25,8 @@ Boston, MA 02111-1307, USA. */ ...@@ -25,12 +25,8 @@ Boston, MA 02111-1307, USA. */
#undef TARGET_DEFAULT #undef TARGET_DEFAULT
#define TARGET_DEFAULT (MASK_POWERPC | MASK_NEW_MNEMONICS | MASK_LITTLE_ENDIAN) #define TARGET_DEFAULT (MASK_POWERPC | MASK_NEW_MNEMONICS | MASK_LITTLE_ENDIAN)
#undef CPP_ENDIAN_SPEC #undef CPP_ENDIAN_DEFAULT_SPEC
#define CPP_ENDIAN_SPEC \ #define CPP_ENDIAN_DEFAULT_SPEC "-D_LITTLE_ENDIAN -Amachine(littleendian)"
"%{mbig: -D_BIG_ENDIAN -Amachine(bigendian)} \
%{mbig-endian: -D_BIG_ENDIAN -Amachine(bigendian)} \
%{!mbig: %{!mbig-endian: -D_LITTLE_ENDIAN -Amachine(littleendian)}}"
/* Define this macro as a C expression for the initializer of an /* Define this macro as a C expression for the initializer of an
array of string to tell the driver program which options are array of string to tell the driver program which options are
...@@ -42,4 +38,4 @@ Boston, MA 02111-1307, USA. */ ...@@ -42,4 +38,4 @@ Boston, MA 02111-1307, USA. */
`MULTILIB_OPTIONS' are set by default. *Note Target Fragment::. */ `MULTILIB_OPTIONS' are set by default. *Note Target Fragment::. */
#undef MULTILIB_DEFAULTS #undef MULTILIB_DEFAULTS
#define MULTILIB_DEFAULTS { "mlittle", "mlittle-endian", "mcall-sysv", "mno-sdata" } #define MULTILIB_DEFAULTS { "mlittle", "mlittle-endian", "mcall-sysv-noeabi", "mno-sdata" }
...@@ -6,7 +6,7 @@ EXTRA_HEADERS = $(srcdir)/ginclude/ppc-asm.h ...@@ -6,7 +6,7 @@ EXTRA_HEADERS = $(srcdir)/ginclude/ppc-asm.h
# These are really part of libgcc1, but this will cause them to be # These are really part of libgcc1, but this will cause them to be
# built correctly, so... [taken from t-sparclite] # built correctly, so... [taken from t-sparclite]
LIB2FUNCS_EXTRA = fp-bit.c dp-bit.c LIB2FUNCS_EXTRA = fp-bit.c dp-bit.c eabi.S eabi-ctors.c
dp-bit.c: $(srcdir)/config/fp-bit.c dp-bit.c: $(srcdir)/config/fp-bit.c
cat $(srcdir)/config/fp-bit.c > dp-bit.c cat $(srcdir)/config/fp-bit.c > dp-bit.c
...@@ -15,15 +15,87 @@ fp-bit.c: $(srcdir)/config/fp-bit.c ...@@ -15,15 +15,87 @@ fp-bit.c: $(srcdir)/config/fp-bit.c
echo '#define FLOAT' > fp-bit.c echo '#define FLOAT' > fp-bit.c
cat $(srcdir)/config/fp-bit.c >> fp-bit.c cat $(srcdir)/config/fp-bit.c >> fp-bit.c
eabi.S: $(srcdir)/config/rs6000/eabi.asm
cat $(srcdir)/config/rs6000/eabi.asm > eabi.S
eabi-ctors.c: $(srcdir)/config/rs6000/eabi-ctors.c
cat $(srcdir)/config/rs6000/eabi-ctors.c > eabi-ctors.c
# Build libgcc.a with different options. If no gas support, don't build # Build libgcc.a with different options. If no gas support, don't build
# explicit little endian or big endian libraries, since it depends on the # explicit little endian or big endian libraries, since it depends on the
# -mbig/-mlittle switches passed to gas. # -mbig/-mlittle switches passed to gas. The -mrelocatable support also needs
# -mrelocatable passed to gas, so don't use it either.
MULTILIB_OPTIONS = msoft-float \
mcall-sysv-noeabi/mcall-sysv-eabi/mcall-aix
MULTILIB_OPTIONS = msoft-float MULTILIB_DIRNAMES = nof \
MULTILIB_DIRNAMES = soft-float le be \
MULTILIB_MATCHES = msoft-float=mcpu?403 \ cs ce ca
MULTILIB_MATCHES = mlittle=mlittle-endian \
mbig=mbig-endian \
mlittle=mcall-solaris \
mbig=mcall-linux \
msoft-float=mcpu?403 \
msoft-float=mcpu?821 \ msoft-float=mcpu?821 \
msoft-float=mcpu?860 msoft-float=mcpu?860 \
mcall-sysv-noeabi=mcall-solaris \
mcall-sysv-noeabi=mcall-linux \
mcall-sysv-eabi=meabi \
mcall-sysv-noeabi=mno-eabi
MULTILIB_EXCEPTIONS =
LIBGCC = stmp-multilib stmp-crt
INSTALL_LIBGCC = install-multilib install-crt
# For eabi we build crti.o and crtn.o which serve to add begin and
# end labels to all of the special sections used when we link using gcc.
# Assemble startup files.
ecrti.S: $(srcdir)/config/rs6000/eabi-ci.asm
cat $(srcdir)/config/rs6000/eabi-ci.asm >ecrti.S
ecrtn.S: $(srcdir)/config/rs6000/eabi-cn.asm
cat $(srcdir)/config/rs6000/eabi-cn.asm >ecrtn.S
scrti.S: $(srcdir)/config/rs6000/sol-ci.asm
cat $(srcdir)/config/rs6000/sol-ci.asm >scrti.S
scrtn.S: $(srcdir)/config/rs6000/sol-cn.asm
cat $(srcdir)/config/rs6000/sol-cn.asm >scrtn.S
scrt0.c: $(srcdir)/config/rs6000/sol-c0.c
cat $(srcdir)/config/rs6000/sol-c0.c >scrt0.c
# Build multiple copies of crt{i,n}.o, one for each target switch.
stmp-crt: ecrti.S ecrtn.S scrti.S scrtn.S scrt0.c $(GCC_PASSES) $(EXTRA_HEADERS) stmp-multilib config.status
for i in `$(GCC_FOR_TARGET) --print-multi-lib`; do \
dir=`echo $$i | sed -e 's/;.*$$//'`; \
flags=`echo $$i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; \
$(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS) $${flags}" \
dir="$${dir}" stmp-crt-sub; \
if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
done
touch stmp-crt
# Subroutine of stmp-crt so make -n works.
stmp-crt-sub:
$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -c -o $(dir)/ecrti.o ecrti.S
$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -c -o $(dir)/ecrtn.o ecrtn.S
$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -c -o $(dir)/scrti.o scrti.S
$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -c -o $(dir)/scrtn.o scrtn.S
$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -c -o $(dir)/scrt0.o scrt0.c
LIBGCC = stmp-multilib # Install multiple versions of crt[in].o
INSTALL_LIBGCC = install-multilib install-crt: stmp-crt install-dir install-multilib
for i in `$(GCC_FOR_TARGET) --print-multi-lib`; do \
dir=`echo $$i | sed -e 's/;.*$$//'`; \
rm -f $(libsubdir)/$${dir}/[es]crt[in0].o; \
$(INSTALL_DATA) $${dir}/ecrti.o $(libsubdir)/$${dir}/ecrti.o; \
$(INSTALL_DATA) $${dir}/ecrtn.o $(libsubdir)/$${dir}/ecrtn.o; \
$(INSTALL_DATA) $${dir}/scrti.o $(libsubdir)/$${dir}/scrti.o; \
$(INSTALL_DATA) $${dir}/scrtn.o $(libsubdir)/$${dir}/scrtn.o; \
$(INSTALL_DATA) $${dir}/scrt0.o $(libsubdir)/$${dir}/scrt0.o; \
done
...@@ -6,7 +6,7 @@ EXTRA_HEADERS = $(srcdir)/ginclude/ppc-asm.h ...@@ -6,7 +6,7 @@ EXTRA_HEADERS = $(srcdir)/ginclude/ppc-asm.h
# These are really part of libgcc1, but this will cause them to be # These are really part of libgcc1, but this will cause them to be
# built correctly, so... [taken from t-sparclite] # built correctly, so... [taken from t-sparclite]
LIB2FUNCS_EXTRA = fp-bit.c dp-bit.c LIB2FUNCS_EXTRA = fp-bit.c dp-bit.c eabi.S eabi-ctors.c
dp-bit.c: $(srcdir)/config/fp-bit.c dp-bit.c: $(srcdir)/config/fp-bit.c
cat $(srcdir)/config/fp-bit.c > dp-bit.c cat $(srcdir)/config/fp-bit.c > dp-bit.c
...@@ -15,23 +15,88 @@ fp-bit.c: $(srcdir)/config/fp-bit.c ...@@ -15,23 +15,88 @@ fp-bit.c: $(srcdir)/config/fp-bit.c
echo '#define FLOAT' > fp-bit.c echo '#define FLOAT' > fp-bit.c
cat $(srcdir)/config/fp-bit.c >> fp-bit.c cat $(srcdir)/config/fp-bit.c >> fp-bit.c
eabi.S: $(srcdir)/config/rs6000/eabi.asm
cat $(srcdir)/config/rs6000/eabi.asm > eabi.S
eabi-ctors.c: $(srcdir)/config/rs6000/eabi-ctors.c
cat $(srcdir)/config/rs6000/eabi-ctors.c > eabi-ctors.c
# Build libgcc.a with different options. # Build libgcc.a with different options.
MULTILIB_OPTIONS = msoft-float \ MULTILIB_OPTIONS = msoft-float \
mrelocatable \
mlittle/mbig \ mlittle/mbig \
mcall-sysv/mcall-aix # /mcall-aixdesc mcall-sysv-noeabi/mcall-sysv-eabi/mcall-aix
MULTILIB_DIRNAMES = soft-float \ MULTILIB_DIRNAMES = nof \
little big \ rel \
sysv aix # aixdesc le be \
cs ce ca
MULTILIB_MATCHES = mlittle=mlittle-endian \ MULTILIB_MATCHES = mlittle=mlittle-endian \
mbig=mbig-endian \ mbig=mbig-endian \
mlittle=mcall-solaris \
mbig=mcall-linux \
msoft-float=mcpu?403 \ msoft-float=mcpu?403 \
msoft-float=mcpu?821 \ msoft-float=mcpu?821 \
msoft-float=mcpu?860 msoft-float=mcpu?860 \
mcall-sysv-noeabi=mcall-solaris \
mcall-sysv-noeabi=mcall-linux \
mcall-sysv-eabi=meabi \
mcall-sysv-noeabi=mno-eabi
MULTILIB_EXCEPTIONS =
LIBGCC = stmp-multilib stmp-crt
INSTALL_LIBGCC = install-multilib install-crt
# For eabigas we build {e,s}crti.o and {e,s}crtn.o which serve to add begin and
# end labels to all of the special sections used when we link using gcc.
# Assemble startup files.
ecrti.S: $(srcdir)/config/rs6000/eabi-ci.asm
cat $(srcdir)/config/rs6000/eabi-ci.asm >ecrti.S
ecrtn.S: $(srcdir)/config/rs6000/eabi-cn.asm
cat $(srcdir)/config/rs6000/eabi-cn.asm >ecrtn.S
scrti.S: $(srcdir)/config/rs6000/sol-ci.asm
cat $(srcdir)/config/rs6000/sol-ci.asm >scrti.S
scrtn.S: $(srcdir)/config/rs6000/sol-cn.asm
cat $(srcdir)/config/rs6000/sol-cn.asm >scrtn.S
scrt0.c: $(srcdir)/config/rs6000/sol-c0.c
cat $(srcdir)/config/rs6000/sol-c0.c >scrt0.c
# Build multiple copies of crt{i,n}.o, one for each target switch.
stmp-crt: ecrti.S ecrtn.S scrti.S scrtn.S scrt0.c $(GCC_PASSES) $(EXTRA_HEADERS) stmp-multilib config.status
for i in `$(GCC_FOR_TARGET) --print-multi-lib`; do \
dir=`echo $$i | sed -e 's/;.*$$//'`; \
flags=`echo $$i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; \
$(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS) $${flags}" \
dir="$${dir}" stmp-crt-sub; \
if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
done
touch stmp-crt
#MULTILIB_EXCEPTIONS = *mlittle/*mcall-aixdesc* # Subroutine of stmp-crt so make -n works.
stmp-crt-sub:
$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -c -o $(dir)/ecrti.o ecrti.S
$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -c -o $(dir)/ecrtn.o ecrtn.S
$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -c -o $(dir)/scrti.o scrti.S
$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -c -o $(dir)/scrtn.o scrtn.S
$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -c -o $(dir)/scrt0.o scrt0.c
LIBGCC = stmp-multilib # Install multiple versions of crt[in].o
INSTALL_LIBGCC = install-multilib install-crt: stmp-crt install-dir install-multilib
for i in `$(GCC_FOR_TARGET) --print-multi-lib`; do \
dir=`echo $$i | sed -e 's/;.*$$//'`; \
rm -f $(libsubdir)/$${dir}/[es]crt[in0].o; \
$(INSTALL_DATA) $${dir}/ecrti.o $(libsubdir)/$${dir}/ecrti.o; \
$(INSTALL_DATA) $${dir}/ecrtn.o $(libsubdir)/$${dir}/ecrtn.o; \
$(INSTALL_DATA) $${dir}/scrti.o $(libsubdir)/$${dir}/scrti.o; \
$(INSTALL_DATA) $${dir}/scrtn.o $(libsubdir)/$${dir}/scrtn.o; \
$(INSTALL_DATA) $${dir}/scrt0.o $(libsubdir)/$${dir}/scrt0.o; \
done
...@@ -48,6 +48,13 @@ Boston, MA 02111-1307, USA. */ ...@@ -48,6 +48,13 @@ Boston, MA 02111-1307, USA. */
#include "xm-svr4.h" #include "xm-svr4.h"
/* if not compiled with GNU C, use the C alloca and use only int bitfields. */
#ifndef __GNUC__ #ifndef __GNUC__
#define USE_C_ALLOCA
extern char *alloca ();
#undef ONLY_INT_FIELDS
#define ONLY_INT_FIELDS #define ONLY_INT_FIELDS
#endif #endif
/* Solaris has a different declaration of sys_siglist than collect uses. */
#define DONT_DECLARE_SYS_SIGLIST
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment