Opened 19 months ago
#71814 assigned defect
micronucleus @2.5: Undefined symbols _SecTaskCopyValueForEntitlement, _SecTaskCreateFromSelf
| Reported by: | ryandesign (Ryan Carsten Schmidt) | Owned by: | mdholling@… |
|---|---|---|---|
| Priority: | Normal | Milestone: | |
| Component: | ports | Version: | 2.10.5 |
| Keywords: | sonoma | Cc: | |
| Port: | micronucleus |
Description
micronucleus @2.5 doesn't build:
Building command line tool: micronucleus...
gcc -I/opt/local/include -Ilibrary -O -g -D MAC_OS -o micronucleus micronucleus.c micronucleus_lib.o littleWire_util.o /opt/local/lib/libusb.a /opt/local/lib/libusb-1.0.a -framework CoreFoundation -framework IOKit
Undefined symbols for architecture x86_64:
"_SecTaskCopyValueForEntitlement", referenced from:
_darwin_detach_kernel_driver in libusb-1.0.a[10](darwin_usb.o)
"_SecTaskCreateFromSelf", referenced from:
_darwin_detach_kernel_driver in libusb-1.0.a[10](darwin_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: *** [micronucleus] Error 1
I think these symbols are part of the security framework but -framework Security is missing from the link line.
In fact I think this error is caused by the build using the libusb static libraries. When you use a static library, you need to also link with all of the libraries that that static library uses; in this case, libusb uses the security framework.
The solution should be to switch to linking with the dynamic libraries instead of the static libraries.
The Makefile contains some Homebrew-specific nonsense that may need to be patched out. Or it may just be what happens when pkg-config is not found; a build dependency on path:bin/pkg-config:pkgconfig would need to be added to the port.
Since this will change installed files, this will require increasing the port's revision (unless combined with a version update).
