Bug #13260

librtld_db demo should be built separately

Added by Robert Mustacchi 4 months ago. Updated 4 months ago.

cmd - userland programs
Start date:
Due date:
% Done:


Estimated time:
Gerrit CR:


The librtld_db directory contains a separate demo application that shows how one might use librtld_db. The way this is constructed it is always built as ancillary subdirectory that is descended into when librtld_db is being built, which follow the normal Makefile.lib style build. This demo requires not only librld_db, but it also uses libelf, libl, and liby.

librtld_db is built in two different paths. There's the normal path in cmd/sgs where it's listed as a target; however, there is a second path. It is listed as one of the items that are to be built in usr/src/lib. This means that the demo directory is built in this early phase, but it has additional dependencies that librtld_db doesn't have. The build attempts to recognize this by trying to make comments about using a native libl, liby, and libelf; however, it tries to use a proto libc and librtld_db. This ends in chaos in certain situations.

The solution here is to no longer try and build the demo in ancillary fashion and make it a top-level target in its own directory in cmd/sgs that can have all the appropriate dependencies met. At the same time, this allows us to make sure that it always builds against the proto area, which is what will be shipped.

Related issues

Related to illumos gate - Bug #13284: demo_rdb build fails on SPARCClosedPeter Tribble

Blocks illumos gate - Feature #13274: enable -fstack-protector-strong by default in user landClosedRobert Mustacchi


Updated by Robert Mustacchi 4 months ago

  • Blocks Feature #13274: enable -fstack-protector-strong by default in user land added

Updated by Electric Monk 4 months ago

  • Gerrit CR set to 1021

Updated by Robert Mustacchi 4 months ago

I tested this primarily through wsdiff and verified that there were no changes induced by this. I also verified the build on systems with and without the stack protector work that led to me discovering this.


Updated by Electric Monk 4 months ago

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

git commit d9328cd43f1300af79f6fc8a3ad4760137618c63

commit  d9328cd43f1300af79f6fc8a3ad4760137618c63
Author: Robert Mustacchi <>
Date:   2020-11-04T15:31:48.000Z

    13260 librtld_db demo should be built separately
    Reviewed by: Richard Lowe <>
    Reviewed by: C Fraire <>
    Reviewed by: Patrick Mooney <>
    Approved by: Gordon Ross <>


Updated by Peter Tribble 4 months ago

  • Related to Bug #13284: demo_rdb build fails on SPARC added

Also available in: Atom PDF