Hi Jakov,

On Fri, Aug 31, 2018 at 5:59 AM Jakov Simunic
<[email protected]> wrote:
>
> Hello,
> I am working on an embedded project which uses an armv7l architecture, which 
> is a 32bit platform, and I am trying to compile iw-4.9 for it, and I don't 
> know how to compile it for 32bit arches.

Unless you're building your Linux system 100% from scratch, you should
leverage the build system for your platform. It will automatically do
the right thing. You're likely using Buildroot, OpenWRT, OpenEmbedded,
Yocto or some other platform that has compilers, build systems,
packages and so on. First off, most likely iw is already included. And
even if you want to build from your own modified version, theres ways
to build using the systems above to just build it in-tree. And
finally, even if not, you should use the target libraries and the
cross-compilers that are used by your platform.

Step one, if you haven't already, is to get the build system for your
platform and configure and build it. Then try building your modified
version of iw if the stock one isn't helpful for you. I'd integrate it
into the platform build system, but you could build out-of-tree by
setting up the right flags and CROSS_COMPILER to point to the
toolchain used for your platform. If I were doing that, I'd build the
platform in verbose output mode and examine the compiler commandlines
for hints.

> Tried adding -m32 to the CFLAGS, everything passes the build except the iw 
> binary, which says:
>
> iw.o: could not read symbols: File in wrong format
> collect2: ld returned 1 exit status
> make: *** [iw] Error 1
>

Most likely your architecture flags to the linker don't match what you
gave in the compiler stage. You could always also confirm the format
of iw.o with the `file` command.

- Steve

Reply via email to