Bug #9692


libvscan has bad _msg dependency

Added by Jason King about 4 years ago. Updated about 4 years ago.

lib - userland libraries
Start date:
Due date:
% Done:


Estimated time:
Gerrit CR:
External Bug:


Upstream of Joyent OS-7100:

(I'm just including Robert's analysis as it's where we finally got to the bottom of the issue)

The problem here is a little involved, but ultimately straightforward. Let's take this apart starting in libvscan and go from there.
Starting in libvscan, when one run runs dmake _msg there are a few issues. The first is that while the target is normally just:


There is an additional dep on _msg as part of the general SUBDIRS statement. However, this itself is problematic. Because while _msg is in the SUBDIRS list, there is no rule to conditionally assign to $(TARGET). This means that when it invokes the rule, it will descend, $(TARGET) will be unset, so it will build the default target which is all. This is seen pretty clearly when one uses -dd to dmake:
   Building i386 because new command
        cd i386; pwd; /home/rm/src/tiresias/proto.strap/usr/bin/dmake
   different from empty old command
   Building i386 because new command longer than old

This is what causes us to always try and build the actual library when we're building messages.
This on its own is not sufficient to cause the build failure seen above. When building the _msg target in $(SRC)/Makefile, it will descend into lib/ and run the target. However, there we explicitly ignore dependencies when running _msg and use the -nodepend variants. As a result it will always descend and because this is in parallel with the other install tasks, it's not hard for us to end up in a situation where due to the earlier bug, and the lack of a link against libnsl due to illumos#9673, that we then fail.

Actions #1

Updated by Jason King about 4 years ago

Just to have the whole synopsis, the upstream is 'OS-7100 Build fails in libvscan after merge'

Actions #2

Updated by Jason King about 4 years ago

I suppose the original build failure message might be useful to have as well (ECAFFEINE :P):

After the merge of:

commit 8a7aa2a592747bd90d85645126d80688e024a0e2
9673 move internet address manipulation functions to libc

builds are failing with:
The following command caused the error:
Undefined            first referenced
 symbol                  in file
inet_pton                           pics/libvscan.o  (symbol belongs to implicit dependency /lib/
ld: fatal: symbol referencing errors. No output written to

(It should be noted that #9673 is not the cause, but just happened to change the order in which dmake built things enough to reveal the existing problem).

Actions #3

Updated by Electric Monk about 4 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit 4b82800c9ef42549e376c68ab63eb6d8228449ce

commit  4b82800c9ef42549e376c68ab63eb6d8228449ce
Author: Jason King <>
Date:   2018-08-02T16:27:08.000Z

    9692 libvscan has bad _msg dependency
    Reviewed by: Dan McDonald <>
    Reviewed by: Andy Fiddaman <>
    Approved by: Richard Lowe <>


Also available in: Atom PDF