LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   ELFCLASS32 incompatible with ELFCLASS64 (https://www.linuxquestions.org/questions/linux-newbie-8/elfclass32-incompatible-with-elfclass64-4175568027/)

bhand14 01-27-2016 09:07 AM

ELFCLASS32 incompatible with ELFCLASS64
 
Hey guys,

I've just recently been tasked with building i686 rpm's on a x86_64 CentOS 7 machine, and have run into an issue with one of the projects:
/bin/ld: form_x.xi.o: file class ELFCLASS32 incompatible with ELFCLASS64
/bin/ld: final link failed: File in wrong format

Correct me if I am wrong, but it appears that the linker is trying to link 32 bit object files with a 64 bit toolchain? I have the correct gcc libs for i686 installed and have passed the -m32 as a cflag and a ldflag when executing the configuration file like so:

./configure --build=i686-redhat-linux CFLAGS="-m32" LDFLAGS="-m32" CXXFLAGS="-m32" --prefix=/usr/local/aubit4gl --with-pg-all="/usr/local/pgsql/" --disable-prefix-check

My thought is that this is not the correct place to pass the LDFLAG...yes? Am I even on the right train of thought?

suicidaleggroll 01-27-2016 09:53 AM

I've always found cross-compiling an entire build (./configure; make) for a different architecture to be a huge PITA. While theoretically it should work, unless the designers actually designed it to be able to do so, it usually breaks at one point or another during the build process.

It's usually much easier to just set up a 32-bit VM and build it locally there.


All times are GMT -5. The time now is 07:47 PM.