New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 620255 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner:
Closed: Jul 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: iOS , Mac
Pri: 3
Type: Bug



Sign in to add a comment

GN: large complete_static_lib causes warning with libtool

Project Member Reported by sdefresne@chromium.org, Jun 15 2016

Issue description

As discussed in https://groups.google.com/a/chromium.org/d/msg/gn-dev/bbOBxxheLgc/NTkliYHAFAAJ, linking a complete static library on Mac using libtool may cause issue as only the base name is used when packing the object file in the library (e.g. obj/net/net/url_util.o and obj/url/url/url_util.o have the same short name url_util.o).

Ensuring that there are no object files with the same short name is difficult (as some of the file may come from third_party project). The other usual recommendation is to avoid large static library.

I propose instead that the link tool for "static_library" pattern is passed an extra argument "complete" that is set to 1 or 0 depending on whether "complete_static_lib" is true or not.

Then each tool can decide how to deal with linking complete static libraries. According to the thread mentioned, "ar" on Linux supports identical base names, so it ignore the flag. On Mac, libtool warns, so the input file name are mangled while linking them by using a wrapper around libtool.

So, the following target:

static_library("stlib") {
  sources = [
    "//foo/source.c"
  ]
  complete_static_lib = true
}

would correspond to the following ninja code:

build obj/foo/libstdlib.a: alink obj/foo/source.o
  complete = 1
  arflags =
  output_extension =
  output_dir =

 
Status: WontFix (was: Assigned)
We decided to build framework on iOS instead and use dynamic library. They do not have the same issue, so marking as WontFix.
Cc: -vabr@chromium.org

Sign in to add a comment