opentitan icon indicating copy to clipboard operation
opentitan copied to clipboard

[devbundle] Statically link opentitantool & hsmtool

Open cfrantz opened this issue 2 months ago • 1 comments

Opentitantool depends on libudev which can cause portability issues between different runtime environments.

  1. Add a flag which permits statically linking host tools.
  2. Supply libudev-zero which is a no-dependencies replacement for libudev.
  3. Add some flags machinery for controlling whether opentitantool is statically linked (default: no).
  4. Deliver statically linked opentitantool and hsmtool in the devbundle.

cfrantz avatar Oct 23 '25 20:10 cfrantz

Yes, libusb is my question too. On my machine OT-tool binary depends on (apart from libssl,libcrypto and glibc libraries), libftdi1/libusb-1.0/libudev. (It does not depend on libelf)

nbdd0121 avatar Nov 04 '25 12:11 nbdd0121

Yes, libusb is my question too. On my machine OT-tool binary depends on (apart from libssl,libcrypto and glibc libraries), libftdi1/libusb-1.0/libudev. (It does not depend on libelf)

Libusb depends on libudev and libudev doesn't typically distribute a static-linked archive.

Libelf is for verilator. The static-linked libelf currently in debian-based distros has a bug and can't correctly link statically (it's missing a sub-dependency from within libelf itself). We can remove libelf as soon as debian starts distributing libelf.

cfrantz avatar Nov 06 '25 17:11 cfrantz