From a8c49809face75f716621e44921bac91134190f0 Mon Sep 17 00:00:00 2001 From: Mark Charlebois Date: Sat, 9 Jan 2016 23:16:20 -0800 Subject: [PATCH] Fixes for other qurt builds to use QURT_BUNDLE Signed-off-by: Mark Charlebois --- .gitmodules | 3 + cmake/cmake_hexagon | 1 + cmake/configs/qurt_eagle_hello.cmake | 4 +- cmake/configs/qurt_eagle_hil.cmake | 3 +- cmake/configs/qurt_eagle_muorb.cmake | 4 +- cmake/configs/qurt_eagle_release.cmake | 3 +- cmake/configs/qurt_eagle_test.cmake | 3 +- cmake/configs/qurt_eagle_travis.cmake | 3 +- .../toolchains/Toolchain-hexagon-7.2.10.cmake | 254 ------------------ cmake/toolchains/Toolchain-hexagon.cmake | 249 ----------------- src/firmware/qurt/CMakeLists.txt | 1 + src/firmware/qurt/mainapp.idl | 41 +++ src/lib/DriverFramework | 2 +- src/platforms/qurt/dspal/dspal_stub.c | 10 +- 14 files changed, 69 insertions(+), 512 deletions(-) create mode 160000 cmake/cmake_hexagon delete mode 100644 cmake/toolchains/Toolchain-hexagon-7.2.10.cmake delete mode 100644 cmake/toolchains/Toolchain-hexagon.cmake create mode 100755 src/firmware/qurt/mainapp.idl diff --git a/.gitmodules b/.gitmodules index 98a23841b5..c5188f49e9 100644 --- a/.gitmodules +++ b/.gitmodules @@ -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 diff --git a/cmake/cmake_hexagon b/cmake/cmake_hexagon new file mode 160000 index 0000000000..e64ded44b2 --- /dev/null +++ b/cmake/cmake_hexagon @@ -0,0 +1 @@ +Subproject commit e64ded44b248fa8571647e11a4aeed7833ecd8a7 diff --git a/cmake/configs/qurt_eagle_hello.cmake b/cmake/configs/qurt_eagle_hello.cmake index 4328a3d4aa..3427746a1d 100644 --- a/cmake/configs/qurt_eagle_hello.cmake +++ b/cmake/configs/qurt_eagle_hello.cmake @@ -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 diff --git a/cmake/configs/qurt_eagle_hil.cmake b/cmake/configs/qurt_eagle_hil.cmake index 0f2e92b0c0..fb34bc4d02 100644 --- a/cmake/configs/qurt_eagle_hil.cmake +++ b/cmake/configs/qurt_eagle_hil.cmake @@ -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 diff --git a/cmake/configs/qurt_eagle_muorb.cmake b/cmake/configs/qurt_eagle_muorb.cmake index d73d7becff..0da1fdb1a7 100644 --- a/cmake/configs/qurt_eagle_muorb.cmake +++ b/cmake/configs/qurt_eagle_muorb.cmake @@ -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 diff --git a/cmake/configs/qurt_eagle_release.cmake b/cmake/configs/qurt_eagle_release.cmake index 67d84c8fa7..1e7beed49c 100644 --- a/cmake/configs/qurt_eagle_release.cmake +++ b/cmake/configs/qurt_eagle_release.cmake @@ -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 # diff --git a/cmake/configs/qurt_eagle_test.cmake b/cmake/configs/qurt_eagle_test.cmake index 2e6a370950..3602056e01 100644 --- a/cmake/configs/qurt_eagle_test.cmake +++ b/cmake/configs/qurt_eagle_test.cmake @@ -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 diff --git a/cmake/configs/qurt_eagle_travis.cmake b/cmake/configs/qurt_eagle_travis.cmake index 85fae3373b..4550c504cc 100644 --- a/cmake/configs/qurt_eagle_travis.cmake +++ b/cmake/configs/qurt_eagle_travis.cmake @@ -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 diff --git a/cmake/toolchains/Toolchain-hexagon-7.2.10.cmake b/cmake/toolchains/Toolchain-hexagon-7.2.10.cmake deleted file mode 100644 index 1ab6fd4060..0000000000 --- a/cmake/toolchains/Toolchain-hexagon-7.2.10.cmake +++ /dev/null @@ -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() - diff --git a/cmake/toolchains/Toolchain-hexagon.cmake b/cmake/toolchains/Toolchain-hexagon.cmake deleted file mode 100644 index 4de37f553c..0000000000 --- a/cmake/toolchains/Toolchain-hexagon.cmake +++ /dev/null @@ -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) diff --git a/src/firmware/qurt/CMakeLists.txt b/src/firmware/qurt/CMakeLists.txt index c16ed4f2b9..34832a15e6 100644 --- a/src/firmware/qurt/CMakeLists.txt +++ b/src/firmware/qurt/CMakeLists.txt @@ -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) diff --git a/src/firmware/qurt/mainapp.idl b/src/firmware/qurt/mainapp.idl new file mode 100755 index 0000000000..c86adac37b --- /dev/null +++ b/src/firmware/qurt/mainapp.idl @@ -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*/ diff --git a/src/lib/DriverFramework b/src/lib/DriverFramework index 2ae8d8118d..f77bf5c958 160000 --- a/src/lib/DriverFramework +++ b/src/lib/DriverFramework @@ -1 +1 @@ -Subproject commit 2ae8d8118db0e95867cd1946d5b8b85d7e4ef9d3 +Subproject commit f77bf5c9583dcbf2e6e790784fb10b6c120aaf3e diff --git a/src/platforms/qurt/dspal/dspal_stub.c b/src/platforms/qurt/dspal/dspal_stub.c index 13542cdfd3..325c08a6b5 100644 --- a/src/platforms/qurt/dspal/dspal_stub.c +++ b/src/platforms/qurt/dspal/dspal_stub.c @@ -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;