nptl: Correct stack size attribute when stack grows up [BZ #32574]
[glibc.git] / login / Makefile
blobd6a9a6975e7f831ad8f6ec2b79e23703b0a60d74
1 # Copyright (C) 1996-2025 Free Software Foundation, Inc.
2 # This file is part of the GNU C Library.
4 # The GNU C Library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
9 # The GNU C Library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with the GNU C Library; if not, see
16 # <https://www.gnu.org/licenses/>.
19 # Sub-makefile for login portion of the library.
22 subdir := login
24 include ../Makeconfig
26 headers := \
27 bits/utmp.h \
28 lastlog.h \
29 pty.h \
30 utmp.h \
31 # headers
33 routines := \
34 forkpty \
35 getlogin \
36 getlogin_r \
37 getlogin_r_chk \
38 getpt \
39 getutent \
40 getutent_r \
41 getutid \
42 getutid_r \
43 getutline \
44 getutline_r \
45 grantpt \
46 login \
47 login_tty \
48 logout \
49 logwtmp \
50 openpty \
51 ptsname \
52 ptsname_r_chk \
53 setlogin \
54 unlockpt \
55 updwtmp \
56 utmp_file \
57 utmpname \
58 # routines
60 CFLAGS-grantpt.c += -DLIBEXECDIR='"$(libexecdir)"'
62 others = utmpdump
64 ifeq (yes,$(build-pt-chown))
65 others += \
66 pt_chown \
67 # others
68 others-pie = \
69 pt_chown \
70 # others-pie
71 install-others-programs = $(inst_libexecdir)/pt_chown
72 endif
74 subdir-dirs = programs
75 vpath %.c programs
77 tests := \
78 tst-getlogin \
79 tst-grantpt \
80 tst-ptsname \
81 tst-pututxline-cache \
82 tst-pututxline-lockfail \
83 tst-updwtmpx \
84 tst-utmp \
85 tst-utmp-size \
86 tst-utmp-size-64 \
87 tst-utmp-unsigned \
88 tst-utmp-unsigned-64 \
89 tst-utmpx \
90 # tests
92 CFLAGS-tst-utmp-size-64.c += -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64
93 CFLAGS-tst-utmp-unsigned-64.c += -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64
95 # Empty compatibility library for old binaries.
96 extra-libs := libutil
97 extra-libs-others := $(extra-libs)
98 ifeq ($(have-GLIBC_2.33),yes)
99 libutil-routines := libutil-compat
100 libutil-shared-only-routines := libutil-compat
102 # Pretend that libutil.so is a linker script, so that the symbolic
103 # link is not installed.
104 install-lib-ldscripts = libutil.so
105 $(inst_libdir)/libutil.so:
106 else # not $(have-GLIBC_2.33)
107 libutil-inhibit-o = $(filter-out .o,$(object-suffixes))
108 endif # $(have-GLIBC_2.33)
110 include ../Rules
112 CFLAGS-getpt.c += -fexceptions
113 CFLAGS-getlogin_r.c += $(config-cflags-wno-ignored-attributes)
115 # Exclude fortified routines from being built with _FORTIFY_SOURCE
116 routines_no_fortify += \
117 getlogin_r \
118 ptsname_r \
119 # routines_no_fortify
121 ifeq (yesyes,$(have-fpie)$(build-shared))
122 pt_chown-cflags += $(pie-ccflag)
123 endif
124 ifeq (yes,$(have-libcap))
125 libcap = -lcap
126 endif
127 CFLAGS-pt_chown.c += $(pt_chown-cflags)
128 LDLIBS-pt_chown = $(libcap)
129 ifeq (yesyes,$(have-fpie)$(build-shared))
130 LDFLAGS-pt_chown = -Wl,-z,now
131 endif
133 # pt_chown needs to be setuid root.
134 $(inst_libexecdir)/pt_chown: $(objpfx)pt_chown $(+force)
135 $(make-target-directory)
136 -$(INSTALL_PROGRAM) -m 4755 -o root $< $@
138 $(objpfx)tst-pututxline-lockfail: $(shared-thread-library)
139 $(objpfx)tst-pututxline-cache: $(shared-thread-library)