From 9ffb68be366f8a65a76860e50598d5540525a0a0 Mon Sep 17 00:00:00 2001 From: "G.E." Date: Wed, 17 Apr 2024 11:33:00 +0300 Subject: [PATCH 1/4] the rpath hack is only needed on arm --- cmake/osdetection.cmake | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/cmake/osdetection.cmake b/cmake/osdetection.cmake index 3369447a..8bfbd3bd 100644 --- a/cmake/osdetection.cmake +++ b/cmake/osdetection.cmake @@ -4,12 +4,14 @@ endif(CMAKE_SYSTEM_NAME MATCHES "Linux") if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") set(FREEBSD true) - set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) - #FIXME: find a nicer and more general way of doing this - if(CMAKE_C_COMPILER MATCHES "/usr/local/bin/gcc12") - set(CMAKE_BUILD_RPATH "/usr/local/lib/gcc12") - elseif(CMAKE_C_COMPILER MATCHES "/usr/local/bin/gcc13") - set(CMAKE_BUILD_RPATH "/usr/local/lib/gcc13") + if(ARCH_AARCH64) + set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + #FIXME: find a nicer and more general way of doing this + if(CMAKE_C_COMPILER MATCHES "/usr/local/bin/gcc12") + set(CMAKE_BUILD_RPATH "/usr/local/lib/gcc12") + elseif(CMAKE_C_COMPILER MATCHES "/usr/local/bin/gcc13") + set(CMAKE_BUILD_RPATH "/usr/local/lib/gcc13") + endif() endif() endif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") From d5f12ecb54dcf9612ac2f8933ac2a244a407d9f0 Mon Sep 17 00:00:00 2001 From: "G.E." Date: Wed, 17 Apr 2024 15:40:52 +0300 Subject: [PATCH 2/4] enable the rpath hack on all gcc13, and on arm/gcc12 --- cmake/osdetection.cmake | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/cmake/osdetection.cmake b/cmake/osdetection.cmake index 8bfbd3bd..2cef0b94 100644 --- a/cmake/osdetection.cmake +++ b/cmake/osdetection.cmake @@ -4,14 +4,12 @@ endif(CMAKE_SYSTEM_NAME MATCHES "Linux") if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") set(FREEBSD true) - if(ARCH_AARCH64) - set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) - #FIXME: find a nicer and more general way of doing this - if(CMAKE_C_COMPILER MATCHES "/usr/local/bin/gcc12") - set(CMAKE_BUILD_RPATH "/usr/local/lib/gcc12") - elseif(CMAKE_C_COMPILER MATCHES "/usr/local/bin/gcc13") - set(CMAKE_BUILD_RPATH "/usr/local/lib/gcc13") - endif() + set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + #FIXME: find a nicer and more general way of doing this + if(CMAKE_C_COMPILER MATCHES "/usr/local/bin/gcc13") + set(CMAKE_BUILD_RPATH "/usr/local/lib/gcc13") + elseif(ARCH_AARCH64 AND (CMAKE_C_COMPILER MATCHES "/usr/local/bin/gcc12")) + set(CMAKE_BUILD_RPATH "/usr/local/lib/gcc12") endif() endif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") From ee03d45506da4cbfa28ccd3a5721d299a5c8fec3 Mon Sep 17 00:00:00 2001 From: "G.E." Date: Wed, 17 Apr 2024 23:03:09 +0300 Subject: [PATCH 3/4] readme edit --- README.md | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/README.md b/README.md index 2e68d2e6..d5f0892c 100644 --- a/README.md +++ b/README.md @@ -146,6 +146,7 @@ export CXX="/usr/pkg/gcc12/bin/g++" ``` In FreeBSD similarly, you might want to install a different compiler. +If you want to use gcc, it is recommended to use gcc12. You will also, as in NetBSD, need to install cmake, sqlite, boost and ragel packages. Using the example of gcc12 from pkg: installing the desired compiler: @@ -175,12 +176,6 @@ export CXX="/usr/local/bin/g++12" Then continue with the build as below. -A note about running in FreeBSD: if you built a dynamically linked binary -with an alternative compiler, the libraries specific to the compiler that -built the binary will probably not be found and the base distro libraries -in /lib will be found instead. Adjust LD_LIBRARY_PATH appropriately. For -example, with gcc12 installed from pkg, one would want to use -```export LD_LIBRARY_PATH=/usr/local/lib/gcc12/``` ## Configure & build From a0de5aaafed72a5ebcc7af4a5fa69cfa8c26ce3a Mon Sep 17 00:00:00 2001 From: "G.E." Date: Thu, 18 Apr 2024 16:16:06 +0300 Subject: [PATCH 4/4] tiny change to readme --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index d5f0892c..483b2cad 100644 --- a/README.md +++ b/README.md @@ -165,7 +165,6 @@ the environment variables to point to this compiler: export CC="/usr/local/bin/gcc" export CXX="/usr/local/bin/g++" ``` - A further note in FreeBSD, on the PowerPC and ARM platforms, the gcc12 package installs to a slightly different name, on FreeBSD/ppc, gcc12 will be found using: