From 3097f1a80451a1cc8ca0f530698e1b75d8fe3291 Mon Sep 17 00:00:00 2001 From: Andreas Bihlmaier Date: Fri, 13 Mar 2020 15:48:42 +0000 Subject: [PATCH 1/2] fix compilation on aarch64 (e.g. Ubuntu 18.04.4 on Raspberry Pi 4) --- src/RaspiCamControl.cpp | 4 ++-- src/raspicam_node.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/RaspiCamControl.cpp b/src/RaspiCamControl.cpp index 3743ba0..aa88da0 100644 --- a/src/RaspiCamControl.cpp +++ b/src/RaspiCamControl.cpp @@ -26,7 +26,7 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifdef __arm__ +#if defined(__arm__) || defined(__aarch64__) #include #include @@ -919,4 +919,4 @@ void raspicamcontrol_check_configuration(int min_gpu_mem) { vcos_log_error("Failed to run camera app. Please check for firmware updates\n"); } -#endif // __arm__ +#endif // __arm__ || __aarch64__ diff --git a/src/raspicam_node.cpp b/src/raspicam_node.cpp index 22d3748..2cb5098 100644 --- a/src/raspicam_node.cpp +++ b/src/raspicam_node.cpp @@ -37,7 +37,7 @@ int main(int argc, char** argv) { #endif // __x86_64__ -#ifdef __arm__ +#if defined(__arm__) || defined(__aarch64__) // We use some GNU extensions (basename) #include @@ -1380,4 +1380,4 @@ int main(int argc, char** argv) { ros::shutdown(); } -#endif // __arm__ +#endif // __arm__ || __aarch64__ From 0df5256ab12e635fed475ee4aadea389d68f09e6 Mon Sep 17 00:00:00 2001 From: Andreas Bihlmaier Date: Sat, 14 Mar 2020 10:45:36 +0000 Subject: [PATCH 2/2] fix "mmal: mmal_component_create_core: could not find component vc.ril.camera" Fixes the following error (on Ubuntu 18.04 aarch64 using Raspbian kernel8.img (4.19.97-v8+ #1294)): mmal: mmal_component_create_core: could not find component 'vc.ril.camera' mmal: Failed to create camera component For details refer to https://github.com/raspberrypi/userland/issues/178 --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9478576..398f89e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,6 +3,7 @@ project(raspicam_node) set(CMAKE_CXX_STANDARD 14) # use C++14 +set(CMAKE_EXE_LINKER_FLAGS "-Wl,--no-as-needed") # https://github.com/raspberrypi/userland/issues/178 ## Find catkin macros and libraries ## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)