Closed Bug 569597 Opened 15 years ago Closed 12 years ago

Detect when ranlib is unnecessary and skip it

Categories

(Firefox Build System :: General, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla28

People

(Reporter: zwol, Assigned: sunfish)

Details

(Whiteboard: [qa-])

Attachments

(1 file)

On most modern Unix systems, applying 'ranlib' to static libraries is completely unnecessary, and it can be quite slow for the very large libraries we build. We should detect this in configure.in and set $(RANLIB) to 'true' or ':'. 'nm -s' will reveal whether a library has an index, but I don't know how portable that is. We might also want to consider the use of 'thin' archives on systems that use GNU binutils - this is what the manual says about them: GNU ar can optionally create a thin archive, which contains a symbol index and references to the original copies of the member files of the archives. Such an archive is useful for building libraries for use within a local build, where the relocatable objects are expected to remain available, and copying the contents of each object would only waste time and space. Thin archives are also flattened, so that adding one or more archives to a thin archive will add the elements of the nested archive individually. The paths to the elements of the archive are stored relative to the archive itself.
See also related bug 522770
Attached patch no-ranlib.patchSplinter Review
Attached is a patch which removes ranlib completely and adds the "s" flag to ar invocations. Are there any platforms which are intended to be supported which don't support this? The patch passes a try run with -p all: https://tbpl.mozilla.org/?tree=Try&rev=8bcc562fa45f
Attachment #830302 - Flags: review?(mh+mozilla)
Comment on attachment 830302 [details] [diff] [review] no-ranlib.patch Review of attachment 830302 [details] [diff] [review]: ----------------------------------------------------------------- We'll see if someone ever reports a problem.
Attachment #830302 - Flags: review?(mh+mozilla) → review+
I noticed that there are potentially other uses of RANLIB in various auxiliary makefile things, so I just checked in the part of the patch which removes it from the rules.mk files and adds "s" to the flags: https://hg.mozilla.org/integration/mozilla-inbound/rev/059604ce6eb7 Also, I filed bug 937685 to track the suggestion above to use "thin" archives.
Assignee: nobody → sunfish
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
(In reply to Dan Gohman [:sunfish] from comment #4) > I noticed that there are potentially other uses of RANLIB in various > auxiliary makefile things None of them are actually getting it from the main configure.
Whiteboard: [qa-]
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: