cmake: use sdk-ng built toolchain for x86_64

This adds the necessary bits to utilize the x86_64 toolchain
built by sdk-ng for x86_64 when toolchain variant is either
zephyr or xtools. This allows decoupling the builds from
the host toolchain.

Newlib is also available with this toolchain so remove
the Kconfig restriction on CONFIG_NEWLIB_LIBC.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
Daniel Leung 2019-05-07 08:37:46 -07:00 committed by Anas Nashif
commit 1c5fa6a128
7 changed files with 16 additions and 3 deletions

View file

@ -11,4 +11,7 @@ add_subdirectory(core)
zephyr_compile_options(${X86_64_BASE_CFLAGS} -mx32)
zephyr_link_libraries(-mx32)
zephyr_link_libraries(
-mx32
${LINKERFLAGPREFIX},-melf32_x86_64
)

View file

@ -48,6 +48,7 @@ add_custom_command(
-T ${CMAKE_CURRENT_SOURCE_DIR}/xuk-stub32.ld
${CMAKE_CURRENT_BINARY_DIR}/xuk-stub32.o
-o ${CMAKE_CURRENT_BINARY_DIR}/xuk-stub32.elf
${LINKERFLAGPREFIX},-melf_i386
COMMAND ${CMAKE_OBJCOPY} -O binary
${CMAKE_CURRENT_BINARY_DIR}/xuk-stub32.elf
${incdir}/xuk-stub32.bin
@ -70,4 +71,5 @@ add_custom_command(
COMMAND ${CMAKE_C_COMPILER} -m32 -T ${CMAKE_CURRENT_SOURCE_DIR}/xuk64.ld
-Wl,--build-id=none -nostdlib -nodefaultlibs -nostartfiles
-o ${qkernel_file} ${CMAKE_CURRENT_BINARY_DIR}/zephyr-qemu.o
${LINKERFLAGPREFIX},-melf_i386
)