0

I am on a 64bit wsl2 machine, and I am trying to compile a 32bit program. To do so, I use these commands CC="afl-clang" CXX="afl-clang++" ./configure --enable-static=yes --enable-shared=no --host=i386 --build=i386 CFLAGS='-m32' CXXFLAGS='-m32' LDFLAGS='-m32' and then I make clean all. Even still, when I run the program it says that the shared object it is trying to load is in the wrong ELFCLASS64. How do I fix this? The program is 32bit, but the shared objects that are also compiled are 64bit.

sepp2k
  • 363,768
  • 54
  • 674
  • 675
  • 1
    Since you're using --disable-shared, you should not be buidling any shared libraries. Perhaps the build has dependencies on some external library that you only have installed as 64-bit and not 32-bit? Which shared object is giving the error? – Chris Dodd Dec 14 '20 at 21:44
  • I put the wrong command. The shared object is a shared object made by the program. It is not an external object. It is made when u compile. – lemonadeice Dec 14 '20 at 21:59
  • https://stackoverflow.com/q/16004206/1216776 – stark Dec 14 '20 at 22:23
  • This results in an error saying c compiler cannot create executables – lemonadeice Dec 15 '20 at 00:20
  • I could not fix the problem, but I just downloaded a new environment and made everything using 32bit. I am guessing the solution is to use this command CC="afl-clang" CXX="afl-clang++" ./configure --enable-static=yes --enable-shared=no --host=i386 --build=i386 CFLAGS='-m32' CXXFLAGS='-m32' LDFLAGS='-m32', but also compile afl-clang with 32bit. afl-clang cannot create executables because it is a 64bit compiler. – lemonadeice Dec 15 '20 at 17:33

0 Answers0