1# The mpn functions need a #define for asm syntax flavor.
2# Every i386 port in use uses gas syntax (I think).
3asm-CPPFLAGS += -DGAS_SYNTAX
4
5# The i386 `long double' is a distinct type we support.
6long-double-fcts = yes
7
8ifeq ($(subdir),math)
9# These functions change the rounding mode internally and need to
10# update both the SSE2 rounding mode and the 387 rounding mode.  See
11# the handling of MATH_SET_BOTH_ROUNDING_MODES in
12# sysdeps/i386/fpu/fenv_private.h.
13CFLAGS-e_gamma_r.c += -DMATH_SET_BOTH_ROUNDING_MODES
14endif
15
16ifeq ($(subdir),gmon)
17sysdep_routines += i386-mcount
18endif
19
20ifeq ($(subdir),elf)
21CFLAGS-rtld.c += -Wno-uninitialized -Wno-unused
22CFLAGS-dl-load.c += -Wno-unused
23CFLAGS-dl-reloc.c += -Wno-unused
24endif
25
26ifeq ($(subdir),csu)
27gen-as-const-headers += link-defines.sym
28else
29stack-align-test-flags += -malign-double
30endif
31
32ifeq ($(subdir),elf)
33sysdep-dl-routines += tlsdesc dl-tlsdesc
34
35tests += tst-audit3
36modules-names += tst-auditmod3a tst-auditmod3b
37
38$(objpfx)tst-audit3: $(objpfx)tst-auditmod3a.so
39$(objpfx)tst-audit3.out: $(objpfx)tst-auditmod3b.so
40tst-audit3-ENV = LD_AUDIT=$(objpfx)tst-auditmod3b.so
41endif
42
43ifeq ($(subdir),csu)
44gen-as-const-headers += tlsdesc.sym
45endif
46
47# Make sure no code in ld.so uses mm/xmm/ymm/zmm registers on i386 since
48# the first 3 mm/xmm/ymm/zmm registers are used to pass vector parameters
49# which must be preserved.
50# With SSE disabled, ensure -fpmath is not set to use sse either.
51rtld-CFLAGS += -mno-sse -mno-mmx -mfpmath=387
52ifeq ($(subdir),elf)
53CFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),\
54		   $(rtld-CFLAGS))
55
56tests-special += $(objpfx)tst-ld-sse-use.out
57$(objpfx)tst-ld-sse-use.out: ../sysdeps/i386/tst-ld-sse-use.sh $(objpfx)ld.so
58	@echo "Checking ld.so for SSE register use.  This will take a few seconds..."
59	$(BASH) $< $(objpfx) '$(NM)' '$(OBJDUMP)' '$(READELF)' > $@; \
60	$(evaluate-test)
61else
62CFLAGS-.os += $(if $(filter rtld-%.os,$(@F)), $(rtld-CFLAGS))
63endif
64