Opened 4 months ago

Last modified 3 months ago

#73995 assigned defect

deno @2.7.14: dyld: lazy symbol binding failed: Symbol not found: _aligned_alloc

Reported by: scrutinizer11 Owned by: herbygillot (Herby Gillot)
Priority: Normal Milestone:
Component: ports Version: 2.12.5
Keywords: mojave Cc:
Port: deno

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

On macOS Mojave, deno 2.7.14 produces the error below when running

deno repl --no-prompt --no-remote --no-lock --node-modules-dir=none --no-config --no-npm --cached-only

--->
  Referenced from: /opt/local/bin/deno
  Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: _aligned_alloc
  Referenced from: /opt/local/bin/deno
  Expected in: /usr/lib/libSystem.B.dylib

Abort trap: 6

The port's description indicates it's compatible with Darwin 16 and newer; mine is Darwin 18.7.0, which corresponds to macOS Mojave.

Change History (1)

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

Cc: herbygillot removed
Description: modified (diff)
Keywords: mojave added
Owner: set to herbygillot
Status: newassigned
Summary: deno: improve compatibilitydeno @2.7.14: dyld: lazy symbol binding failed: Symbol not found: _aligned_alloc

This problem occurs at runtime, rather than being caught at build time, because this port installs a binary rather than building from source.

The decision to mark the port as requiring macOS 10.12 (Darwin 16) may have been influenced by the fact that the binary was compiled with MACOSX_DEPLOYMENT_TARGET set to 10.12, as I can see by looking at the binary's load commands with otool:

$ port -q installed deno
  deno @2.7.14_0 (active)

$ otool -l $(which deno) | grep -B1 -A3 LC_VERSION_MIN_MACOSX
Load command 9
      cmd LC_VERSION_MIN_MACOSX
  cmdsize 16
  version 10.12
      sdk 15.5

However, looking at the symbols the binary references with nm, I can confirm that it does reference _aligned_alloc, as per your error message:

$ nm $(which deno) | grep aligned_alloc
                 U _aligned_alloc

Unfortunately aligned_alloc first appeared in macOS 10.15, so we will need to mark the port as requiring macOS 10.15 (Darwin 19) or later.

Getting the port to work on earlier OS versions would require either that the developers produce a binary that runs on earlier systems, or that we switch the port to building from source (and that's assuming that the code contains a fallback for when aligned_alloc is not available). Normally we do want ports to build from source, however this port contains a comment explaining that building it from source is too difficult.

Note: See TracTickets for help on using tickets.