Project

General

Profile

Bug #5469

Undefined contract_init_fork_template

Added by Gary Mills about 6 years ago. Updated about 6 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
lib - userland libraries
Start date:
2014-12-21
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

Description

Building illumos on a Solaris 11.2 build host resulted in several instances of this error:


Undefined first referenced
symbol in file
contract_init_fork_template /lib/libcmdutils.so.1
ld: fatal: symbol referencing errors
collect2: error: ld returned 1 exit status

The symbol contract_init_fork_template is not defined in illumos, but only on the build host, in /lib/libcmdutils.so.1 and /lib/libcontract.so.1 . The error happened because some of the illumos libraries had an indirect requirement for libxml2.so.2 . This library is not available on illumos, but only on the build host. Here's an interesting example, from usr/src/lib/libpool/Makefile.com:

@
  1. Adding -lxml2 to LDLIBS would cause lint to complain as there is no .ln file
  2. for libxml2, so add it to DYNFLAGS
    DYNFLAGS += -lxml2

LIBS = $(DYNLIB) $(LINTLIB)
LDLIBS += -lscf -lnvpair -lexacct -lc
@

Other than adding libxml2.so.2 to illumos, there is no solution. The problem is that illumos is not self-contained.

#1

Updated by Robert Mustacchi about 6 years ago

Alternatively, you should use the adjunct proto area and build those external dependencies and that way you'll have the exact versions that illumos requires and not just end up with the arbitrary version that's on the build system. For an example of setting this up, take a look at illumos-extra and how the smartos build deals with exactly this problem.

Also available in: Atom PDF