hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1356041 - /hadoop/common/trunk/hadoop-tools/hadoop-pipes/src/CMakeLists.txt
Date Sun, 01 Jul 2012 22:47:50 GMT
Author: eli
Date: Sun Jul  1 22:47:48 2012
New Revision: 1356041

URL: http://svn.apache.org/viewvc?rev=1356041&view=rev
Log:
HADOOP-8538. CMake builds fail on ARM. Contributed by Trevor Robinson

Modified:
    hadoop/common/trunk/hadoop-tools/hadoop-pipes/src/CMakeLists.txt

Modified: hadoop/common/trunk/hadoop-tools/hadoop-pipes/src/CMakeLists.txt
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-tools/hadoop-pipes/src/CMakeLists.txt?rev=1356041&r1=1356040&r2=1356041&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-tools/hadoop-pipes/src/CMakeLists.txt (original)
+++ hadoop/common/trunk/hadoop-tools/hadoop-pipes/src/CMakeLists.txt Sun Jul  1 22:47:48 2012
@@ -27,9 +27,12 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_R
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_REENTRANT -D_FILE_OFFSET_BITS=64")
 
 if (JVM_ARCH_DATA_MODEL EQUAL 32)
-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32")
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32")
-    set(CMAKE_LD_FLAGS "${CMAKE_LD_FLAGS} -m32")
+    # force 32-bit code generation on amd64/x86_64, ppc64, sparc64
+    if (CMAKE_COMPILER_IS_GNUCC AND CMAKE_SYSTEM_PROCESSOR MATCHES ".*64")
+        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32")
+        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32")
+        set(CMAKE_LD_FLAGS "${CMAKE_LD_FLAGS} -m32")
+    endif ()
     if (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "amd64")
         set(CMAKE_SYSTEM_PROCESSOR "i686")
     endif ()



Mime
View raw message