]>
Commit | Line | Data |
---|---|---|
8d57beea | 1 | ifeq ($(subdir),csu) |
c6645251 | 2 | sysdep_routines += errno-loc |
39778c6c UD |
3 | endif |
4 | ||
2c008571 UD |
5 | ifeq ($(subdir),assert) |
6 | CFLAGS-assert.c += -DFATAL_PREPARE_INCLUDE='<fatal-prepare.h>' | |
7 | CFLAGS-assert-perr.c += -DFATAL_PREPARE_INCLUDE='<fatal-prepare.h>' | |
8 | endif | |
9 | ||
a1648746 | 10 | ifeq ($(subdir),malloc) |
7c2842bf | 11 | CFLAGS-malloc.c += -DMORECORE_CLEARS=2 |
a1648746 UD |
12 | endif |
13 | ||
8d57beea | 14 | ifeq ($(subdir),misc) |
c9009328 L |
15 | include $(firstword $(wildcard $(sysdirs:=/sysctl.mk))) |
16 | ||
cb191f23 | 17 | sysdep_routines += clone llseek umount umount2 readahead \ |
63eb8df8 | 18 | setfsuid setfsgid epoll_pwait signalfd \ |
e0043e17 DL |
19 | eventfd eventfd_read eventfd_write prlimit \ |
20 | personality | |
84724245 | 21 | |
ce42435c | 22 | CFLAGS-gethostid.c = -fexceptions |
c27714f1 | 23 | CFLAGS-tst-writev.c += "-DARTIFICIAL_LIMIT=0x80000000-__getpagesize()" |
ce42435c | 24 | |
7d375303 RM |
25 | # Note that bits/mman-linux.h is listed here though the file lives in the |
26 | # top-level bits/ subdirectory instead of here in sysdeps/.../linux/bits/. | |
27 | # That is just so that other (non-Linux) configurations for whom the | |
28 | # bits/mman-linux.h definitions work well do not have to duplicate the | |
29 | # contents of the file. The file must still be listed in sysdep_headers | |
30 | # here and in any non-Linux configuration that uses it; other | |
31 | # configurations will not install the file. | |
67afae58 | 32 | sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h \ |
eed3e1eb | 33 | sys/klog.h \ |
9287adf0 | 34 | sys/user.h sys/prctl.h \ |
39382b8b | 35 | sys/kd.h sys/soundcard.h sys/vt.h \ |
3d42e04d | 36 | sys/quota.h sys/fsuid.h \ |
844633d1 | 37 | scsi/sg.h scsi/scsi.h scsi/scsi_ioctl.h sys/pci.h \ |
3e360d34 | 38 | sys/ultrasound.h sys/raw.h sys/personality.h sys/epoll.h \ |
2e3e9ff1 | 39 | bits/a.out.h sys/inotify.h sys/signalfd.h sys/eventfd.h \ |
8e475601 | 40 | sys/timerfd.h sys/fanotify.h bits/eventfd.h bits/inotify.h \ |
02a6f887 | 41 | bits/signalfd.h bits/timerfd.h bits/epoll.h \ |
4dd4e157 AJ |
42 | bits/socket_type.h bits/syscall.h bits/sysctl.h \ |
43 | bits/mman-linux.h | |
cd6ede75 | 44 | |
6c63e2d8 AZ |
45 | tests += tst-clone tst-clone2 tst-fanotify tst-personality tst-quota \ |
46 | tst-fallocate tst-fallocate64 | |
38027f90 | 47 | |
f127cd28 | 48 | # Generate the list of SYS_* macros for the system calls (__NR_* macros). |
154bfc16 JM |
49 | |
50 | # If there is more than one syscall list for different architecture | |
0ab0291b L |
51 | # variants, the CPU/Makefile defines abi-variants to be a list of names |
52 | # for those variants (e.g. 32 64), and, for each variant, defines | |
53 | # abi-$(variant)-options to be compiler options to cause <asm/unistd.h> | |
54 | # to define the desired list of syscalls and abi-$(variant)-condition to | |
55 | # be the condition for those options to use in a C #if condition. | |
56 | # abi-includes may be defined to a list of headers to include | |
154bfc16 | 57 | # in the generated header, if the default does not suffice. |
d7e06450 CD |
58 | # |
59 | # The generated header is compiled with `-ffreestanding' to avoid any | |
60 | # circular dependencies against the installed implementation headers. | |
61 | # Such a dependency would require the implementation header to be | |
62 | # installed before the generated header could be built (See bug 15711). | |
63 | # In current practice the generated header dependencies do not include | |
64 | # any of the implementation headers removed by the use of `-ffreestanding'. | |
154bfc16 | 65 | |
bd951ccb | 66 | $(objpfx)bits/syscall%h $(objpfx)bits/syscall%d: ../sysdeps/unix/sysv/linux/sys/syscall.h |
362f5ae2 | 67 | $(make-target-directory) |
9afc8a59 UD |
68 | { \ |
69 | echo '/* Generated at libc build time from kernel syscall list. */';\ | |
70 | echo ''; \ | |
71 | echo '#ifndef _SYSCALL_H'; \ | |
72 | echo '# error "Never use <bits/syscall.h> directly; include <sys/syscall.h> instead."'; \ | |
73 | echo '#endif'; \ | |
74 | echo ''; \ | |
0ab0291b | 75 | $(foreach h,$(abi-includes), echo '#include <$(h)>';) \ |
154bfc16 | 76 | echo ''; \ |
0ab0291b L |
77 | $(if $(abi-variants), \ |
78 | $(foreach v,$(abi-variants),\ | |
d7e06450 | 79 | $(CC) -ffreestanding -E -MD -MP -MF $(@:.h=.d)-t$(v) -MT '$(@:.d=.h) $(@:.h=.d)' \ |
0ab0291b | 80 | -x c $(sysincludes) $< $(abi-$(v)-options) \ |
154bfc16 | 81 | -D_LIBC -dM | \ |
abe7b661 | 82 | sed -n 's@^#define __NR_\([^ ]*\) .*$$@#define SYS_\1 __NR_\1@p' | \ |
154bfc16 | 83 | LC_ALL=C sort > $(@:.d=.h).new$(v); \ |
0ab0291b L |
84 | $(if $(abi-$(v)-condition),\ |
85 | echo '#if $(abi-$(v)-condition)';) \ | |
154bfc16 | 86 | cat $(@:.d=.h).new$(v); \ |
0ab0291b | 87 | $(if $(abi-$(v)-condition),echo '#endif';) \ |
154bfc16 | 88 | rm -f $(@:.d=.h).new$(v); \ |
0ab0291b | 89 | ), \ |
d7e06450 | 90 | $(CC) -ffreestanding -E -MD -MP -MF $(@:.h=.d)-t$(v) -MT '$(@:.d=.h) $(@:.h=.d)' \ |
0ab0291b L |
91 | -x c $(sysincludes) $< \ |
92 | -D_LIBC -dM | \ | |
93 | sed -n 's@^#define __NR_\([^ ]*\) .*$$@#define SYS_\1 __NR_\1@p' | \ | |
94 | LC_ALL=C sort;) \ | |
9afc8a59 | 95 | } > $(@:.d=.h).new |
f127cd28 | 96 | mv -f $(@:.d=.h).new $(@:.d=.h) |
0ab0291b | 97 | ifdef abi-variants |
7cd72ad3 | 98 | ifneq (,$(objpfx)) |
154bfc16 | 99 | sed $(sed-remove-objpfx) \ |
0ab0291b | 100 | $(foreach v,$(abi-variants),$(@:.h=.d)-t$(v)) > $(@:.h=.d)-t3 |
7cd72ad3 | 101 | else |
0ab0291b | 102 | cat $(foreach v,$(abi-variants),$(@:.h=.d)-t$(v)) \ |
154bfc16 | 103 | > $(@:.h=.d)-t3 |
7cd72ad3 | 104 | endif |
0ab0291b | 105 | rm -f $(foreach v,$(abi-variants),$(@:.h=.d)-t$(v)) |
7cd72ad3 | 106 | mv -f $(@:.h=.d)-t3 $(@:.h=.d) |
0ab0291b L |
107 | else |
108 | mv -f $(@:.h=.d)-t $(@:.h=.d) | |
109 | endif | |
cd6ede75 | 110 | |
d705269e | 111 | ifndef no_deps |
f127cd28 | 112 | # Get the generated list of dependencies (probably /usr/include/asm/unistd.h). |
bd951ccb | 113 | -include $(objpfx)bits/syscall.d |
d705269e | 114 | endif |
bd951ccb | 115 | generated += bits/syscall.h bits/syscall.d |
d2f5be2a UD |
116 | endif |
117 | ||
8d57beea | 118 | ifeq ($(subdir),time) |
6e63d5e1 | 119 | sysdep_headers += sys/timex.h bits/timex.h |
997d6467 | 120 | |
eb415739 | 121 | sysdep_routines += ntp_gettime ntp_gettimex |
d2f5be2a UD |
122 | endif |
123 | ||
8d57beea | 124 | ifeq ($(subdir),socket) |
4f173e2c | 125 | sysdep_headers += net/if_ppp.h net/ppp-comp.h \ |
d705269e | 126 | net/ppp_defs.h net/if_arp.h net/route.h net/ethernet.h \ |
999b2f6b | 127 | net/if_slip.h net/if_packet.h net/if_shaper.h |
78880cc1 AZ |
128 | sysdep_routines += cmsg_nxthdr |
129 | CFLAGS-recvmmsg.c = -fexceptions -fasynchronous-unwind-tables | |
130 | CFLAGS-sendmmsg.c = -fexceptions -fasynchronous-unwind-tables | |
8f5ca04b RM |
131 | endif |
132 | ||
8d57beea | 133 | ifeq ($(subdir),sunrpc) |
dfe1754a | 134 | sysdep_headers += nfs/nfs.h |
57aefafe RM |
135 | endif |
136 | ||
8d57beea | 137 | ifeq ($(subdir),termios) |
5107cf1d | 138 | sysdep_headers += termio.h |
80791291 RM |
139 | endif |
140 | ||
d64fae6a | 141 | ifeq ($(subdir),posix) |
13a571a7 | 142 | sysdep_headers += bits/initspin.h |
7ae4abe9 | 143 | |
e0db6517 | 144 | sysdep_routines += sched_getcpu |
341c566f | 145 | |
2359035a | 146 | tests += tst-affinity tst-affinity-pid |
08192659 RM |
147 | |
148 | CFLAGS-fork.c = $(libio-mtsafe) | |
149 | CFLAGS-getpid.o = -fomit-frame-pointer | |
150 | CFLAGS-getpid.os = -fomit-frame-pointer | |
d64fae6a UD |
151 | endif |
152 | ||
8d57beea | 153 | ifeq ($(subdir),inet) |
d9997a45 | 154 | sysdep_headers += netinet/if_fddi.h netinet/if_tr.h \ |
59cacc81 | 155 | netipx/ipx.h netash/ash.h netax25/ax25.h netatalk/at.h \ |
09236fba | 156 | netrom/netrom.h netpacket/packet.h netrose/rose.h \ |
ea2c47b6 | 157 | neteconet/ec.h netiucv/iucv.h |
2eecc8af | 158 | sysdep_routines += netlink_assert_response |
a401eea9 UD |
159 | endif |
160 | ||
93995795 RM |
161 | # Don't compile the ctype glue code, since there is no old non-GNU C library. |
162 | inhibit-glue = yes | |
d705269e | 163 | |
9756dfe1 | 164 | ifeq ($(subdir),dirent) |
e5cd813b | 165 | sysdep_routines += getdirentries getdirentries64 |
9756dfe1 UD |
166 | endif |
167 | ||
9931ba24 UD |
168 | ifeq ($(subdir),nis) |
169 | CFLAGS-ypclnt.c = -DUSE_BINDINGDIR=1 | |
170 | endif | |
913a752b | 171 | |
9c7ff11a | 172 | ifeq ($(subdir),io) |
4e87573f | 173 | sysdep_routines += xstatconv internal_statvfs internal_statvfs64 \ |
cc0e6ed8 | 174 | sync_file_range fallocate fallocate64 |
1728f92d | 175 | sysdep_headers += bits/fcntl-linux.h |
9c7ff11a UD |
176 | endif |
177 | ||
913a752b | 178 | ifeq ($(subdir),elf) |
6fb2dde3 UD |
179 | sysdep-rtld-routines += dl-brk dl-sbrk dl-getcwd dl-openat64 dl-opendir \ |
180 | dl-fxstatat64 | |
3ba06713 | 181 | |
9cd47470 | 182 | libof-lddlibc4 = lddlibc4 |
fe658845 RM |
183 | |
184 | others += pldd | |
185 | install-bin += pldd | |
186 | $(objpfx)pldd: $(objpfx)xmalloc.o | |
913a752b | 187 | endif |
1fe42a2b UD |
188 | |
189 | ifeq ($(subdir),rt) | |
190 | CFLAGS-mq_send.c += -fexceptions | |
191 | CFLAGS-mq_receive.c += -fexceptions | |
192 | endif | |
fc03df7a UD |
193 | |
194 | ifeq ($(subdir),nscd) | |
3a2c0242 | 195 | sysdep-CFLAGS += -DHAVE_EPOLL -DHAVE_SENDFILE -DHAVE_INOTIFY -DHAVE_NETLINK |
e14bbf53 | 196 | CFLAGS-gai.c += -DNEED_NETLINK |
fc03df7a | 197 | endif |
08192659 RM |
198 | |
199 | ifeq ($(subdir),nptl) | |
0cb313f7 | 200 | tests += tst-setgetname tst-align-clone tst-getpid1 \ |
2359035a FW |
201 | tst-thread-affinity-pthread tst-thread-affinity-pthread2 \ |
202 | tst-thread-affinity-sched | |
08192659 | 203 | endif |