blob: 11f425dc92d2c2c91d9cd4fcc3e338258b0533fc [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -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),gmon)
9sysdep_routines += i386-mcount
10endif
11
12ifeq ($(subdir),elf)
13CFLAGS-rtld.c += -Wno-uninitialized -Wno-unused
14CFLAGS-dl-load.c += -Wno-unused
15CFLAGS-dl-reloc.c += -Wno-unused
16endif
17
18ifeq ($(subdir),debug)
19CFLAGS-backtrace.c += -fexceptions
20endif
21
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.
31ifeq ($(subdir),math)
32sysdep-CFLAGS += -mpreferred-stack-boundary=4
33else
34ifeq ($(subdir),csu)
35sysdep-CFLAGS += -mpreferred-stack-boundary=4
36gen-as-const-headers += link-defines.sym
37else
38# Likewise, any function which calls user callbacks
39uses-callbacks += -mpreferred-stack-boundary=4
40# Likewise, any stack alignment tests
41stack-align-test-flags += -malign-double -mpreferred-stack-boundary=4
42endif
43endif
44
45# And a couple of other routines
46ifeq ($(subdir),stdlib)
47CFLAGS-exit.c += -mpreferred-stack-boundary=4
48CFLAGS-cxa_finalize.c += -mpreferred-stack-boundary=4
49endif
50ifeq ($(subdir),elf)
51CFLAGS-dl-init.c += -mpreferred-stack-boundary=4
52CFLAGS-dl-fini.c += -mpreferred-stack-boundary=4
53CFLAGS-dl-open.c += -mpreferred-stack-boundary=4
54CFLAGS-dl-close.c += -mpreferred-stack-boundary=4
55CFLAGS-dl-error.c += -mpreferred-stack-boundary=4
56endif
57ifeq ($(subdir),dlfcn)
58CFLAGS-dlopen.c += -mpreferred-stack-boundary=4
59CFLAGS-dlopenold.c += -mpreferred-stack-boundary=4
60CFLAGS-dlclose.c += -mpreferred-stack-boundary=4
61CFLAGS-dlerror.c += -mpreferred-stack-boundary=4
62endif
63
64ifneq (,$(filter -mno-tls-direct-seg-refs,$(CFLAGS)))
65defines += -DNO_TLS_DIRECT_SEG_REFS
66endif
67
68ifeq ($(subdir),elf)
69sysdep-dl-routines += tlsdesc dl-tlsdesc
70
71tests += tst-audit3
72modules-names += tst-auditmod3a tst-auditmod3b
73
74$(objpfx)tst-audit3: $(objpfx)tst-auditmod3a.so
75$(objpfx)tst-audit3.out: $(objpfx)tst-auditmod3b.so
76tst-audit3-ENV = LD_AUDIT=$(objpfx)tst-auditmod3b.so
77endif
78
79ifeq ($(subdir),csu)
80gen-as-const-headers += tlsdesc.sym
81endif