Last Comment Bug 678361 - Missing corner case from bug 655339
: Missing corner case from bug 655339
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Build Config (show other bugs)
: unspecified
: x86_64 Linux
: -- normal (vote)
: mozilla8
Assigned To: Nobody; OK to take it and work on it
:
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-08-11 14:49 PDT by Rafael Ávila de Espíndola (:espindola) (not reading bugmail)
Modified: 2011-08-16 03:59 PDT (History)
2 users (show)
khuey: in‑testsuite-
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
fix 32 bit builds on 64 bit OS X 10.7 (392 bytes, patch)
2011-08-11 14:49 PDT, Rafael Ávila de Espíndola (:espindola) (not reading bugmail)
smichaud: review+
Details | Diff | Splinter Review

Description Rafael Ávila de Espíndola (:espindola) (not reading bugmail) 2011-08-11 14:49:10 PDT
Created attachment 552512 [details] [diff] [review]
fix 32 bit builds on 64 bit OS X 10.7

I tried doing a 32 bit only build on a 64 bit system by setting CC="gcc -arch i386" CXX="g++ -arch i386". That changes the value of $host, so the existing check for x86_64-apple-darwin fails.

The attached patch should fix it.
Comment 1 Steven Michaud [:smichaud] (Retired) 2011-08-11 15:50:44 PDT
Comment on attachment 552512 [details] [diff] [review]
fix 32 bit builds on 64 bit OS X 10.7

Oops, I didn't realize $host would change in that case.

Your patch looks fine to me (and in fact corresponds to an earlier version of my patch).

Note that I'll have to change my workaround again to deal with MacPorts installing a 64-bit-only egrep in /opt/local/bin, then prepending that directory to $PATH.  See bug 655339 for more info.
Comment 2 :Ehsan Akhgari 2011-08-11 16:26:45 PDT
So can this be landed?
Comment 3 Steven Michaud [:smichaud] (Retired) 2011-08-11 17:43:08 PDT
> So can this be landed?

Yes, I think so.
Comment 4 Rafael Ávila de Espíndola (:espindola) (not reading bugmail) 2011-08-12 08:18:05 PDT
Thanks!
If we think it will be a long time for apple to ship a fixed grep, maybe the best check would be to actually trying a test string:

if [ grep "long string" file ]
then
  fixed_grep="grep"
else
  fixed_grep="arch -i386 grep"
fi
Comment 5 Steven Michaud [:smichaud] (Retired) 2011-08-12 08:35:13 PDT
Thanks for the suggestion.

Though it might be better to make the else clause read:

else
  fixed_egrep="arch -arch i386 /usr/bin/egrep"
fi

That way we fall back to a known quantity (the broken egrep that Apple ships, which we know has a 32-bit binary, and whose 32-bit binary we know works).
Comment 6 Steven Michaud [:smichaud] (Retired) 2011-08-12 08:36:44 PDT
We also that, even when/if Apple fixes their egrep, it'll always be a universal binary (with both x86_64 and i386 executables).
Comment 7 Steven Michaud [:smichaud] (Retired) 2011-08-12 08:38:07 PDT
> We also that,

We also know that, ...
Comment 8 Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary) 2011-08-16 03:59:15 PDT
http://hg.mozilla.org/mozilla-central/rev/a7911fd8e779

Note You need to log in before you can comment on or make changes to this bug.