Bug 82466

Summary: Use xcrun to find nm and ranlib on OS X builds
Product: WebKit Reporter: David Kilzer (:ddkilzer) <ddkilzer>
Component: Tools / TestsAssignee: David Kilzer (:ddkilzer) <ddkilzer>
Status: RESOLVED FIXED    
Severity: Normal CC: mitz, mrowe
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 80915    
Attachments:
Description Flags
Patch
none
Patch mitz: review+

Description David Kilzer (:ddkilzer) 2012-03-28 07:19:10 PDT
When running build-webkit, we should use xcrun to find the nm(1) and ranlib(1) commands on OS X.
Comment 1 David Kilzer (:ddkilzer) 2012-03-28 07:40:36 PDT
Created attachment 134292 [details]
Patch
Comment 2 mitz 2012-03-28 10:14:32 PDT
Comment on attachment 134292 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=134292&action=review

> Tools/Scripts/webkitperl/features.pm:57
> +sub nmPath()
> +{
> +    if (isAppleMacWebKit()) {
> +        my $nm = `xcrun -find nm`;
> +        chomp $nm;
> +        return $nm if $nm;
> +    }
> +    return "nm";
> +}

Should this function cache the result? Probably doesn’t matter if we run nm only on libraries, but could matter if we run it on every new .o file.
Comment 3 David Kilzer (:ddkilzer) 2012-03-28 10:37:58 PDT
Created attachment 134330 [details]
Patch
Comment 4 David Kilzer (:ddkilzer) 2012-03-28 10:39:22 PDT
(In reply to comment #3)
> Created an attachment (id=134330) [details]
> Patch

ChangeLog:
- Moved nmPath() to webkitdirs.pm so check-for-global-initializers could use it later.
- Cache result of nmPath().
- Moved $ranlib out of the foreach loop in build-webkit.
Comment 5 mitz 2012-03-28 10:51:31 PDT
Comment on attachment 134330 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=134330&action=review

> Tools/Scripts/webkitdirs.pm:1312
> +sub determineNMPath()

I don’t know why the M is uppercase :-)
Comment 6 David Kilzer (:ddkilzer) 2012-03-28 13:03:34 PDT
(In reply to comment #5)
> (From update of attachment 134330 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=134330&action=review
> 
> > Tools/Scripts/webkitdirs.pm:1312
> > +sub determineNMPath()
> 
> I don’t know why the M is uppercase :-)

My Shift key was stuck?!  :)  Fixed.
Comment 7 David Kilzer (:ddkilzer) 2012-03-28 13:14:25 PDT
Committed r112431: <http://trac.webkit.org/changeset/112431>