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

Unified Diff: pylib/gyp/generator/make.py

Issue 6912005: make: remove hacks used for shared-object builds (Closed) Base URL: http://gyp.googlecode.com/svn/trunk/
Patch Set: '' Created 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pylib/gyp/generator/make.py
===================================================================
--- pylib/gyp/generator/make.py (revision 917)
+++ pylib/gyp/generator/make.py (working copy)
@@ -208,11 +208,13 @@
cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(filter-out FORCE_DO_CMD, $^) -Wl,--end-group $(LIBS)
# Shared-object link (for generating .so).
-# Set SONAME to the library filename so our binaries don't reference the local,
-# absolute paths used on the link command-line.
-# TODO: perhaps this can share with the LINK command above?
+# - Set SONAME to the library filename so our binaries don't reference
+# the local, absolute paths used on the link command-line.
+# - Use --whole-archive so that the .a files we combine end up in the public
+# API of the shared object. (Note that --whole-archive is incompatible with
+# the --start-group used in normal linking.)
quiet_cmd_solink = SOLINK($(TOOLSET)) $@
-cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ -Wl,--start-group $(filter-out FORCE_DO_CMD, $^) -Wl,--end-group $(LIBS)
+cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ -Wl,--whole-archive $(filter-out FORCE_DO_CMD, $^) -Wl,--no-whole-archive $(LIBS)
Michael Moss 2011/05/02 22:39:28 Is --whole-archive advisable for all types of shar
"""
r"""
# Define an escape_quotes function to escape single quotes.
@@ -495,9 +497,10 @@
# Map from qualified target to path to output.
target_outputs = {}
-# Map from qualified target to a list of all linker dependencies,
-# transitively expanded.
-# Used in building shared-library-based executables.
+# Map from qualified target to a list of linkable outputs. A subset
+# of target_outputs. E.g. when mybinary depends on liba, we want to
+# include liba in the linker line; when otherbinary depends on
+# mybinary, we just want to build mybinary first.
target_link_deps = {}
@@ -601,12 +604,8 @@
target_outputs[qualified_target] = install_path
# Update global list of link dependencies.
- if self.type == 'static_library':
+ if self.type in ('static_library', 'shared_library'):
target_link_deps[qualified_target] = [self.output]
- elif self.type == 'shared_library':
- # Anyone that uses us transitively depend on all of our link
- # dependencies.
- target_link_deps[qualified_target] = [self.output] + link_deps
self.fp.close()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698