title: Build with gcc binary issue: Wrong ELF class: ELFCLASS32 on Solaris
body: <p>I need to build a simple app to run on Solaris 8 64 bit system.
  The Solaris system is on production and do not have developer packages installed.</p>
  
  <p>For this purpose I maintained (after hard work of following manuals and experimenting) to build a gcc cross compiler on Fedora 24 64 bit machine and successfully built a hello world program that runs well on target Solaris machine.</p>
  
  <p>The actually needed app was built also successful after another long time of research after includes and libraries.</p>
  
  <p>Unfortunately, the app does not run on target system because of wrong library linked by ld, it is trying to load both 32 and 64 bit libdga.so.1:</p>
  
  <pre><code>ldd getIdleTime_sparc
          libX11.so.4 =&gt;   /usr/lib/64/libX11.so.4
          libXext.so.0 =&gt;  /usr/lib/64/libXext.so.0
          libdga.so.1 =&gt;   /usr/openwin/lib/libdga.so.1  - wrong ELF class: ELFCLASS32
          libc.so.1 =&gt;     /usr/lib/64/libc.so.1
          libsocket.so.1 =&gt;        /usr/lib/64/libsocket.so.1
          libnsl.so.1 =&gt;   /usr/lib/64/libnsl.so.1
          libdl.so.1 =&gt;    /usr/lib/64/libdl.so.1
          libdga.so.1 =&gt;   /usr/openwin/lib/sparcv9/libdga.so.1
          libmp.so.2 =&gt;    /usr/lib/64/libmp.so.2
          /usr/platform/SUNW,UltraSPARC-IIi-Engine/lib/sparcv9/libc_psr.so.1
  </code></pre>
  
  <p>I did not succeed to find how to exclude this wrong ELF.</p>
  
  <p>Any suggestions and help are appreciated.
  Best regards.</p>