-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Initial support for building on FreeBSD #12996
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
05d64da
34e51bc
46adf1d
e8e5b0a
71345e2
aa14c60
203130c
54c732d
96d1820
af96b2c
65fb8d0
9810d44
49560a5
c829cc9
bbb27ec
e8770e8
41e6bf3
7347184
d502f3f
0278fe2
c37d609
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| # Copyright (C) 1995-2023, Rene Brun and Fons Rademakers. | ||
| # All rights reserved. | ||
| # | ||
| # For the licensing terms see $ROOTSYS/LICENSE. | ||
| # For the list of contributors see $ROOTSYS/README/CREDITS. | ||
|
|
||
| set(ROOT_PLATFORM freebsd) | ||
|
|
||
| if(CMAKE_SYSTEM_PROCESSOR MATCHES x86_64 OR CMAKE_SYSTEM_PROCESSOR MATCHES amd64) | ||
| set(ROOT_ARCHITECTURE freebsdamd64) | ||
| elseif(CMAKE_SYSTEM_PROCESSOR MATCHES i686) | ||
| set(FP_MATH_FLAGS "-msse2 -mfpmath=sse") | ||
| set(ROOT_ARCHITECTURE freebsdi686) | ||
| elseif(CMAKE_SYSTEM_PROCESSOR MATCHES aarch64) | ||
| set(ROOT_ARCHITECTURE freebsdarm64) | ||
| elseif(CMAKE_SYSTEM_PROCESSOR MATCHES arm) | ||
| set(ROOT_ARCHITECTURE freebsdarm) | ||
| elseif(CMAKE_SYSTEM_PROCESSOR MATCHES ppc64 OR | ||
| CMAKE_SYSTEM_PROCESSOR MATCHES powerpc64 OR | ||
| CMAKE_SYSTEM_PROCESSOR MATCHES powerpc64le) | ||
| set(ROOT_ARCHITECTURE freebsdppc64) | ||
| elseif(CMAKE_SYSTEM_PROCESSOR MATCHES s390x) | ||
| set(ROOT_ARCHITECTURE freebsds390x) | ||
| elseif(CMAKE_SYSTEM_PROCESSOR MATCHES s390) | ||
| set(ROOT_ARCHITECTURE freebsds390) | ||
| elseif(CMAKE_SYSTEM_PROCESSOR MATCHES riscv64) | ||
| set(ROOT_ARCHITECTURE freebsdriscv64) | ||
| else() | ||
| message(FATAL_ERROR "Unknown processor: ${CMAKE_SYSTEM_PROCESSOR}") | ||
| endif() | ||
|
|
||
| # JIT must be able to resolve symbols from all ROOT binaries. | ||
| set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -rdynamic") | ||
|
|
||
| # Set developer flags | ||
| if(dev) | ||
| # Warnings are errors. | ||
| set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") | ||
|
|
||
| # Do not relink just because a dependent .so has changed. | ||
| # I.e. relink only if a header included by the libs .o-s has changed, | ||
| # whether or not that header "belongs" to a different .so. | ||
| set(CMAKE_LINK_DEPENDS_NO_SHARED On) | ||
|
|
||
| # Split debug info for faster builds. | ||
| if(NOT gnuinstall) | ||
| # We won't install DWARF files. | ||
| set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -gsplit-dwarf") | ||
| endif() | ||
|
|
||
| if(_BUILD_TYPE_UPPER MATCHES "DEB") | ||
| message(STATUS "Using ld.lld linker with gdb-index") | ||
| set(GDBINDEX "-Wl,--gdb-index") | ||
| else() | ||
| message(STATUS "Using ld.lld linker without gdb-index") | ||
| endif() | ||
|
|
||
| set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${GDBINDEX}") | ||
| set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${GDBINDEX}") | ||
| set(LLVM_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${GDBINDEX}") | ||
| set(LLVM_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${GDBINDEX}") | ||
| endif() | ||
|
|
||
| if(CMAKE_COMPILER_IS_GNUCXX) | ||
| set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe ${FP_MATH_FLAGS} -Wshadow -Wall -W -Woverloaded-virtual -fsigned-char") | ||
| set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pipe -Wall -W") | ||
| set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -std=legacy") | ||
|
|
||
| set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined -Wl,--hash-style=\"both\"") | ||
|
|
||
| if(asan) | ||
| # See also core/sanitizer/README.md for what's happening. | ||
| execute_process(COMMAND ${CMAKE_CXX_COMPILER} --print-file-name=libclang_rt.asan-x86_64.so OUTPUT_VARIABLE ASAN_RUNTIME_LIBRARY OUTPUT_STRIP_TRAILING_WHITESPACE) | ||
| set(ASAN_EXTRA_CXX_FLAGS -fsanitize=address -fno-omit-frame-pointer -fsanitize-recover=address) | ||
| set(ASAN_EXTRA_SHARED_LINKER_FLAGS "-fsanitize=address -z undefs") | ||
| set(ASAN_EXTRA_EXE_LINKER_FLAGS "-fsanitize=address -z undefs -Wl,--undefined=__asan_default_options -Wl,--undefined=__lsan_default_options -Wl,--undefined=__lsan_default_suppressions") | ||
| endif() | ||
|
|
||
| elseif(CMAKE_CXX_COMPILER_ID STREQUAL Clang) | ||
| set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe ${FP_MATH_FLAGS} -Wall -W -Woverloaded-virtual -fsigned-char") | ||
| set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pipe -Wall -W") | ||
| set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -std=legacy") | ||
|
|
||
| if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8) | ||
| set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wshadow") | ||
| endif() | ||
|
|
||
| set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined") | ||
|
|
||
| if(asan) | ||
| # See also core/sanitizer/README.md for what's happening. | ||
| execute_process(COMMAND ${CMAKE_CXX_COMPILER} --print-file-name=libclang_rt.asan-x86_64.so OUTPUT_VARIABLE ASAN_RUNTIME_LIBRARY OUTPUT_STRIP_TRAILING_WHITESPACE) | ||
| set(ASAN_EXTRA_CXX_FLAGS -fsanitize=address -fno-omit-frame-pointer -fsanitize-address-use-after-scope) | ||
| set(ASAN_EXTRA_SHARED_LINKER_FLAGS "-fsanitize=address -static-libsan -z undefs") | ||
| set(ASAN_EXTRA_EXE_LINKER_FLAGS "-fsanitize=address -static-libsan -z undefs -Wl,--undefined=__asan_default_options -Wl,--undefined=__lsan_default_options -Wl,--undefined=__lsan_default_suppressions") | ||
| endif() | ||
| endif() |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,6 +20,11 @@ | |
|
|
||
| #undef R__DLLEXPORT | ||
|
|
||
| #ifdef __FreeBSD__ | ||
| char* __progname; | ||
| char** environ; | ||
|
Comment on lines
+24
to
+25
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. possibly, this is a "legacy" fix from the port maintainer, it is needed and sufficient (it seems). I think maybe for some reason the symbols needed to be visible for lld, possibly some subtle difference with ld. |
||
| #endif | ||
|
|
||
| #include "TROOT.h" | ||
| #include "TCling.h" | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw some other usages of the procfs filesystem typically mounted on
/procon Linux, namely in:proof/,rootx/andbindings/pyroot/cppyy/directoriesconfig/thisroot.shfileMaybe we should take a look into those too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
config/thisroot.sh should work as it is
rootx I'll fix, but is there no common library/place to define GetExePath (and the like) once for all components?
proof and python I'll leave for later as I have no use for those. Someone will contribute a patch if there is need:)