|
|||||||||||
|
library/2928:
From: <rob(at)pickering.org>
Date: Mon Sep 23 2002 - 09:32:43 EDT
System : OpenBSD 3.2
Architecture: OpenBSD.i386
Machine : i386
>Description: "make build" has been failing for me for some time (since at least OPENBSD_3_1) when I do a clean build with DESTDIR set to get a release tree. I finally got annoyed about this enough to try and work out why. It fails when linking ld.so in /usr/src/gnu/usr/bin/ld due to a bug in bsd.prog.mk which compiles in {DESTDIR}/usr/lib/crt0.o, to avoid using the system C startup files. The link of the ld.so binary doesn't want C startup files, and uses -nostartfiles flag at link time. This is fine for a normal link, but bsd.prog.mk overrides this when DESTDIR is set and it gets them anyway, resulting in link errors >How-To-Repeat:
Patch for bsd.prog.mk below omits ${DESTDIR}/usr/lib/crt0.o etc if original LDFLAGS had -nostartfiles also added -nostartfiles flag to new linker line if doing an ordinary DESTDIR build as I think this is more correct. RCS file: /cvs/src/share/mk/bsd.prog.mk,v retrieving revision 1.33 diff -C3 -r1.33 bsd.prog.mk *** bsd.prog.mk 2002/07/25 18:19:06 1.33 --- bsd.prog.mk 2002/09/23 13:01:13
.if defined(OBJS) && !empty(OBJS)
${PROG}: ${LIBCRT0} ${OBJS} ${LIBC} ${CRTBEGIN} ${CRTEND} ${DPADD} ! ${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} -nostdlib -L${DESTDIR}/usr/lib ${LIBCRT0} ${CRTBEGIN} ${OBJS} ${LDADD} -lgcc - lc -lgcc ${CRTEND} .else
.if defined(OBJS) && !empty(OBJS)
+
+ .if !empty(LDFLAGS:M-nostartfiles)
+
+ ${PROG}: ${OBJS} ${LIBC} ${DPADD}
+ ${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} ${OBJS} ${LDADD}
+
+ .else
+
.if defined(DESTDIR) ${PROG}: ${LIBCRT0} ${OBJS} ${LIBC} ${CRTBEGIN} ${CRTEND} ${DPADD} ! ${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} -nostartfiles -nostdlib -L${DESTDIR}/usr/lib ${LIBCRT0} ${CRTBEGIN} ${OBJS} ${ LDADD} -lgcc -lc -lgcc ${CRTEND} .else
.endif # defined(DESTDIR)
+ .endif # !empty(${LDFLAGS:M-nostartfiles})
.endif # defined(OBJS) && !empty(OBJS)
.if !defined(MAN) >Release-Note:
non-critical
This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 13:29:37 EDT |
||||||||||
|
|||||||||||