GNU Emacs 32.0 on FreeBSD 15.0-RELEASE

Table of Contents

1. Overview

Building and validating GNU Emacs 32.0.50 (development master) from source on FreeBSD 15.0-RELEASE (amd64) with maximum features: native compilation via libgccjit, tree-sitter, Cairo rendering, GTK3, Org 9.8.6, and full image/crypto support. This replaces the pkg-installed Emacs 30.2.

1.1. Version Information

Component Version
OS FreeBSD 15.0-RELEASE amd64
Emacs 32.0.50 (master, ca44dce1ec1)
Org 9.8.6
GCC/libgccjit 14.2.0
GTK 3.24.52
Tree-sitter 0.26.7
HarfBuzz 12.3.0
Cairo 1.18.2
GnuTLS 3.8.13
SQLite 3.50.4

1.2. Screenshot

GNU Emacs 32.0.50 on FreeBSD 15.0 — four panes: org-mode research note, IELM REPL with feature checks, elisp feature report, and 43/43 test results

GNU Emacs 32.0.50 with GTK3 toolkit on FreeBSD 15.0-RELEASE. Four panes: research.org (org 9.8.6), IELM REPL (native-comp, ImageMagick 271 formats, treesit), features.el (elisp syntax highlighting), test suite (43/43 PASS).

2. Prerequisites

2.1. System Packages

pkg install gcc14 gtk3 cairo tree-sitter harfbuzz gnutls \
  libxml2 sqlite3 dbus mailutils jansson lcms2 \
  png jpeg-turbo tiff giflib webp librsvg2-rust libXpm

Key notes:

  • gcc14 includes libgccjit.so at /usr/local/lib/gcc14/, enabling native Emacs Lisp compilation without a separate package.
  • mailutils provides GNU Mailutils for mail integration.

2.2. Source

cd ~/opt/emacs
git pull
git log --oneline -1
ca44dce1ec1 In Edebug, don't setup a margin for fringe users

3. Build Process

3.1. Configure

./configure \
  --prefix=/usr/local \
  --with-x-toolkit=gtk3 \
  --with-cairo \
  --with-tree-sitter \
  --with-imagemagick \
  --with-modules \
  --with-threads \
  --with-dbus \
  --with-mailutils \
  --with-native-compilation \
  --with-sound=oss \
  --with-file-notification=kqueue \
  --with-pdumper=yes \
  --with-dumping=pdumper \
  --with-xinput2 \
  CFLAGS="-O2 -pipe" \
  LDFLAGS="-L/usr/local/lib/gcc14"

3.2. FreeBSD Build Fix: sysinfo Link Error

The configure script incorrectly detects Linux sysinfo() on FreeBSD. FreeBSD has <sys/sysinfo.h> with struct sysinfo but lacks the sysinfo() function. Compilation passes but linking fails:

/usr/local/bin/ld: alloc.o: in function `Fmemory_info':
alloc.c:(.text+0x2e10): undefined reference to `sysinfo'

Fix: after ./configure completes, edit src/config.h:

-#define HAVE_LINUX_SYSINFO 1
+/* #undef HAVE_LINUX_SYSINFO */

-#define LINUX_SYSINFO_UNIT 1
+/* #undef LINUX_SYSINFO_UNIT */

This disables the Linux-specific memory info path in src/alloc.c and falls through to a generic implementation. M-x memory-info returns nil but Emacs works correctly otherwise.

Warning: gmake bootstrap re-runs configure and overwrites this fix. Apply it after configure, then use gmake (not gmake bootstrap).

3.3. Build

gmake -j$(sysctl -n hw.ncpu)
[build output omitted — completes successfully]

3.4. Install

This replaces the pkg-installed Emacs 30.2:

# Optional: remove pkg version first
pkg info emacs 2>/dev/null && sudo pkg remove emacs

# Install from source
sudo gmake install

# Verify
emacs --version

4. Enabled Features

Feature Status Notes
Toolkit GTK3 X11 windowing with toolbar/menubar
Cairo yes Vector graphics rendering
Native compilation yes Via gcc14 libgccjit
Tree-sitter yes Incremental parsing for major modes
HarfBuzz yes Text shaping
GnuTLS yes TLS/SSL for HTTPS, IMAP, etc.
libxml2 yes XML/HTML parsing
SQLite3 yes Built-in database for org-roam, etc.
JSON yes Via Jansson (built-in to Emacs 28+)
D-Bus yes Desktop IPC
GSettings yes Desktop settings integration
Dynamic modules yes .so loading
Threading yes Elisp threads with mutexes
pdumper yes Portable dumper for fast startup
File notification kqueue FreeBSD native (not inotify)
XInput2 yes Extended input (touchpad, stylus)
Sound OSS FreeBSD audio
SVG yes librsvg
WebP yes libwebp
PNG yes libpng
JPEG yes libjpeg-turbo
TIFF yes libtiff
GIF yes giflib
XPM yes libXpm
ImageMagick yes ImageMagick7 (MagickWand 7.1.2)
Mailutils yes GNU Mailutils
Org mode 9.8.6 Bundled (latest stable)

4.1. Features Not Available

Feature Reason
Xwidgets/WebKit webkit2gtk not packaged for FreeBSD
SELinux Linux-specific
systemd Linux-specific
m17n-flt / libotf Not installed
Xft Superseded by HarfBuzz+Cairo

5. Validation Test Suite

A comprehensive test suite is included as test-suite.el. Run it with:

./src/emacs -Q --batch -l test-suite.el 2>&1
=== Emacs 32.0 FreeBSD 15.0 Test Suite ===

Emacs: 32.0.50
System: berkeley-unix x86_64-unknown-freebsd15.0
Date: 2026-06-14 12:07:51

--- Core Functionality ---
  json-round-trip                     PASS
  json-parse-array                    PASS
  sqlite-create-insert-select         PASS
  sqlite-transaction                  PASS
  libxml-parse-html                   PASS
  libxml-parse-xml                    PASS
  gnutls-available                    PASS
  process-execution                   PASS
  file-notification-api               PASS
  regexp-engine                       PASS

--- Native Compilation ---
  native-comp-available               PASS
  native-comp-lambda                  PASS
  native-comp-defun                   PASS

--- Threading ---
  thread-basic                        PASS
  thread-mutex                        PASS

--- Tree-sitter ---
  treesit-api-available               PASS
  treesit-parser-api                  PASS
  treesit-node-api                    PASS

--- Org Mode ---
  org-version-check                   PASS
  org-html-export                     PASS
  org-latex-export                    PASS
  org-table-align                     PASS
  org-babel-elisp                     PASS
  org-element-parse                   PASS

--- Image Support ---
  image-svg                           PASS
  image-webp                          PASS
  image-png                           PASS
  image-jpeg                          PASS
  image-tiff                          PASS
  image-gif                           PASS
  image-xpm                           PASS

--- Dynamic Modules ---
  module-suffix                       PASS
  module-load-api                     PASS

--- D-Bus ---
  dbus-binding                        PASS

--- Cairo ---
  cairo-available                     PASS

--- Elisp Standard Library ---
  seq-library                         PASS
  map-library                         PASS
  cl-lib-basics                       PASS
  subr-x-extras                       PASS
  transient-available                 PASS
  project-available                   PASS
  eglot-available                     PASS
  use-package-available               PASS

=== Summary ===

Total: 43  Passed: 43  Failed: 0

Result: ALL PASS

5.1. Test Categories

Category Tests Description
Core 10 JSON, SQLite, libxml, GnuTLS, regexp, process
Native Compilation 3 Available, lambda compile, defun compile
Threading 2 Basic threads, mutex synchronization
Tree-sitter 3 API availability, parser, node operations
Org Mode 6 Version, HTML/LaTeX export, tables, babel
Image Support 7 SVG, WebP, PNG, JPEG, TIFF, GIF, XPM
Dynamic Modules 2 Module suffix, load API
D-Bus 1 Binding available
Cairo 1 Rendering available
Elisp Stdlib 8 seq, map, cl-lib, subr-x, transient, eglot
Total 43  

6. Org Mode 9.8.6

The bundled Org version is 9.8.6, the latest stable release, synced from upstream at commit 0bfbe06090c. This is maintained directly in the Emacs source tree at lisp/org/ (not a submodule).

./src/emacs -Q --batch --eval '(progn (require (quote org)) (princ (org-version)))'
9.8.6

6.1. Key Org Features

  • org-cite — citation management and export
  • ox-html, ox-latex, ox-md — export backends
  • org-babel — literate programming with code execution
  • org-element — robust AST-based parsing
  • org-agenda — time management and task tracking
  • org-capture — quick note/task capture

6.2. Org Export Test

(with-temp-buffer
  (insert "* Hello\n\nFrom Org 9.8.6 on FreeBSD 15.0.\n")
  (org-mode)
  (org-html-export-as-html nil nil nil t))

7. Native Compilation

Native compilation (--with-native-compilation) uses GCC 14's libgccjit to compile Emacs Lisp to native machine code at runtime. This provides significant performance improvements for compute-heavy Elisp.

ls ~/.emacs.d/eln-cache/32.0.50-*/ 2>/dev/null | wc -l
37

The cache builds asynchronously on first use. Mode line may show "Building…" messages during initial sessions.

8. Tree-sitter Integration

Tree-sitter provides incremental parsing for syntax highlighting, indentation, and structural navigation. Language grammars must be installed separately:

;; Install a tree-sitter grammar (e.g., for Python)
(setq treesit-language-source-alist
      '((python "https://github.com/tree-sitter/tree-sitter-python")
        (javascript "https://github.com/tree-sitter/tree-sitter-javascript")
        (typescript "https://github.com/tree-sitter/tree-sitter-typescript"
                    "typescript/src")
        (json "https://github.com/tree-sitter/tree-sitter-json")
        (yaml "https://github.com/nickel-lang/tree-sitter-nickel")
        (bash "https://github.com/tree-sitter/tree-sitter-bash")
        (c "https://github.com/tree-sitter/tree-sitter-c")
        (cpp "https://github.com/tree-sitter/tree-sitter-cpp")
        (rust "https://github.com/tree-sitter/tree-sitter-rust")
        (go "https://github.com/tree-sitter/tree-sitter-go")))

;; Then: M-x treesit-install-language-grammar RET python RET

9. Headless Screenshot Capture

Screenshots were captured using Xvfb (virtual framebuffer):

# Start headless X11
Xvfb :99 -screen 0 1280x1024x24 &

# Launch Emacs
DISPLAY=:99 ./src/emacs -Q --eval '...' &
sleep 4

# Capture via xwd + netpbm
DISPLAY=:99 xwd -root -out /tmp/emacs.xwd
xwdtopnm /tmp/emacs.xwd | pnmtopng > screenshot.png

# Clean up
kill $(pgrep -f Xvfb)

Requires: pkg install xorg-vfbserver xwd netpbm

10. Comparison: pkg Emacs 30.2 vs Source Emacs 32.0

Aspect Emacs 30.2 (pkg) Emacs 32.0 (source)
Installation pkg install emacs Build from source
Native compilation Depends on port Yes (gcc14 libgccjit)
Tree-sitter Depends on port Yes
Org version 9.7.x 9.8.6
Cairo Depends on port Yes
Latest features Stable release Development master
sysinfo fix needed No Yes (see above)
Update frequency Port maintainer git pull && gmake

11. Full Diagnostic Commands

echo "=== Full System Info ==="
echo "OS: $(uname -srm)"
echo "Emacs: $(./src/emacs --version 2>&1 | head -1)"
echo "Org: $(./src/emacs -Q --batch --eval '(progn (require (quote org)) (princ (org-version)))' 2>&1)"
echo "GCC: $(gcc14 --version 2>&1 | head -1)"
echo "GTK: $(pkg-config --modversion gtk+-3.0 2>&1)"
echo "Tree-sitter: $(pkg-config --modversion tree-sitter 2>&1)"
echo "Cairo: $(pkg-config --modversion cairo 2>&1)"
echo "GnuTLS: $(pkg-config --modversion gnutls 2>&1)"
echo "SQLite: $(pkg-config --modversion sqlite3 2>&1)"
=== Full System Info ===
OS: FreeBSD 15.0-RELEASE amd64
Emacs: GNU Emacs 32.0.50
Org: 9.8.6
GCC: gcc14 (FreeBSD Ports Collection) 14.2.0
GTK: 3.24.52
Tree-sitter: 0.26.7
Cairo: 1.18.2
GnuTLS: 3.8.13
SQLite: 3.50.4

12. What's New: Emacs 30 to 32

Upgrading from Emacs 30.2 (pkg) to 32.0 (source) brings significant changes across three release cycles.

12.1. Emacs Core

12.1.1. Tree-Sitter (Production-Ready)

  • treesit-enabled-modes — selectively enable tree-sitter per mode
  • treesit-auto-install-grammar — automatic grammar installation on first use
  • Multi-language support: multiple parsers at point with aggregated settings
  • define-treesit-generic-mode macro for easy new mode creation
  • Tree-sitter integration with show-paren-mode, hs-minor-mode, outline-minor-mode
  • treesit-language-remap-alist for grammar aliasing
  • New markdown-ts-mode (Emacs 32)

12.1.2. Native Compilation

  • Now enabled by default in Emacs 30 (previously opt-in)
  • Native JSON support built-in; libjansson no longer required
  • Unexec dumper removed in Emacs 31 (deprecated since 27)

12.1.3. Window & Frame Management (Emacs 31)

  • split-frame, merge-frames, clone-frame, undelete-frame
  • Frame IDs with frame-id for unambiguous identification
  • MRU frame selection after deletion
  • combine-windows / uncombine-window for layout operations
  • split-window-preferred-direction to control split orientation

12.1.4. Minibuffer & Completion (Emacs 31)

  • Eager display with completion-eager-display and completion-eager-update
  • Category inheritance via define-completion-category
  • Flex completion rewritten for better accuracy
  • Completion preview mode with lazy highlighting

12.1.5. Display & Rendering

  • Styled underlines (double-line, dots, dashes) on GUI and TTY (Emacs 30)
  • mode-line-format-right-align for right-aligned mode line content (Emacs 30)
  • TTY child frame support via tty-tip-mode (Emacs 31)
  • Line spacing now supports above-line spacing (Emacs 31)

12.2. Org Mode 9.7 to 9.8.6

12.2.1. Breaking Changes

  • org-toggle-inline-images replaced by org-link-preview
  • Tab width assumed to be 8 (list indentation consistency)
  • :results drawer no longer treats output as verbatim
  • Emacs 26 & 27 support dropped (requires Emacs 28+)

12.2.2. Link Preview System (Unified)

All link types can now define custom preview behavior via org-link-parameters :preview parameter. New org-link-preview command with batch processing (org-link-preview-batch-size, org-link-preview-delay) for async display.

12.2.3. Repeatable Navigation

All heading/block navigation commands (C-c C-n/p/f/b, C-c C-u) now work with repeat-mode, enabling rapid structural navigation.

12.2.4. New Babel Backend: C#

ob-csharp — C# code evaluation via .NET SDK.

12.2.5. Capture & Archiving

  • Headline/OLP targets can now be functions or variables
  • Datetree capture supports flexible tree-type: years, quarters, months, weeks
  • Extended %*N placeholder for accessing all prompt values
  • org-archive-finalize-hook runs in destination with context
  • Parent ID (olid) now saveable in archive context

12.2.6. ID Links with Search Options

New syntax id:abc::*heading for search within ID targets. org-id-link-use-context controls auto-addition of search context. org-id-link-consider-parent-id enables parent ID search.

12.2.7. Citation System

  • BibTeX bibliography style fallback
  • CSL + BibTeX title case conversion
  • org-cite-csl-latex-label-separator and org-cite-csl-latex-label-width-per-char

12.2.8. Export Improvements

  • LaTeX: New xelatex process for Unicode; org-latex-toc-include-unnumbered; org-latex-use-sans; org-latex-mathml-directory
  • HTML: Source blocks wrapped in <pre> + <code>; semantic <time> element with datetime attribute
  • Beamer: Frame subtitles via BEAMER_SUBTITLE; new onlyenv environment
  • Markdown: org-md-link-org-files-as-md for linking .org as .md
  • Texinfo: Links in headings preserved; numeric toc: support

12.2.9. Other Notable Changes

  • LibreOffice Calc table paste as Org tables via yank-media
  • Ditaa: executable mode + SVG output
  • SQLite: :readonly yes header argument in ob-sqlite
  • org-sort-function controls sorting algorithm
  • Numeric priority support (=1=highest, =2=default, =3=lowest)
  • Statistics cookies respect narrowing
  • Flyspell works in LOGBOOK drawers

13. References