xref: /netbsd-src/external/gpl3/gcc.old/dist/gcc/config/lm32/uclinux-elf.h (revision 8feb0f0b7eaff0608f8350bbfa3098827b4bb91b)
136ac495dSmrg /* Definitions for LM32 running Linux-based GNU systems using ELF
2*8feb0f0bSmrg    Copyright (C) 1993-2020 Free Software Foundation, Inc.
336ac495dSmrg    Contributed by Philip Blundell <philb@gnu.org>
436ac495dSmrg 
536ac495dSmrg    This file is part of GCC.
636ac495dSmrg 
736ac495dSmrg    GCC is free software; you can redistribute it and/or modify it
836ac495dSmrg    under the terms of the GNU General Public License as published
936ac495dSmrg    by the Free Software Foundation; either version 3, or (at your
1036ac495dSmrg    option) any later version.
1136ac495dSmrg 
1236ac495dSmrg    GCC is distributed in the hope that it will be useful, but WITHOUT
1336ac495dSmrg    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
1436ac495dSmrg    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
1536ac495dSmrg    License for more details.
1636ac495dSmrg 
1736ac495dSmrg    You should have received a copy of the GNU General Public License
1836ac495dSmrg    along with GCC; see the file COPYING3.  If not see
1936ac495dSmrg    <http://www.gnu.org/licenses/>.  */
2036ac495dSmrg 
2136ac495dSmrg /* elfos.h should have already been included.  Now just override
2236ac495dSmrg    any conflicting definitions and add any extras.  */
2336ac495dSmrg 
2436ac495dSmrg /* The GNU C++ standard library requires that these macros be defined.  */
2536ac495dSmrg #undef CPLUSPLUS_CPP_SPEC
2636ac495dSmrg #define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
2736ac495dSmrg 
2836ac495dSmrg /* Now we define the strings used to build the spec file.  */
2936ac495dSmrg #undef  LIB_SPEC
3036ac495dSmrg #define LIB_SPEC \
3136ac495dSmrg   "%{pthread:-lpthread} \
3236ac495dSmrg    %{shared:-lc} \
3336ac495dSmrg    %{!shared:-lc} "
3436ac495dSmrg 
3536ac495dSmrg #define LIBGCC_SPEC "-lgcc"
3636ac495dSmrg 
3736ac495dSmrg /* Provide a STARTFILE_SPEC appropriate for GNU/Linux.  Here we add
3836ac495dSmrg    the GNU/Linux magical crtbegin.o file (see crtstuff.c) which
3936ac495dSmrg    provides part of the support for getting C++ file-scope static
4036ac495dSmrg    object constructed before entering `main'.  */
4136ac495dSmrg 
4236ac495dSmrg #undef  STARTFILE_SPEC
4336ac495dSmrg #define STARTFILE_SPEC \
4436ac495dSmrg   "%{!shared: \
4536ac495dSmrg      %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
4636ac495dSmrg                        %{!p:%{profile:gcrt1.o%s} \
4736ac495dSmrg                          %{!profile:crt1.o%s}}}} \
4836ac495dSmrg    crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
4936ac495dSmrg 
5036ac495dSmrg /* Provide a ENDFILE_SPEC appropriate for GNU/Linux.  Here we tack on
5136ac495dSmrg    the GNU/Linux magical crtend.o file (see crtstuff.c) which
5236ac495dSmrg    provides part of the support for getting C++ file-scope static
5336ac495dSmrg    object constructed before entering `main', followed by a normal
5436ac495dSmrg    GNU/Linux "finalizer" file, `crtn.o'.  */
5536ac495dSmrg 
5636ac495dSmrg #undef  ENDFILE_SPEC
5736ac495dSmrg #define ENDFILE_SPEC \
5836ac495dSmrg   "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
5936ac495dSmrg 
6036ac495dSmrg #undef  LINK_SPEC
6136ac495dSmrg #define LINK_SPEC "%{h*} \
6236ac495dSmrg    %{static:-Bstatic} \
6336ac495dSmrg    %{shared:-shared} \
6436ac495dSmrg    %{symbolic:-Bsymbolic} \
6536ac495dSmrg    %{rdynamic:-export-dynamic} \
6636ac495dSmrg    -dynamic-linker /lib/ld-linux.so.2"
6736ac495dSmrg 
6836ac495dSmrg #define TARGET_OS_CPP_BUILTINS() GNU_USER_TARGET_OS_CPP_BUILTINS()
6936ac495dSmrg 
7036ac495dSmrg #define LINK_GCC_C_SEQUENCE_SPEC \
71c0a68be4Smrg   "%{static|static-pie:--start-group} %G %{!nolibc:%L} \
72a2dc1f3fSmrg    %{static|static-pie:--end-group}%{!static:%{!static-pie:%G}}"
7336ac495dSmrg 
7436ac495dSmrg #undef  CC1_SPEC
7536ac495dSmrg #define CC1_SPEC "%{G*} %{!fno-PIC:-fPIC}"
76