[ 
https://issues.apache.org/jira/browse/HADOOP-8659?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13431933#comment-13431933
 ] 

Colin Patrick McCabe commented on HADOOP-8659:
----------------------------------------------

This looks good overall.

{code}
+    else ()
+        # On hard-float systems, soft-float compatibility dev packages are 
required,
+        # e.g. libc6-dev-armel on Ubuntu 12.04.
+        message("Soft-float JVM detected; ensure that soft-float dev packages 
are installed")
+        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfloat-abi=softfp")
+    endif ()
{code}

Would it be possible to use {{CHECK_SYMBOL_EXISTS}} or {{CHECK_LIBRARY_EXISTS}} 
to ensure that the soft-float dev packages are installed?  I'm not too familiar 
with soft-float libraries on ARM, so I'm just guessing here.

{code}
+    execute_process(
+        COMMAND readelf -A ${JAVA_JVM_LIBRARY}
+        OUTPUT_VARIABLE JVM_ELF_ARCH
+        ERROR_QUIET)
+    if (JVM_ELF_ARCH MATCHES "Tag_ABI_VFP_args: VFP registers")
+        message("Hard-float JVM detected")
+        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfloat-abi=hard")
{code}

I wish there were a way to use CHECK_C_SOURCE_COMPILES or something here to 
determine if the JVM library was soft-float or hard-float.  I don't know if 
everyone has {{readelf}} installed by default, and it's preferable to reduce 
the number of dependencies we have.  However, if you can't find an easy way to 
do this, then feel free to ignore this comment.
                
> Native libraries must build with soft-float ABI for Oracle JVM on ARM
> ---------------------------------------------------------------------
>
>                 Key: HADOOP-8659
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8659
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: native
>         Environment: armhf Linux with Oracle JVM
>            Reporter: Trevor Robinson
>            Assignee: Trevor Robinson
>         Attachments: HADOOP-8659.patch, HADOOP-8659.patch, HADOOP-8659.patch
>
>
> There was recently an ABI (application binary interface) change in most Linux 
> distributions for modern ARM processors (ARMv7). Historically, hardware 
> floating-point (FP) support was optional/vendor-specific for ARM processors, 
> so for software compatibility, the default ABI required that processors with 
> FP units copy FP arguments into integer registers (or memory) when calling a 
> shared library function. Now that hardware floating-point has been 
> standardized for some time, Linux distributions such as Ubuntu 12.04 have 
> changed the default ABI to leave FP arguments in FP registers, since this can 
> significantly improve performance for FP libraries.
> Unfortunately, Oracle has not yet released a JVM (as of 7u4) that supports 
> the new ABI, presumably since this involves some non-trivial changes to 
> components like JNI. While the soft-float JVM can run on systems with 
> multi-arch support (currently Debian/Ubuntu) using compatibility libraries, 
> this configuration requires that any third-party JNI libraries also be 
> compiled using the soft-float ABI. Since hard-float systems default to 
> compiling for hard-float, an extra argument to GCC (and installation of a 
> compatibility library) is required to build soft-float Hadoop native 
> libraries that work with the Oracle JVM.
> Note that OpenJDK on hard-float systems does use the new ABI, and expects JNI 
> libraries to use it as well. Therefore the fix for this issue requires 
> detecting the float ABI of the current JVM.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to