macOS and mystical minOS

After a three-year hiatus, the current version of sView is now available again on macOS. The release of sView 20.08 promised support for macOS 10.10+ , but something went wrong and several users came up with a strange problem - macOS 10.13 and 10.14 systems refused to launch the application with a message about the need to update to macOS 10.15 ...





To say that the error puzzled me is to greatly underestimate the degree of my indignation, because the magic number 10.15 did not appear anywhere in the build scripts or in the sView resources! Moreover, the application has been personally tested on an older version of the system, namely macOS 10.10.





A bit of background. Back in 2011, the first sView build for OS X 10.6 Snow Leopard was released , and for six years this version of the system remained the minimum requirement to run sView. Support for relatively old versions of operating systems provides maximum coverage of potential users, but requires additional efforts.





The practice of developing Windows, Linux, Android and macOS applications shows that assumptions that the compiled application "seems to work" on all versions of systems periodically fail, and compatibility problems surface in unexpected ways. In such cases, the ability to test the performance of an application on different (including the oldest, formally supported) systems becomes vital.





However, the older version of OS X requires the same old device , since it is often not possible to install the system on a device released later than the system itself. Virtualization tools could solve the problem, but in the case of macOS, they are not doing well.





. , OS X SDK XCode. SDK XCode SDK XCode, .





OS X 10.6 Snow Leopard, sView OS X , MacBook. OS X .





, Apple , , . , XCode macOS SDK - , - macOS :





  • MACOSX_DEPLOYMENT_TARGET





    (.., export MACOSX_DEPLOYMENT_TARGET=10.0



    );





  • -mmacosx-version-min





    (.., EXTRA_CXXFLAGS += -mmacosx-version-min=10.0



    ).





CMake CMAKE_OSX_DEPLOYMENT



, qmake - QMAKE_MACOSX_DEPLOYMENT_TARGET



.





XCode 11 OS X 10.6, Hello World 10.7 . , OS X 10.6 Snow Leopard 2009 - , - . ?





OS X 10.10 Yosemite 6 6 "" macOS 11.0 Big Sur. OS X Apple. , OS X 10.10 MacBook - , .





“” mid-2010 MacBook , macOS , macOS 10.13 High Sierra 2017 .

, Apple 7 ! Apple macOS - OS X 10.10 macOS 10.13 .





sView Makefile



10.10



, Info.plist



LSMinimumSystemVersion=10.0



. macOS 10.15, Mac mini ‘2018, OS X 10.10 - !





… , , sView macOS,  . ! 10.15



, LSMinimumSystemVersion



10.10



- macOS ?





- 10.15



. macOS 10.13, . , sView !





, - sView, , otool -l



:





Load command 9
        cmd LC_BUILD_VERSION
    cmdsize 32
   platform macos
        sdk 10.15
      minos 10.15
     ntools 1
       tool ld
    version 450.3
      
      



minos



, , macOS . , - , OS X 10.10 sView , macOS 10.13-10.14 ? OS X 10.10 minos



!





The last question remained - where did the error crept in during the application build process? Examining the sView package revealed that the field was minos



present only in the libraries and the executable file of the project itself, but not in the FFmpeg libraries built in a similar way. That is, the problem was clearly in the Makefile



project. As it turned out, the flag was -mmacosx-version-min



passed to the compiler through a variable EXTRA_CXXFLAGS



, but not passed to the linker. Adding a flag to a variable EXTRA_LDFLAGS



finally solved the problem:





TARGET_OS_VERSION = 10.10
EXTRA_CFLAGS   += -mmacosx-version-min=$(TARGET_OS_VERSION)
EXTRA_CXXFLAGS += -mmacosx-version-min=$(TARGET_OS_VERSION)
EXTRA_LDFLAGS  += -mmacosx-version-min=$(TARGET_OS_VERSION)
      
      



The original publication in English can be found here .












All Articles