1 /* Definitions for LM32 running Linux-based GNU systems using ELF 2 Copyright (C) 1993-2022 Free Software Foundation, Inc. 3 Contributed by Philip Blundell <philb@gnu.org> 4 5 This file is part of GCC. 6 7 GCC is free software; you can redistribute it and/or modify it 8 under the terms of the GNU General Public License as published 9 by the Free Software Foundation; either version 3, or (at your 10 option) any later version. 11 12 GCC is distributed in the hope that it will be useful, but WITHOUT 13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 14 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 15 License for more details. 16 17 You should have received a copy of the GNU General Public License 18 along with GCC; see the file COPYING3. If not see 19 <http://www.gnu.org/licenses/>. */ 20 21 /* elfos.h should have already been included. Now just override 22 any conflicting definitions and add any extras. */ 23 24 /* The GNU C++ standard library requires that these macros be defined. */ 25 #undef CPLUSPLUS_CPP_SPEC 26 #define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)" 27 28 /* Now we define the strings used to build the spec file. */ 29 #undef LIB_SPEC 30 #define LIB_SPEC \ 31 "%{pthread:-lpthread} \ 32 %{shared:-lc} \ 33 %{!shared:-lc} " 34 35 #define LIBGCC_SPEC "-lgcc" 36 37 /* Provide a STARTFILE_SPEC appropriate for GNU/Linux. Here we add 38 the GNU/Linux magical crtbegin.o file (see crtstuff.c) which 39 provides part of the support for getting C++ file-scope static 40 object constructed before entering `main'. */ 41 42 #undef STARTFILE_SPEC 43 #define STARTFILE_SPEC \ 44 "%{!shared: \ 45 %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \ 46 %{!p:%{profile:gcrt1.o%s} \ 47 %{!profile:crt1.o%s}}}} \ 48 crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}" 49 50 /* Provide a ENDFILE_SPEC appropriate for GNU/Linux. Here we tack on 51 the GNU/Linux magical crtend.o file (see crtstuff.c) which 52 provides part of the support for getting C++ file-scope static 53 object constructed before entering `main', followed by a normal 54 GNU/Linux "finalizer" file, `crtn.o'. */ 55 56 #undef ENDFILE_SPEC 57 #define ENDFILE_SPEC \ 58 "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s" 59 60 #undef LINK_SPEC 61 #define LINK_SPEC "%{h*} \ 62 %{static:-Bstatic} \ 63 %{shared:-shared} \ 64 %{symbolic:-Bsymbolic} \ 65 %{rdynamic:-export-dynamic} \ 66 -dynamic-linker /lib/ld-linux.so.2" 67 68 #define TARGET_OS_CPP_BUILTINS() GNU_USER_TARGET_OS_CPP_BUILTINS() 69 70 #undef LINK_GCC_C_SEQUENCE_SPEC 71 #define LINK_GCC_C_SEQUENCE_SPEC \ 72 "%{static|static-pie:--start-group} %G %{!nolibc:%L} \ 73 %{static|static-pie:--end-group}%{!static:%{!static-pie:%G}}" 74 75 #undef CC1_SPEC 76 #define CC1_SPEC "%{G*} %{!fno-PIC:-fPIC}" 77