@@ -342,8 +342,9 @@ private command revSaveAsMobileStandaloneMain pStack, pAppBundle, pTarget
342342 -- Make the minimum run version of the engine 4.3
343343 -- SN-2015-02-05: [[ Bug 14422 ]] The linker minimum iphoneOS version
344344 -- should be relevant with the desired minimum version.
345- put revGetMinimumOSByArch(tSettings ["ios,minimum version" ]) into tVersion
346- put "-miphoneos-version-min=" & tVersion ["armv7" ] & return after tLinkCommand
345+ -- SN-2015-02-19: [[ Bug 14625 ]] Minimum version is architecture-specific
346+ -- put revGetMinimumOSByArch(tSettings["ios,minimum version"]) into tVersion
347+ -- put "-miphoneos-version-min=" & tVersion["armv7"] & return after tLinkCommand
347348
348349 -- MW-2013-06-26: [[ CloneAndRun ]] Only dead strip if an installed env.
349350 if revEnvironmentIsInstalled() then
@@ -373,15 +374,6 @@ private command revSaveAsMobileStandaloneMain pStack, pAppBundle, pTarget
373374 end if
374375 end repeat
375376
376- -- Make a temporary file for link options and execute it
377- local tLinkOptionsFile
378- put tempName () into tLinkOptionsFile
379-
380- -- MM-2011-09-28: Create the engine for the instruction set specified in the build type setting.
381- --
382- put tempName () into tSDKs [tInstSet ]["engine file" ]
383- put tLinkCommand & "-o" && quote & tSDKs [tInstSet ]["engine file" ] & quote & return into url ("binfile:" & tLinkOptionsFile )
384-
385377 -- Compute the list of archs in the fat binary
386378 local tRawArchs
387379 put shell ("otool -fv" && quote & mapFilePath(tSDKs [tInstSet ]["runtime path" ] & slash & "Standalone" ) & quote ) into tRawArchs
@@ -391,21 +383,50 @@ private command revSaveAsMobileStandaloneMain pStack, pAppBundle, pTarget
391383
392384 local tArchs
393385 if tRawArchs contains "ARM64" then
394- put "-arch arm64 " after tArchs
386+ put "arm64 " after tArchs
395387 end if
396388 if tRawArchs contains "V7" then
397- put "-arch armv7 " after tArchs
389+ put "armv7 " after tArchs
398390 end if
399391
400- -- MM-2013-09-23: [[ iOS7 Support ]] Use g++ instead of llvm-g++-4.2. XCode 5.0 uses llvm 5.0.
401- -- g++ appears to be sym-linked to the appropriate compiler in all SDKS.
392+ -- SN-2015-02-19: [[ Bug 14625 ]] Build each binary separately according
393+ -- to their architecture.
394+ put empty into tArchSpecificEngineList
395+ repeat for each word tArch in tArchs
396+ -- Make a temporary file for link options and execute it
397+ local tLinkOptionsFile
398+ put tempName () into tLinkOptionsFile
399+
400+ put tempName () into tArchSpecificEngineFile
401+ put tLinkCommand & "-o" && quote & tArchSpecificEngineFile & quote & return into url ("binfile:" & tLinkOptionsFile )
402+
403+ local tiPhoneMinVersion
404+ if tArch = "arm64" then
405+ put "7.0.0" into tiPhoneMinVersion
406+ else
407+ put "5.1.1" into tiPhoneMinVersion
408+ end if
409+ -- MM-2013-09-23: [[ iOS7 Support ]] Use g++ instead of llvm-g++-4.2. XCode 5.0 uses llvm 5.0.
410+ -- g++ appears to be sym-linked to the appropriate compiler in all SDKS.
411+ -- SN-2015-02-19: [[ Bug 14625 ]] The minimum iOS version is bound to the architecture
412+ get shell ("g++ -arch " & tArch && "-miphoneos-version-min=" & tiPhoneMinVersion && quote & "@" & tLinkOptionsFile & quote )
413+
414+ put tArchSpecificEngineFile & space after tArchSpecificEngineList
415+ delete file tLinkOptionsFile
416+ if it is not empty or there is no file tArchSpecificEngineFile then
417+ throw "linking for" && tInstSet && " (" & tArch & ") failed with " & it
418+ end if
419+ end repeat
420+
421+ -- MM-2011-09-28: Create the engine for the instruction set specified in the build type setting.
402422 --
403- get shell ("g++ " & tArchs && quote & "@" & tLinkOptionsFile & quote )
423+ put tempName () into tSDKs [tInstSet ]["engine file" ]
424+ -- SN-2015-02-19: [[ Bug 14625 ]] Make the fat binary with the architecture-specific engines
425+ get shell ("lipo -create " & tArchSpecificEngineList & " -output " & quote & tSDKs [tInstSet ]["engine file" ] & quote )
404426
405- delete file tLinkOptionsFile
406427 if it is not empty or there is no file tSDKs [tInstSet ]["engine file" ] then
407428 throw "linking for" && tInstSet && "failed with " & it
408- end if
429+ end if
409430
410431 -- Put the path back the way it was
411432 put tOldPath into $PATH
0 commit comments