cmake/tricore/tasking: add cmake build for tasking toolchain
cmake build for tasking toolchain Signed-off-by: chao an <anchao@lixiang.com>
This commit is contained in:
parent
73b7128fb6
commit
9bbecc27ab
10 changed files with 345 additions and 162 deletions
|
@ -485,7 +485,7 @@ if(MSVC)
|
|||
# data
|
||||
-wd4305 # 'context' : truncation from 'type1' to 'type2'
|
||||
)
|
||||
else()
|
||||
elseif(NOT CONFIG_ARCH_TOOLCHAIN_TASKING)
|
||||
add_compile_options(
|
||||
# system wide warnings
|
||||
-Wall $<$<COMPILE_LANGUAGE:C>:-Wstrict-prototypes> -Wshadow -Wundef
|
||||
|
@ -640,9 +640,13 @@ set(nuttx_libs ${nuttx_kernel_libs} ${nuttx_system_libs} ${nuttx_apps_libs}
|
|||
if(NOT CONFIG_ARCH_SIM)
|
||||
|
||||
# TODO: nostart/nodefault not applicable to nuttx toolchain
|
||||
target_link_libraries(
|
||||
nuttx PRIVATE ${NUTTX_EXTRA_FLAGS} -T${ldscript} -Wl,--start-group
|
||||
${nuttx_libs} -Wl,--end-group)
|
||||
if(CONFIG_ARCH_TOOLCHAIN_TASKING)
|
||||
target_link_libraries(nuttx PRIVATE --lsl-file=${ldscript} ${nuttx_libs})
|
||||
else()
|
||||
target_link_libraries(
|
||||
nuttx PRIVATE ${NUTTX_EXTRA_FLAGS} -T${ldscript} -Wl,--start-group
|
||||
${nuttx_libs} -Wl,--end-group)
|
||||
endif()
|
||||
|
||||
# generate binary outputs in different formats (.bin, .hex, etc)
|
||||
nuttx_generate_outputs(nuttx)
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
#
|
||||
# ##############################################################################
|
||||
|
||||
add_subdirectory(${ARCH_SUBDIR})
|
||||
add_subdirectory(${NUTTX_CHIP_ABS_DIR} EXCLUDE_FROM_ALL exclude_chip)
|
||||
add_subdirectory(common)
|
||||
|
||||
|
|
|
@ -20,130 +20,8 @@
|
|||
|
||||
# Toolchain
|
||||
|
||||
set(CMAKE_SYSTEM_NAME Generic)
|
||||
set(CMAKE_SYSTEM_VERSION 1)
|
||||
|
||||
set(ARCH_SUBDIR)
|
||||
|
||||
if(CONFIG_ARCH_TC3XX) # TC3XX
|
||||
set(ARCH_SUBDIR tc3xx)
|
||||
else()
|
||||
set(ARCH_SUBDIR tc3xx)
|
||||
endif()
|
||||
|
||||
include(${ARCH_SUBDIR})
|
||||
|
||||
set(TOOLCHAIN_PREFIX tricore-elf)
|
||||
set(CMAKE_LIBRARY_ARCHITECTURE ${TOOLCHAIN_PREFIX})
|
||||
set(CMAKE_C_COMPILER_TARGET ${TOOLCHAIN_PREFIX})
|
||||
set(CMAKE_CXX_COMPILER_TARGET ${TOOLCHAIN_PREFIX})
|
||||
|
||||
set(CMAKE_ASM_COMPILER ${TOOLCHAIN_PREFIX}-gcc)
|
||||
set(CMAKE_C_COMPILER ${CMAKE_ASM_COMPILER})
|
||||
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++)
|
||||
set(CMAKE_STRIP ${TOOLCHAIN_PREFIX}-strip --strip-unneeded)
|
||||
set(CMAKE_OBJCOPY ${TOOLCHAIN_PREFIX}-objcopy)
|
||||
set(CMAKE_OBJDUMP ${TOOLCHAIN_PREFIX}-objdump)
|
||||
|
||||
set(CMAKE_LINKER ${TOOLCHAIN_PREFIX}-gcc)
|
||||
set(CMAKE_LD ${TOOLCHAIN_PREFIX}-gcc)
|
||||
set(CMAKE_AR ${TOOLCHAIN_PREFIX}-gcc-ar)
|
||||
set(CMAKE_NM ${TOOLCHAIN_PREFIX}-gcc-nm)
|
||||
set(CMAKE_RANLIB ${TOOLCHAIN_PREFIX}-gcc-ranlib)
|
||||
|
||||
# override the ARCHIVE command
|
||||
|
||||
set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> rcs <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> rcs <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
set(CMAKE_ASM_ARCHIVE_CREATE "<CMAKE_AR> rcs <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
|
||||
# Architecture flags
|
||||
|
||||
add_compile_options(-fno-common)
|
||||
add_compile_options(-Wall -Wshadow -Wundef)
|
||||
add_compile_options(-nostdlib)
|
||||
|
||||
if(CONFIG_DEBUG_CUSTOMOPT)
|
||||
add_compile_options(${CONFIG_DEBUG_OPTLEVEL})
|
||||
elseif(CONFIG_DEBUG_FULLOPT)
|
||||
add_compile_options(-Os)
|
||||
endif()
|
||||
|
||||
if(NOT CONFIG_DEBUG_NOOPT)
|
||||
add_compile_options(-fno-strict-aliasing)
|
||||
endif()
|
||||
|
||||
if(CONFIG_FRAME_POINTER)
|
||||
add_compile_options(-fno-omit-frame-pointer -fno-optimize-sibling-calls)
|
||||
else()
|
||||
add_compile_options(-fomit-frame-pointer)
|
||||
endif()
|
||||
|
||||
if(CONFIG_STACK_CANARIES)
|
||||
add_compile_options(-fstack-protector-all)
|
||||
endif()
|
||||
|
||||
if(CONFIG_ARCH_COVERAGE)
|
||||
add_compile_options(-fprofile-generate -ftest-coverage)
|
||||
endif()
|
||||
|
||||
# Optimization of unused sections
|
||||
|
||||
if(CONFIG_DEBUG_OPT_UNUSED_SECTIONS)
|
||||
add_link_options(-Wl,--gc-sections)
|
||||
add_compile_options(-ffunction-sections -fdata-sections)
|
||||
endif()
|
||||
|
||||
# Debug --whole-archive
|
||||
|
||||
if(CONFIG_DEBUG_LINK_WHOLE_ARCHIVE)
|
||||
add_link_options(-Wl,--whole-archive)
|
||||
endif()
|
||||
|
||||
if(CONFIG_ENDIAN_BIG)
|
||||
add_compile_options(-mbig-endian)
|
||||
endif()
|
||||
|
||||
# Link Time Optimization
|
||||
|
||||
if(CONFIG_LTO_THIN)
|
||||
add_compile_options(-flto=thin)
|
||||
elseif(CONFIG_LTO_FULL)
|
||||
add_compile_options(-flto)
|
||||
if(CONFIG_ARCH_TOOLCHAIN_GNU)
|
||||
add_compile_options(-fno-builtin)
|
||||
add_compile_options(-fuse-linker-plugin)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Debug link map
|
||||
|
||||
if(CONFIG_DEBUG_LINK_MAP)
|
||||
add_link_options(-Wl,--cref -Wl,-Map=nuttx.map)
|
||||
endif()
|
||||
|
||||
if(CONFIG_DEBUG_SYMBOLS)
|
||||
add_compile_options(-g)
|
||||
endif()
|
||||
|
||||
add_link_options(-Wl,--no-warn-rwx-segments)
|
||||
|
||||
add_compile_options(-Wno-attributes -Wno-unknown-pragmas
|
||||
$<$<COMPILE_LANGUAGE:C>:-Wstrict-prototypes>)
|
||||
|
||||
if(CONFIG_CXX_STANDARD)
|
||||
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-std=${CONFIG_CXX_STANDARD}>)
|
||||
endif()
|
||||
|
||||
if(NOT CONFIG_LIBCXXTOOLCHAIN)
|
||||
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-nostdinc++>)
|
||||
endif()
|
||||
|
||||
if(NOT CONFIG_CXX_EXCEPTION)
|
||||
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-fno-exceptions>
|
||||
$<$<COMPILE_LANGUAGE:CXX>:-fcheck-new>)
|
||||
endif()
|
||||
|
||||
if(NOT CONFIG_CXX_RTTI)
|
||||
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-fno-rtti>)
|
||||
if(CONFIG_TRICORE_TOOLCHAIN_TASKING)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/ToolchainTasking.cmake)
|
||||
elseif(CONFIG_TRICORE_TOOLCHAIN_GNU)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/ToolchainGnuc.cmake)
|
||||
endif()
|
||||
|
|
150
arch/tricore/src/cmake/ToolchainGnuc.cmake
Normal file
150
arch/tricore/src/cmake/ToolchainGnuc.cmake
Normal file
|
@ -0,0 +1,150 @@
|
|||
# ##############################################################################
|
||||
# arch/tricore/src/cmake/Toolchain.cmake
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with this work for
|
||||
# additional information regarding copyright ownership. The ASF licenses this
|
||||
# file to you under the Apache License, Version 2.0 (the "License"); you may not
|
||||
# use this file except in compliance with the License. You may obtain a copy of
|
||||
# the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
#
|
||||
# ##############################################################################
|
||||
|
||||
# Toolchain
|
||||
|
||||
set(CMAKE_SYSTEM_NAME Generic)
|
||||
set(CMAKE_SYSTEM_VERSION 1)
|
||||
|
||||
set(ARCH_SUBDIR)
|
||||
|
||||
if(CONFIG_ARCH_TC3XX) # TC3XX
|
||||
set(ARCH_SUBDIR tc3xx)
|
||||
else()
|
||||
set(ARCH_SUBDIR tc3xx)
|
||||
endif()
|
||||
|
||||
include(${ARCH_SUBDIR})
|
||||
|
||||
set(TOOLCHAIN_PREFIX tricore-elf)
|
||||
set(CMAKE_LIBRARY_ARCHITECTURE ${TOOLCHAIN_PREFIX})
|
||||
set(CMAKE_C_COMPILER_TARGET ${TOOLCHAIN_PREFIX})
|
||||
set(CMAKE_CXX_COMPILER_TARGET ${TOOLCHAIN_PREFIX})
|
||||
|
||||
set(CMAKE_ASM_COMPILER ${TOOLCHAIN_PREFIX}-gcc)
|
||||
set(CMAKE_C_COMPILER ${CMAKE_ASM_COMPILER})
|
||||
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++)
|
||||
set(CMAKE_STRIP ${TOOLCHAIN_PREFIX}-strip --strip-unneeded)
|
||||
set(CMAKE_OBJCOPY ${TOOLCHAIN_PREFIX}-objcopy)
|
||||
set(CMAKE_OBJDUMP ${TOOLCHAIN_PREFIX}-objdump)
|
||||
set(CMAKE_ASM_GENERATION_TOOL hldumparm)
|
||||
|
||||
set(CMAKE_LINKER ${TOOLCHAIN_PREFIX}-gcc)
|
||||
set(CMAKE_LD ${TOOLCHAIN_PREFIX}-gcc)
|
||||
set(CMAKE_AR ${TOOLCHAIN_PREFIX}-gcc-ar)
|
||||
set(CMAKE_NM ${TOOLCHAIN_PREFIX}-gcc-nm)
|
||||
set(CMAKE_RANLIB ${TOOLCHAIN_PREFIX}-gcc-ranlib)
|
||||
|
||||
# override the ARCHIVE command
|
||||
|
||||
set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> rcs <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> rcs <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
set(CMAKE_ASM_ARCHIVE_CREATE "<CMAKE_AR> rcs <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
|
||||
# Architecture flags
|
||||
|
||||
add_compile_options(-fno-common)
|
||||
add_compile_options(-Wall -Wshadow -Wundef)
|
||||
add_compile_options(-nostdlib)
|
||||
|
||||
if(CONFIG_DEBUG_CUSTOMOPT)
|
||||
add_compile_options(${CONFIG_DEBUG_OPTLEVEL})
|
||||
elseif(CONFIG_DEBUG_FULLOPT)
|
||||
add_compile_options(-Os)
|
||||
endif()
|
||||
|
||||
if(NOT CONFIG_DEBUG_NOOPT)
|
||||
add_compile_options(-fno-strict-aliasing)
|
||||
endif()
|
||||
|
||||
if(CONFIG_FRAME_POINTER)
|
||||
add_compile_options(-fno-omit-frame-pointer -fno-optimize-sibling-calls)
|
||||
else()
|
||||
add_compile_options(-fomit-frame-pointer)
|
||||
endif()
|
||||
|
||||
if(CONFIG_STACK_CANARIES)
|
||||
add_compile_options(-fstack-protector-all)
|
||||
endif()
|
||||
|
||||
if(CONFIG_ARCH_COVERAGE)
|
||||
add_compile_options(-fprofile-generate -ftest-coverage)
|
||||
endif()
|
||||
|
||||
# Optimization of unused sections
|
||||
|
||||
if(CONFIG_DEBUG_OPT_UNUSED_SECTIONS)
|
||||
add_link_options(-Wl,--gc-sections)
|
||||
add_compile_options(-ffunction-sections -fdata-sections)
|
||||
endif()
|
||||
|
||||
# Debug --whole-archive
|
||||
|
||||
if(CONFIG_DEBUG_LINK_WHOLE_ARCHIVE)
|
||||
add_link_options(-Wl,--whole-archive)
|
||||
endif()
|
||||
|
||||
if(CONFIG_ENDIAN_BIG)
|
||||
add_compile_options(-mbig-endian)
|
||||
endif()
|
||||
|
||||
# Link Time Optimization
|
||||
|
||||
if(CONFIG_LTO_THIN)
|
||||
add_compile_options(-flto=thin)
|
||||
elseif(CONFIG_LTO_FULL)
|
||||
add_compile_options(-flto)
|
||||
if(CONFIG_ARCH_TOOLCHAIN_GNU)
|
||||
add_compile_options(-fno-builtin)
|
||||
add_compile_options(-fuse-linker-plugin)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Debug link map
|
||||
|
||||
if(CONFIG_DEBUG_LINK_MAP)
|
||||
add_link_options(-Wl,--cref -Wl,-Map=nuttx.map)
|
||||
endif()
|
||||
|
||||
if(CONFIG_DEBUG_SYMBOLS)
|
||||
add_compile_options(-g)
|
||||
endif()
|
||||
|
||||
add_link_options(-Wl,--no-warn-rwx-segments)
|
||||
|
||||
add_compile_options(-Wno-attributes -Wno-unknown-pragmas
|
||||
$<$<COMPILE_LANGUAGE:C>:-Wstrict-prototypes>)
|
||||
|
||||
if(CONFIG_CXX_STANDARD)
|
||||
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-std=${CONFIG_CXX_STANDARD}>)
|
||||
endif()
|
||||
|
||||
if(NOT CONFIG_LIBCXXTOOLCHAIN)
|
||||
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-nostdinc++>)
|
||||
endif()
|
||||
|
||||
if(NOT CONFIG_CXX_EXCEPTION)
|
||||
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-fno-exceptions>
|
||||
$<$<COMPILE_LANGUAGE:CXX>:-fcheck-new>)
|
||||
endif()
|
||||
|
||||
if(NOT CONFIG_CXX_RTTI)
|
||||
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-fno-rtti>)
|
||||
endif()
|
138
arch/tricore/src/cmake/ToolchainTasking.cmake
Normal file
138
arch/tricore/src/cmake/ToolchainTasking.cmake
Normal file
|
@ -0,0 +1,138 @@
|
|||
# ##############################################################################
|
||||
# arch/tricore/src/cmake/Toolchain.cmake
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with this work for
|
||||
# additional information regarding copyright ownership. The ASF licenses this
|
||||
# file to you under the Apache License, Version 2.0 (the "License"); you may not
|
||||
# use this file except in compliance with the License. You may obtain a copy of
|
||||
# the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
#
|
||||
# ##############################################################################
|
||||
|
||||
# Toolchain
|
||||
|
||||
set(CMAKE_SYSTEM_NAME Generic)
|
||||
set(CMAKE_SYSTEM_VERSION 1)
|
||||
|
||||
set(ARCH_SUBDIR)
|
||||
|
||||
if(CONFIG_ARCH_TC3XX) # TC3XX
|
||||
set(ARCH_SUBDIR tc3xx)
|
||||
else()
|
||||
set(ARCH_SUBDIR tc3xx)
|
||||
endif()
|
||||
|
||||
include(${ARCH_SUBDIR})
|
||||
|
||||
set(CMAKE_ASM_COMPILER cctc)
|
||||
set(CMAKE_C_COMPILER ${CMAKE_ASM_COMPILER})
|
||||
set(CMAKE_CXX_COMPILER cctc)
|
||||
set(CMAKE_STRIP strip --strip-unneeded)
|
||||
set(CMAKE_OBJCOPY echo)
|
||||
set(CMAKE_OBJDUMP elfdump)
|
||||
|
||||
set(CMAKE_LINKER cctc)
|
||||
set(CMAKE_LD cctc)
|
||||
set(CMAKE_AR artc -r)
|
||||
set(CMAKE_NM nm)
|
||||
set(CMAKE_RANLIB ranlib)
|
||||
|
||||
# override the ARCHIVE command
|
||||
|
||||
set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> rcs <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> rcs <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
set(CMAKE_ASM_ARCHIVE_CREATE "<CMAKE_AR> rcs <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
|
||||
# Architecture flags
|
||||
|
||||
add_compile_options(--lsl-core=vtc)
|
||||
add_compile_options(--iso=99)
|
||||
add_compile_options(--language=+gcc,+volatile,-strings,-kanji)
|
||||
|
||||
if(CONFIG_DEBUG_CUSTOMOPT)
|
||||
add_compile_options(${CONFIG_DEBUG_OPTLEVEL})
|
||||
elseif(CONFIG_DEBUG_FULLOPT)
|
||||
add_compile_options(-Os)
|
||||
endif()
|
||||
|
||||
# pragma align <4> (default: 0)
|
||||
|
||||
add_compile_options(--align=4)
|
||||
|
||||
# Always use 32-bit integers for enumeration
|
||||
|
||||
add_compile_options(--integer-enumeration)
|
||||
|
||||
# tradeoff between speed (-t0) and size (-t4) (default: 4)
|
||||
|
||||
add_compile_options(--tradeoff=2)
|
||||
|
||||
# enable symbolic debug information
|
||||
|
||||
if(CONFIG_DEBUG_SYMBOLS)
|
||||
add_compile_options(--debug-info=default)
|
||||
add_compile_options(--keep-temporary-files)
|
||||
add_link_options(-g)
|
||||
endif()
|
||||
|
||||
# merge source code with assembly output
|
||||
|
||||
add_compile_options(--source)
|
||||
|
||||
# generate alignment depending on assume_if hints
|
||||
|
||||
add_compile_options(--branch-target-align)
|
||||
|
||||
# cmake-format: off
|
||||
# Since nuttx uses too many of GNU extensions in the implementation of
|
||||
# FPU-related library functions, which is not supported in tasking, so currently
|
||||
# we cannot use FPU-related configurations to manage it.
|
||||
#
|
||||
# Just set fp-model to Double Precision:
|
||||
# --fp-model[=<flag>,...] floating-point model (default: cFlnrSTz)
|
||||
# 0 alias for --fp-model=CFLNRStZ (strict)
|
||||
# 1 alias for --fp-model=cFLNRSTZ (precise)
|
||||
# 2 alias for --fp-model=cFlnrSTz (fast-dp)
|
||||
# 3 alias for --fp-model=cflnrSTz (fast-sp)
|
||||
# cmake-format: on
|
||||
|
||||
add_compile_options(--fp-model=2)
|
||||
add_link_options(--fp-model=2)
|
||||
add_link_options(-lfp_fpu)
|
||||
|
||||
add_link_options(--hex-format=s -Wl-OtxYcL -Wl-mcrfiklsmnoduq)
|
||||
add_link_options(-lrt)
|
||||
|
||||
# cmake-format: off
|
||||
# ctc W500: ["stdio/lib_libvsprintf.c" 884/29] expression without effect
|
||||
# ctc W507: ["mm_heap/mm_malloc.c" 238/64] variable "nodesize" is possibly uninitialized
|
||||
# ctc W508: ["misc/lib_impure.c" 1/1] empty source file
|
||||
# ctc W525: ["getopt.c" 678/3] discarded 'const' qualifier at assignment: conversion from char const * to char *
|
||||
# ctc W527: ["stdlib/lib_strtold.c" 565/23] constant of type "double" saturated
|
||||
# ctc W526: ["include/sys/epoll.h" 87/5] enumeration constant shall be representable as 'int'
|
||||
# ctc W529: ["wchar/lib_mbrtowc.c" 88/35] overflow in constant expression of type "unsigned long int"
|
||||
# ctc W544: ["wqueue/kwork_thread.c" 210/32] unreachable code
|
||||
# ctc W549: ["unistd/lib_getopt_common.c" 544/15] condition is always true
|
||||
# ctc W553: ["vfs/fs_fcntl.c" 231/7] no 'break' or comment before case label
|
||||
# ctc W557: ["common/tricore_main.c" 58/11] possible infinite loop
|
||||
# ctc W560: ["tmpfs/fs_tmpfs.c" 232/25] possible truncation at implicit conversion to type "unsigned short int"
|
||||
# ctc W562: ["mm_heap/mm_memalign.c" 70/20] unary minus applied to unsigned value
|
||||
# ctc W558: ["include/nuttx/power/regulator.h" 224/36] struct/union/enum definition in parameter declaration
|
||||
# ctc W587: ["stdlib/lib_strtold.c" 571/23] underflow on constant of type "double"
|
||||
# ctc W588: ["misc/lib_glob.c" 150/13] dead assignment to "i" eliminated
|
||||
# ctc W589: ["inode/fs_inodesearch.c" 72/8] pointer assumed to be nonzero - test removed
|
||||
# cmake-format: on
|
||||
|
||||
set(TASKING_WARNINGS
|
||||
500,507,508,525,526,527,529,544,549,553,560,562,557,558,587,588,589)
|
||||
|
||||
add_compile_options(--pass-c=--no-warnings=${TASKING_WARNINGS})
|
|
@ -17,6 +17,7 @@
|
|||
# the License.
|
||||
#
|
||||
# ##############################################################################
|
||||
|
||||
get_directory_property(TOOLCHAIN_DIR_FLAGS DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
COMPILE_OPTIONS)
|
||||
|
||||
|
@ -36,37 +37,39 @@ endforeach()
|
|||
|
||||
separate_arguments(CMAKE_C_FLAG_ARGS NATIVE_COMMAND ${CMAKE_C_FLAGS})
|
||||
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_C_COMPILER} ${CMAKE_C_FLAG_ARGS} ${NUTTX_EXTRA_FLAGS}
|
||||
--print-libgcc-file-name
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
OUTPUT_VARIABLE extra_library)
|
||||
list(APPEND EXTRA_LIB ${extra_library})
|
||||
if(NOT CONFIG_LIBM)
|
||||
if(CONFIG_TRICORE_TOOLCHAIN_GNU)
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_C_COMPILER} ${CMAKE_C_FLAG_ARGS} ${NUTTX_EXTRA_FLAGS}
|
||||
--print-file-name=libm.a
|
||||
--print-libgcc-file-name
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
OUTPUT_VARIABLE extra_library)
|
||||
list(APPEND EXTRA_LIB ${extra_library})
|
||||
endif()
|
||||
if(CONFIG_LIBSUPCXX)
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_C_COMPILER} ${CMAKE_C_FLAG_ARGS} ${NUTTX_EXTRA_FLAGS}
|
||||
--print-file-name=libsupc++.a
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
OUTPUT_VARIABLE extra_library)
|
||||
list(APPEND EXTRA_LIB ${extra_library})
|
||||
endif()
|
||||
if(CONFIG_ARCH_COVERAGE)
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_C_COMPILER} ${CMAKE_C_FLAG_ARGS} ${NUTTX_EXTRA_FLAGS}
|
||||
--print-file-name=libgcov.a
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
OUTPUT_VARIABLE extra_library)
|
||||
list(APPEND EXTRA_LIB ${extra_library})
|
||||
endif()
|
||||
if(NOT CONFIG_LIBM)
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_C_COMPILER} ${CMAKE_C_FLAG_ARGS} ${NUTTX_EXTRA_FLAGS}
|
||||
--print-file-name=libm.a
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
OUTPUT_VARIABLE extra_library)
|
||||
list(APPEND EXTRA_LIB ${extra_library})
|
||||
endif()
|
||||
if(CONFIG_LIBSUPCXX)
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_C_COMPILER} ${CMAKE_C_FLAG_ARGS} ${NUTTX_EXTRA_FLAGS}
|
||||
--print-file-name=libsupc++.a
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
OUTPUT_VARIABLE extra_library)
|
||||
list(APPEND EXTRA_LIB ${extra_library})
|
||||
endif()
|
||||
if(CONFIG_ARCH_COVERAGE)
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_C_COMPILER} ${CMAKE_C_FLAG_ARGS} ${NUTTX_EXTRA_FLAGS}
|
||||
--print-file-name=libgcov.a
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
OUTPUT_VARIABLE extra_library)
|
||||
list(APPEND EXTRA_LIB ${extra_library})
|
||||
endif()
|
||||
|
||||
nuttx_add_extra_library(${EXTRA_LIB})
|
||||
nuttx_add_extra_library(${EXTRA_LIB})
|
||||
|
||||
set(PREPROCES ${CMAKE_C_COMPILER} ${CMAKE_C_FLAG_ARGS} -E -P -x c)
|
||||
set(PREPROCES ${CMAKE_C_COMPILER} ${CMAKE_C_FLAG_ARGS} -E -P -x c)
|
||||
endif()
|
||||
|
|
|
@ -21,7 +21,12 @@
|
|||
set(PLATFORM_FLAGS)
|
||||
|
||||
if(CONFIG_ARCH_CHIP_TC397)
|
||||
list(APPEND PLATFORM_FLAGS -mcpu=tc39xx -mtc162)
|
||||
if(CONFIG_TRICORE_TOOLCHAIN_TASKING)
|
||||
add_compile_options(--cpu=tc39xb)
|
||||
add_link_options(-Ctc39xb)
|
||||
else()
|
||||
list(APPEND PLATFORM_FLAGS -mcpu=tc39xx -mtc162)
|
||||
endif()
|
||||
list(APPEND PLATFORM_FLAGS
|
||||
-I${NUTTX_CHIP_ABS_DIR}/tc397/Libraries/iLLD/TC39B/Tricore/Cpu/Std)
|
||||
list(APPEND PLATFORM_FLAGS
|
||||
|
|
|
@ -38,4 +38,12 @@ if(CONFIG_ARCH_CHIP_TC397)
|
|||
|
||||
add_subdirectory(tc397)
|
||||
|
||||
if(CONFIG_TRICORE_TOOLCHAIN_TASKING)
|
||||
nuttx_add_kernel_library(c_fpu)
|
||||
target_sources(c_fpu PRIVATE tc3xx_libc.c)
|
||||
target_link_options(
|
||||
nuttx PRIVATE
|
||||
--library-directory=${CMAKE_BINARY_DIR}/arch/tricore/src/exclude_chip)
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
|
|
@ -25,8 +25,6 @@
|
|||
#include <nuttx/config.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "tricore_internal.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
#include "../../../include/nuttx/config.h"
|
||||
#include "include/nuttx/config.h"
|
||||
|
||||
#define LCF_CSA0_SIZE 40k
|
||||
#define LCF_USTACK0_SIZE CONFIG_IDLETHREAD_STACKSIZE
|
||||
|
|
Loading…
Reference in a new issue