forked from Archive/PX4-Autopilot
Fixes for other qurt builds to use QURT_BUNDLE
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
parent
f22c574b87
commit
a8c49809fa
|
@ -34,3 +34,6 @@
|
|||
[submodule "src/lib/ecl"]
|
||||
path = src/lib/ecl
|
||||
url = https://github.com/PX4/ecl.git
|
||||
[submodule "cmake/cmake_hexagon"]
|
||||
path = cmake/cmake_hexagon
|
||||
url = https://github.com/ATLFlight/cmake_hexagon
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Subproject commit e64ded44b248fa8571647e11a4aeed7833ecd8a7
|
|
@ -1,6 +1,8 @@
|
|||
include(qurt/px4_impl_qurt)
|
||||
|
||||
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-hexagon-7.2.10.cmake)
|
||||
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/cmake_hexagon/toolchain/Toolchain-qurt.cmake)
|
||||
include(${CMAKE_SOURCE_DIR}/cmake/cmake_hexagon/qurt_app.cmake)
|
||||
|
||||
|
||||
set(config_module_list
|
||||
drivers/device
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
include(qurt/px4_impl_qurt)
|
||||
|
||||
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-hexagon-7.2.10.cmake)
|
||||
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/cmake_hexagon/toolchain/Toolchain-qurt.cmake)
|
||||
include(${CMAKE_SOURCE_DIR}/cmake/cmake_hexagon/qurt_app.cmake)
|
||||
|
||||
set(config_module_list
|
||||
drivers/device
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
include(qurt/px4_impl_qurt)
|
||||
|
||||
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-hexagon-7.2.10.cmake)
|
||||
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/cmake_hexagon/toolchain/Toolchain-qurt.cmake)
|
||||
include(${CMAKE_SOURCE_DIR}/cmake/cmake_hexagon/qurt_app.cmake)
|
||||
|
||||
|
||||
set(config_module_list
|
||||
drivers/device
|
||||
|
|
|
@ -20,7 +20,8 @@ set(target_libraries
|
|||
)
|
||||
|
||||
|
||||
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-hexagon-7.2.10.cmake)
|
||||
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/cmake_hexagon/toolchain/Toolchain-qurt.cmake)
|
||||
include(${CMAKE_SOURCE_DIR}/cmake/cmake_hexagon/qurt_app.cmake)
|
||||
|
||||
set(config_module_list
|
||||
#
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
include(qurt/px4_impl_qurt)
|
||||
|
||||
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-hexagon-7.2.10.cmake)
|
||||
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/cmake_hexagon/toolchain/Toolchain-qurt.cmake)
|
||||
include(${CMAKE_SOURCE_DIR}/cmake/cmake_hexagon/qurt_app.cmake)
|
||||
|
||||
set(config_module_list
|
||||
drivers/device
|
||||
|
|
|
@ -3,7 +3,8 @@ include(qurt/px4_impl_qurt)
|
|||
# Run a full link with build stubs to make sure qurt target isn't broken
|
||||
set(QURT_ENABLE_STUBS "1")
|
||||
|
||||
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-hexagon-7.2.10.cmake)
|
||||
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/cmake_hexagon/toolchain/Toolchain-qurt.cmake)
|
||||
include(${CMAKE_SOURCE_DIR}/cmake/cmake_hexagon/qurt_app.cmake)
|
||||
|
||||
set(config_module_list
|
||||
drivers/device
|
||||
|
|
|
@ -1,254 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2015 Mark Charlebois. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name PX4 nor the names of its contributors may be
|
||||
# used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
include(CMakeForceCompiler)
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
|
||||
include(common/px4_base)
|
||||
|
||||
if ("$ENV{HEXAGON_TOOLS_ROOT}" STREQUAL "")
|
||||
message(FATAL_ERROR
|
||||
"The HexagonTools version 7.2.10 must be installed and the environment variable HEXAGON_TOOLS_ROOT must be set"
|
||||
"(e.g. export HEXAGON_TOOLS_ROOT=/opt/HEXAGON_Tools/7.2.10/Tools)")
|
||||
else()
|
||||
set(HEXAGON_TOOLS_ROOT $ENV{HEXAGON_TOOLS_ROOT})
|
||||
endif()
|
||||
|
||||
macro (list2string out in)
|
||||
set(list ${ARGV})
|
||||
list(REMOVE_ITEM list ${out})
|
||||
foreach(item ${list})
|
||||
set(${out} "${${out}} ${item}")
|
||||
endforeach()
|
||||
endmacro(list2string)
|
||||
|
||||
set(V_ARCH "v5")
|
||||
set(CROSSDEV "hexagon-")
|
||||
set(HEXAGON_BIN ${HEXAGON_TOOLS_ROOT}/bin)
|
||||
set(HEXAGON_LIB_DIR ${HEXAGON_TOOLS_ROOT}/gnu/hexagon/lib)
|
||||
set(HEXAGON_ISS_DIR ${HEXAGON_TOOLS_ROOT}/lib/iss)
|
||||
set(TOOLSLIB ${HEXAGON_TOOLS_ROOT}/target/hexagon/lib/${V_ARCH}/G0)
|
||||
|
||||
# Use the HexagonTools compiler (7.2.10)
|
||||
set(CMAKE_C_COMPILER ${HEXAGON_BIN}/${CROSSDEV}clang)
|
||||
set(CMAKE_CXX_COMPILER ${HEXAGON_BIN}/${CROSSDEV}clang++)
|
||||
|
||||
set(CMAKE_AR ${HEXAGON_BIN}/${CROSSDEV}ar CACHE FILEPATH "Archiver")
|
||||
set(CMAKE_RANLIB ${HEXAGON_BIN}/${CROSSDEV}ranlib)
|
||||
set(CMAKE_LINKER ${HEXAGON_BIN}/${CROSSDEV}ld.qcld)
|
||||
set(CMAKE_NM ${HEXAGON_BIN}/${CROSSDEV}nm)
|
||||
set(CMAKE_OBJDUMP ${HEXAGON_BIN}/${CROSSDEV}objdump)
|
||||
set(CMAKE_OBJCOPY ${HEXAGON_BIN}/${CROSSDEV}objcopy)
|
||||
|
||||
list2string(HEXAGON_INCLUDE_DIRS
|
||||
-I${HEXAGON_TOOLS_ROOT}/target/hexagon/include
|
||||
)
|
||||
|
||||
#set(DYNAMIC_LIBS -Wl,${TOOLSLIB}/pic/libstdc++.a)
|
||||
|
||||
#set(MAXOPTIMIZATION -O0)
|
||||
|
||||
# Base CPU flags for each of the supported architectures.
|
||||
#
|
||||
set(ARCHCPUFLAGS
|
||||
-m${V_ARCH}
|
||||
-G0
|
||||
)
|
||||
|
||||
add_definitions(
|
||||
-D_PID_T -D_UID_T -D_TIMER_T
|
||||
-Dnoreturn_function=
|
||||
-D_HAS_C9X
|
||||
-D__EXPORT=
|
||||
-Drestrict=
|
||||
-D_DEBUG
|
||||
-Wno-error=shadow
|
||||
)
|
||||
|
||||
# optimisation flags
|
||||
#
|
||||
set(ARCHOPTIMIZATION
|
||||
-O0
|
||||
-g
|
||||
-fno-strict-aliasing
|
||||
-fdata-sections
|
||||
-fno-zero-initialized-in-bss
|
||||
)
|
||||
|
||||
# Language-specific flags
|
||||
#
|
||||
set(ARCHCFLAGS
|
||||
-std=gnu99
|
||||
-D__CUSTOM_FILE_IO__
|
||||
)
|
||||
set(ARCHCXXFLAGS
|
||||
-fno-exceptions
|
||||
-fno-rtti
|
||||
-std=c++11
|
||||
-fno-threadsafe-statics
|
||||
-DCONFIG_WCHAR_BUILTIN
|
||||
-D__CUSTOM_FILE_IO__
|
||||
)
|
||||
|
||||
set(ARCHWARNINGS
|
||||
-Wall
|
||||
-Wextra
|
||||
-Werror
|
||||
-Wno-unused-parameter
|
||||
-Wno-unused-function
|
||||
-Wno-unused-variable
|
||||
-Wno-gnu-array-member-paren-init
|
||||
-Wno-cast-align
|
||||
-Wno-missing-braces
|
||||
-Wno-strict-aliasing
|
||||
# -Werror=float-conversion - works, just needs to be phased in with some effort and needs GCC 4.9+
|
||||
# -Wcast-qual - generates spurious noreturn attribute warnings, try again later
|
||||
# -Wconversion - would be nice, but too many "risky-but-safe" conversions in the code
|
||||
# -Wcast-align - would help catch bad casts in some cases, but generates too many false positives
|
||||
)
|
||||
|
||||
# C-specific warnings
|
||||
#
|
||||
set(ARCHCWARNINGS
|
||||
${ARCHWARNINGS}
|
||||
-Wstrict-prototypes
|
||||
-Wnested-externs
|
||||
)
|
||||
|
||||
# C++-specific warnings
|
||||
#
|
||||
set(ARCHWARNINGSXX
|
||||
${ARCHWARNINGS}
|
||||
-Wno-missing-field-initializers
|
||||
)
|
||||
exec_program(${CMAKE_CXX_COMPILER} ${CMAKE_CURRENT_SOURCE_DIR} ARGS -print-libgcc-file-name OUTPUT_VARIABLE LIBGCC)
|
||||
exec_program(${CMAKE_CXX_COMPILER} ${CMAKE_CURRENT_SOURCE_DIR} ARGS -print-file-name=libm.a OUTPUT_VARIABLE LIBM)
|
||||
set(EXTRA_LIBS ${EXTRA_LIBS} ${LIBM})
|
||||
|
||||
# Flags we pass to the C compiler
|
||||
#
|
||||
list2string(CFLAGS
|
||||
${ARCHCFLAGS}
|
||||
${ARCHCWARNINGS}
|
||||
${ARCHOPTIMIZATION}
|
||||
${ARCHCPUFLAGS}
|
||||
${ARCHINCLUDES}
|
||||
${INSTRUMENTATIONDEFINES}
|
||||
${ARCHDEFINES}
|
||||
${EXTRADEFINES}
|
||||
${EXTRACFLAGS}
|
||||
${HEXAGON_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
# Flags we pass to the C++ compiler
|
||||
#
|
||||
list2string(CXXFLAGS
|
||||
${ARCHCXXFLAGS}
|
||||
${ARCHWARNINGSXX}
|
||||
${ARCHOPTIMIZATION}
|
||||
${ARCHCPUFLAGS}
|
||||
${ARCHXXINCLUDES}
|
||||
${INSTRUMENTATIONDEFINES}
|
||||
${ARCHDEFINES}
|
||||
${EXTRADEFINES}
|
||||
${EXTRACXXFLAGS}
|
||||
${HEXAGON_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
# Flags we pass to the assembler
|
||||
#
|
||||
list2string(AFLAGS
|
||||
${CFLAGS}
|
||||
-D__ASSEMBLY__
|
||||
${EXTRADEFINES}
|
||||
${EXTRAAFLAGS}
|
||||
)
|
||||
|
||||
# Set cmake flags
|
||||
#
|
||||
list2string(CMAKE_C_FLAGS
|
||||
${CMAKE_C_FLAGS}
|
||||
${CFLAGS}
|
||||
)
|
||||
|
||||
set(QURT_CMAKE_C_FLAGS ${CMAKE_C_FLAGS} CACHE STRING "cflags")
|
||||
|
||||
message(STATUS "CMAKE_C_FLAGS: -${CMAKE_C_FLAGS}-")
|
||||
|
||||
list2string(CMAKE_CXX_FLAGS
|
||||
${CMAKE_CXX_FLAGS}
|
||||
${CXXFLAGS}
|
||||
)
|
||||
|
||||
set(QURT_CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} CACHE STRING "cxxflags")
|
||||
|
||||
message(STATUS "CMAKE_CXX_FLAGS: -${CMAKE_CXX_FLAGS}-")
|
||||
|
||||
# Flags we pass to the linker
|
||||
#
|
||||
list2string(CMAKE_EXE_LINKER_FLAGS
|
||||
-g
|
||||
-mv5
|
||||
-mG0lib
|
||||
-G0
|
||||
-fpic
|
||||
-shared
|
||||
-Wl,-Bsymbolic
|
||||
-Wl,--wrap=malloc
|
||||
-Wl,--wrap=calloc
|
||||
-Wl,--wrap=free
|
||||
-Wl,--wrap=realloc
|
||||
-Wl,--wrap=memalign
|
||||
-Wl,--wrap=__stack_chk_fail
|
||||
-lc
|
||||
${EXTRALDFLAGS}
|
||||
)
|
||||
|
||||
# where is the target environment
|
||||
set(CMAKE_FIND_ROOT_PATH get_file_component(${C_COMPILER} PATH))
|
||||
|
||||
set(CMAKE_C_COMPILER_ID, "Clang")
|
||||
set(CMAKE_CXX_COMPILER_ID, "Clang")
|
||||
|
||||
# search for programs in the build host directories
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
# for libraries and headers in the target directories
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||
|
||||
# The Hexagon compiler doesn't support the -rdynamic flag and this is set
|
||||
# in the base cmake scripts. We have to redefine the __linux_compiler_gnu
|
||||
# macro for cmake 2.8 to work
|
||||
set(__LINUX_COMPILER_GNU 1)
|
||||
macro(__linux_compiler_gnu lang)
|
||||
set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "")
|
||||
endmacro()
|
||||
|
|
@ -1,249 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2015 Mark Charlebois. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name PX4 nor the names of its contributors may be
|
||||
# used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
include(CMakeForceCompiler)
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
|
||||
include(common/px4_base)
|
||||
|
||||
if(NOT HEXAGON_TOOLS_ROOT)
|
||||
set(HEXAGON_TOOLS_ROOT /opt/6.4.05)
|
||||
endif()
|
||||
|
||||
if(NOT HEXAGON_SDK_ROOT)
|
||||
set(HEXAGON_SDK_ROOT /opt/Hexagon_SDK)
|
||||
endif()
|
||||
|
||||
macro (list2string out in)
|
||||
set(list ${ARGV})
|
||||
list(REMOVE_ITEM list ${out})
|
||||
foreach(item ${list})
|
||||
set(${out} "${${out}} ${item}")
|
||||
endforeach()
|
||||
endmacro(list2string)
|
||||
|
||||
set(V_ARCH "v5")
|
||||
set(CROSSDEV "hexagon-")
|
||||
set(HEXAGON_BIN ${HEXAGON_TOOLS_ROOT}/gnu/bin)
|
||||
set(HEXAGON_CLANG_BIN ${HEXAGON_TOOLS_ROOT}/qc/bin)
|
||||
set(HEXAGON_LIB_DIR ${HEXAGON_TOOLS_ROOT}/gnu/hexagon/lib)
|
||||
set(HEXAGON_ISS_DIR ${HEXAGON_TOOLS_ROOT}/qc/lib/iss)
|
||||
set(TOOLSLIB ${HEXAGON_TOOLS_ROOT}/dinkumware/lib/$(V_ARCH)/G0)
|
||||
set(QCTOOLSLIB ${HEXAGON_TOOLS_ROOT}/qc/lib/$(V_ARCH)/G0)
|
||||
|
||||
# Use the HexagonTools compiler (6.4.05)
|
||||
set(CMAKE_C_COMPILER ${HEXAGON_CLANG_BIN}/${CROSSDEV}clang)
|
||||
set(CMAKE_CXX_COMPILER ${HEXAGON_CLANG_BIN}/${CROSSDEV}clang++)
|
||||
|
||||
set(CMAKE_AR ${HEXAGON_BIN}/${CROSSDEV}ar CACHE FILEPATH "Archiver")
|
||||
set(CMAKE_RANLIB ${HEXAGON_BIN}/${CROSSDEV}ranlib)
|
||||
set(CMAKE_LINKER ${HEXAGON_BIN}/${CROSSDEV}ld)
|
||||
set(CMAKE_NM ${HEXAGON_BIN}/${CROSSDEV}nm)
|
||||
set(CMAKE_OBJDUMP ${HEXAGON_BIN}/${CROSSDEV}objdump)
|
||||
set(CMAKE_OBJCOPY ${HEXAGON_BIN}/${CROSSDEV}objcopy)
|
||||
|
||||
list2string(HEXAGON_INCLUDE_DIRS
|
||||
-I${HEXAGON_TOOLS_ROOT}/gnu/hexagon/include
|
||||
-I${HEXAGON_SDK_ROOT}/inc
|
||||
-I${HEXAGON_SDK_ROOT}/inc/stddef
|
||||
)
|
||||
|
||||
#set(DYNAMIC_LIBS -Wl,${TOOLSLIB}/pic/libstdc++.a)
|
||||
|
||||
#set(MAXOPTIMIZATION -O0)
|
||||
|
||||
# Base CPU flags for each of the supported architectures.
|
||||
#
|
||||
set(ARCHCPUFLAGS
|
||||
-m${V_ARCH}
|
||||
-G0
|
||||
)
|
||||
|
||||
add_definitions(
|
||||
-D_PID_T -D_UID_T -D_TIMER_T
|
||||
-Dnoreturn_function=
|
||||
-D__EXPORT=
|
||||
-Drestrict=
|
||||
-D_DEBUG
|
||||
-Wno-error=shadow
|
||||
)
|
||||
|
||||
# optimisation flags
|
||||
#
|
||||
set(ARCHOPTIMIZATION
|
||||
-O0
|
||||
-g
|
||||
-fno-strict-aliasing
|
||||
-fdata-sections
|
||||
-fpic
|
||||
-fno-zero-initialized-in-bss
|
||||
)
|
||||
|
||||
# Language-specific flags
|
||||
#
|
||||
set(ARCHCFLAGS
|
||||
-std=gnu99
|
||||
-D__CUSTOM_FILE_IO__
|
||||
)
|
||||
set(ARCHCXXFLAGS
|
||||
-fno-exceptions
|
||||
-fno-rtti
|
||||
-std=c++11
|
||||
-fno-threadsafe-statics
|
||||
-DCONFIG_WCHAR_BUILTIN
|
||||
-D__CUSTOM_FILE_IO__
|
||||
)
|
||||
|
||||
set(ARCHWARNINGS
|
||||
-Wall
|
||||
-Wextra
|
||||
-Werror
|
||||
-Wno-unused-parameter
|
||||
-Wno-unused-function
|
||||
-Wno-unused-variable
|
||||
-Wno-gnu-array-member-paren-init
|
||||
-Wno-cast-align
|
||||
-Wno-missing-braces
|
||||
-Wno-strict-aliasing
|
||||
# -Werror=float-conversion - works, just needs to be phased in with some effort and needs GCC 4.9+
|
||||
# -Wcast-qual - generates spurious noreturn attribute warnings, try again later
|
||||
# -Wconversion - would be nice, but too many "risky-but-safe" conversions in the code
|
||||
# -Wcast-align - would help catch bad casts in some cases, but generates too many false positives
|
||||
)
|
||||
|
||||
# C-specific warnings
|
||||
#
|
||||
set(ARCHCWARNINGS
|
||||
${ARCHWARNINGS}
|
||||
-Wstrict-prototypes
|
||||
-Wnested-externs
|
||||
)
|
||||
|
||||
# C++-specific warnings
|
||||
#
|
||||
set(ARCHWARNINGSXX
|
||||
${ARCHWARNINGS}
|
||||
-Wno-missing-field-initializers
|
||||
)
|
||||
exec_program(${CMAKE_CXX_COMPILER} ${CMAKE_CURRENT_SOURCE_DIR} ARGS -print-libgcc-file-name OUTPUT_VARIABLE LIBGCC)
|
||||
exec_program(${CMAKE_CXX_COMPILER} ${CMAKE_CURRENT_SOURCE_DIR} ARGS -print-file-name=libm.a OUTPUT_VARIABLE LIBM)
|
||||
set(EXTRA_LIBS ${EXTRA_LIBS} ${LIBM})
|
||||
|
||||
# Flags we pass to the C compiler
|
||||
#
|
||||
list2string(CFLAGS
|
||||
${ARCHCFLAGS}
|
||||
${ARCHCWARNINGS}
|
||||
${ARCHOPTIMIZATION}
|
||||
${ARCHCPUFLAGS}
|
||||
${ARCHINCLUDES}
|
||||
${INSTRUMENTATIONDEFINES}
|
||||
${ARCHDEFINES}
|
||||
${EXTRADEFINES}
|
||||
${EXTRACFLAGS}
|
||||
${HEXAGON_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
# Flags we pass to the C++ compiler
|
||||
#
|
||||
list2string(CXXFLAGS
|
||||
${ARCHCXXFLAGS}
|
||||
${ARCHWARNINGSXX}
|
||||
${ARCHOPTIMIZATION}
|
||||
${ARCHCPUFLAGS}
|
||||
${ARCHXXINCLUDES}
|
||||
${INSTRUMENTATIONDEFINES}
|
||||
${ARCHDEFINES}
|
||||
${EXTRADEFINES}
|
||||
${EXTRACXXFLAGS}
|
||||
${HEXAGON_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
# Flags we pass to the assembler
|
||||
#
|
||||
list2string(AFLAGS
|
||||
${CFLAGS}
|
||||
-D__ASSEMBLY__
|
||||
${EXTRADEFINES}
|
||||
${EXTRAAFLAGS}
|
||||
)
|
||||
|
||||
# Set cmake flags
|
||||
#
|
||||
list2string(CMAKE_C_FLAGS
|
||||
${CMAKE_C_FLAGS}
|
||||
${CFLAGS}
|
||||
)
|
||||
|
||||
set(QURT_CMAKE_C_FLAGS ${CMAKE_C_FLAGS} CACHE STRING "cflags")
|
||||
|
||||
message(STATUS "CMAKE_C_FLAGS: -${CMAKE_C_FLAGS}-")
|
||||
|
||||
list2string(CMAKE_CXX_FLAGS
|
||||
${CMAKE_CXX_FLAGS}
|
||||
${CXXFLAGS}
|
||||
)
|
||||
|
||||
set(QURT_CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} CACHE STRING "cxxflags")
|
||||
|
||||
message(STATUS "CMAKE_CXX_FLAGS: -${CMAKE_CXX_FLAGS}-")
|
||||
|
||||
# Flags we pass to the linker
|
||||
#
|
||||
list2string(CMAKE_EXE_LINKER_FLAGS
|
||||
-g
|
||||
-mv5
|
||||
-mG0lib
|
||||
-G0
|
||||
-fpic
|
||||
-shared
|
||||
-Wl,-Bsymbolic
|
||||
-Wl,--wrap=malloc
|
||||
-Wl,--wrap=calloc
|
||||
-Wl,--wrap=free
|
||||
-Wl,--wrap=realloc
|
||||
-Wl,--wrap=memalign
|
||||
-Wl,--wrap=__stack_chk_fail
|
||||
-lc
|
||||
${EXTRALDFLAGS}
|
||||
)
|
||||
|
||||
# where is the target environment
|
||||
set(CMAKE_FIND_ROOT_PATH get_file_component(${C_COMPILER} PATH))
|
||||
|
||||
set(CMAKE_C_COMPILER_ID, "Clang")
|
||||
set(CMAKE_CXX_COMPILER_ID, "Clang")
|
||||
|
||||
# search for programs in the build host directories
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
# for libraries and headers in the target directories
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
|
@ -8,6 +8,7 @@ px4_qurt_generate_builtin_commands(
|
|||
|
||||
# Enable build without HexagonSDK to check link dependencies
|
||||
if ("${QURT_ENABLE_STUBS}" STREQUAL "1")
|
||||
add_definitions(-DQURT_EXE_BUILD)
|
||||
add_executable(mainapp
|
||||
${CMAKE_SOURCE_DIR}/src/platforms/qurt/dspal/dspal_stub.c
|
||||
${CMAKE_BINARY_DIR}/apps.h)
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
/****************************************************************************
|
||||
* Copyright (c) 2015 Mark Charlebois. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name ATLFlight nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
#ifndef MAINAPP_IDL
|
||||
#define MAINAPP_IDL
|
||||
|
||||
#include "AEEStdDef.idl"
|
||||
|
||||
interface mainapp{
|
||||
uint32 test();
|
||||
};
|
||||
|
||||
#endif /*MAINAPP_IDL*/
|
|
@ -1 +1 @@
|
|||
Subproject commit 2ae8d8118db0e95867cd1946d5b8b85d7e4ef9d3
|
||||
Subproject commit f77bf5c9583dcbf2e6e790784fb10b6c120aaf3e
|
|
@ -61,14 +61,20 @@ static void do_dlopen()
|
|||
#endif
|
||||
}
|
||||
|
||||
#ifdef QURT_EXE_BUILD
|
||||
int dlinit(int a, char **b)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int ret = 0;
|
||||
char *builtin[] = {"libgcc.so", "libc.so", "libstdc++.so"};
|
||||
char *builtin[] = {"libgcc.so", "libc.so"};
|
||||
|
||||
printf("In DSPAL main\n");
|
||||
dlinit(3, builtin);
|
||||
dlinit(2, builtin);
|
||||
|
||||
do_dlopen();
|
||||
return ret;
|
||||
|
|
Loading…
Reference in New Issue