Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-7]: src/share/mk Pull up following revision(s) (requested by riz ...



details:   https://anonhg.NetBSD.org/src/rev/a9cae9f4d744
branches:  netbsd-7
changeset: 799418:a9cae9f4d744
user:      snj <snj%NetBSD.org@localhost>
date:      Fri Jun 05 17:03:43 2015 +0000

description:
Pull up following revision(s) (requested by riz in ticket #825):
        share/mk/bsd.lib.mk: revision 1.358 via patch
fix MKDEBUG vs parallel builds.  split the creation of the final
.so file from the main link of it, and use the main file as the
input for both the .so output and the .so.debug file.  for MKDEBUG
builds we now:
        (a) create the (new) .so.full file
        (d) create the .so.debug file
        (c) create the (installable) .so file
for other builds, we simply use the same rule for (a) to create (c).
this stops the .so.debug rule from modifying the .so rule's target
and leading to mayhem.
see this thread for more details:
    http://mail-index.netbsd.org/tech-toolchain/2015/06/03/msg002616.html

diffstat:

 share/mk/bsd.lib.mk |  35 +++++++++++++++++++++++------------
 1 files changed, 23 insertions(+), 12 deletions(-)

diffs (70 lines):

diff -r 9213d2bc25c5 -r a9cae9f4d744 share/mk/bsd.lib.mk
--- a/share/mk/bsd.lib.mk       Fri Jun 05 16:52:39 2015 +0000
+++ b/share/mk/bsd.lib.mk       Fri Jun 05 17:03:43 2015 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.lib.mk,v 1.355 2014/06/13 01:17:45 mrg Exp $
+#      $NetBSD: bsd.lib.mk,v 1.355.2.1 2015/06/05 17:03:43 snj Exp $
 #      @(#)bsd.lib.mk  8.3 (Berkeley) 4/22/94
 
 .include <bsd.init.mk>
@@ -406,6 +406,7 @@
 _LIB.so:=${_LIB}.so
 _LIB.so.major:=${_LIB}.so.${SHLIB_MAJOR}
 _LIB.so.full:=${_LIB}.so.${SHLIB_FULLVERSION}
+_LIB.so.link:=${_LIB}.so.${SHLIB_FULLVERSION}.link
 .if ${MKDEBUG} != "no"
 _LIB.so.debug:=${_LIB.so.full}.debug
 .endif
@@ -614,8 +615,25 @@
 _LDADD.${_LIB}=        ${LDADD} ${LDADD.${_LIB}}
 _LDFLAGS.${_LIB}=      ${LDFLAGS} ${LDFLAGS.${_LIB}}
 
-${_LIB.so.full}: ${SOLIB} ${DPADD} ${DPLIBC} \
-    ${SHLIB_LDSTARTFILE} ${SHLIB_LDENDFILE}
+_MAINLIBDEPS=  ${SOLIB} ${DPADD} ${DPLIBC} \
+               ${SHLIB_LDSTARTFILE} ${SHLIB_LDENDFILE}
+
+.if defined(_LIB.so.debug)
+${_LIB.so.debug}: ${_LIB.so.link}
+       ${_MKTARGET_CREATE}
+       (  ${OBJCOPY} --only-keep-debug \
+               ${_LIB.so.link} ${_LIB.so.debug} \
+       ) || (rm -f ${.TARGET}; false)
+${_LIB.so.full}: ${_LIB.so.link} ${_LIB.so.debug}
+       ${_MKTARGET_CREATE}
+       (  ${OBJCOPY} --strip-debug -p -R .gnu_debuglink \
+               --add-gnu-debuglink=${_LIB.so.debug} \
+               ${_LIB.so.link} ${_LIB.so.full} \
+       ) || (rm -f ${.TARGET}; false)
+${_LIB.so.link}: ${_MAINLIBDEPS}
+.else # aka no MKDEBUG
+${_LIB.so.full}: ${_MAINLIBDEPS}
+.endif
        ${_MKTARGET_BUILD}
        rm -f ${.TARGET}
        ${LIBCC} ${LDLIBC} -Wl,-x -shared ${SHLIB_SHFLAGS} \
@@ -625,6 +643,8 @@
 #  We don't use INSTALL_SYMLINK here because this is just
 #  happening inside the build directory/objdir. XXX Why does
 #  this spend so much effort on libraries that aren't live??? XXX
+#  XXX Also creates dead symlinks until the .full rule runs
+#  above and creates the main link
 .if defined(SHLIB_FULLVERSION) && defined(SHLIB_MAJOR) && \
     "${SHLIB_FULLVERSION}" != "${SHLIB_MAJOR}"
        ${HOST_LN} -sf ${_LIB.so.full} ${_LIB.so.major}.tmp
@@ -636,15 +656,6 @@
        ${OBJCOPY} -R .ident ${.TARGET}
 .endif
 
-.if defined(_LIB.so.debug)
-${_LIB.so.debug}: ${_LIB.so.full}
-       ${_MKTARGET_CREATE}
-       (  ${OBJCOPY} --only-keep-debug ${_LIB.so.full} ${_LIB.so.debug} \
-       && ${OBJCOPY} --strip-debug -p -R .gnu_debuglink \
-               --add-gnu-debuglink=${_LIB.so.debug} ${_LIB.so.full} \
-       ) || (rm -f ${.TARGET}; false)
-.endif
-
 .if !empty(LOBJS)                                                      # {
 LLIBS?=                -lc
 ${_LIB.ln}: ${LOBJS}



Home | Main Index | Thread Index | Old Index