Fixed `make depend' and related bogons. LDFLAGS was used for

ld-specific flags.  LDFLAGS is really for ld-related flags for cc,
not for ld, and some flags, e.g., -Bshareable, mean completely
different things to cc and ld.  Having the wrong things in LDFLAGS
also broke the standard ${PROG} target.  This was kludged around
by using a special rule that depended on LDFLAGS being bogus.
Fixing `make depend' broke the special rule but fixed the standard
rule (except in the DESTDIR case, which was handled more strictly
here than elsewhere).
This commit is contained in:
Bruce Evans 1997-04-16 11:31:32 +00:00
parent 12d247a783
commit 9453d60b10
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=24979
2 changed files with 4 additions and 20 deletions

View File

@ -1,4 +1,4 @@
# $Id$
# $Id: Makefile,v 1.23 1997/02/22 15:46:46 peter Exp $
PROG= ld.so
SRCS= mdprologue.S rtld.c malloc.c shlib.c md.c support.c sbrk.c
@ -7,7 +7,7 @@ LDDIR?= $(.CURDIR)/..
# As there is relocation going on behind GCC's back, don't cache function addresses.
PICFLAG=-fpic -fno-function-cse
CFLAGS+=-I$(LDDIR) -I$(.CURDIR) -I$(LDDIR)/$(MACHINE) $(PICFLAG) -DRTLD
LDFLAGS+=-Bshareable -Bsymbolic -assert nosymbolic
LDFLAGS+=-nostdlib -Wl,-Bshareable -Wl,-Bsymbolic -Wl,-assert -Wl,nosymbolic
ASFLAGS+=-k
DPADD+= ${LIBC:S/c.a/c_pic.a/} ${LIBC:S/c.a/gcc_pic.a/}
LDADD+= -lc_pic -lgcc_pic
@ -17,12 +17,4 @@ MLINKS= rtld.1 ld.so.1
.PATH: $(LDDIR) $(LDDIR)/$(MACHINE)
.if defined(DESTDIR)
$(PROG):
$(LD) -o $(PROG) $(LDFLAGS) -nostdlib -L${DESTDIR}/usr/lib $(OBJS) $(LDADD)
.else
$(PROG):
$(LD) -o $(PROG) $(LDFLAGS) $(OBJS) $(LDADD)
.endif
.include <bsd.prog.mk>

View File

@ -1,4 +1,4 @@
# $Id$
# $Id: Makefile,v 1.23 1997/02/22 15:46:46 peter Exp $
PROG= ld.so
SRCS= mdprologue.S rtld.c malloc.c shlib.c md.c support.c sbrk.c
@ -7,7 +7,7 @@ LDDIR?= $(.CURDIR)/..
# As there is relocation going on behind GCC's back, don't cache function addresses.
PICFLAG=-fpic -fno-function-cse
CFLAGS+=-I$(LDDIR) -I$(.CURDIR) -I$(LDDIR)/$(MACHINE) $(PICFLAG) -DRTLD
LDFLAGS+=-Bshareable -Bsymbolic -assert nosymbolic
LDFLAGS+=-nostdlib -Wl,-Bshareable -Wl,-Bsymbolic -Wl,-assert -Wl,nosymbolic
ASFLAGS+=-k
DPADD+= ${LIBC:S/c.a/c_pic.a/} ${LIBC:S/c.a/gcc_pic.a/}
LDADD+= -lc_pic -lgcc_pic
@ -17,12 +17,4 @@ MLINKS= rtld.1 ld.so.1
.PATH: $(LDDIR) $(LDDIR)/$(MACHINE)
.if defined(DESTDIR)
$(PROG):
$(LD) -o $(PROG) $(LDFLAGS) -nostdlib -L${DESTDIR}/usr/lib $(OBJS) $(LDADD)
.else
$(PROG):
$(LD) -o $(PROG) $(LDFLAGS) $(OBJS) $(LDADD)
.endif
.include <bsd.prog.mk>