Commit graph

2 commits

Author SHA1 Message Date
Daniel Leung 7308fdc3c7 cmake: add --divide to GNU assembler options for x86
GNU Assembler, by default on non-Linux targets, treats slashes as
start of comments on i386.
(https://sourceware.org/binutils/docs-2.33.1/as/i386_002dChars.html#i386_002dChars)
In order to use division, `--divide` needs to be passed to
the assembler.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-10-31 09:09:22 +01:00
Daniel Leung 7aca9af7ed cmake: need to specify m32/m64 for x86_64 toolchain
Since x86_64-zephyr-elf is a multi-lib toolchain, m32/m64
need to be specified for the compiler to return the correct
library path when queried (e.g. --print-libgcc-file-name).
This affects the compile check done by CMake. Without these
flags, the compiler returns incorrect toolchain path (e.g.
requiring 64-bit libraries but returning 32-bit library path).
This also affects compiler flag checks for "-lstdc++". Incorrect
library path results in error when checking for "-lstdc++", and
this flag will not be used for the build. This results in
undefined references when compiling C++ code.

This creates target_x86.cmake to add the necessary flags for
CMake to use. The target_x86_64.cmake is also created to
mirror the same change.

Also removing the -m32 flags for host-gcc since we are not
building x86 targets with the host-gcc compiler.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-10-29 06:19:33 +01:00