Skip to content

macOS support: portable ld64 symbol export + macOS CI - #6

Merged
lemenkov merged 2 commits into
masterfrom
macos-build-support
Jul 24, 2026
Merged

macOS support: portable ld64 symbol export + macOS CI#6
lemenkov merged 2 commits into
masterfrom
macos-build-support

Conversation

@lemenkov

Copy link
Copy Markdown
Owner

Brings up macOS (Apple Silicon / ld64) support for the ODBC driver.

Background

The transport/auth code already uses only POSIX BSD sockets (no MSG_NOSIGNAL, epoll, accept4, or other Linux-only idioms), so the only hard blocker was the linker: the shim restricted its exported symbols with -Wl,--version-script + -Wl,-Bsymbolic, both GNU-ld-specific and rejected by ld64.

Commits

  1. odbc: make the shim's symbol-export linking portable to macOS (ld64)

    • Gate the link args on host_machine.system().
    • GNU ld (Linux/*BSD): unchanged — version script + -Bsymbolic.
    • ld64 (macOS): new seerodbc.exp (_SQL*) via -exported_symbols_list. macOS's default two-level namespace already binds a *W wrapper's call to our own ANSI SQL* definition, so no -Bsymbolic equivalent is needed.
    • Linux output verified unchanged: only SQL* exported under the SEERODBC_1.0 version node; unit + live 11g (ASan) stay 40/0/11; REUSE stays compliant.
  2. ci: add a macOS build + unit-test job

    • macos-latest job: brew install toolchain, wire keg-only OpenSSL 3 + DM headers via PKG_CONFIG_PATH/CPPFLAGS/LDFLAGS, then build + offline unit tests (live tests self-gate without Oracle).

Note

I develop on Fedora with no Mac, so commit 1 is correct-by-construction and Linux-verified, but the macOS CI run on this PR is the first real ld64 build. If the runner surfaces Homebrew path quirks (keg-only OpenSSL, DM header/lib location), I'll fix them forward on this branch.

🤖 Generated with Claude Code

lemenkov and others added 2 commits July 25, 2026 00:34
The driver restricted its exported symbols to the ODBC entry points with
two GNU-ld-specific flags: -Wl,--version-script and -Wl,-Bsymbolic.
ld64 (macOS) understands neither, so the shim could not link there.

Gate the link arguments on host_machine.system():

  GNU ld (Linux, *BSD): unchanged - version script + -Bsymbolic.
  ld64 (macOS): -exported_symbols_list with a new seerodbc.exp listing
    "_SQL*" (Mach-O underscores C symbols). macOS links two-level
    namespace by default, which already binds a *W wrapper's call to an
    ANSI SQL* function to our own definition, so no -Bsymbolic equivalent
    is required.

Linux behaviour is unchanged: the else branch is identical, the built
.so still exports only SQL* under the SEERODBC_1.0 version node, unit +
live integration (11g, ASan) stay at 40/0/11, and REUSE remains
compliant (seerodbc.exp carries an SPDX header ld64 treats as a comment).

This is the build-system half of macOS support; the transport/auth code
already uses only POSIX BSD sockets, no Linux-only idioms.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
The ld64 symbol-export path added in the previous commit (seerodbc.exp /
-exported_symbols_list) can only be exercised on Apple's linker, so add
a macos-latest job that builds the driver and runs the offline unit
tests. No Oracle is involved - the live meson tests self-gate (exit 77)
without SEER_TEST_*, so this leg is a pure build + protocol-core smoke.

Homebrew's OpenSSL 3 is keg-only and the ODBC Driver Manager headers
(sql.h) and libs live under the brew prefix, so PKG_CONFIG_PATH, CPPFLAGS
and LDFLAGS are wired in from `brew --prefix`.

This is the first real validation of macOS support; if the runner
surfaces Homebrew path quirks, they will be fixed forward on this branch.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
@lemenkov
lemenkov merged commit ff01f05 into master Jul 24, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant