Reviewers: danno,

Message:
Please take a look.

Tested for simulator builds (on x64) and native builds on ARM. Should also work
for cross-compilation.

Compared to what you saw yesterday evening, I had to extend the shell command a bit by appending »|| echo -n ""« so that the overall command line always returns
the "success" error code; otherwise GYP will complain.

Description:
Fix native ARM build


BUG=v8:1744, v8:539


Please review this at https://chromiumcodereview.appspot.com/10008082/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M Makefile
  M build/common.gypi
  M src/arm/macro-assembler-arm.h


Index: Makefile
diff --git a/Makefile b/Makefile
index da1d6883fe4fa8191feee4ec78facef790d4dbec..fb672e5fe783fa7da98e2f9b2d49e9f851068dfe 100644
--- a/Makefile
+++ b/Makefile
@@ -261,7 +261,8 @@ $(ENVFILE): $(ENVFILE).new

 # Stores current GYPFLAGS in a file.
 $(ENVFILE).new:
-       @mkdir -p $(OUTDIR); echo "GYPFLAGS=$(GYPFLAGS)" > $(ENVFILE).new;
+       @mkdir -p $(OUTDIR); echo "GYPFLAGS=$(GYPFLAGS)" > $(ENVFILE).new; \
+           echo "CXX=$(CXX)" >> $(ENVFILE).new

 # Dependencies.
 dependencies:
Index: build/common.gypi
diff --git a/build/common.gypi b/build/common.gypi
index 3016d0c5573e1a4d1c92dadeab8dfda1435d2f7b..656f27c71d3720fe5ff1da392e04e1ac5eba99c7 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -280,9 +280,13 @@
       ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \
          or OS=="netbsd"', {
         'conditions': [
-          [ 'target_arch=="ia32"', {
-            'cflags': [ '-m32' ],
-            'ldflags': [ '-m32' ],
+          [ 'v8_target_arch!="x64"', {
+            # Pass -m32 to the compiler iff it understands the flag.
+            'variables': {
+ 'm32flag': '<!((echo | $(echo ${CXX:-$(which g++)}) -m32 -E - >/dev/null 2>&1) && echo -n "-m32" || echo -n "")',
+            },
+            'cflags': [ '<(m32flag)' ],
+            'ldflags': [ '<(m32flag)' ],
           }],
           [ 'v8_no_strict_aliasing==1', {
             'cflags': [ '-fno-strict-aliasing' ],
Index: src/arm/macro-assembler-arm.h
diff --git a/src/arm/macro-assembler-arm.h b/src/arm/macro-assembler-arm.h
index 47afa93a6e0e637e31255ea4c4fe43ceea5358e5..666a36f6d0edb6c4abf4e25e6e511724106fc862 100644
--- a/src/arm/macro-assembler-arm.h
+++ b/src/arm/macro-assembler-arm.h
@@ -1321,7 +1321,6 @@ class MacroAssembler: public Assembler {
 };


-#ifdef ENABLE_DEBUGGER_SUPPORT
// The code patcher is used to patch (typically) small parts of code e.g. for // debugging and other types of instrumentation. When using the code patcher // the exact number of bytes specified must be emitted. It is not legal to emit
@@ -1351,7 +1350,6 @@ class CodePatcher {
   int size_;  // Number of bytes of the expected patch size.
   MacroAssembler masm_;  // Macro assembler used to generate the code.
 };
-#endif  // ENABLE_DEBUGGER_SUPPORT


// -----------------------------------------------------------------------------


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to