Opened 3 years ago

Closed 17 months ago

Last modified 7 months ago

#61598 closed defect (fixed)

nut @2.7.4: Undefined symbols

Reported by: AP1010 Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.6.4
Keywords: bigsur Cc: cooljeanius (Eric Gallager)
Port: nut

Description (last modified by ryandesign (Ryan Carsten Schmidt))

linker fails with:

Undefined symbols for architecture x86_64:
  "_str_rtrim", referenced from:
      _nutscan_scan_usb in libnutscan_la-scan_usb.o

Attachments (1)

main.log (195.0 KB) - added by AP1010 3 years ago.
main.log

Download all attachments as: .zip

Change History (12)

Changed 3 years ago by AP1010

Attachment: main.log added

main.log

comment:1 Changed 3 years ago by kencu (Ken)

This looks like the ubiquitous libtool error with MacOS 11 issue.... see 5500 other similar reports. There is a patch in the libtool port that is pretty simple to implement that will probably fix this for you.

comment:2 Changed 3 years ago by jmroot (Joshua Root)

Keywords: bigsur added; nut Big Sur removed
Port: @2.7.4 removed

comment:3 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)
Summary: nut @2.7.4 is not building on Big Surnut @2.7.4: Undefined symbols

comment:4 Changed 3 years ago by cooljeanius (Eric Gallager)

Cc: cooljeanius added

comment:5 Changed 3 years ago by cooljeanius (Eric Gallager)

A bit more context showing the compile command:

/bin/sh ../../libtool  --tag=CC   --mode=link /usr/bin/clang -I../../clients -I../../include  -I../../drivers -I/opt/local/include/nss -I/opt/local/include/nspr -I/opt/local/include/libusb-1.0  -I/opt/local/include/neon -D_REENTRANT  -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -arch x86_64 -Wall -Wsign-compare  -version-info 1:0:0 -L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -arch x86_64 -o libnutscan.la -rpath /opt/local/lib libnutscan_la-scan_nut.lo libnutscan_la-scan_ipmi.lo libnutscan_la-nutscan-device.lo libnutscan_la-nutscan-ip.lo libnutscan_la-nutscan-display.lo libnutscan_la-nutscan-init.lo libnutscan_la-scan_usb.lo libnutscan_la-scan_snmp.lo libnutscan_la-scan_xml_http.lo libnutscan_la-scan_avahi.lo libnutscan_la-scan_eaton_serial.lo libnutscan_la-nutscan-serial.lo ../../drivers/libnutscan_la-serial.lo ../../drivers/libnutscan_la-bcmxcp_ser.lo ../../common/libnutscan_la-common.lo  -lltdl  -L/opt/local/lib/nss -L/opt/local/lib/nspr -L/opt/local/lib -lssl3 -lsmime3 -lnssutil3 -lnss3 -lplds4 -lplc4 -lnspr4 
libtool: link: /usr/bin/clang -dynamiclib  -o .libs/libnutscan.1.dylib  .libs/libnutscan_la-scan_nut.o .libs/libnutscan_la-scan_ipmi.o .libs/libnutscan_la-nutscan-device.o .libs/libnutscan_la-nutscan-ip.o .libs/libnutscan_la-nutscan-display.o .libs/libnutscan_la-nutscan-init.o .libs/libnutscan_la-scan_usb.o .libs/libnutscan_la-scan_snmp.o .libs/libnutscan_la-scan_xml_http.o .libs/libnutscan_la-scan_avahi.o .libs/libnutscan_la-scan_eaton_serial.o .libs/libnutscan_la-nutscan-serial.o ../../drivers/.libs/libnutscan_la-serial.o ../../drivers/.libs/libnutscan_la-bcmxcp_ser.o ../../common/.libs/libnutscan_la-common.o   -L/opt/local/lib -lltdl -L/opt/local/lib/nss -L/opt/local/lib/nspr -lssl3 -lsmime3 -lnssutil3 -lnss3 -lplds4 -lplc4 -lnspr4  -Os -arch x86_64 -Wl,-headerpad_max_install_names -Wl,-syslibroot -Wl,/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -arch x86_64   -install_name  /opt/local/lib/libnutscan.1.dylib -compatibility_version 2 -current_version 2.0 -Wl,-single_module
Undefined symbols for architecture x86_64:
  "_str_rtrim", referenced from:
      _nutscan_scan_usb in libnutscan_la-scan_usb.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [libnutscan.la] Error 1
make[3]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_nut/nut/work/nut-2.7.4/tools/nut-scanner'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_nut/nut/work/nut-2.7.4/tools/nut-scanner'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_nut/nut/work/nut-2.7.4/tools'
make: *** [all-recursive] Error 1
make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_nut/nut/work/nut-2.7.4'
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_nut/nut/work/nut-2.7.4" && /usr/bin/make -j16 -w all 
Exit code: 2
Error: Failed to build nut: command execution failed
DEBUG: Error code: CHILDSTATUS 55526 2

So, yes, libtool.

comment:6 Changed 2 years ago by vespasian99

similar error for M1 Monterey:

Undefined symbols for architecture arm64:

"_str_rtrim", referenced from:

_nutscan_scan_usb in libnutscan_la-scan_usb.o

ld: symbol(s) not found for architecture arm64

comment:7 Changed 18 months ago by vespasian99

also fails M1 Ventura

comment:8 Changed 17 months ago by jmroot (Joshua Root)

In fd0b4c82f50698b21054caf383a72ac7693e9591/macports-ports (master):

nut: patch libtool bug, use add_users

See: #61598

comment:9 Changed 17 months ago by jmroot (Joshua Root)

Resolution: fixed
Status: newclosed

comment:10 in reply to:  9 Changed 17 months ago by shardul10

Replying to jmroot:

Can you please elaborate? How to patch the libtool bug?

comment:11 Changed 7 months ago by johyphenel (Jo-el van Bergen)

Should this be fixed at for the current download retrieved by $ sudo port install nut on Mac OS13?

Today I installed using that command, and get a very similar error for running nut-scanner:

$ nut-scanner
dyld[1814]: symbol not found in flat namespace '_str_rtrim'
Abort trap: 6
Note: See TracTickets for help on using tickets.