diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-26 18:56:23 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-26 18:56:23 +0000 |
commit | 4dcd5397159a138335329e5fe44255adb8e1ce4a (patch) | |
tree | 176f96982fdd2612dede7d2aa76c88e26959e267 /tools/gn | |
parent | c46460594b7b0d5b6edde48df3bf08c6fc389bba (diff) | |
download | chromium_src-4dcd5397159a138335329e5fe44255adb8e1ce4a.zip chromium_src-4dcd5397159a138335329e5fe44255adb8e1ce4a.tar.gz chromium_src-4dcd5397159a138335329e5fe44255adb8e1ce4a.tar.bz2 |
Add 32-bit GN binary to Linux, and reorder linker flags.
Pull gn 32-bit Linux binary @237111
This moves the linker flags to the end of the link line. ld (as opposed to gold, since this is 32-bit) needs it there instead.
R=phajdan.jr@chromium.org
Review URL: https://codereview.chromium.org/86203004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@237370 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/gn')
-rw-r--r-- | tools/gn/bin/linux/gn32.sha1 | 1 | ||||
-rw-r--r-- | tools/gn/ninja_binary_target_writer.cc | 46 | ||||
-rw-r--r-- | tools/gn/ninja_binary_target_writer.h | 4 |
3 files changed, 28 insertions, 23 deletions
diff --git a/tools/gn/bin/linux/gn32.sha1 b/tools/gn/bin/linux/gn32.sha1 new file mode 100644 index 0000000..274385d --- /dev/null +++ b/tools/gn/bin/linux/gn32.sha1 @@ -0,0 +1 @@ +51a20779d49d935d1c81ca52fa8d99bef029ae24
\ No newline at end of file diff --git a/tools/gn/ninja_binary_target_writer.cc b/tools/gn/ninja_binary_target_writer.cc index c404006..089a80e 100644 --- a/tools/gn/ninja_binary_target_writer.cc +++ b/tools/gn/ninja_binary_target_writer.cc @@ -188,23 +188,9 @@ void NinjaBinaryTargetWriter::WriteLinkerStuff( out_ << std::endl; } - WriteLinkerFlags(); - - // Append manifest flag on Windows to reference our file. - // HACK ERASEME BRETTW FIXME - if (settings_->IsWin()) { - out_ << " /MANIFEST /ManifestFile:"; - path_output_.WriteFile(out_, windows_manifest); - } - out_ << std::endl; - - // Libraries to link. - out_ << "libs ="; - if (settings_->IsMac()) { - // TODO(brettw) fix this. - out_ << " -framework AppKit -framework ApplicationServices -framework Carbon -framework CoreFoundation -framework Foundation -framework IOKit -framework Security"; - } - out_ << std::endl; + const Toolchain::Tool& tool = toolchain_->GetTool(tool_type_); + WriteLinkerFlags(tool, windows_manifest); + WriteLibs(tool); // The external output file is the one that other libs depend on. OutputFile external_output_file = helper_.GetTargetOutputFile(target_); @@ -257,7 +243,9 @@ void NinjaBinaryTargetWriter::WriteLinkerStuff( out_ << std::endl; } -void NinjaBinaryTargetWriter::WriteLinkerFlags() { +void NinjaBinaryTargetWriter::WriteLinkerFlags( + const Toolchain::Tool& tool, + const OutputFile& windows_manifest) { out_ << "ldflags ="; // First the ldflags from the target and its config. @@ -265,8 +253,6 @@ void NinjaBinaryTargetWriter::WriteLinkerFlags() { RecursiveTargetConfigStringsToStream(target_, &ConfigValues::ldflags, flag_options, out_); - const Toolchain::Tool& tool = toolchain_->GetTool(tool_type_); - // Followed by library search paths that have been recursively pushed // through the dependency tree. const OrderedSet<SourceDir> all_lib_dirs = target_->all_lib_dirs(); @@ -282,8 +268,23 @@ void NinjaBinaryTargetWriter::WriteLinkerFlags() { } } - // Followed by libraries that have been recursively pushed through the - // dependency tree. + // Append manifest flag on Windows to reference our file. + // HACK ERASEME BRETTW FIXME + if (settings_->IsWin()) { + out_ << " /MANIFEST /ManifestFile:"; + path_output_.WriteFile(out_, windows_manifest); + } + out_ << std::endl; +} + +void NinjaBinaryTargetWriter::WriteLibs(const Toolchain::Tool& tool) { + out_ << "libs ="; + if (settings_->IsMac()) { + // TODO(brettw) write frameworks correctly for Mac. + out_ << " -framework AppKit -framework ApplicationServices -framework Carbon -framework CoreFoundation -framework Foundation -framework IOKit -framework Security"; + } + + // Libraries that have been recursively pushed through the dependency tree. EscapeOptions lib_escape_opts; lib_escape_opts.mode = ESCAPE_NINJA_SHELL; const OrderedSet<std::string> all_libs = target_->all_libs(); @@ -292,6 +293,7 @@ void NinjaBinaryTargetWriter::WriteLinkerFlags() { EscapeStringToStream(out_, all_libs[i], lib_escape_opts); out_ << ""; } + out_ << std::endl; } void NinjaBinaryTargetWriter::WriteLinkCommand( diff --git a/tools/gn/ninja_binary_target_writer.h b/tools/gn/ninja_binary_target_writer.h index c188335..10fc3ab 100644 --- a/tools/gn/ninja_binary_target_writer.h +++ b/tools/gn/ninja_binary_target_writer.h @@ -26,7 +26,9 @@ class NinjaBinaryTargetWriter : public NinjaTargetWriter { void WriteCompilerVars(); void WriteSources(std::vector<OutputFile>* object_files); void WriteLinkerStuff(const std::vector<OutputFile>& object_files); - void WriteLinkerFlags(); + void WriteLinkerFlags(const Toolchain::Tool& tool, + const OutputFile& windows_manifest); + void WriteLibs(const Toolchain::Tool& tool); // Writes the build line for linking the target. Includes newline. void WriteLinkCommand(const OutputFile& external_output_file, |