Page MenuHomeFreeBSD

crypto/openssl: make vendor imports easier/less error prone
AbandonedPublic

Authored by ngie on Aug 1 2025, 4:26 AM.
Tags
None
Referenced Files
F127430410: D51663.id.diff
Sun, Aug 31, 8:08 PM
Unknown Object (File)
Thu, Aug 28, 7:40 PM
Unknown Object (File)
Tue, Aug 26, 5:07 PM
Unknown Object (File)
Tue, Aug 26, 3:33 PM
Unknown Object (File)
Tue, Aug 26, 2:58 AM
Unknown Object (File)
Mon, Aug 25, 5:32 AM
Unknown Object (File)
Sun, Aug 24, 11:01 PM
Unknown Object (File)
Sat, Aug 23, 4:52 PM

Details

Summary

This change adds a custom BSD makefile containing multiple high-level PHONY
targets, similar to targets provided by the ports framework.

The Makefile does the following:

  • Reruns Configure with a deterministic set of arguments to ensure that all appropriate features have been enabled/disabled in OpenSSL.
  • Preens the pkgconfig files to remove duplicate paths in their CFLAGS and includedir variables.
  • Rebuilds all ASM files to ensure that the content contained is fresh.
  • Rebuilds all manpages to ensure that the content contained in the manpages is fresh.

Some additional work needs to be done to make the manpage regeneration
"operation" reproducible (the date the manpages were generated is
embedded in the files).

All dynamic configuration previously captured in
include/openssl/configuration.h and include/crypto/bn_conf.h has been
moved to freebsd/include/dynamic_freebsd_configuration.h and
freebsd/include/crypto/bn_conf.h, respectively. This helps
ensure that future updates don't wipe out FreeBSD customizations to
these files, which tune behavior on a per-target architecture basis, e.g.,
ARM vs x86, 32-bit vs 64-bit, etc.

Test Plan

I used this to regenerate the 3.5.1 artifacts multiple times for follow-up differential revisions, but have used similar diffs when working on the 3.0.17 update as well.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 66336
Build 63219: arc lint + arc unit

Event Timeline

ngie requested review of this revision.Aug 1 2025, 4:26 AM

Regenerate ASM files while here

ngie edited the test plan for this revision. (Show Details)
ngie added a reviewer: khorben.
ngie added subscribers: emaste, philip.
ngie added subscribers: jhb, andrew, nwhitehorn.
ngie edited the test plan for this revision. (Show Details)

Move all vendor import build machinery to crypto/openssl/BSDmakefile as it should be run from there

Update manpage copying scheme.

Remove openssl_configuration.h changes so this change can be easily isolated and backported.

ngie edited the test plan for this revision. (Show Details)

Undefine all remaining preprocessor constants in second block before doing dynamic tests.

This ensures that the "slate is clean" before applying the preprocessor constants
dynamically.

crypto/openssl/dynamic_freebsd_configuration.h
12 ↗(On Diff #159529)

Please use something like __SIZEOF_LONG__ == 4 instead of !__LP64__ (if the limitation is that it needs 64-bit longs). The code below already uses __SIZEOF_LONG__.

  • Apply feedback from @jhb re: LP64, etc.
  • Update release/version information with information provided by configdata.pm.
  • Move configuration.h aside so the OpenSSL generated file doesn't accidentally get checked in instead of the patched file.
ngie marked an inline comment as done.Thu, Aug 7, 2:57 PM
  • Rebase with 3.0.16 changes.
  • Handle generating bn_conf.h
  • Add clean target.
  • Mirror targets provided by ports:
    • configure
    • patch
    • all

The primary difference flow-wise is that patch and configure are swapped around.

I'm considering changing the patches to instead update the .pl scripts.

Refresh with latest changes used to regenerate Makefiles, etc

crypto/openssl/util/wrap.pl
12

I need to push a change back upstream to use relative paths instead of hardcoding the full path to one's source tree.

56

I need to push a change back upstream to use relative paths instead of hardcoding the full path to one's source tree.

63

I need to push a change back upstream to use relative paths instead of hardcoding the full path to one's source tree.

ngie marked 3 inline comments as not done.Mon, Aug 18, 11:57 PM

Readd options for algorithms previously disabled

This achieves parity with what's shipping on main.

Also, fix a typo in the newly added sed statement for cleaning out the
pkgconfig files.

This revision is now accepted and ready to land.Tue, Aug 19, 2:44 PM

Remove a stray endif from the bn_conf.h customization so the code compiles.

Discovered when running make tinderbox on universe15a.

This revision now requires review to proceed.Wed, Aug 20, 1:10 AM