NetBSD-Bugs archive

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

misc/47700: MKSTATICLIB, MKPICLIB, and `-g' interact badly in

>Number:         47700
>Category:       misc
>Synopsis:       MKSTATICLIB, MKPICLIB, and `-g' interact badly in
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    misc-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Mar 28 03:30:00 +0000 2013
>Originator:     Taylor R Campbell <>
>Release:        NetBSD 6.99.17
System: NetBSD vox.local 6.99.17 NetBSD 6.99.17 (GENERIC) #0: Thu Mar 28 
03:12:05 UTC 2013 
Architecture: vax
Machine: vax

        MKDEBUG=yes is broken on VAX, because...

        The logic surrounding CSHLIBFLAGS affects which variants of a
        library (.a, _pic.a), and the initialization of CSHLIBFLAGS
        depends on whether `-g' has turned up.  This breaks the case of
        MKDEBUG=yes/MKSTATICLIB=no/MKPICLIB=no, which happens in
        librumphijack (which sets NOSTATICLIB) on VAX (which sets
        MKPICLIB=no) if you set MKDEBUG=yes in your mk.conf -- the
        symlink at librumphijack_pic.a is omitted from the destdir in
        spite of its presence in the set lists.

        A separate problem is that librumphijack_pic.a has no business
        being installed, really, any more than librumphijack.a does.
        But fixing this sounds even more convoluted and I think I've
        had enough of a foray into architecture necrophilia and the
        tortu(r)ous convolutions of logic in for now.

>How-To-Repeat: -m vax -V MKDEBUG=yes distribution

        See that librumphijack_pic.a is not installed.


        Apply the following patch to set CSHLIBFLAGS a little later,
        after it could change the decision of what libraries get built:

Index: share/mk/
RCS file: /cvsroot/src/share/mk/,v
retrieving revision 1.332
diff -p -u -r1.332
--- share/mk/ 5 Mar 2013 21:16:24 -0000       1.332
+++ share/mk/ 28 Mar 2013 03:22:12 -0000
@@ -47,13 +47,6 @@ CFLAGS+=        ${PIE_CFLAGS}
 AFLAGS+=        ${PIE_AFLAGS}
-.if (defined(MKDEBUG) && (${MKDEBUG} != "no")) || \
-    (defined(CFLAGS) && !empty(CFLAGS:M*-g*))
-# We only add -g to the shared library objects
-# because we don't currently split .a archives.
 ##### Libraries that this may depend upon.
 .if defined(LIBDPLIBS) && ${MKPIC} != "no"                             # {
 .for _lib _dir in ${LIBDPLIBS}
@@ -200,6 +193,13 @@ MKSHLIBOBJS= yes
+.if (defined(MKDEBUG) && (${MKDEBUG} != "no")) || \
+    (defined(CFLAGS) && !empty(CFLAGS:M*-g*))
+# We only add -g to the shared library objects
+# because we don't currently split .a archives.
 # Platform-independent linker flags for ELF shared libraries
 SHLIB_SHFLAGS=         -Wl,-soname,${_LIB}.so.${SHLIB_SOVERSION}

Home | Main Index | Thread Index | Old Index