Skip to content

Commit 274a8f2

Browse files
gatekeeplorenzolromnyaaaaaaatalieW3AXL
authored
Merge R05A02 (r04k32_dev branch) into Master (#110)
Below is a summary from the various commits, this release updates the major version number. Backward compatibility, with previous versions should not be a problem. But YMMV and its important to note that FNE backward compatibility, specifically might be problematic (FNE's should be at the same release level). This release changes significant under the hood implementations, including the lowest level of our network stack. * update version number for next dev version; * implement passing complex types as refs in lambda functions; * move KMM NoService response into its own helper function; * remove data call collisions (this code was really iffy); refactor log messages; refactor default handling of packets the FNE doesn't process; insert null bits before PDU; * set RSI data properly for outgoing KMM frame; * implement TEK encryption with an AES-256 KEK; * add support for unwrapping (decrypting) a KEK encrypted TEK; * reorganize code and organization for handling P25 OTAR KMMs for better separation and robustness (this is still a WIP and does not function!); * force hard disable KMF services if OpenSSL isn't compiled in; add instance of P25 crypto to P25OTARService; * add support to expose KMF services via DLI UDP; add plumbing to support encrypted KMM frames; * add some debug dumping; * BUGFIX: null reference when trying to perform old style lookup of timestamp when debugging is enabled; * standardize KMM logging; * begin adding support for V.24 PDU data; * fix C++ namespace shenanigans; * fix documentation error; * add support for outgoing V.24 PDU data; * minor alterations to bridge UDP audio logic; set better default for bridge udpJitter buffer; * re-engineer entirely how source untimed raw PCM frames over UDP are handled and timed; refactor how udp end of call is handled; * add support to resize the recv and send buffers on the raw UDP socket; adjust the recv buffer on bridge to use 131K system buffer for the socket (this allows us to hold ~394 frames worth of *raw* PCM + metadata in the socket's internal buffer in the system kernel; * set socket buffer sizes to larger values then the default; * annotate Linux limiting the maximum send and recv socket buffer sizes * update dvmhost submodule; * use a 2M buffer for bridge UDP audio; * display the socket buffer resize as warnings and not errors; * reduce UDP recv/send buffer size to a lower reasonable value of 512K; * update README.md; * add more class copy safety; * correct missing parens; * correct loop indexing; remove unused variable; * deprecate unused DIU flag (this isn't what this byte meant in the first place); * add call start marker to main application log; * remove SIP classes (this will be done by a different team, and done differently); begin refactoring Log and ActivityLog implementations into C++-type functions to do away with the C-style va_args functions for log message handling; correct -Wstringop-trunction warnings from BaseNetwork.cpp (we hide the warning for these because we are intentionally copying these strings without the nul terminator); * whoops accidentally blew away activity log transmission to the FNE, fix that...; * add better concurrency protection to AffiliationLookup; fix issues when getting the granted source ID from a destination ID by properly ensuring the mapping table has an entry first; add srcId to the release grant callback (callback should never call AffiliationLookup gets as it can deadlock, so adding this parameter gives the source ID to the callback so that it doesn't have to do the lookup); * remove __spinlock() from touchGrant() and isGranted(); * correct bad ordering of log message for call source switching; * remove blockTrafficTo; implement promiscuous hub mode for FNE (this mode allows the FNE to pass any and all traffic transparently); * fix typo; * for the purposes of my OCD fix incorrect one-liner Doxygen documentation (its //!< and not just //!); * better document peer ID and rid ACL list files; * add backward for stacktrace support on crash; * fix FNE compilation when SSL is not available; make Win32 builds work again; * remove double error message; * generate stacktrace file if main logger file is not initialized or unavailable; * reduce the use of unordered_map::at(); * begin relabeling peer-link to peer replication/peer replica; * implement identity with qualifier, this makes logs (and only logs) easier to trace by uniquely identifying certain peer types, a peer qualifier is simply a symbol appended to the beginning of a resolved peer identity in the FNE logs (@ = SysView, + = External/Linked FNE, % = Replica FNE); silence the Call Source Switched log messages, we will only actually print these if the call source ID changes; fix missed Peer-Link log branding/naming; * lock m_status and m_statusPVCall before trying to update data elements; * don't drop out-of-order packets (this was a bad idea, instead log an issue, the real fix for this will be some sort of RTP jitter buffer); if the current packet sequence reaches the maximum allowed, roll over to 0; * update order of operations for peer ident; * normalize log messages; * differentiate a call end collision from a call collision; * differentiate a call grant collision from a call collision; * fix missing code commenting; * initial implementation of naive round-robin HA mechanism. this mechanism allows the FNE master to communicate to a peer connected to it, to announce alternate IPs for the peer to connect to if the primary configured FNE master becomes inaccessible. the HA mechanism requires peer replication to create a loose cluster of FNEs, each FNE in the cluster is configured with the external WAN IP and port for connection to the FNE, and these IPs are then disseminated to all FNE replicas (and downstream connected peers) in the cluster automatically; * hide debug messages unless debugging is enabled; * remove old call in progress global; refactor call collisions, allow the call collision timeout be user definable (with 0 disabling call collisions, user beware); * simplify sendmmsg implementation; * BUGFIX: correct scenario where traffic from an upstream master to a downstream peer FNE would lose the RTP sequence numbering; * refactor how RTP multiplexing by stream is handled; * fix some odd behavior with very fast calls locking up grants on on DVRS channels; * refactor RTP sequence count handling; * whoops this stream ID check was intended for non-promiscuous operation only; * fix memory leak with PacketBuffer::decode(), dont use a direct heap allocated buffer, instead use a unique_ptr buffer; * simplify implementation; * rename backtrace namespace to log_stacktrace, when using simple mode the namespace conflicts with a global function backtrace(); add package element for libdw-dev:arm64 for cross compile instructions; * whoops forgot to update BridgeMain.cpp for log_stacktrace; * lock the peer list when writing traffic data to prevent peer removal during traffic operations; * utilize a shared_timed_mutex for peer list locking on the FNE, this better keeps the peer list locked during traffic operations using lock counting vs the original spinlock mechanism; * better handling locking peer connections during critical state changes; * whoops this lock should only take place for a connected peer; * reflect higher requirements for FNE; fix issue on host where sometimes a stuck network call would cause network traffic to stop incorrectly hanging on the previous TG; * change around some naming; * typo; * [EXPERIMENTAL] implement rudimentary spanning tree mechanism to prevent peer looping; refactor how FNENetwork handled peer disconnect cleanups and consolidate into a singular routine; * [EXPERIMENTAL] enhance detection for case where FNE A and FNE B are cross-peered to each other (dont do this); * add REST API endpoint to fetch the master tree; * make sure master peer ID 0 doesnt ever happen; * log condition where masterPeerId is 0 * SysView peers announce themselves as an external FNE, but we do not consider them FNE peer links; * SysView masquarades its masterPeerId as itself; * instead of killing a peer connection instantly on a duplicate conn drop, increase retry time to 30 minutes and allow up to 3 duplicate conn failures before killing; * better handle duplicate connection disconnect NAKs; add REST API on FNE to force reset a upstream peer connection; * fix issue with purely ACL virtual FNEs not being able to replicate configuration further down the master tree; * deprecate the "external FNE" terming for upstream FNE connections and instead call them "neighbor FNE"; * more code cleanup, simplify naming; * cleanup code; refactor log messages from the FNE to better categorize them; correct issue where a peer reconnecting may trip tree duplicate conn checking; * enhance STP peer reconnect logic to allow peers announcing the same peerId and masterId to reconnect between spanning tree updates; * update log colorizer to match new logging categories in the FNE; * update log colorizer to match new logging categories in the FNE (round 2); * update log colorizer to match new logging categories in the FNE (round 3); * update log colorizer to match new logging categories in the FNE (round 4); * bump major version numbering in a preliminary fashion, at least until group talks about it are done (so this could be permenant); * fix messaging for fast peer reconnect (it was misleading as a RPTC NAK which it isnt); * allow reparenting of a STP node if it moves from one tree node to another; * implement tree cleanups if the downstream announcement removes child leaves or reports no children at all; * relabel MasterTree to SpanningTree proper; * whoops errant i++; * fix up some concurrency problems when dealing with parrot transmissions, due to migration of parrot playback into its own thread; * make sure to share lock peers while processing in maintainence loop; * add mutex locking around spanning tree updates; * simplify log levels, deprecate LogMessage log level in favor of just using LogInfoEx (message and info logs are basically the same thing); * better classify log messages; * simplify FNE configuration for peers, make identity a global applying to all peer connections, remove bogus frequency data; * better report global identity; * allow overriding the global identity for upstream connections; implement use of identity for spanning tree; * update config examples to reflect new log levels; * add back peer "name" field, this is strictly informational to make the config file easier on the brain; * Win32: bump version number for file resource metadata; * add documentation for packet payloads for: writeLogin, writeAuthorisation, writeConfig and writePing; * add some more packet payload documentation; * continue packet payload documenting; * minor comment alteration; * correct DMR data handling; refactor FNE DMR data calls to be structured more akin to P25 data calls; * use WASAPI by default on Windows; * better handle out of order blocks for PDUs; reduce packet retry to 2; correct handling ack response packets; * refactor how buffered UDP datagram queuing is performed; * relabel static class variables to use s_ and globals to use g_ * enhance colorize-host.sh to terminate color properly; * enhance colorize-host.sh to terminate color properly; * RTS PTT will only assert when audio is present. Add holdoff timer before removing RTS. (#103) * add option to enable/disable upstream call start/end event logging; * more work towards a working DLD-type OTAR service for P25; * fix typos; * Add carrier operated relay support to dvmbridge. (#104) * refactor KMMFrame to properly support message number and add framework to support MAC; refactor all derived KMM classes to properly determine KMM frame length and body offsets; change collision in class naming for KeyItem in the CryptoContainer and KeyItem in the p25::kmm namespace; cleanup magic numbers; add initial code for transmitting a rekey command; add KEK crypto wrapping testcase; * begin work on generating KMM CMAC for message authentication; * document sections of doc where a test originates test data; * begin work on generating CBC-MAC for message authentication; * minor cleanups; * test should be using generated key; * CBC-MAC now works properly; CMAC MAC generation works (just gotta fix CMAC MAC key generation); * complete CBC-MAC implemenation, at least for the provided samples from TIA-102.AACA-C this is now passing for the rekey example provided in section 14.3.4; anything compiling against libcommon.a while OpenSSL is enabled will require OpenSSL -lssl; fix delete vs free in various tests; * typo * implement OFB data encryption per TIA-102.AAAD-B; test proper final encrypted output for CBC-MAC check; implement use of cryptAES_PDU() in P25OTARService; * add experimental DES crypto; * move Git hash global defines out of Defines.h and into GitHash.h; * fix copyrights; * cleanup file headers containing lingering old comments; update fw/modem submodule; update fw/hotspot submodule; * remove debug trace not needed anymore; * add support for PDU auxiliary ES headers; * complete refactor of how P25 PDUs are assembled from user data and disassembled to user data; various corrections for data path nullptr reference issues; implement several tests for testing the P25 PDU assembler; * remove left over debug code; fix AMBT CRC-32 calculation error, AMBTs calculate the CRC-32 for the PDU themselves the Assembler does not need to do it; correct default value of p25TxNAC; * add some better error handling for NetRPC; * validate LC_CALL_TERM peer ID before allowing them to repeat, this fixes an issue where an errant peer on the network could spam LC_CALL_TERM to cause trunked nodes to terminate/kill a call in progress; * fix issue with dvmpatch not properly evaluating the destination TEK; * add support to patch to *disable* enc processing and allow frames to pass transparently; implement DES for bridge and patch; * reorganize application files, I've wanted to do this for a while JSON isn't really a network service, and REST API while it is a network service, I want to be in a separate namespace; * add multi-block PDU for V.24; * add some guard rails on PDU reception so we dont overflow ourselves; * it seems as if PDU_(UN)CONF_END is variable length, it will always be at least 1 block containing the last PDU block, and PDU_(UN)CONF_BLOCK_X is always 4 blocks; * cleanup dataBlocks pointer array; * preliminary code for sending PDU frames >3 blocks over V.24; * use unsigned numbers for these loops the values should never be negative anyway; * properly encode sequence opcode; * whoops missing parens; * initialize these unordered_maps to allow the max connection cap count number of entries (before it was zero and could result in many reallocations of these maps); * well that was a little naive of me, I didnt multiply the count by the size of the stored elements...; * reverse course lets do this more intelligently and implement the passthru for the reserve() function on the concurrency classes; * add STP check to see if a downstream leaf is blown itself away on the tree; * implement DMR data PDU assembler based on the P25 PDU assembler; * expand on the files related to an FNE instance for clarity; * add preliminary support for enabling peers with call priority, this will give those peers the ability to override any current call in progress; * implement a more solidified peer call priority mechanism using ICC; * bump WebSocketPP version to conform to new CMake minimum version; (#108) * fix typo; * add some documentation around newer protocol additions; * whoops typo; * start adding foundational work for future P25 Phase 2; * decomplicate foundational changes to RS coders for Phase 2; * added new peer config options to FNE REST api * add some locks around pkt maps in DiagNetwork; * better document the master peerId importance; * ensure buffers are set to nullptr after deleting to prevent double frees; * skip trying to transmit any buffer that is null; * add thread safties to SpanningTree; * correct bad memory allocation; * revert previous change to add locking to SpanningTree (this is handled externally in FNENetwork and DiagNetwork); fix issue in FNENetwork which could cause a STP deadlock; fix issue incorrectly labeling a peer as allowing call priority in the log when infact the peer was not configured that way; * make sure during resetPeer() we lock the connection; * readd SpanningTree internal locking mechanisms; * make sure pointers are set to null after delete; * ensure when a FNE loses all its downstream leaves, that it will properly notify upstream FNEs; fix issue where dangling tree nodes were being incorrectly left in the flat peer node list for the spanning tree; * fix defaultNetIdleTalkgroup being treated as a hex value instead of dec; enhance P25 defaultNetIdleTalkgroup slightly to better pass traffic after RF traffic; enhance P25 defaultNetIdleTalkgroup to pass traffic if there are affiliations to the group; * how about we dont blatently leave debug messages enabled...; * BUGFIX: hopefully correct crash condition when trying to erase child nodes; * followup for last commit, simplify implementation; * this will be unpopular, but I am deprecating support for cross-compiling for armhf/legacy RPi, maintaining this is already causing problems with OpenSSL and will ultimately handcuff us in the future if we upgrade C++ versions because the legacy toolchain uses GCC 4.9; * remove deprecated patch; * update README.md; * correct some cross-compile shennigans for OpenSSL; * correct some cross-compile shennigans for aarch64; * BUGFIX: fix issue where the host would incorrectly reset the voice stream ID during a call; * match code change from previous bugfix to DMR and NXDN; * dont use the deprecated OpenSSL1.1 functions, use portable AESCrypto functions instead for low-level AES crypto; * disable STP reparenting when deserializing children of a tree; * BUGFIX: fix tged and peered in the case where an empty file or file with no entries is provided for editing; * BUGFIX: add some validation checks around deserialization reparenting; * implement P25P2 reed-solomon codes for future use; * BUGFIX: correct bad check for parrot frames end of call; --------- Co-authored-by: Lorenzo L. Romero <lorenzolrom@gmail.com> Co-authored-by: Natalie <jelimoore@gmail.com> Co-authored-by: W3AXL <29879554+W3AXL@users.noreply.github.com>
1 parent e9abdf6 commit 274a8f2

427 files changed

Lines changed: 28739 additions & 11225 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
needs: [setup]
5353
strategy:
5454
matrix:
55-
arch: ["amd64", "arm", "aarch64", "armhf"]
55+
arch: ["amd64", "arm", "aarch64"]
5656
runs-on: ubuntu-22.04
5757
env:
5858
PACKAGENAME: ${{ needs.setup.outputs.APPNAME }}-${{ needs.setup.outputs.DATE }}-${{ matrix.arch }}
@@ -105,12 +105,8 @@ jobs:
105105
build_args="$build_args -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS='-s' -DCMAKE_CXX_FLAGS='-s'"
106106
fi
107107
108-
if [[ "${{ matrix.arch }}" == 'armhf' ]]; then
109-
cmake $(echo $build_args) -DCROSS_COMPILE_RPI_ARM=1 .
110-
else
111-
cmake $(echo $build_args) \
112-
-D "CROSS_COMPILE_$(echo '${{ matrix.arch }}' | tr '[:lower:]' '[:upper:]')=1" .
113-
fi
108+
cmake $(echo $build_args) \
109+
-D "CROSS_COMPILE_$(echo '${{ matrix.arch }}' | tr '[:lower:]' '[:upper:]')=1" .
114110
115111
make -j $(nproc)
116112
make tarball
@@ -146,7 +142,7 @@ jobs:
146142
needs: [setup, build, create-release]
147143
strategy:
148144
matrix:
149-
arch: ["amd64", "arm", "aarch64", "armhf"]
145+
arch: ["amd64", "arm", "aarch64"]
150146
runs-on: ubuntu-22.04
151147
env:
152148
PACKAGENAME: ${{ needs.setup.outputs.APPNAME }}-${{ needs.setup.outputs.DATE }}-${{ matrix.arch }}

.github/workflows/release.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
needs: [setup]
3131
strategy:
3232
matrix:
33-
arch: ["amd64", "arm", "aarch64", "armhf"]
33+
arch: ["amd64", "arm", "aarch64"]
3434
runs-on: ubuntu-22.04
3535
env:
3636
PACKAGENAME: ${{ needs.setup.outputs.APPNAME }}-${{ needs.setup.outputs.VERSION }}-${{ matrix.arch }}
@@ -77,12 +77,8 @@ jobs:
7777
7878
build_args="$build_args -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS='-s' -DCMAKE_CXX_FLAGS='-s'"
7979
80-
if [[ "${{ matrix.arch }}" == 'armhf' ]]; then
81-
cmake $(echo $build_args) -DCROSS_COMPILE_RPI_ARM=1 .
82-
else
83-
cmake $(echo $build_args) \
84-
-D "CROSS_COMPILE_$(echo '${{ matrix.arch }}' | tr '[:lower:]' '[:upper:]')=1" .
85-
fi
80+
cmake $(echo $build_args) \
81+
-D "CROSS_COMPILE_$(echo '${{ matrix.arch }}' | tr '[:lower:]' '[:upper:]')=1" .
8682
8783
make -j $(nproc)
8884
make strip
@@ -118,7 +114,7 @@ jobs:
118114
needs: [setup, build, create-release]
119115
strategy:
120116
matrix:
121-
arch: ["amd64", "arm", "aarch64", "armhf"]
117+
arch: ["amd64", "arm", "aarch64"]
122118
runs-on: ubuntu-22.04
123119
env:
124120
PACKAGENAME: ${{ needs.setup.outputs.APPNAME }}-${{ needs.setup.outputs.VERSION }}-${{ matrix.arch }}

CMakeLists.txt

Lines changed: 52 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,11 @@ endif (DISABLE_WEBSOCKETS)
3636
# Cross-compile options
3737
option(CROSS_COMPILE_ARM "Cross-compile for 32-bit ARM" off)
3838
option(CROSS_COMPILE_AARCH64 "Cross-compile for 64-bit ARM" off)
39-
option(CROSS_COMPILE_RPI_ARM "Cross-compile for (old RPi) 32-bit ARM" off)
39+
4040
option(COMPILE_WIN32 "Compile for Win32" off)
4141

42+
set(ENABLE_LIBDW_SUPPORT ON)
43+
4244
if (COMPILE_WIN32)
4345
set(ARCH amd64)
4446
set(CMAKE_SYSTEM_PROCESSOR amd64)
@@ -73,69 +75,37 @@ else()
7375
endif (COMPILE_WIN32)
7476

7577
if (CROSS_COMPILE_ARM)
78+
set(CMAKE_CROSSCOMPILING TRUE)
79+
set(ARCH armhf CACHE STRING "Architecture" FORCE)
80+
set(CMAKE_SYSTEM_PROCESSOR armhf CACHE STRING "System Processor" FORCE)
81+
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE armhf CACHE STRING "Package Architecture" FORCE)
82+
message(CHECK_START "Target Architecture - ${ARCH}")
83+
7684
set(CMAKE_C_COMPILER /usr/bin/arm-linux-gnueabihf-gcc CACHE STRING "C compiler" FORCE)
7785
set(CMAKE_CXX_COMPILER /usr/bin/arm-linux-gnueabihf-g++ CACHE STRING "C++ compiler" FORCE)
78-
set(ARCH armhf)
79-
set(CMAKE_SYSTEM_PROCESSOR armhf)
80-
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE armhf)
86+
8187
set(OPENSSL_ROOT_DIR /usr/lib/arm-linux-gnueabihf)
82-
message(CHECK_START "Target Architecture - ${ARCH}")
88+
set(CMAKE_INCLUDE_PATH /usr/arm-linux-gnueabihf/include)
89+
set(CMAKE_LIBRARY_PATH /usr/arm-linux-gnueabihf/lib)
90+
8391
message(CHECK_START "Cross compiling for 32-bit ARM - ${CMAKE_C_COMPILER}")
8492
endif (CROSS_COMPILE_ARM)
8593
if (CROSS_COMPILE_AARCH64)
94+
set(CMAKE_CROSSCOMPILING TRUE)
95+
set(ARCH aarch64 CACHE STRING "Architecture" FORCE)
96+
set(CMAKE_SYSTEM_PROCESSOR aarch64 CACHE STRING "System Processor" FORCE)
97+
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE aarch64 CACHE STRING "Package Architecture" FORCE)
98+
message(CHECK_START "Target Architecture - ${ARCH}")
99+
86100
set(CMAKE_C_COMPILER /usr/bin/aarch64-linux-gnu-gcc CACHE STRING "C compiler" FORCE)
87101
set(CMAKE_CXX_COMPILER /usr/bin/aarch64-linux-gnu-g++ CACHE STRING "C++ compiler" FORCE)
88-
set(ARCH arm64)
89-
set(CMAKE_SYSTEM_PROCESSOR arm64)
90-
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE arm64)
102+
91103
set(OPENSSL_ROOT_DIR /usr/lib/aarch64-linux-gnu)
92-
message(CHECK_START "Target Architecture - ${ARCH}")
104+
set(CMAKE_INCLUDE_PATH /usr/aarch64-linux-gnu/include)
105+
set(CMAKE_LIBRARY_PATH /usr/aarch64-linux-gnu/lib)
93106
message(CHECK_START "Cross compiling for 64-bit ARM - ${CMAKE_C_COMPILER}")
94107
endif (CROSS_COMPILE_AARCH64)
95108

96-
option(WITH_RPI_ARM_TOOLS "Specifies the location for the RPI ARM tools" off)
97-
if (WITH_RPI_ARM_TOOLS)
98-
set(RPI_ARM_TOOLS ${WITH_RPI_ARM_TOOLS})
99-
message(CHECK_START "With RPi 1 Tools: ${RPI_ARM_TOOLS}")
100-
endif (WITH_RPI_ARM_TOOLS)
101-
102-
if (CROSS_COMPILE_RPI_ARM)
103-
if (NOT WITH_RPI_ARM_TOOLS)
104-
message("-- Cloning legacy Raspberry Pi compilation toolchain")
105-
include(FetchContent)
106-
FetchContent_Declare(
107-
RPiTools
108-
GIT_REPOSITORY https://github.com/raspberrypi/tools.git
109-
)
110-
FetchContent_MakeAvailable(RPiTools)
111-
set(CMAKE_C_COMPILER ${CMAKE_CURRENT_BINARY_DIR}/_deps/rpitools-src/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc CACHE STRING "C compiler" FORCE)
112-
set(CMAKE_CXX_COMPILER ${CMAKE_CURRENT_BINARY_DIR}/_deps/rpitools-src/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ CACHE STRING "C++ compiler" FORCE)
113-
114-
message(CHECK_START "Apply OpenSSL library binaries for cross compling (old RPi) 32-bit ARM - ${CMAKE_CURRENT_BINARY_DIR}/_deps/rpitools-src")
115-
execute_process(COMMAND tar xzf contrib/openssl_cross_patch.RPI_ARM.tar.gz -C ${CMAKE_CURRENT_BINARY_DIR}/_deps/rpitools-src WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})
116-
117-
set(OPENSSL_ROOT_DIR ${CMAKE_CURRENT_BINARY_DIR}/_deps/rpitools-src/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/arm-linux-gnueabihf/sysroot/usr/lib)
118-
else()
119-
set(CMAKE_C_COMPILER ${RPI_ARM_TOOLS}/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc CACHE STRING "C compiler" FORCE)
120-
set(CMAKE_CXX_COMPILER ${RPI_ARM_TOOLS}/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ CACHE STRING "C++ compiler" FORCE)
121-
122-
message(CHECK_START "Apply OpenSSL library binaries for cross compling (old RPi) 32-bit ARM - ${RPI_ARM_TOOLS}")
123-
execute_process(COMMAND tar xzf contrib/openssl_cross_patch.RPI_ARM.tar.gz -C ${RPI_ARM_TOOLS} WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})
124-
125-
set(OPENSSL_ROOT_DIR ${RPI_ARM_TOOLS}/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/arm-linux-gnueabihf/sysroot/usr/lib)
126-
endif ()
127-
128-
set(ARCH armhf)
129-
set(CMAKE_SYSTEM_PROCESSOR armhf)
130-
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE armhf)
131-
message(CHECK_START "Target Architecture - ${ARCH}")
132-
message(CHECK_START "Cross compiling for (old RPi) 32-bit ARM - ${CMAKE_C_COMPILER}")
133-
134-
# No TUI for this
135-
set(ENABLE_TUI_SUPPORT OFF)
136-
message(CHECK_START "Enable TUI support - no; for simplicity RPI_ARM cross-compiling does not support TUI.")
137-
endif (CROSS_COMPILE_RPI_ARM)
138-
139109
# search for programs in the build host directories
140110
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
141111

@@ -174,11 +144,6 @@ if (CROSS_COMPILE_ARM)
174144
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Wno-psabi")
175145
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wno-psabi")
176146
endif (CROSS_COMPILE_ARM)
177-
if (CROSS_COMPILE_RPI_ARM)
178-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")
179-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
180-
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -std=c99")
181-
endif (CROSS_COMPILE_RPI_ARM)
182147
if (COMPILE_WIN32)
183148
set(CMAKE_C_FLAGS "/EHsc /D_WIN32 /D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR")
184149
set(CMAKE_CXX_FLAGS "/EHsc /D_WIN32 /D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR")
@@ -191,6 +156,7 @@ set(CMAKE_INSTALL_PREFIX "/usr/local")
191156
#
192157
# Library Inclusions
193158
#
159+
# ASIO
194160
if (NOT ASIO_INCLUDED)
195161
option(WITH_ASIO "Manually specify the location for the ASIO library" off)
196162
if (WITH_ASIO)
@@ -210,21 +176,49 @@ if (NOT ASIO_INCLUDED)
210176
endif (WITH_ASIO)
211177
endif (NOT ASIO_INCLUDED)
212178

179+
# WebSocket++
213180
if (NOT DISABLE_WEBSOCKETS)
214181
if (NOT WEBSOCKETPP_INCLUDED)
215182
message("-- Cloning WebSocket++")
216183
include(FetchContent)
217184
FetchContent_Declare(
218185
WEBSOCKETPP
219186
GIT_REPOSITORY https://github.com/zaphoyd/websocketpp.git
220-
GIT_TAG 56123c87598f8b1dd471be83ca841ceae07f95ba # 0.8.2
187+
GIT_TAG 4dfe1be74e684acca19ac1cf96cce0df9eac2a2d # 0.8.2 with modified CMake version
221188
)
222189
FetchContent_MakeAvailable(WEBSOCKETPP)
223190
add_subdirectory(${websocketpp_SOURCE_DIR} EXCLUDE_FROM_ALL)
224191
set(WEBSOCKETPP_INCLUDED 1)
225192
endif (NOT WEBSOCKETPP_INCLUDED)
226193
endif (NOT DISABLE_WEBSOCKETS)
227194

195+
# elfutils (libdw-dev)
196+
if (ENABLE_LIBDW_SUPPORT)
197+
find_path(LIBDW_INCLUDE_DIR NAMES elfutils/libdw.h elfutils/libdwfl.h HINTS /usr /usr/local PATH_SUFFIXES include)
198+
199+
include(FindPackageHandleStandardArgs)
200+
find_package_handle_standard_args(Libdw DEFAULT_MSG LIBDW_INCLUDE_DIR)
201+
202+
if (LIBDW_FOUND)
203+
message("-- libdw (libdw-dev) found, detailed backtrace support enabled")
204+
add_definitions(-DBACKWARD_HAS_DW=1)
205+
set(LIBDW_LIBRARY "dw")
206+
else()
207+
message("-- libdw (libdw-dev) not found, simple backtrace only")
208+
add_definitions(-DBACKWARD_HAS_DW=0 -DBACKWARD_HAS_BACKTRACE_SYMBOL=1)
209+
set(LIBDW_INCLUDE_DIR "")
210+
set(LIBDW_LIBRARY "")
211+
endif (LIBDW_FOUND)
212+
213+
mark_as_advanced(LIBDW_INCLUDE_DIR LIBDW_LIBRARY)
214+
else()
215+
message("-- libdw (libdw-dev) disabled, simple backtrace only")
216+
add_definitions(-DBACKWARD_HAS_DW=0 -DBACKWARD_HAS_BACKTRACE_SYMBOL=1)
217+
set(LIBDW_INCLUDE_DIR "")
218+
set(LIBDW_LIBRARY "")
219+
endif (ENABLE_LIBDW_SUPPORT)
220+
221+
# FinalCut
228222
if (ENABLE_TUI_SUPPORT AND NOT FC_INCLUDED)
229223
message("-- Cloning finalcut")
230224
include(FetchContent)
@@ -342,22 +336,6 @@ if (NOT TARGET strip)
342336
COMMAND aarch64-linux-gnu-strip -s dvmbridge
343337
COMMAND aarch64-linux-gnu-strip -s dvmpatch)
344338
endif (ENABLE_TUI_SUPPORT AND (NOT DISABLE_TUI_APPS))
345-
elseif (CROSS_COMPILE_RPI_ARM)
346-
if (NOT WITH_RPI_ARM_TOOLS)
347-
add_custom_target(strip
348-
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/_deps/rpitools-src/arm-bcm2708/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-strip -s dvmhost
349-
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/_deps/rpitools-src/arm-bcm2708/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-strip -s dvmfne
350-
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/_deps/rpitools-src/arm-bcm2708/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-strip -s dvmcmd
351-
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/_deps/rpitools-src/arm-bcm2708/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-strip -s dvmbridge
352-
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/_deps/rpitools-src/arm-bcm2708/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-strip -s dvmpatch)
353-
else()
354-
add_custom_target(strip
355-
COMMAND ${RPI_ARM_TOOLS}/arm-bcm2708/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-strip -s dvmhost
356-
COMMAND ${RPI_ARM_TOOLS}/arm-bcm2708/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-strip -s dvmfne
357-
COMMAND ${RPI_ARM_TOOLS}/arm-bcm2708/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-strip -s dvmcmd
358-
COMMAND ${RPI_ARM_TOOLS}/arm-bcm2708/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-strip -s dvmbridge
359-
COMMAND ${RPI_ARM_TOOLS}/arm-bcm2708/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-strip -s dvmpatch)
360-
endif ()
361339
else()
362340
if (ENABLE_TUI_SUPPORT AND (NOT DISABLE_TUI_APPS))
363341
add_custom_target(strip

Makefile

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,6 @@ aarch64:
3232
&& make -j $(nproc)
3333
@echo 'Successfully compiled for AARCH64'
3434

35-
armhf:
36-
@echo 'Cross-Compiling for ARMHF'
37-
mkdir -p "build/$@" && cd "build/$@" \
38-
&& cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS="-s" -DCMAKE_CXX_FLAGS="-s" \
39-
-DCROSS_COMPILE_RPI_ARM=1 ../.. \
40-
&& make -j $(nproc)
41-
@echo 'Successfully compiled for ARMHF'
42-
4335
clean:
4436
@echo 'Removing all temporary files'
4537
git clean -ffxd

0 commit comments

Comments
 (0)