Compare commits

...

5 Commits

Author SHA1 Message Date
Steffen Winter b93206f038
Add missing linker flag for static links on FreeBSD
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=278551
2024-05-13 22:47:03 +02:00
Jakob P. Liljenberg ac62ba9de1
Merge pull request #840 from aristocratos/fix/zero_temp 2024-05-13 19:10:17 +02:00
Jakob P. Liljenberg 3f917c0412
Merge pull request #850 from acidghost/theme-comments 2024-05-13 19:08:45 +02:00
Andrea Jemmett 0127e8b3cd Fix comments in theme files 2024-05-12 16:09:09 +02:00
Jos Dehaes ebc86e9702 fix zero temp (#467) 2024-05-04 20:59:04 +02:00
4 changed files with 28 additions and 11 deletions

View File

@ -193,6 +193,12 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
INSTALL_RPATH "/usr/local/lib/gcc${GCC_VERSION_MAJOR}"
BUILD_WITH_INSTALL_RPATH TRUE
)
# The gcc compiler wrapper doesn't add '--eh-frame-hdr' on FreeBSD with static builds
# https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=278551
if(BTOP_STATIC)
target_link_options(btop PRIVATE LINKER:--eh-frame-hdr)
endif()
endif()
find_package(devstat REQUIRED)

View File

@ -97,17 +97,18 @@ ifneq ($(PLATFORM) $(ARCH),macos arm64)
endif
ifeq ($(STATIC),true)
ifeq ($(CXX_IS_CLANG) $(CLANG_WORKS),true true)
ifeq ($(CXX_IS_CLANG),true)
ifeq ($(shell $(CXX) -print-target-triple | grep gnu >/dev/null; echo $$?),0)
$(error $(shell printf "\033[1;91mERROR: \033[97m$(CXX) can't statically link glibc\033[0m"))
endif
else
override ADDFLAGS += -static-libgcc -static-libstdc++
endif
ifeq ($(PLATFORM_LC),linux)
override ADDFLAGS += -DSTATIC_BUILD -static -Wl,--fatal-warnings
else ifeq ($(PLATFORM_LC),freebsd)
override ADDFLAGS += -DSTATIC_BUILD
ifeq ($(PLATFORM_LC),$(filter $(PLATFORM_LC),freebsd linux))
override ADDFLAGS += -DSTATIC_BUILD -static
else
ifeq ($(CXX_IS_CLANG),false)
override ADDFLAGS += -static-libgcc -static-libstdc++
endif
endif
endif
@ -130,9 +131,13 @@ else ifeq ($(PLATFORM_LC),freebsd)
PLATFORM_DIR := freebsd
THREADS := $(shell getconf NPROCESSORS_ONLN 2>/dev/null || echo 1)
SU_GROUP := wheel
override ADDFLAGS += -lm -lkvm -ldevstat -Wl,-rpath=/usr/local/lib/gcc$(CXX_VERSION_MAJOR)
ifneq ($(STATIC),true)
override ADDFLAGS += -lstdc++
override ADDFLAGS += -lm -lkvm -ldevstat
ifeq ($(STATIC),true)
override ADDFLAGS += -lelf -Wl,--eh-frame-hdr
endif
ifeq ($(CXX_IS_CLANG),false)
override ADDFLAGS += -lstdc++ -Wl,rpath=/usr/local/lib/gcc$(CXX_VERSION_MAJOR)
endif
export MAKE = gmake
else ifeq ($(PLATFORM_LC),macos)

View File

@ -381,11 +381,16 @@ namespace Theme {
if (themefile.good()) {
Logger::debug("Loading theme file: " + filename);
while (not themefile.bad()) {
if (themefile.peek() == '#') {
themefile.ignore(SSmax, '\n');
continue;
}
themefile.ignore(SSmax, '[');
if (themefile.eof()) break;
string name, value;
getline(themefile, name, ']');
if (not Default_theme.contains(name)) {
themefile.ignore(SSmax, '\n');
continue;
}
themefile.ignore(SSmax, '=');
@ -394,6 +399,7 @@ namespace Theme {
if (themefile.peek() == '"') {
themefile.ignore(1);
getline(themefile, value, '"');
themefile.ignore(SSmax, '\n');
}
else getline(themefile, value, '\n');

View File

@ -448,7 +448,7 @@ namespace Cpu {
const int file_id = atoi(file.path().filename().c_str() + 4); // skip "temp" prefix
string file_path = file.path();
if (!s_contains(file_path, file_suffix)) {
if (!s_contains(file_path, file_suffix) or s_contains(file_path, "nvme")) {
continue;
}