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