Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overhaul SymbolLoader #280

Merged
merged 1 commit into from
Aug 25, 2015
Merged

Conversation

fealebenpae
Copy link
Contributor

Make SymbolLoader cache by the ModuleMeta pointer, which is unique.
SymbolLoader now supports embedded frameworks.
Stubbed support for dylibs.

Fixes #273

@fealebenpae fealebenpae added this to the 1.3.0 milestone Aug 24, 2015
@fealebenpae fealebenpae self-assigned this Aug 24, 2015
@fealebenpae fealebenpae force-pushed the fealebenpae/symbol-loader-bundle-caching branch from 429527e to 7839e29 Compare August 24, 2015 14:09
#endif
} else {
baseUrl = [[NSBundle mainBundle] privateFrameworksURL];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you share some frameworks that would need this? I'm just wondering how this is helpful, because I don't remember having anything similar before. Or are these the embeded frameworks.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is supposed to handle embedded frameworks that export functions and other symbols. They've worked up to now, yes, but they've relied on the RTLD_GLOBAL fallback.

@fealebenpae fealebenpae force-pushed the fealebenpae/symbol-loader-bundle-caching branch from 7839e29 to 448f00a Compare August 24, 2015 15:04
@@ -6,75 +6,146 @@
// Copyright (c) 2014 г. Telerik. All rights reserved.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could also rename the license header from SymbolLoader.cpp to SymbolLoader.mm if you want :D

@fealebenpae fealebenpae force-pushed the fealebenpae/symbol-loader-bundle-caching branch from 448f00a to 935e638 Compare August 24, 2015 15:21
}
NSURL* bundleUrl = [NSURL URLWithString:frameworkPathStr relativeToURL:baseUrl];
WTF::RetainPtr<CFBundleRef> bundle = adoptCF(CFBundleCreate(kCFAllocatorDefault, (CFURLRef)bundleUrl));
WTF::dataLogF("NativeScript loaded bundle %s", bundleUrl.absoluteString.UTF8String);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could append '\n' at the end to make it more clear.

@jasssonpet
Copy link
Contributor

This branch seems to crash on our tests when the CFBundle is nil sometimes.

@fealebenpae fealebenpae force-pushed the fealebenpae/symbol-loader-bundle-caching branch 2 times, most recently from e9fabc2 to 41f27ab Compare August 24, 2015 15:43
Make SymbolLoader cache by the ModuleMeta pointer, which is unique.
SymbolLoader now supports embedded frameworks.
Stubbed support for dylibs.
@fealebenpae fealebenpae force-pushed the fealebenpae/symbol-loader-bundle-caching branch from 41f27ab to a215614 Compare August 24, 2015 15:45
@fealebenpae
Copy link
Contributor Author

Accelerate and Metal report themselves as non-system frameworks so this failed the isSystem check and resulted in paths to bundles that aren't there. I've added nil guards for CFBundleCreate.

@jasssonpet
Copy link
Contributor

👍

fealebenpae added a commit that referenced this pull request Aug 25, 2015
@fealebenpae fealebenpae merged commit e5e49c2 into master Aug 25, 2015
@fealebenpae fealebenpae deleted the fealebenpae/symbol-loader-bundle-caching branch August 25, 2015 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants