Skip to content

Improve support for iOS targets (v2) - #14481

Merged
jpakkane merged 3 commits into
mesonbuild:masterfrom
bonzini:ios
Apr 16, 2025
Merged

jpakkane merged 3 commits into
mesonbuild:masterfrom
bonzini:ios

Conversation

@bonzini

@bonzini bonzini commented Apr 15, 2025

Copy link
Copy Markdown
Contributor

Improved/fixed version of #14444:

  • apply review remarks
  • pass new system argument to ld64.lld linker as well, as well as in detect_rust_compiler()
  • add visionOS as well
  • revert switch from -dynamiclib to -bundle on macOS

@bonzini bonzini added regression OS:macos Issues specific to Apple Operating Systems like MacOS and iOS dynamic linkers Dynamic linkers (ld, link, lld-link, etc) labels Apr 15, 2025
@bonzini bonzini added this to the 1.8 milestone Apr 15, 2025
All of iOS, tvOS, visionOS, watchOS use the XNU kernel.  Report that and also
make them return true for is_darwin() which is really more like "is_xnu()".

Co-authored-by: Russell Keith-Magee <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
@jpakkane

Copy link
Copy Markdown
Member

I ran this on a local M1 Mac mini and got the following:

All failures:
  -> cmake: 13 system includes
  -> common: 184 openmp
  -> common: 273 customtarget exe for test
  -> common: 277 custom target private dir
  -> common: 278 pkgconfig-gen
  -> common: 279 pkgconfig-gen
  -> failing: 34 dependency not-required then required
  -> failing: 101 no fallback
  -> failing: 108 empty fallback
  -> osx: 9 framework recasting
  -> java: 1 basic
  -> java: 2 subdir
  -> java: 3 args
  -> java: 4 inner class
  -> java: 5 includedirs
  -> java: 6 codegen
  -> java: 7 linking
  -> java: 8 codegen custom target
  -> java: 9 jni
  -> java: 10 resources

The Java, OpenMP and pkg-config ones are not relevant. What remains is this:

  -> cmake: 13 system includes
  -> osx: 9 framework recasting

The CMake one is

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.4.sdk/usr/include/c++/v1/__config:48:6: error: "_LIBCPP_ENABLE_ASSERTIONS is deprecated, please use _LIBCPP_HARDENING_MODE instead" [-Werror,-W#warnings]
   48 | #    warning "_LIBCPP_ENABLE_ASSERTIONS is deprecated, please use _LIBCPP_HARDENING_MODE instead"
      |      ^
1 error generated.

9 framework recasting fails with:

test cases/osx/9 framework recasting/meson.build:3:4: ERROR: Dependency lookup for OpenAL with method 'cmake' failed: Dependency OpenAL not found: CMake: failed to guess a CMake target for OpenAL.

bonzini and others added 2 commits April 15, 2025 12:11
Apple linkers need to use different arguments on macOS and iOS-like platforms.
Pass the system to the constructor so that it can be examined.

Co-authored-by: Russell Keith-Magee <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
iOS should not use -undefined,dynamic_lookup; whereas macOS should revert from
-dynamiclib to -bundle, as was the case before commit cfb5a48 ("linkers: darwin:
do not use -bundle for shared_modules", 2025-03-24), because Postgres wants to
use -bundle_loader and that is only possible together with -bundle.

Co-authored-by: Russell Keith-Magee <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
@freakboy3742

Copy link
Copy Markdown
Contributor

@bonzini Thanks for picking this up. If there's anything I can do to assist, let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dynamic linkers Dynamic linkers (ld, link, lld-link, etc) OS:macos Issues specific to Apple Operating Systems like MacOS and iOS regression

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants