Closed aaronjensen closed 1 week ago
Undefined symbols for architecture arm64:
"_sqlite3_load_extension", referenced from:
_Fsqlite_load_extension in sqlite.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Ooof, initially I thought that it could be an upstream issue. But then I though - do you have sqlite3 installed? We don't have it as a dependency, and this is a fresh install. So maybe that's the reason. For sqlite extensions you need at least 3.13 version (afaik).
I actually do have it installed. Adding it as a dependency doesn't work either. 30 doesn't build either.
That's strange. What if you disable native comp?
That doesn't help. I've got two machines here I can't build it on. One I built it on a couple days ago. Both are M4 MacBook Pros.
Oh, and I can build it from source just fine manually with --with-sqlite3
What version of SQLite do you have?
==> sqlite: stable 3.47.0 (bottled) [keg-only]
Command-line interface for SQLite
https://sqlite.org/index.html
Installed
/opt/homebrew/Cellar/sqlite/3.47.0 (12 files, 4.9MB)
Poured from bottle using the formulae.brew.sh API on 2024-11-11 at 22:03:20
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/s/sqlite.rb
Not sure if it's of note or not, but the cmake command from my gmake log looks like this:
clang -o temacs.tmp \
-Demacs -I. -I. -I../lib -I../lib -isystem /opt/homebrew/Cellar/librsvg/2.58.4/include/librsvg-2.0 -isystem /opt/homebrew/Cellar/gdk-pixbuf/2.42.12/include/gdk-pixbuf-2.0 -isystem /opt/homebrew/Cellar/libtiff/4.7.0/include -isystem /opt/homebrew/opt/zstd/include -isystem /opt/homebrew/Cellar/xz/5.6.3/include -isystem /opt/homebrew/Cellar/jpeg-turbo/3.0.4/include -isystem /opt/homebrew/Cellar/glib/2.82.2/include -isystem /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/ffi -isystem /opt/homebrew/Cellar/glib/2.82.2/include/glib-2.0 -isystem /opt/homebrew/Cellar/glib/2.82.2/lib/glib-2.0/include -isystem /opt/homebrew/opt/gettext/include -isystem /opt/homebrew/Cellar/pcre2/10.44/include -isystem /opt/homebrew/Cellar/cairo/1.18.2/include/cairo -isystem /opt/homebrew/Cellar/fontconfig/2.15.0/include -isystem /opt/homebrew/opt/freetype/include/freetype2 -isystem /opt/homebrew/opt/libpng/include/libpng16 -isystem /opt/homebrew/opt/zlib/include -isystem /opt/homebrew/Cellar/libxext/1.3.6/include -isystem /opt/homebrew/Cellar/xorgproto/2024.1/include -isystem /opt/homebrew/Cellar/libxrender/0.9.11/include -isystem /opt/homebrew/Cellar/libx11/1.8.10/include -isystem /opt/homebrew/Cellar/libxcb/1.17.0/include -isystem /opt/homebrew/Cellar/libxau/1.0.11/include -isystem /opt/homebrew/Cellar/libxdmcp/1.1.5/include -isystem /opt/homebrew/Cellar/pixman/0.44.0/include/pixman-1 -isystem /opt/homebrew/opt/libpng/include/libpng16 -isystem /opt/homebrew/opt/zlib/include -isystem /opt/homebrew/Cellar/webp/1.4.0/include -isystem /opt/homebrew/Cellar/webp/1.4.0/include/webp -isystem /opt/homebrew/Cellar/little-cms2/2.16/include -MMD -MF deps/.d -MP -isystem /opt/homebrew/Cellar/tree-sitter/0.24.4/include -isystem /opt/homebrew/Cellar/gnutls/3.8.4/include -isystem /opt/homebrew/Cellar/nettle/3.10/include -isystem /opt/homebrew/Cellar/libtasn1/4.19.0/include -isystem /opt/homebrew/Cellar/libidn2/2.3.7/include -isystem /opt/homebrew/Cellar/p11-kit/0.25.5/include/p11-kit-1 -isystem /opt/homebrew/opt/zlib/include -Wall -Wdate-time -Wdisabled-optimization -Wextra -Winit-self -Winvalid-pch -Wmissing-declarations -Wmissing-include-dirs -Wmissing-prototypes -Wmissing-variable-declarations -Wnested-externs -Wnull-dereference -Wold-style-definition -Wpacked -Wpointer-arith -Wstrict-prototypes -Wuninitialized -Wunknown-pragmas -Wvariadic-macros -Wwrite-strings -Wformat=2 -Wredundant-decls -Wno-missing-field-initializers -Wno-override-init -Wno-sign-compare -Wno-type-limits -Wno-unused-parameter -Wno-format-nonliteral -Wno-bitwise-instead-of-logical -Wno-missing-braces -Wno-null-pointer-arithmetic -Wno-implicit-const-int-float-conversion -Wno-int-in-bool-context -Wno-shift-overflow -Wno-initializer-overrides -Wno-tautological-compare -Wno-tautological-constant-out-of-range-compare -Wno-deprecated-declarations -O2 -DFD_SETSIZE=10000 -DDARWIN_UNLIMITED_SELECT -I/opt/homebrew/opt/gcc/include -I/opt/homebrew/opt/libgccjit/include -framework AppKit -framework IOKit -framework Carbon -framework IOSurface -framework QuartzCore -framework UniformTypeIdentifiers -L/opt/homebrew/lib/gcc/14 -I/opt/homebrew/opt/gcc/include -I/opt/homebrew/opt/libgccjit/include \
dispnew.o frame.o scroll.o xdisp.o menu.o window.o charset.o coding.o category.o ccl.o character.o chartab.o bidi.o cm.o term.o terminal.o xfaces.o emacs.o keyboard.o macros.o keymap.o sysdep.o bignum.o buffer.o filelock.o insdel.o marker.o minibuf.o fileio.o dired.o cmds.o casetab.o casefiddle.o indent.o search.o regex-emacs.o undo.o alloc.o pdumper.o data.o doc.o editfns.o callint.o eval.o floatfns.o fns.o sort.o font.o print.o lread.o emacs-module.o syntax.o bytecode.o comp.o dynlib.o process.o gnutls.o callproc.o region-cache.o sound.o timefns.o atimer.o doprnt.o intervals.o textprop.o composite.o xml.o lcms.o kqueue.o profiler.o decompress.o thread.o systhread.o sqlite.o treesit.o itree.o json.o fontset.o fringe.o image.o nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o macfont.o terminfo.o lastfile.o ../lib/libgnu.a -ltiff -ljpeg -L/opt/homebrew/opt/libpng/lib -lpng16 -lgif -L/opt/homebrew/Cellar/webp/1.4.0/lib -lwebpdemux -lwebpdecoder -L/opt/homebrew/Cellar/librsvg/2.58.4/lib -lrsvg-2 -lm -L/opt/homebrew/Cellar/glib/2.82.2/lib -lgio-2.0 -L/opt/homebrew/Cellar/gdk-pixbuf/2.42.12/lib -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0 -L/opt/homebrew/opt/gettext/lib -lintl -L/opt/homebrew/Cellar/cairo/1.18.2/lib -lcairo -L/usr/lib -lxml2 -lncurses -L/opt/homebrew/Cellar/gnutls/3.8.4/lib -lgnutls -L/opt/homebrew/Cellar/little-cms2/2.16/lib -llcms2 -lz -lgmp -lgccjit -ldl -L/opt/homebrew/Cellar/tree-sitter/0.24.4/lib -ltree-sitter -lsqlite3
it's truncated, but there's no -L
for sqlite, which seems suspect.
🤔 yeah it might be the reason btw, did you add it as a regular dep or a build one? i.e.
depends_on "sqlite3" => :build
Emacs adding it by default https://github.com/emacs-mirror/emacs/blob/emacs-30/src/Makefile.in
I got it working by adding --with-sqlite3=no
for now but probably need to provide correct paths?
I have reproduced the same issue on my environment (macOS 15.1). This might be related to the system's SQLite library.
The build succeeded after modifying the formula to use Homebrew's SQLite instead of the system library.
...
depends_on "mailutils" => :optional
+ depends_on "sqlite"
...
ENV.append "CFLAGS", "-O2 -DFD_SETSIZE=10000 -DDARWIN_UNLIMITED_SELECT"
+
+ # sqlite
+ ENV.append "CFLAGS", "-I#{Formula["sqlite"].include}"
+ ENV.append "LDFLAGS", "-L#{Formula["sqlite"].opt_lib}"
...
I am running on Sonoma (14.7) and the workaround provided by oshiteku worked for me with emacs-plus@30
A note for others: to modify the formula use brew edit
Is this a result of a homebrew change? It appears to not matter which Emacs version or macOS version is used.
I tested all the way back to Homebrew 4.4.0 and still had the same issue. I have no idea what might be causing this.
I am running on Sonoma (14.7) and the workaround provided by oshiteku worked for me with
emacs-plus@30
A note for others: to modify the formula use
brew edit
Thanks that was super helpful, and @oshiteku 's suggestion worked for me as well on Sequoia 15.0.1. Learned a little something about hombrew along the way...
@d12frosted Any reason not to turn this into a PR?
@aaronjensen it's easy. PR is welcome. 😅 I am away, so I can only approve/merge stuff from mobile client. 🥲
Version
emacs-plus@30
Make sure to follow these steps before submitting the issue
brew update
and try to reproduce the issue againbrew doctor
, fix all issues and try to reproduce your issue againWhat happened?
Command output
End of gmake log
brew doctor output
Your system is ready to brew.
brew config output
HOMEBREW_VERSION: 4.4.5 ORIGIN: https://github.com/Homebrew/brew HEAD: 254bf3fe9d8fa2e1b2fb55dbcf535b2d870180c4 Last commit: 19 hours ago Core tap JSON: 12 Nov 06:11 UTC Core cask tap JSON: 12 Nov 06:11 UTC HOMEBREW_PREFIX: /opt/homebrew HOMEBREW_CASK_OPTS: ["--appdir=/Applications"] HOMEBREW_EDITOR: e HOMEBREW_MAKE_JOBS: 16 HOMEBREW_TEMP: /var/tmp Homebrew Ruby: 3.3.6 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.6/bin/ruby CPU: 16-core 64-bit dunno Clang: 16.0.0 build 1600 Git: 2.47.0 => /opt/homebrew/bin/git Curl: 8.7.1 => /usr/bin/curl macOS: 15.1-arm64 CLT: 16.1.0.0.1.1729049160 Xcode: N/A Rosetta 2: false
Any extra information
Brand new laptop.