aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/arm/t-semiaof
blob: 228879396557dddf9f5c8e5ae1b3d76f63c8286e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
OLDCC = armcc -w
# Don't build enquire
ENQUIRE=
CROSS_LIBGCC1 = libgcc1-aof.a
LIBGCC2 = libgcc2-aof.a
LIBGCC = libgcc-aof.a
TARGET_LIBGCC2_CFLAGS = -fomit-frame-pointer
LIBGCC2_DEBUG_CFLAGS = -g0

LIBGCC1_TEST = #libgcc1-atest
EXTRA_PARTS = crtbegin.o crtend.o
STMP_FIXPROTO =

# Rule to build libgcc1.a and libgcc2.a and libgcc.a, since the librarian 
# for the ARM tools is somewhat quirky, and needs a special rule to use it.
libgcc1-aof.a: libgcc1.c $(CONFIG_H) config.status
	-rm -rf tmplib libgcc1.a libgcc1-aof.a tmplibgcc1.a
	mkdir tmplib
	for name in $(LIB1FUNCS); \
	do \
	  echo $${name}; \
	  rm -f $${name}$(objext); \
	  $(OLDCC) $(CCLIBFLAGS) $(INCLUDES) -c -DL$${name} $(srcdir)/libgcc1.c; \
	  if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
	  mv libgcc1$(objext) tmplib/$${name}$(objext); \
	done
	(cd tmplib; \
	 armlib -c tmplibgcc1.a *; \
	 mv tmplibgcc1.a ..)
	mv tmplibgcc1.a libgcc1-aof.a
	rm -rf tmplib

libgcc2-aof.a: libgcc2.c libgcc2.ready $(CONFIG_H) $(LIB2FUNCS_EXTRA) \
   machmode.h longlong.h gbl-ctors.h config.status
	-rm -f tmplibgcc2.a
	-rm -rf tmplib
	mkdir tmplib
	for name in $(LIB2FUNCS); \
	do \
	  echo $${name}; \
	  $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) -c -DL$${name} \
	      $(srcdir)/libgcc2.c -o tmplib/$${name}$(objext); \
	  if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
	done
	(cd tmplib; \
	 armlib -c tmplibgcc2.a *; \
	 mv tmplibgcc2.a ..)
	mv tmplibgcc2.a libgcc2-aof.a
	rm -rf tmplib

# Combine the various libraries into a single library, libgcc.a.
libgcc-aof.a: $(CROSS_LIBGCC1) $(LIBGCC2)
	-rm -rf tmplibgcc.a libgcc.a tmpcopy libgcc-aof.a
	mkdir tmpcopy
	(cd tmpcopy; armlib -e ../$(LIBGCC1) \*)
	-(cd tmpcopy; chmod +w * > /dev/null 2>&1)
	(cd tmpcopy; armlib -e ../$(LIBGCC2) \*)
	(cd tmpcopy; armlib -co ../tmplibgcc.a *$(objext))
	rm -rf tmpcopy
	mv tmplibgcc.a libgcc.a
	ln libgcc.a libgcc-aof.a

libgcc1-atest: libgcc1-test.o native $(GCC_PARTS) $(EXTRA_PARTS)
	@echo "Testing libgcc1.  Ignore linker warning messages."
	$(GCC_FOR_TARGET) $(GCC_CFLAGS) libgcc1-test.o -o libgcc1-test \
	-v