xref: /netbsd-src/external/gpl3/gcc.old/dist/libgcc/config/arc/t-arc (revision f3cfa6f6ce31685c6c4a758bc430e69eb99f50a4)
1# GCC Makefile fragment for Synopsys DesignWare ARC
2
3# Copyright (C) 2007-2016 Free Software Foundation, Inc.
4# Contributor: Joern Rennecke <joern.rennecke@embecosm.com>
5#              on behalf of Synopsys Inc.
6
7# This file is part of GCC.
8
9# GCC is free software; you can redistribute it and/or modify it under the
10# terms of the GNU General Public License as published by the Free Software
11# Foundation; either version 3, or (at your option) any later version.
12
13# GCC is distributed in the hope that it will be useful, but WITHOUT ANY
14# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
16# details.
17
18# You should have received a copy of the GNU General Public License along
19# with GCC; see the file COPYING3.  If not see
20# <http://www.gnu.org/licenses/>.
21
22CROSS_LIBGCC1 = libgcc1-asm.a
23LIB1ASMSRC = arc/lib1funcs.S
24LIB1ASMFUNCS = _mulsi3 _umulsidi3  _umulsi3_highpart \
25  _udivsi3 _divsi3 _umodsi3 _modsi3 \
26  _divmod_tools _clzsi2 \
27  _millicodethunk_st _millicodethunk_ld _millicodethunk_ret \
28  _adddf3 _muldf3 _addsf3 _mulsf3 _divsf3 _divdf3 _truncdfsf2 _extendsfdf2 \
29  _eqdf2 _eqsf2 _gedf2 _gesf2 _gtdf2 _gtsf2 _uneqdf2 _uneqsf2 _ordsf2 _orddf2 \
30  _fixdfsi _fixsfsi _floatsidf _floatsisf _fixunsdfsi _floatunsidf
31
32#LIBGCC2_CFLAGS = -g1 -O2 $(LIBGCC2_INCLUDES) $(GCC_CFLAGS)
33
34# For floating-point emulation, we mostly use hand-coded assembly.
35# We use fp-bit.c for debugging purposes, and some parts of it
36# as a fallback for hardware configurations for which the hand-coded
37# assembly support is incomplete, i.e., where there is no NORM and/or no
38# supported multiply instruction.  Using floating point on such a
39# configuration is generally inadvisable, but we got to provide support
40# somehow so that we can run the testsuites.
41# fp-hack.h / dp-hack.h take care of slecting the parts that are needed,
42# and (for debugging) of renaming functions so that they can be
43# used in an asm wrapper.
44
45LIB2ADD = fp-bit.c dp-bit.c
46
47dp-bit.c: $(srcdir)/fp-bit.c
48	echo '#ifndef __big_endian__' > dp-bit.c
49	echo '#define FLOAT_BIT_ORDER_MISMATCH' >> dp-bit.c
50	echo '#endif' >> dp-bit.c
51	echo '#include "fp-bit.h"' >> dp-bit.c
52	echo '#include "config/arc/dp-hack.h"' >> dp-bit.c
53	grep -v 'include.*fp-bit.h' $(srcdir)/fp-bit.c >> dp-bit.c
54
55fp-bit.c: $(srcdir)/fp-bit.c
56	echo '#define FLOAT' > fp-bit.c
57	echo '#ifndef __big_endian__' >> fp-bit.c
58	echo '#define FLOAT_BIT_ORDER_MISMATCH' >> fp-bit.c
59	echo '#endif' >> fp-bit.c
60	echo '#include "config/arc/fp-hack.h"' >> fp-bit.c
61	cat $(srcdir)/fp-bit.c >> fp-bit.c
62
63# .init/.fini section routines
64
65crtg.o: $(srcdir)/config/arc/crtg.S
66	$(crt_compile) -c -x assembler-with-cpp $<
67
68crtgend.o: $(srcdir)/config/arc/crtgend.S
69	$(crt_compile) -c -x assembler-with-cpp $<
70
71mcount.o: $(srcdir)/config/arc/gmon/mcount.c
72	$(gcc_compile) -isystem $(srcdir)/config/arc/gmon -c $< \
73	-fcall-saved-r0 -fcall-saved-r1 -fcall-saved-r2 -fcall-saved-r3 \
74	-fcall-saved-r4 -fcall-saved-r5 -fcall-saved-r6 -fcall-saved-r7 \
75	-fomit-frame-pointer
76
77gmon.o: $(srcdir)/config/arc/gmon/gmon.c
78	$(gcc_compile) -isystem $(srcdir)/config/arc/gmon -mno-sdata -c $< \
79	-fno-strict-aliasing \
80	-Wno-extra # suppress inane warning about missing initializer.
81	# Adding initializers for the remaining elements of gmonparam would
82	# make the code more brittle.
83
84prof-freq-stub.o: $(srcdir)/config/arc/gmon/prof-freq-stub.S
85	$(gcc_compile) -isystem $(srcdir)/config/arc/gmon -c $<
86
87prof-freq.o: $(srcdir)/config/arc/gmon/prof-freq.c
88	$(gcc_compile) -isystem $(srcdir)/config/arc/gmon -c $<
89
90dcache_linesz.o: $(srcdir)/config/arc/gmon/dcache_linesz.S
91	$(gcc_compile) -isystem $(srcdir)/config/arc/gmon -c $<
92
93profil.o: $(srcdir)/config/arc/gmon/profil.S
94	$(gcc_compile) -isystem $(srcdir)/config/arc/gmon -c $<
95
96profil-uclibc.o: $(srcdir)/config/arc/gmon/profil-uclibc.c
97	$(gcc_compile) -isystem $(srcdir)/config/arc/gmon -c $<
98
99libgmon.a: mcount.o gmon.o dcache_linesz.o $(PROFILE_OSDEP)
100	$(AR_CREATE_FOR_TARGET) $@ $^
101