]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/config/i386/netbsd64.h
netbsd64.h (CPP_LP64_SPEC): Define.
[thirdparty/gcc.git] / gcc / config / i386 / netbsd64.h
1 /* Definitions of target machine for GNU compiler,
2 for x86-64/ELF NetBSD systems.
3 Copyright (C) 2002 Free Software Foundation, Inc.
4 Contributed by Wasabi Systems, Inc.
5
6 This file is part of GNU CC.
7
8 GNU CC is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
11 any later version.
12
13 GNU CC is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with GNU CC; see the file COPYING. If not, write to
20 the Free Software Foundation, 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. */
22
23
24 /* Provide a LINK_SPEC appropriate for a NetBSD/x86-64 ELF target.
25 This is a copy of LINK_SPEC from <netbsd-elf.h> tweaked for
26 the x86-64 target. */
27
28 #undef LINK_SPEC
29 #define LINK_SPEC \
30 "%{!m32:-m elf_x86_64} \
31 %{m32:-m elf_i386} \
32 %{assert*} %{R*} \
33 %{shared:-shared} \
34 %{!shared: \
35 -dc -dp \
36 %{!nostdlib: \
37 %{!r*: \
38 %{!e*:-e _start}}} \
39 %{!static: \
40 %{rdynamic:-export-dynamic} \
41 %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.elf_so}} \
42 %{static:-static}}"
43
44
45 /* Names to predefine in the preprocessor for this target machine. */
46
47 #define CPP_PREDEFINES \
48 "-D__NetBSD__ -D__ELF__ -Asystem=unix -Asystem=NetBSD"
49
50
51 /* Provide some extra CPP specs needed by NetBSD/x86_64. */
52 #define CPP_LP64_SPEC "%{!m32:-D_LP64}"
53
54 #define CPP_SUBTARGET_SPEC "%(cpp_lp64)"
55
56 #undef SUBTARGET_EXTRA_SPECS
57 #define SUBTARGET_EXTRA_SPECS \
58 { "cpp_lp64", CPP_LP64_SPEC }, \
59 { "cpp_subtarget", CPP_SUBTARGET_SPEC },
60
61
62 /* Provide a CPP_SPEC appropriate for NetBSD. Currently we deal with
63 our subtarget specs and the GCC option `-posix'. */
64
65 #undef CPP_SPEC
66 #define CPP_SPEC "%(cpp_cpu) %(cpp_subtarget) %{posix:-D_POSIX_SOURCE}"
67
68
69 /* Output assembler code to FILE to call the profiler. */
70
71 #undef FUNCTION_PROFILER
72 #define FUNCTION_PROFILER(FILE, LABELNO) \
73 { \
74 if (TARGET_64BIT && flag_pic) \
75 fprintf (FILE, "\tcall *__mcount@PLT\n"); \
76 else if (flag_pic) \
77 fprintf (FILE, "\tcall *__mcount@PLT\n"); \
78 else \
79 fprintf (FILE, "\tcall __mcount\n"); \
80 }
81
82
83 #define TARGET_VERSION fprintf (stderr, " (NetBSD/x86_64 ELF)");