Disable tests for strdup/strndup on __hpux__
[official-gcc.git] / gcc / config / kfreebsd-d.cc
blob7435e9d7ba2b7652c1a013e628fe5ca88f2a97ea
1 /* kFreeBSD-based GNU systems support needed only by D front-end.
2 Copyright (C) 2017-2024 Free Software Foundation, Inc.
4 GCC is free software; you can redistribute it and/or modify it under
5 the terms of the GNU General Public License as published by the Free
6 Software Foundation; either version 3, or (at your option) any later
7 version.
9 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
10 WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 for more details.
14 You should have received a copy of the GNU General Public License
15 along with GCC; see the file COPYING3. If not see
16 <http://www.gnu.org/licenses/>. */
18 #include "config.h"
19 #include "system.h"
20 #include "coretypes.h"
21 #include "tm.h"
22 #include "tm_d.h"
23 #include "d/d-target.h"
24 #include "d/d-target-def.h"
26 /* Implement TARGET_D_OS_VERSIONS for kFreeBSD targets. */
28 static void
29 kfreebsd_d_os_builtins (void)
31 d_add_builtin_version ("Posix");
32 d_add_builtin_version ("FreeBSD");
33 d_add_builtin_version ("CRuntime_Glibc");
36 /* Handle a call to `__traits(getTargetInfo, "objectFormat")'. */
38 static tree
39 kfreebsd_d_handle_target_object_format (void)
41 const char *objfmt = "elf";
43 return build_string_literal (strlen (objfmt) + 1, objfmt);
46 /* Implement TARGET_D_REGISTER_OS_TARGET_INFO for kFreeBSD targets. */
48 static void
49 kfreebsd_d_register_target_info (void)
51 const struct d_target_info_spec handlers[] = {
52 { "objectFormat", kfreebsd_d_handle_target_object_format },
53 { NULL, NULL },
56 d_add_target_info_handlers (handlers);
59 #undef TARGET_D_OS_VERSIONS
60 #define TARGET_D_OS_VERSIONS kfreebsd_d_os_builtins
62 #undef TARGET_D_REGISTER_OS_TARGET_INFO
63 #define TARGET_D_REGISTER_OS_TARGET_INFO kfreebsd_d_register_target_info
65 struct gcc_targetdm targetdm = TARGETDM_INITIALIZER;