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

Đang mở
#465 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
rust
Lĩnh vực
build-system, cli

Hướng nghiên cứu

Bắt đầu bằng cách tái tạo các bản build debug và release của opteadm, rồi kiểm tra các dependency động của chúng bằng elfdump. Truy vết cây dependency của cargo từ opteadm và opte-ioctl qua libnet, dlpi, num_enum và num_enum_derive, tập trung vào thay đổi của cargo update từ 258a8b5 sang c0564a0. Hoàn tất khi biến thể debug không còn đưa vào dependency libm.so.2 ngoài dự kiến.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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) (*)
Ngôn ngữ chính
Rust
Star
82
Fork
16
Merge trung bình
3 ngày 6 giờ
Pull request đã merge (30 ngày)
11

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của oxidecomputer/opte

Tất cả issue của oxidecomputer/opte

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.