Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected dynamic dependency on libm.so.2 for opteadm debug variant #465

Open
FelixMcFelix opened this issue Feb 26, 2024 · 0 comments
Open

Comments

@FelixMcFelix
Copy link
Collaborator

FelixMcFelix commented Feb 26, 2024

After including the debug variant in the opte package we've learned that opteadm compiled in debug mode includes a dependency on libm.so.2, leading to oxidecomputer/helios-omicron-brand#13. This is not present in the release variant of opteadm.

I did some digging and this behaviour is present from c0564a0 onwards. Specifically, calling cargo update from its predecessor (258a8b5) is sufficient. The only individual crate I've found with this dependency is num_enum_derive (the release-built crate has the same dependency):

kyle@farme:~/gits/opte$ elfdump -d target/debug/deps/libnum_enum_derive-610c1d435ea8a838.so

Dynamic Section:  .dynamic
     index  tag                value
       [0]  NEEDED            0x1c2307            libsocket.so.1
       [1]  NEEDED            0x1c2346            librt.so.1
       [2]  NEEDED            0x1c235a            libpthread.so.1
       [3]  NEEDED            0x1c2373            libumem.so.1
       [4]  NEEDED            0x1c2380            libgcc_s.so.1
       [5]  NEEDED            0x1c23a8            libm.so.2
       [6]  NEEDED            0x1c23b2            libc.so.1
       [7]  INIT              0x72ffc0
       [8]  FINI              0x72ffd0
       [9]  RUNPATH           0x1c2426            /usr/gcc/12/lib/amd64
      [10]  RPATH             0x1c2426            /usr/gcc/12/lib/amd64
      [11]  HASH              0xcef40
      [12]  STRTAB            0x157448
      [13]  STRSZ             0x1c263c
      [14]  SYMTAB            0x104318
      [15]  SYMENT            0x18
      [16]  SUNW_SYMTAB       0xeaa58
      [17]  SUNW_SYMSZ        0x6c9f0
      [18]  SUNW_SORTENT      0x4
      [19]  SUNW_SYMSORT      0x320b70
      [20]  SUNW_SYMSORTSZ    0x11dbc
      [21]  CHECKSUM          0x93b2
      [22]  VERNEED           0x319a88
      [23]  VERNEEDNUM        0x7
      [24]  RELACOUNT         0x128a
      [25]  FINI_ARRAY        0x7adaa8
      [26]  FINI_ARRAYSZ      0x8
      [27]  INIT_ARRAY        0x7adab0
      [28]  INIT_ARRAYSZ      0x8
      [29]  PLTRELSZ          0x42be8
      [30]  PLTREL            0x7
      [31]  JMPREL            0x357f68
      [32]  RELA              0x332930
      [33]  RELASZ            0x68220
      [34]  RELAENT           0x18
      [35]  SYMINFO           0xc11b8
      [36]  SYMINSZ           0xdd88
      [37]  SYMINENT          0x4
      [38]  FLAGS             0                   0
      [39]  FLAGS_1           0                   0
      [40]  SUNW_STRPAD       0x200
      [41]  SUNW_LDMACH       0x3e                EM_AMD64
      [42]  PLTGOT            0x797000
   [43-53]  NULL              0

This is currently used by:

kyle@farme:~/gits/opte$ cargo tree -i num_enum_derive
num_enum_derive v0.5.11 (proc-macro)
└── num_enum v0.5.11
    ├── dlpi v0.2.0 (https://github.com/oxidecomputer/dlpi-sys#1d587ea9)
    │   └── libnet v0.1.0 (https://github.com/oxidecomputer/netadm-sys#d44d9e08)
    │       ├── opte-ioctl v0.1.0 (/develop/gits/opte/lib/opte-ioctl)
    │       │   └── opteadm v0.2.0 (/develop/gits/opte/bin/opteadm)
    │       └── opteadm v0.2.0 (/develop/gits/opte/bin/opteadm)
    └── libnet v0.1.0 (https://github.com/oxidecomputer/netadm-sys#d44d9e08) (*)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant