150397Sobrien/* Configuration for an OpenBSD i386 target. 2132718Skan Copyright (C) 1999, 2000, 2002, 2004 Free Software Foundation, Inc. 350397Sobrien 4132718SkanThis file is part of GCC. 550397Sobrien 6132718SkanGCC is free software; you can redistribute it and/or modify 750397Sobrienit under the terms of the GNU General Public License as published by 850397Sobrienthe Free Software Foundation; either version 2, or (at your option) 950397Sobrienany later version. 1050397Sobrien 11132718SkanGCC is distributed in the hope that it will be useful, 1250397Sobrienbut WITHOUT ANY WARRANTY; without even the implied warranty of 1350397SobrienMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1450397SobrienGNU General Public License for more details. 1550397Sobrien 1650397SobrienYou should have received a copy of the GNU General Public License 17132718Skanalong with GCC; see the file COPYING. If not, write to 18169689Skanthe Free Software Foundation, 51 Franklin Street, Fifth Floor, 19169689SkanBoston, MA 02110-1301, USA. */ 2050397Sobrien 2150397Sobrien 22117395Skan#define TARGET_VERSION fprintf (stderr, " (OpenBSD/i386)"); 2350397Sobrien 2452284Sobrien/* This goes away when the math-emulator is fixed */ 2590075Sobrien#undef TARGET_SUBTARGET_DEFAULT 2690075Sobrien#define TARGET_SUBTARGET_DEFAULT \ 2752284Sobrien (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS | MASK_NO_FANCY_MATH_387) 2852284Sobrien 29117395Skan#define TARGET_OS_CPP_BUILTINS() \ 30117395Skan do \ 31117395Skan { \ 32117395Skan builtin_define ("__unix__"); \ 33117395Skan builtin_define ("__OpenBSD__"); \ 34117395Skan builtin_assert ("system=unix"); \ 35117395Skan builtin_assert ("system=bsd"); \ 36117395Skan builtin_assert ("system=OpenBSD"); \ 37117395Skan } \ 38117395Skan while (0) 3950397Sobrien 4050397Sobrien/* Layout of source language data types. */ 4150397Sobrien 4250397Sobrien/* This must agree with <machine/ansi.h> */ 4350397Sobrien#undef SIZE_TYPE 4450397Sobrien#define SIZE_TYPE "unsigned int" 4550397Sobrien 4650397Sobrien#undef PTRDIFF_TYPE 4750397Sobrien#define PTRDIFF_TYPE "int" 4850397Sobrien 4950397Sobrien#undef WCHAR_TYPE 5050397Sobrien#define WCHAR_TYPE "int" 5150397Sobrien 5250397Sobrien#undef WCHAR_TYPE_SIZE 5350397Sobrien#define WCHAR_TYPE_SIZE 32 5450397Sobrien 5550397Sobrien/* Assembler format: overall framework. */ 5650397Sobrien 5750397Sobrien#undef ASM_APP_ON 5850397Sobrien#define ASM_APP_ON "#APP\n" 5950397Sobrien 6050397Sobrien#undef ASM_APP_OFF 6150397Sobrien#define ASM_APP_OFF "#NO_APP\n" 6250397Sobrien 6350397Sobrien/* Stack & calling: aggregate returns. */ 6450397Sobrien 6550397Sobrien/* Don't default to pcc-struct-return, because gcc is the only compiler, and 6650397Sobrien we want to retain compatibility with older gcc versions. */ 6750397Sobrien#define DEFAULT_PCC_STRUCT_RETURN 0 6850397Sobrien 6950397Sobrien/* Assembler format: alignment output. */ 7050397Sobrien 7150397Sobrien/* Kludgy test: when gas is upgraded, it will have p2align, and no problems 7250397Sobrien with nops. */ 7350397Sobrien#ifndef HAVE_GAS_MAX_SKIP_P2ALIGN 7450397Sobrien/* i386 OpenBSD still uses an older gas that doesn't insert nops by default 7550397Sobrien when the .align directive demands to insert extra space in the text 7650397Sobrien segment. */ 7750397Sobrien#undef ASM_OUTPUT_ALIGN 7850397Sobrien#define ASM_OUTPUT_ALIGN(FILE,LOG) \ 7950397Sobrien if ((LOG)!=0) fprintf ((FILE), "\t.align %d,0x90\n", (LOG)) 8050397Sobrien#endif 8150397Sobrien 8250397Sobrien/* Stack & calling: profiling. */ 8350397Sobrien 8450397Sobrien/* OpenBSD's profiler recovers all information from the stack pointer. 8550397Sobrien The icky part is not here, but in machine/profile.h. */ 8650397Sobrien#undef FUNCTION_PROFILER 8750397Sobrien#define FUNCTION_PROFILER(FILE, LABELNO) \ 8850397Sobrien fputs (flag_pic ? "\tcall mcount@PLT\n": "\tcall mcount\n", FILE); 8950397Sobrien 9050397Sobrien/* Assembler format: exception region output. */ 9150397Sobrien 9250397Sobrien/* All configurations that don't use elf must be explicit about not using 93132718Skan dwarf unwind information. */ 9450397Sobrien#define DWARF2_UNWIND_INFO 0 9550397Sobrien 9690075Sobrien#undef ASM_PREFERRED_EH_DATA_FORMAT 9790075Sobrien 9890075Sobrien#undef ASM_COMMENT_START 9990075Sobrien#define ASM_COMMENT_START ";#" 10090075Sobrien 101102780Skan/* OpenBSD gas currently does not support quad, so do not use it. */ 102102780Skan#undef ASM_QUAD 103