Bug 153355

Summary: Add WebKitSystemInterface for iOS 9.2
Product: WebKit Reporter: Louis Romero <lpromero>
Component: Tools / TestsAssignee: Daniel Bates <dbates>
Status: RESOLVED FIXED    
Severity: Major CC: ap, dbates, ddkilzer, lforschler
Priority: P2    
Version: Other   
Hardware: iPhone / iPad   
OS: Other   
Attachments:
Description Flags
Patch ddkilzer: review+

Description Louis Romero 2016-01-22 08:17:18 PST
Add WebKitSystemInterface for iOS 9.2

When building from a Git checkout with Xcode 7.2, I get this linker error:
Ld /Users/lpromero/Developer/WebKit/WebKitBuild/Release-iphonesimulator/WebKitLegacy.framework/WebKitLegacy normal x86_64
    cd /Users/lpromero/Developer/WebKit/Source/WebKit
    export IPHONEOS_DEPLOYMENT_TARGET=9.2
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch x86_64 -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.2.sdk -L/Users/lpromero/Developer/WebKit/WebKitBuild/Release-iphonesimulator -F/Users/lpromero/Developer/WebKit/WebKitBuild/Release-iphonesimulator -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.2.sdk/System/Library/PrivateFrameworks -filelist /Users/lpromero/Developer/WebKit/WebKitBuild/WebKit.build/Release-iphonesimulator/WebKitLegacy.build/Objects-normal/x86_64/WebKitLegacy.LinkFileList -Xlinker --no-demangle -exported_symbols_list /Users/lpromero/Developer/WebKit/WebKitBuild/Release-iphonesimulator/DerivedSources/WebKitLegacy/WebKitLegacy.generated.exp -install_name /System/Library/PrivateFrameworks/WebKitLegacy.framework/WebKitLegacy -mios-simulator-version-min=9.2 -dead_strip -Xlinker -objc_abi_version -Xlinker 2 -lobjc -lsqlite3 -framework CFNetwork -framework CoreFoundation -framework CoreGraphics -framework CoreText -framework Foundation -framework GraphicsServices -framework ImageIO -framework OpenGLES -framework MobileCoreServices -lMobileGestalt -lWebKitSystemInterfaceIOSSimulator9.2 -stdlib=libc++ -fobjc-link-runtime -framework JavaScriptCore -licucore -framework QuartzCore -framework Security -framework WebCore -single_module -compatibility_version 1 -current_version 602.1.13 -Xlinker -dependency_info -Xlinker /Users/lpromero/Developer/WebKit/WebKitBuild/WebKit.build/Release-iphonesimulator/WebKitLegacy.build/Objects-normal/x86_64/WebKitLegacy_dependency_info.dat -o /Users/lpromero/Developer/WebKit/WebKitBuild/Release-iphonesimulator/WebKitLegacy.framework/WebKitLegacy
ld: library not found for -lWebKitSystemInterfaceIOSSimulator9.2
clang: error: linker command failed with exit code 1 (use -v to see invocation)

** BUILD FAILED **


The following build commands failed:
	Ld /Users/lpromero/Developer/WebKit/WebKitBuild/Release-iphonesimulator/WebKitLegacy.framework/WebKitLegacy normal x86_64
(1 failure)


In the history, I see that the previous versions of the missing library were added: see issue 149550.

Is it expected to use Xcode 7.0? Or manually set IPHONEOS_DEPLOYMENT_TARGET=9.0?
Comment 1 Louis Romero 2016-01-22 08:24:11 PST
Note that this is the output for Release build.

On Debug builds:
duplicate symbol _kMGQAppleInternalInstallCapability in:
    /Users/lpromero/Developer/WebKit/WebKitBuild/WebCore.build/Debug-iphonesimulator/WebCore.build/Objects-normal/x86_64/Device.o
    /Users/lpromero/Developer/WebKit/WebKitBuild/WebCore.build/Debug-iphonesimulator/WebCore.build/Objects-normal/x86_64/MediaQueryEvaluator.o
duplicate symbol _kMGQiPadCapability in:
    /Users/lpromero/Developer/WebKit/WebKitBuild/WebCore.build/Debug-iphonesimulator/WebCore.build/Objects-normal/x86_64/Device.o
    /Users/lpromero/Developer/WebKit/WebKitBuild/WebCore.build/Debug-iphonesimulator/WebCore.build/Objects-normal/x86_64/MediaQueryEvaluator.o
duplicate symbol _kMGQDeviceClassNumber in:
    /Users/lpromero/Developer/WebKit/WebKitBuild/WebCore.build/Debug-iphonesimulator/WebCore.build/Objects-normal/x86_64/Device.o
    /Users/lpromero/Developer/WebKit/WebKitBuild/WebCore.build/Debug-iphonesimulator/WebCore.build/Objects-normal/x86_64/MediaQueryEvaluator.o
duplicate symbol _kMGQMainScreenPitch in:
    /Users/lpromero/Developer/WebKit/WebKitBuild/WebCore.build/Debug-iphonesimulator/WebCore.build/Objects-normal/x86_64/Device.o
    /Users/lpromero/Developer/WebKit/WebKitBuild/WebCore.build/Debug-iphonesimulator/WebCore.build/Objects-normal/x86_64/MediaQueryEvaluator.o
...
duplicate symbol _kMGQDeviceName in:
    /Users/lpromero/Developer/WebKit/WebKitBuild/WebCore.build/Debug-iphonesimulator/WebCore.build/Objects-normal/x86_64/Device.o
    /Users/lpromero/Developer/WebKit/WebKitBuild/WebCore.build/Debug-iphonesimulator/WebCore.build/Objects-normal/x86_64/UserAgentIOS.o
duplicate symbol _kMGQMainScreenScale in:
    /Users/lpromero/Developer/WebKit/WebKitBuild/WebCore.build/Debug-iphonesimulator/WebCore.build/Objects-normal/x86_64/Device.o
    /Users/lpromero/Developer/WebKit/WebKitBuild/WebCore.build/Debug-iphonesimulator/WebCore.build/Objects-normal/x86_64/UserAgentIOS.o
ld: 30 duplicate symbols for architecture x86_64

Which looks like issue 151859.
Comment 2 Alexey Proskuryakov 2016-01-25 16:08:07 PST
Will this work if you manually copy from 9.1 to 9.2? I don't know of any differences expected there.
Comment 3 Louis Romero 2016-01-26 07:20:39 PST
The debug build issue seems related to:

In MobileGestaltSPI.h:

#if USE(APPLE_INTERNAL_SDK)

#include <MobileGestalt.h>

#else

EXTERN_C const CFStringRef kMGQAppleInternalInstallCapability = CFSTR("apple-internal-install");
EXTERN_C const CFStringRef kMGQMainScreenPitch = CFSTR("main-screen-pitch");
EXTERN_C const CFStringRef kMGQMainScreenScale = CFSTR("main-screen-scale");
EXTERN_C const CFStringRef kMGQiPadCapability = CFSTR("ipad");
EXTERN_C const CFStringRef kMGQDeviceName = CFSTR("DeviceName");
EXTERN_C const CFStringRef kMGQDeviceClassNumber = CFSTR("DeviceClassNumber");



As I don't have APPLE_INTERNAL_SDK, I end up with all the constants definition inline.

With the following diff, I build up to the issue in my first comment.
Diff: http://pastebin.com/eXpX1fa3
Comment 4 Louis Romero 2016-01-26 07:25:57 PST
(In reply to comment #2)
> Will this work if you manually copy from 9.1 to 9.2? I don't know of any
> differences expected there.

No, it still doesn't find it:

cp WebKitLibraries/libWebKitSystemInterfaceIOSSimulator9.0.a WebKitLibraries/libWebKitSystemInterfaceIOSSimulator9.2.a 

then:

$ build-webkit --debug --ios-simulator
Ld /Users/lpromero/Developer/WebKit/WebKitBuild/Debug-iphonesimulator/WebKitLegacy.framework/WebKitLegacy normal x86_64
    cd /Users/lpromero/Developer/WebKit/Source/WebKit
    export IPHONEOS_DEPLOYMENT_TARGET=9.2
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch x86_64 -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.2.sdk -L/Users/lpromero/Developer/WebKit/WebKitBuild/Debug-iphonesimulator -F/Users/lpromero/Developer/WebKit/WebKitBuild/Debug-iphonesimulator -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.2.sdk/System/Library/PrivateFrameworks -filelist /Users/lpromero/Developer/WebKit/WebKitBuild/WebKit.build/Debug-iphonesimulator/WebKitLegacy.build/Objects-normal/x86_64/WebKitLegacy.LinkFileList -Xlinker --no-demangle -exported_symbols_list /Users/lpromero/Developer/WebKit/WebKitBuild/Debug-iphonesimulator/DerivedSources/WebKitLegacy/WebKitLegacy.generated.exp -install_name /System/Library/PrivateFrameworks/WebKitLegacy.framework/WebKitLegacy -mios-simulator-version-min=9.2 -dead_strip -Xlinker -objc_abi_version -Xlinker 2 -lobjc -lsqlite3 -framework CFNetwork -framework CoreFoundation -framework CoreGraphics -framework CoreText -framework Foundation -framework GraphicsServices -framework ImageIO -framework OpenGLES -framework MobileCoreServices -lMobileGestalt -lWebKitSystemInterfaceIOSSimulator9.2 -stdlib=libc++ -fobjc-link-runtime -framework JavaScriptCore -licucore -framework QuartzCore -framework Security -framework WebCore -single_module -compatibility_version 1 -current_version 602.1.13 -Xlinker -dependency_info -Xlinker /Users/lpromero/Developer/WebKit/WebKitBuild/WebKit.build/Debug-iphonesimulator/WebKitLegacy.build/Objects-normal/x86_64/WebKitLegacy_dependency_info.dat -o /Users/lpromero/Developer/WebKit/WebKitBuild/Debug-iphonesimulator/WebKitLegacy.framework/WebKitLegacy
ld: library not found for -lWebKitSystemInterfaceIOSSimulator9.2
clang: error: linker command failed with exit code 1 (use -v to see invocation)

** BUILD FAILED **

Is it that WebKitLibraries is not in the include paths, thus not found?
Comment 5 Daniel Bates 2016-01-26 10:26:52 PST
(In reply to comment #4)
> (In reply to comment #2)
> > Will this work if you manually copy from 9.1 to 9.2? I don't know of any
> > differences expected there.
> 
> No, it still doesn't find it:
> 
> cp WebKitLibraries/libWebKitSystemInterfaceIOSSimulator9.0.a
> WebKitLibraries/libWebKitSystemInterfaceIOSSimulator9.2.a 
> 
> then:
> 
> $ build-webkit --debug --ios-simulator
> Ld
> /Users/lpromero/Developer/WebKit/WebKitBuild/Debug-iphonesimulator/
> WebKitLegacy.framework/WebKitLegacy normal x86_64
>     cd /Users/lpromero/Developer/WebKit/Source/WebKit
>     export IPHONEOS_DEPLOYMENT_TARGET=9.2
>     export
> PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.
> platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/
> bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
>    
> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.
> xctoolchain/usr/bin/clang++ -arch x86_64 -dynamiclib -isysroot
> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.
> platform/Developer/SDKs/iPhoneSimulator9.2.sdk
> -L/Users/lpromero/Developer/WebKit/WebKitBuild/Debug-iphonesimulator
> -F/Users/lpromero/Developer/WebKit/WebKitBuild/Debug-iphonesimulator
> -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.
> platform/Developer/SDKs/iPhoneSimulator9.2.sdk/System/Library/
> PrivateFrameworks -filelist
> /Users/lpromero/Developer/WebKit/WebKitBuild/WebKit.build/Debug-
> iphonesimulator/WebKitLegacy.build/Objects-normal/x86_64/WebKitLegacy.
> LinkFileList -Xlinker --no-demangle -exported_symbols_list
> /Users/lpromero/Developer/WebKit/WebKitBuild/Debug-iphonesimulator/
> DerivedSources/WebKitLegacy/WebKitLegacy.generated.exp -install_name
> /System/Library/PrivateFrameworks/WebKitLegacy.framework/WebKitLegacy
> -mios-simulator-version-min=9.2 -dead_strip -Xlinker -objc_abi_version
> -Xlinker 2 -lobjc -lsqlite3 -framework CFNetwork -framework CoreFoundation
> -framework CoreGraphics -framework CoreText -framework Foundation -framework
> GraphicsServices -framework ImageIO -framework OpenGLES -framework
> MobileCoreServices -lMobileGestalt -lWebKitSystemInterfaceIOSSimulator9.2
> -stdlib=libc++ -fobjc-link-runtime -framework JavaScriptCore -licucore
> -framework QuartzCore -framework Security -framework WebCore -single_module
> -compatibility_version 1 -current_version 602.1.13 -Xlinker -dependency_info
> -Xlinker
> /Users/lpromero/Developer/WebKit/WebKitBuild/WebKit.build/Debug-
> iphonesimulator/WebKitLegacy.build/Objects-normal/x86_64/
> WebKitLegacy_dependency_info.dat -o
> /Users/lpromero/Developer/WebKit/WebKitBuild/Debug-iphonesimulator/
> WebKitLegacy.framework/WebKitLegacy
> ld: library not found for -lWebKitSystemInterfaceIOSSimulator9.2
> clang: error: linker command failed with exit code 1 (use -v to see
> invocation)
> 
> ** BUILD FAILED **
> 
> Is it that WebKitLibraries is not in the include paths, thus not found?

You need to copy libWebKitSystemInterfaceIOSSimulator9.2.a to directory /Users/lpromero/Developer/WebKit/WebKitBuild/Debug-iphonesimulator for Xcode to find it. Notice that the script copy-webkitlibraries-to-product-directory, invoked by build-webkit, does this for you.
Comment 6 Daniel Bates 2016-01-26 10:30:33 PST
Created attachment 269888 [details]
Patch
Comment 7 Daniel Bates 2016-01-26 10:32:52 PST
(In reply to comment #5)
> [...]
> Notice that the script copy-webkitlibraries-to-product-directory, invoked by build-webkit, does this for you.

This should read:

Notice that the script copy-webkitlibraries-to-product-directory, invoked by build-webkit, normally does this for you. At the time of writing, copy-webkitlibraries-to-product-directory does not know about libWebKitSystemInterfaceIOSSimulator9.2.a.
Comment 8 David Kilzer (:ddkilzer) 2016-01-26 10:37:47 PST
Comment on attachment 269888 [details]
Patch

rs=me
Comment 9 Daniel Bates 2016-01-26 10:40:36 PST
Committed r195597: <http://trac.webkit.org/changeset/195597>
Comment 10 Louis Romero 2016-01-27 04:28:04 PST
Thanks, I updated and the library is both copied and linked.

I had to add this diff to build though:
http://pastebin.com/ubMRJvWz

Should I file a separate issue?
Comment 11 Daniel Bates 2016-01-28 14:38:09 PST
(In reply to comment #10)
> Thanks, I updated and the library is both copied and linked.
> 
> I had to add this diff to build though:
> http://pastebin.com/ubMRJvWz
> 
> Should I file a separate issue?

Please file a bug for this. I can see how the linker the can complain about duplicate symbols. I'm unclear of the need to change WebView::isInternalInstall(). Regardless, please file a new bug for this so that we can continue this discussion in a bug dedicated to resolving your build issue.
Comment 12 Daniel Bates 2016-02-04 12:01:45 PST
(In reply to comment #11)
> (In reply to comment #10)
> > Thanks, I updated and the library is both copied and linked.
> > 
> > I had to add this diff to build though:
> > http://pastebin.com/ubMRJvWz
> > 
> > Should I file a separate issue?
> 
> Please file a bug for this. I can see how the linker the can complain about
> duplicate symbols. I'm unclear of the need to change
> WebView::isInternalInstall(). Regardless, please file a new bug for this so
> that we can continue this discussion in a bug dedicated to resolving your
> build issue.

Filed bug #153881 to fix the compiler and linker errors when building with iOS SDK 9.2.