Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(571)

Unified Diff: third_party/libc++/libc++.gyp

Issue 264613005: Change the way libc++ is linked when use_custom_libcxx=1. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: s/L/l Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/common.gypi ('k') | third_party/libc++abi/libc++abi.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/libc++/libc++.gyp
diff --git a/third_party/libc++/libc++.gyp b/third_party/libc++/libc++.gyp
index b5f14f8471625d7841caae0fba9c1542e83f7f49..0e6fbe4ca9b364c9cfdb8aeab4eb22a8325f7843 100644
--- a/third_party/libc++/libc++.gyp
+++ b/third_party/libc++/libc++.gyp
@@ -5,14 +5,52 @@
{
'targets': [
{
- 'target_name': 'libc++',
- 'type': 'shared_library',
+ 'target_name': 'libcxx_proxy',
+ 'type': 'none',
+ 'dependencies=': [
+ 'libc++',
+ ],
+ # Do not add dependency on libc++.so to dependents of this target. We
+ # don't want to pass libc++.so on the command line to the linker, as that
+ # would cause it to be linked into C executables which don't need it.
+ # Instead, we supply -stdlib=libc++ and let the clang driver decide.
+ 'dependencies_traverse': 0,
'variables': {
- 'prune_self_dependency': 1,
# Don't add this target to the dependencies of targets with type=none.
'link_dependency': 1,
},
+ 'direct_dependent_settings': {
+ 'target_conditions': [
+ ['_type!="none"', {
+ 'include_dirs': [
+ 'trunk/include',
+ '../libc++abi/trunk/include',
+ ],
+ 'cflags_cc': [
+ '-nostdinc++',
+ ],
+ 'ldflags': [
+ '-stdlib=libc++',
+ # Normally the generator takes care of RPATH. Our case is special
+ # because the generator is unaware of the libc++.so dependency.
+ # Note that setting RPATH here is a potential security issue. See:
+ # https://code.google.com/p/gyp/issues/detail?id=315
+ '-Wl,-R,\$$ORIGIN/lib/',
+ ],
+ 'library_dirs': [
+ '<(PRODUCT_DIR)/lib/',
+ ],
+ }],
+ ],
+ },
+ },
+ {
+ 'target_name': 'libc++',
+ 'type': 'shared_library',
'dependencies=': [
+ # libc++abi is linked statically into libc++.so. This allows us to get
+ # both libc++ and libc++abi by passing '-stdlib=libc++'. If libc++abi
+ # was a separate DSO, we'd have to link against it explicitly.
'../libc++abi/libc++abi.gyp:libc++abi',
],
'sources': [
@@ -62,22 +100,6 @@
'-Wstrict-overflow=4',
'-nostdinc++',
],
- 'direct_dependent_settings': {
- 'target_conditions': [
- ['_type!="none"', {
- 'include_dirs': [
- 'trunk/include',
- ],
- 'cflags_cc': [
- '-nostdinc++',
- ],
- 'ldflags': [
- '-stdlib=libc++',
- '-L<(PRODUCT_DIR)/lib/',
- ],
- }],
- ],
- },
'cflags_cc!': [
'-fno-rtti',
],
@@ -87,7 +109,6 @@
],
'ldflags': [
'-nodefaultlibs',
- '<(PRODUCT_DIR)/lib/libc++abi.so',
],
'ldflags!': [
# This somehow causes a warning from clang about an unused compilation
« no previous file with comments | « build/common.gypi ('k') | third_party/libc++abi/libc++abi.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698