Skip to content

Commit 539ebde

Browse files
besser82solardiz
authored andcommitted
Makefile: Pass CFLAGS to the compiler when invoking the linker.
Some CFLAGS imply effects on the linker too (e.g., -fsanitize=), so they must get passed within the linker rule as well. Signed-off-by: Björn Esser <[email protected]>
1 parent db2b934 commit 539ebde

File tree

5 files changed

+17
-7
lines changed

5 files changed

+17
-7
lines changed

ChangeLog

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
2024-12-12 Björn Esser <besser82 at fedoraproject.org>
2+
3+
Makefile: Pass CFLAGS to the compiler when invoking the linker.
4+
Some CFLAGS imply effects on the linker too (e.g., -fsanitize=),
5+
so they must get passed within the linker rule as well.
6+
* libs/Makefile: Pass CFLAGS to the compiler when linking.
7+
* pam_tcb/Makefile: Likewise.
8+
* progs/Makefile: Likewise.
9+
* LICENSE: Update copyright for this contribution.
10+
111
2024-10-17 Dmitry V. Levin <ldv at owl.openwall.com>
212

313
pam_tcb: Do not use deprecated _pam_overwrite macro.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Copyright (c) 2001, 2002 Rafal Wojtczuk <nergal at owl.openwall.com>
22
Copyright (c) 2001 - 2003 Solar Designer <solar at owl.openwall.com>
33
Copyright (c) 2001, 2003 - 2006, 2009, 2010, 2012, 2018, 2020 Dmitry V. Levin <ldv at owl.openwall.com>
4-
Copyright (c) 2021 Björn Esser <besser82 at fedoraproject.org>
4+
Copyright (c) 2021, 2024 Björn Esser <besser82 at fedoraproject.org>
55

66
Additionally, some or all of the following copyright notices may apply
77
to portions of pam_tcb and tcb_chkpwd:

libs/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ libtcb_a.o: libtcb.c
1717
$(CC) $(CFLAGS) $(DBGFLAG) -c $< -o $@
1818

1919
$(LIBTCB_LONG): libtcb.o $(LIB_MAP)
20-
$(CC) $(LDFLAGS) -shared -o $@ -Wl,-soname,$(LIBTCB) \
20+
$(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ -Wl,-soname,$(LIBTCB) \
2121
-Wl,--version-script=$(LIB_MAP) $<
2222
ln -sf $@ $(LIBTCB)
2323
ln -sf $(LIBTCB) libtcb.so
2424

2525
$(LIBNSS): nss.o $(NSS_MAP) $(LIBTCB_LONG)
26-
$(CC) $(LDFLAGS) -shared -o $@ -Wl,-soname,$(LIBNSS) \
26+
$(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ -Wl,-soname,$(LIBNSS) \
2727
-Wl,--version-script=$(NSS_MAP) $< -ltcb
2828

2929
.c.o:

pam_tcb/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ LIBOBJ = $(LIBSRC:.c=.o)
1717
all: $(PAM_TCB)
1818

1919
$(PAM_TCB): $(LIBOBJ) $(PAM_MAP)
20-
$(CC) $(LDFLAGS) -shared -o $@ $(PAM_TCB_SONAME) \
20+
$(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $(PAM_TCB_SONAME) \
2121
-Wl,--version-script=$(PAM_MAP) $(LIBOBJ) -lcrypt -lpam -ltcb
2222

2323
.c.o:

progs/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ CHKPWD = tcb_chkpwd
77
all: $(CONVERT) $(UNCONVERT) $(CHKPWD)
88

99
$(CONVERT): $(CONVERT).o
10-
$(CC) $(LDFLAGS) -o $@ $<
10+
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
1111

1212
$(UNCONVERT): $(UNCONVERT).o
13-
$(CC) $(LDFLAGS) -o $@ $< -ltcb
13+
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -ltcb
1414

1515
$(CHKPWD): $(CHKPWD).o
16-
$(CC) $(LDFLAGS) -o $@ $< -lcrypt
16+
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lcrypt
1717

1818
.c.o:
1919
$(CC) $(CFLAGS) -c $< -o $@

0 commit comments

Comments
 (0)