Adjust __MATH_EVAL_FMT2 definition to handle _Float16 better.
[glibc.git] / sysdeps / i386 / Makefile
bloba1500454e5a977415b8bd120326f3db104d18df2
1 # The mpn functions need a #define for asm syntax flavor.
2 # Every i386 port in use uses gas syntax (I think).
3 asm-CPPFLAGS += -DGAS_SYNTAX
5 # The i386 `long double' is a distinct type we support.
6 long-double-fcts = yes
8 ifeq ($(subdir),string)
9 sysdep_routines += cacheinfo
10 endif
12 ifeq ($(subdir),gmon)
13 sysdep_routines += i386-mcount
14 endif
16 ifeq ($(subdir),elf)
17 CFLAGS-rtld.c += -Wno-uninitialized -Wno-unused
18 CFLAGS-dl-load.c += -Wno-unused
19 CFLAGS-dl-reloc.c += -Wno-unused
20 endif
22 # Most of the glibc routines don't ever call user defined callbacks
23 # nor use any FPU or SSE* and as such don't need bigger %esp alignment
24 # than 4 bytes.
25 # Lots of routines in math will use FPU, so make math subdir an exception
26 # here.
27 # In gcc 4.6 (and maybe earlier?) giving -mpreferred-stack-boundary=2 is
28 # an error, so don't try to reduce it here like we used to. We still
29 # explicit set -mpreferred-stack-boundary=4 the places where it matters,
30 # in case an older compiler defaulted to 2.
31 ifeq ($(subdir),math)
32 sysdep-CFLAGS += -mpreferred-stack-boundary=4
33 else
34 ifeq ($(subdir),csu)
35 sysdep-CFLAGS += -mpreferred-stack-boundary=4
36 gen-as-const-headers += link-defines.sym
37 else
38 # Likewise, any function which calls user callbacks
39 uses-callbacks += -mpreferred-stack-boundary=4
40 # Likewise, any stack alignment tests
41 stack-align-test-flags += -malign-double -mpreferred-stack-boundary=4
42 endif
43 endif
45 # And a couple of other routines
46 ifeq ($(subdir),stdlib)
47 CFLAGS-exit.c += -mpreferred-stack-boundary=4
48 CFLAGS-cxa_finalize.c += -mpreferred-stack-boundary=4
49 endif
50 ifeq ($(subdir),elf)
51 CFLAGS-dl-init.c += -mpreferred-stack-boundary=4
52 CFLAGS-dl-fini.c += -mpreferred-stack-boundary=4
53 CFLAGS-dl-open.c += -mpreferred-stack-boundary=4
54 CFLAGS-dl-close.c += -mpreferred-stack-boundary=4
55 CFLAGS-dl-error.c += -mpreferred-stack-boundary=4
56 endif
57 ifeq ($(subdir),dlfcn)
58 CFLAGS-dlopen.c += -mpreferred-stack-boundary=4
59 CFLAGS-dlopenold.c += -mpreferred-stack-boundary=4
60 CFLAGS-dlclose.c += -mpreferred-stack-boundary=4
61 CFLAGS-dlerror.c += -mpreferred-stack-boundary=4
62 endif
64 ifneq (,$(filter -mno-tls-direct-seg-refs,$(CFLAGS)))
65 defines += -DNO_TLS_DIRECT_SEG_REFS
66 endif
68 ifeq ($(subdir),elf)
69 sysdep-dl-routines += tlsdesc dl-tlsdesc
71 tests += tst-audit3
72 modules-names += tst-auditmod3a tst-auditmod3b
74 $(objpfx)tst-audit3: $(objpfx)tst-auditmod3a.so
75 $(objpfx)tst-audit3.out: $(objpfx)tst-auditmod3b.so
76 tst-audit3-ENV = LD_AUDIT=$(objpfx)tst-auditmod3b.so
77 endif
79 ifeq ($(subdir),csu)
80 gen-as-const-headers += tlsdesc.sym
81 endif
83 # Make sure no code in ld.so uses mm/xmm/ymm/zmm registers on i386 since
84 # the first 3 mm/xmm/ymm/zmm registers are used to pass vector parameters
85 # which must be preserved.
86 # With SSE disabled, ensure -fpmath is not set to use sse either.
87 rtld-CFLAGS += -mno-sse -mno-mmx -mfpmath=387
88 ifeq ($(subdir),elf)
89 CFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),\
90 $(rtld-CFLAGS))
92 tests-special += $(objpfx)tst-ld-sse-use.out
93 $(objpfx)tst-ld-sse-use.out: ../sysdeps/i386/tst-ld-sse-use.sh $(objpfx)ld.so
94 @echo "Checking ld.so for SSE register use. This will take a few seconds..."
95 $(BASH) $< $(objpfx) '$(NM)' '$(OBJDUMP)' '$(READELF)' > $@; \
96 $(evaluate-test)
97 else
98 CFLAGS-.os += $(if $(filter rtld-%.os,$(@F)), $(rtld-CFLAGS))
99 endif