Bug 135848 - [iOS] Make JavaScriptCore and bmalloc build with the public SDK
Summary: [iOS] Make JavaScriptCore and bmalloc build with the public SDK
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: iPhone / iPad Unspecified
: P2 Normal
Assignee: Daniel Bates
URL:
Keywords:
Depends on: 135843
Blocks:
  Show dependency treegraph
 
Reported: 2014-08-12 12:43 PDT by Daniel Bates
Modified: 2014-08-13 12:43 PDT (History)
6 users (show)

See Also:


Attachments
Patch (9.70 KB, patch)
2014-08-12 12:48 PDT, Daniel Bates
ggaren: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Bates 2014-08-12 12:43:39 PDT
Towards getting iOS WebKit built using the iOS public SDK, get the WTF, JavaScriptCore, and bmalloc projects building with the iOS public SDK.
Comment 1 Daniel Bates 2014-08-12 12:48:56 PDT
Created attachment 236459 [details]
Patch
Comment 2 WebKit Commit Bot 2014-08-12 12:51:36 PDT
Attachment 236459 [details] did not pass style-queue:


ERROR: Source/bmalloc/bmalloc/PerThread.h:36:  __PTK_FRAMEWORK_JAVASCRIPTCORE_KEY0 is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
Total errors found: 1 in 8 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Joseph Pecoraro 2014-08-12 13:05:18 PDT
Comment on attachment 236459 [details]
Patch

Remote Inspector changes look fine to me.
Comment 4 Geoffrey Garen 2014-08-12 13:57:26 PDT
Comment on attachment 236459 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=236459&action=review

r=me

> Source/bmalloc/bmalloc/PerThread.h:39
> +#elif BPLATFORM(IOS_SIMULATOR)
> +const pthread_key_t __PTK_FRAMEWORK_JAVASCRIPTCORE_KEY0 = 90;
> +INLINE int _pthread_setspecific_direct(pthread_key_t key, const void* value) { return pthread_setspecific(key, value); }
> +INLINE void* _pthread_getspecific_direct(pthread_key_t key) { return pthread_getspecific(key); }
> +extern "C" int pthread_key_init_np(int, void (*destructor)(void*));

Does the __thread code patch not work in the iOS simulator? If it does work, I think it would be slightly better, so we wouldn't have the brittleness of defining this constant for ourselves.
Comment 5 Mark Rowe (bdash) 2014-08-12 18:52:58 PDT
It's not necessary to check defined(__has_include) in Mac-only files.
Comment 6 Daniel Bates 2014-08-13 12:31:49 PDT
(In reply to comment #4)
> (From update of attachment 236459 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=236459&action=review
> 
> r=me
> 
> > Source/bmalloc/bmalloc/PerThread.h:39
> > +#elif BPLATFORM(IOS_SIMULATOR)
> > +const pthread_key_t __PTK_FRAMEWORK_JAVASCRIPTCORE_KEY0 = 90;
> > +INLINE int _pthread_setspecific_direct(pthread_key_t key, const void* value) { return pthread_setspecific(key, value); }
> > +INLINE void* _pthread_getspecific_direct(pthread_key_t key) { return pthread_getspecific(key); }
> > +extern "C" int pthread_key_init_np(int, void (*destructor)(void*));
> 
> Does the __thread code patch not work in the iOS simulator? If it does work, I think it would be slightly better, so we wouldn't have the brittleness of defining this constant for ourselves.

No, __thread isn't available when building for iOS Simulator. Filed bug #135895 to consider adding logic for toolchains that don't support C++ thread local storage. I'll add a FIXME comment that references bug #135895 for now.
Comment 7 Daniel Bates 2014-08-13 12:32:27 PDT
(In reply to comment #5)
> It's not necessary to check defined(__has_include) in Mac-only files.

Will remove the check for "defined(__has_include) " from the Mac-only files in this patch before landing.
Comment 8 Daniel Bates 2014-08-13 12:43:47 PDT
Committed r172532: <http://trac.webkit.org/changeset/172532>