<h5 dir="auto">System information (version)</h5>

<ul dir="auto">
<li>OpenCV =&gt; <code class="notranslate">3.4</code></li>
<li>Operating System / Platform =&gt; <code class="notranslate">Android x86 and Android x86_64</code></li>
<li>Compiler =&gt; <code class="notranslate">Android NDK GCC</code></li>
</ul>
<h5 dir="auto">Detailed description</h5>
<p dir="auto">Link ipp library error.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Error:error: opencv/sdk/native/3rdparty/libs/x86/libippicv.a(jmp_icvippsSortRadixIndexAscend_32f_as.s.o): relocation R_386_GOTOFF against preemptible symbol icv_ippJumpIndexForMergedLibs cannot be used when making a shared object
Error:error: opencv/sdk/native/3rdparty/libs/x86/libippicv.a(jmp_icvippiNormDiff_L2_32f_C1MR_as.s.o): relocation R_386_GOTOFF against preemptible symbol icv_ippJumpIndexForMergedLibs cannot be used when making a shared object
Error:error: opencv/sdk/native/3rdparty/libs/x86/libippicv.a(jmp_icvippiSqrDistanceNormGetBufferSize_as.s.o): relocation R_386_GOTOFF against preemptible symbol icv_ippJumpIndexForMergedLibs cannot be used when making a shared object
More...."><pre class="notranslate"><code class="notranslate">Error:error: opencv/sdk/native/3rdparty/libs/x86/libippicv.a(jmp_icvippsSortRadixIndexAscend_32f_as.s.o): relocation R_386_GOTOFF against preemptible symbol icv_ippJumpIndexForMergedLibs cannot be used when making a shared object
Error:error: opencv/sdk/native/3rdparty/libs/x86/libippicv.a(jmp_icvippiNormDiff_L2_32f_C1MR_as.s.o): relocation R_386_GOTOFF against preemptible symbol icv_ippJumpIndexForMergedLibs cannot be used when making a shared object
Error:error: opencv/sdk/native/3rdparty/libs/x86/libippicv.a(jmp_icvippiSqrDistanceNormGetBufferSize_as.s.o): relocation R_386_GOTOFF against preemptible symbol icv_ippJumpIndexForMergedLibs cannot be used when making a shared object
More....
</code></pre></div>
<h5 dir="auto">Steps to reproduce</h5>
<p dir="auto">Downlod <a href="https://sourceforge.net/projects/opencvlibrary/files/opencv-android/3.4.0/opencv-3.4.0-android-sdk.zip/download" rel="nofollow"> OpenCV for Android SDK 3.4. 0 </a></p>
<p dir="auto">Extract it to your project, and write cmake:</p>
<div class="highlight highlight-source-cmake notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="cmake_minimum_required(VERSION 3.6)

set ( OpenCV_DIR &quot;../opencv/sdk/native/jni&quot;)
find_package ( OpenCV REQUIRED )

include_directories ( ${OpenCV_INCLUDE_DIRS} )

add_library( image_analyze SHARED

             # Provides a relative path to your source file(s).
             src/main/cpp/image_analyze.cpp
             src/main/cpp/pattern_recognition.cpp
             src/main/cpp/pretreatment.cpp )

target_link_libraries( image_analyze ${OpenCV_LIBS} )"><pre class="notranslate"><span class="pl-c1">cmake_minimum_required</span>(<span class="pl-k">VERSION</span> 3.6)

<span class="pl-c1">set</span> ( OpenCV_DIR <span class="pl-s">"../opencv/sdk/native/jni"</span>)
<span class="pl-c1">find_package</span> ( OpenCV <span class="pl-k">REQUIRED</span> )

<span class="pl-c1">include_directories</span> ( <span class="pl-smi">${OpenCV_INCLUDE_DIRS}</span> )

<span class="pl-c1">add_library</span>( image_analyze <span class="pl-k">SHARED</span>

             <span class="pl-c"><span class="pl-c">#</span> Provides a relative path to your source file(s).</span>
             src/main/cpp/image_analyze.cpp
             src/main/cpp/pattern_recognition.cpp
             src/main/cpp/pretreatment.cpp )

<span class="pl-c1">target_link_libraries</span>( image_analyze <span class="pl-smi">${OpenCV_LIBS}</span> )</pre></div>
<p dir="auto">Then build, when link to the ippicv wiil be failed!</p>
<h5 dir="auto">System information (version)</h5>
<ul dir="auto">
<li>OpenCV =&gt; 3.3.0</li>
<li>Operating System / Platform =&gt; Android x86/x86_64</li>
<li>Compiler =&gt; Android toolchain (OpenCV binaries downloaded from github 3.3.0/3.3.1 release, My binary built from Android Studio, ndk-bundle-16.0.4442984 darwin-x86_64-gcc-i686-linux-android-4.9.x)</li>
</ul>
<h5 dir="auto">Detailed description</h5>
<p dir="auto">Can no longer link application for x86 or x86_64, get <code class="notranslate">relocation R_386_GOTOFF against preemptible symbol</code> in symbols from <code class="notranslate">libippiw.a</code> and <code class="notranslate">libippicw.a</code>. Rebuilding OpenCV for Android without IPP support fixes the problem. IPP are only used on x86/x86_64 so this is not a problem for arm builds, but the x86 builds are useful for debugging on HAX accelerated emulator.</p>
<p dir="auto">Problem appeared after Android ndk upgrade (don't know my old version). The IPP binaries seems to be a binary only release compiled by Intel so I can't test rebuilding those libraries, otherwise searching the net suggests that the binaries should be compiled with <code class="notranslate">-fPIC</code> to fix this issue.</p>