[PR #15120] [MERGED] mac: prevent generate on cross-compiles #61734

Closed
opened 2026-04-29 16:45:50 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/15120
Author: @dhiltgen
Created: 3/28/2026
Status: Merged
Merged: 4/13/2026
Merged by: @dhiltgen

Base: mainHead: mac_cross


📝 Commits (1)

  • a5d1d00 mac: prevent generate on cross-compiles

📊 Changes

1 file changed (+24 additions, -14 deletions)

View changed files

📝 x/imagegen/mlx/CMakeLists.txt (+24 -14)

📄 Description

For some versions of Xcode, cmake builds are failing due to header problems in cross-compiling during the generate phase. Since generate is producing arch independent generated output, we can skip this during cross-compiling.

Failure mode without this:

./scripts/build_darwin.sh

....

Generated mlx.h and mlx.c successfully
# runtime/cgo
_cgo_export.c:3:10: fatal error: 'stdlib.h' file not found
x/mlxrunner/mlx/mlx.go:3: running "go": exit status 1
CMake Error at x/imagegen/mlx/CMakeLists.txt:118 (execute_process):
  execute_process failed command indexes:

    1: "Child return code: 1"



-- Configuring incomplete, errors occurred!

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/15120 **Author:** [@dhiltgen](https://github.com/dhiltgen) **Created:** 3/28/2026 **Status:** ✅ Merged **Merged:** 4/13/2026 **Merged by:** [@dhiltgen](https://github.com/dhiltgen) **Base:** `main` ← **Head:** `mac_cross` --- ### 📝 Commits (1) - [`a5d1d00`](https://github.com/ollama/ollama/commit/a5d1d00b452db9761affb056efc60bcfad0d9f60) mac: prevent generate on cross-compiles ### 📊 Changes **1 file changed** (+24 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `x/imagegen/mlx/CMakeLists.txt` (+24 -14) </details> ### 📄 Description For some versions of Xcode, cmake builds are failing due to header problems in cross-compiling during the generate phase. Since generate is producing arch independent generated output, we can skip this during cross-compiling. Failure mode without this: ``` ./scripts/build_darwin.sh .... Generated mlx.h and mlx.c successfully # runtime/cgo _cgo_export.c:3:10: fatal error: 'stdlib.h' file not found x/mlxrunner/mlx/mlx.go:3: running "go": exit status 1 CMake Error at x/imagegen/mlx/CMakeLists.txt:118 (execute_process): execute_process failed command indexes: 1: "Child return code: 1" -- Configuring incomplete, errors occurred! ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-29 16:45:50 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#61734