1# Powerpc64 specific build options.
2# this is ./sysdeps/powerpc/powerpc64/Makefile
3
4# Each TOC entry takes 8 bytes and the TOC holds up to 2^16 bytes,
5# or 8192 entries.
6# If -fpic is not specified, the latest gcc-3.2.1 now generates
7# different code for call stubs (without the TOC reload).
8# Shared objects need the TOC reload so specify -fpic.
9ifeq (yes,$(build-shared))
10pic-ccflag = -fpic
11endif
12
13# These flags prevent FPU or Altivec registers from being used,
14# for code called in contexts that is not allowed to touch those registers.
15# Stupid GCC requires us to pass all these ridiculous switches.  We need to
16# pass the -mno-* switches as well to prevent the compiler from attempting
17# to emit altivec or vsx instructions, especially when the registers aren't
18# available.
19no-special-regs := $(sort $(foreach n,40 41 50 51 60 61 62 63 \
20				      $(foreach m,2 3 4 5 6 7 8 9, \
21						  3$m 4$m 5$m),\
22				    -ffixed-$n)) \
23		   $(sort $(foreach n,$(foreach m,0 1 2 3 4 5 6 7 8 9,\
24						$m 1$m 2$m) 30 31,\
25				    -ffixed-v$n)) \
26		   -ffixed-vrsave -ffixed-vscr -mno-altivec -mno-vsx
27
28# Likewise, we must disable IEEE long double support as some (all?)
29# compilers will not accept the above options with IEEE long double.
30ifeq ($(ibm128-fcts),yes)
31no-special-regs += -mabi=ibmlongdouble
32endif
33
34# Need to prevent gcc from using fprs in code used during dynamic linking.
35
36CFLAGS-dl-runtime.os = $(no-special-regs)
37CFLAGS-dl-lookup.os = $(no-special-regs)
38CFLAGS-dl-misc.os = $(no-special-regs)
39CFLAGS-rtld-mempcpy.os = $(no-special-regs)
40CFLAGS-rtld-memmove.os = $(no-special-regs)
41CFLAGS-rtld-memchr.os = $(no-special-regs)
42CFLAGS-rtld-strnlen.os = $(no-special-regs)
43
44ifeq ($(subdir),elf)
45# help gcc inline asm code from dl-machine.h
46+cflags += -finline-limit=2000
47endif
48
49ifeq ($(subdir),gmon)
50# The assembly functions assume that fp arg regs are not trashed.
51# Compiling with -msoft-float ensures that fp regs are not used
52# for moving memory around.
53CFLAGS-mcount.c += $(no-special-regs)
54sysdep_routines += ppc-mcount
55endif
56
57ifeq ($(subdir),setjmp)
58tests += tst-setjmp-bug21895-static
59tests-static += tst-setjmp-bug21895-static
60modules-names += setjmp-bug21895
61
62$(objpfx)tst-setjmp-bug21895-static.out: $(objpfx)setjmp-bug21895.so
63
64tst-setjmp-bug21895-static-ENV = \
65	LD_LIBRARY_PATH=$(objpfx):$(common-objpfx):$(common-objpfx)setjmp:$(common-objpfx)elf
66endif
67
68ifeq ($(subdir),stdlib)
69CFLAGS-tst-ucontext-ppc64-vscr.c += -maltivec
70tests += tst-ucontext-ppc64-vscr
71endif
72