Skip to content

Parallel buildworld can link OpenSSL engines before libcrypto exists #501

Description

@laffer1

A clean parallel world build can fail because the OpenSSL engine subdirectories attempt to link before the parent libcrypto shared library exists.

Reproduction:

env MAKEOBJDIRPREFIX=/tmp/pr500-obj make -j10 buildworld buildkernel

Observed failures:

--- all_subdir_secure/lib/libcrypto/engines/capi ---
ld: error: unable to find library -lcrypto
cc: error: linker command failed with exit code 1
*** [capi.so.full] Error code 1

--- all_subdir_secure/lib/libcrypto/engines/padlock ---
ld: error: unable to find library -lcrypto
cc: error: linker command failed with exit code 1
*** [padlock.so.full] Error code 1

At failure time neither the parent object directory nor the staged sysroot contained libcrypto.so. secure/lib/libcrypto/Makefile declares SUBDIR=engines, while secure/lib/libcrypto/engines/Makefile declares SUBDIR_PARALLEL=. The capi and padlock engine Makefiles use bsd.lib.mk and link against -lcrypto, but the build graph does not ensure that the parent library is available before those parallel links.

An incremental rerun may get past the failure after enough parent-library objects have been retained, which makes this timing-dependent and easy to miss. The dependency/order should be expressed explicitly so a clean -j build succeeds on the first invocation.

This was discovered while validating PR #500, but the PR does not modify the engine Makefiles or their subdirectory ordering.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions