mirror of
https://review.haiku-os.org/buildtools
synced 2025-01-18 12:28:37 +01:00
Patch by Nathan Mentley: Fixed multilib generation for x86-64.
git-svn-id: file:///srv/svn/repos/haiku/buildtools/trunk@37521 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
107d3d5cca
commit
b363ec1bd9
@ -1063,8 +1063,9 @@ i[34567]86-*-haiku*)
|
||||
extra_parts='crtbegin.o crtend.o'
|
||||
;;
|
||||
x86_64-*-haiku*)
|
||||
tmake_file='t-haiku i386/t-crtpic'
|
||||
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h haiku.h i386/x86-64.h i386/haiku64.h"
|
||||
tmake_file='t-haiku i386/t-haiku64 i386/t-crtpic'
|
||||
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h haiku.h i386/haiku64.h"
|
||||
extra_parts='crtbegin.o crtend.o'
|
||||
;;
|
||||
i[34567]86-*-netbsdelf*)
|
||||
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/netbsd-elf.h"
|
||||
|
@ -20,7 +20,7 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
|
||||
#if TARGET_64BIT_DEFAULT
|
||||
#if TARGET_64BIT
|
||||
#define TARGET_VERSION fprintf (stderr, " (x86-64 Haiku/ELF)");
|
||||
#else
|
||||
#define TARGET_VERSION fprintf (stderr, " (i386 Haiku/ELF)");
|
||||
@ -35,21 +35,46 @@ Boston, MA 02111-1307, USA. */
|
||||
#undef DEFAULT_PCC_STRUCT_RETURN
|
||||
#define DEFAULT_PCC_STRUCT_RETURN 1
|
||||
|
||||
#undef DBX_REGISTER_NUMBER
|
||||
#define DBX_REGISTER_NUMBER(n) \
|
||||
(TARGET_64BIT ? dbx64_register_map[n] : svr4_dbx_register_map[n])
|
||||
|
||||
#if TARGET_64BIT
|
||||
#define TARGET_OS_CPP_BUILTINS() \
|
||||
do \
|
||||
{ \
|
||||
builtin_define ("__HAIKU__"); \
|
||||
builtin_define ("__x86_64__"); \
|
||||
builtin_define ("__stdcall=__attribute__((__stdcall__))"); \
|
||||
builtin_define ("__cdecl=__attribute__((__cdecl__))"); \
|
||||
builtin_assert ("system=haiku"); \
|
||||
builtin_assert ("system=haiku"); \
|
||||
/* Haiku apparently doesn't support merging of symbols across shared \
|
||||
object boundaries. Hence we need to explicitly specify that \
|
||||
type_infos are not merged, so that they get compared by name \
|
||||
instead of by pointer. */ \
|
||||
builtin_define ("__GXX_MERGED_TYPEINFO_NAMES=0"); \
|
||||
builtin_define ("__GXX_TYPEINFO_EQUALITY_INLINE=0"); \
|
||||
builtin_define ("__GXX_MERGED_TYPEINFO_NAMES=0"); \
|
||||
builtin_define ("__GXX_TYPEINFO_EQUALITY_INLINE=0"); \
|
||||
} \
|
||||
while (0)
|
||||
#else
|
||||
#define TARGET_OS_CPP_BUILTINS() \
|
||||
do \
|
||||
{ \
|
||||
builtin_define ("__HAIKU__"); \
|
||||
builtin_define ("__INTEL__"); \
|
||||
builtin_define ("__X86__"); \
|
||||
builtin_define ("__stdcall=__attribute__((__stdcall__))"); \
|
||||
builtin_define ("__cdecl=__attribute__((__cdecl__))"); \
|
||||
builtin_assert ("system=haiku"); \
|
||||
/* Haiku apparently doesn't support merging of symbols across shared \
|
||||
object boundaries. Hence we need to explicitly specify that \
|
||||
type_infos are not merged, so that they get compared by name \
|
||||
instead of by pointer. */ \
|
||||
builtin_define ("__GXX_MERGED_TYPEINFO_NAMES=0"); \
|
||||
builtin_define ("__GXX_TYPEINFO_EQUALITY_INLINE=0"); \
|
||||
} \
|
||||
while (0)
|
||||
#endif
|
||||
|
||||
/* Provide a LINK_SPEC appropriate for Haiku. Here we provide support
|
||||
for the special GCC options -static and -shared, which allow us to
|
||||
@ -57,5 +82,59 @@ Boston, MA 02111-1307, USA. */
|
||||
combinations of options at link-time. */
|
||||
|
||||
#undef LINK_SPEC
|
||||
#define LINK_SPEC "-m elf_x86_64_haiku -shared -Bsymbolic %{nostart:-e 0} %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}}"
|
||||
#if TARGET_64BIT
|
||||
#define LINK_SPEC "-m elf_x86_64 -z max-page-size=0x1000 -shared -Bsymbolic %{nostart:-e 0} %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}}"
|
||||
#else
|
||||
#define LINK_SPEC "-m elf_i386_haiku -shared -Bsymbolic %{nostart:-e 0} %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}}"
|
||||
#endif
|
||||
|
||||
|
||||
/* A C statement (sans semicolon) to output to the stdio stream
|
||||
FILE the assembler definition of uninitialized global DECL named
|
||||
NAME whose size is SIZE bytes and alignment is ALIGN bytes.
|
||||
Try to use asm_output_aligned_bss to implement this macro. */
|
||||
|
||||
#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
|
||||
asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
|
||||
|
||||
/* A C statement to output to the stdio stream FILE an assembler
|
||||
command to advance the location counter to a multiple of 1<<LOG
|
||||
bytes if it is within MAX_SKIP bytes.
|
||||
|
||||
This is used to align code labels according to Intel recommendations. */
|
||||
|
||||
#ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
|
||||
#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP) \
|
||||
if ((LOG)!=0) \
|
||||
if ((MAX_SKIP)==0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \
|
||||
else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP))
|
||||
#endif
|
||||
|
||||
|
||||
/* Output assembler code to FILE to call the profiler. */
|
||||
#define NO_PROFILE_COUNTERS 1
|
||||
|
||||
#undef ASM_SPEC
|
||||
#define ASM_SPEC "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} \
|
||||
%{Wa,*:%*} %{m32:--32} %{m64:--64}"
|
||||
|
||||
#undef ASM_OUTPUT_ALIGNED_COMMON
|
||||
#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \
|
||||
x86_elf_aligned_common (FILE, NAME, SIZE, ALIGN);
|
||||
|
||||
|
||||
/* i386 System V Release 4 uses DWARF debugging info.
|
||||
x86-64 ABI specifies DWARF2. */
|
||||
#if TARGET_64BIT
|
||||
#define DWARF2_DEBUGGING_INFO 1
|
||||
#define DWARF2_UNWIND_INFO 1
|
||||
|
||||
#undef PREFERRED_DEBUGGING_TYPE
|
||||
#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
|
||||
|
||||
#undef TARGET_ASM_SELECT_SECTION
|
||||
#define TARGET_ASM_SELECT_SECTION x86_64_elf_select_section
|
||||
|
||||
#undef TARGET_ASM_UNIQUE_SECTION
|
||||
#define TARGET_ASM_UNIQUE_SECTION x86_64_elf_unique_section
|
||||
#endif
|
||||
|
3
gcc/gcc/config/i386/t-haiku64
Normal file
3
gcc/gcc/config/i386/t-haiku64
Normal file
@ -0,0 +1,3 @@
|
||||
MULTILIB_OPTIONS = m32
|
||||
MULTILIB_DIRNAMES = legacy
|
||||
MULTILIB_OSDIRNAMES = legacy
|
Loading…
Reference in New Issue
Block a user