From 9453d60b10f0b985d5c55a1e045419dcb4c0cc6a Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Wed, 16 Apr 1997 11:31:32 +0000 Subject: [PATCH] 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). --- gnu/usr.bin/ld/rtld/Makefile | 12 ++---------- libexec/rtld-aout/Makefile | 12 ++---------- 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/gnu/usr.bin/ld/rtld/Makefile b/gnu/usr.bin/ld/rtld/Makefile index 22c5c6561bb6..4177f6bd397a 100644 --- a/gnu/usr.bin/ld/rtld/Makefile +++ b/gnu/usr.bin/ld/rtld/Makefile @@ -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 diff --git a/libexec/rtld-aout/Makefile b/libexec/rtld-aout/Makefile index 22c5c6561bb6..4177f6bd397a 100644 --- a/libexec/rtld-aout/Makefile +++ b/libexec/rtld-aout/Makefile @@ -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