Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports
Path: blob/main/emulators/fbsd-duckstation/files/patch-disable-pch.txt
18157 views
1
Disable PCH to work around the following errors on arm64:
2
3
In file included from /wrkdirs/usr/ports/emulators/fbsd-duckstation/work/duckstation-0.1-6937/src/util/audio_stream.cpp:9:
4
In file included from /wrkdirs/usr/ports/emulators/fbsd-duckstation/work/duckstation-0.1-6937/src/util/../common/error.h:6:
5
/wrkdirs/usr/ports/emulators/fbsd-duckstation/work/duckstation-0.1-6937/src/util/../common/small_string.h:353:3: error: non-const lvalue reference to type '__builtin_va_list' cannot bind to a value of unrelated type 'std::va_list' (aka 'std::__va_list')
6
353 | va_start(ap, format);
7
| ^~~~~~~~~~~~~~~~~~~~
8
/usr/include/sys/_stdarg.h:43:49: note: expanded from macro 'va_start'
9
43 | #define va_start(ap, last) __builtin_va_start((ap), (last))
10
| ^~~~
11
In file included from /wrkdirs/usr/ports/emulators/fbsd-duckstation/work/duckstation-0.1-6937/src/util/audio_stream.cpp:9:
12
In file included from /wrkdirs/usr/ports/emulators/fbsd-duckstation/work/duckstation-0.1-6937/src/util/../common/error.h:6:
13
/wrkdirs/usr/ports/emulators/fbsd-duckstation/work/duckstation-0.1-6937/src/util/../common/small_string.h:358:10: error: non-const lvalue reference to type '__builtin_va_list' cannot bind to a value of unrelated type 'std::va_list' (aka 'std::__va_list')
14
358 | va_end(ap);
15
| ^~
16
/usr/include/sys/_stdarg.h:49:40: note: expanded from macro 'va_end'
17
49 | #define va_end(ap) __builtin_va_end(ap)
18
| ^~
19
2 errors generated.
20
21
(see also: https://reviews.llvm.org/D18557 and https://github.com/llvm/llvm-project/issues/69524)
22
23
--- src/util/CMakeLists.txt.orig 2024-06-14 05:59:32 UTC
24
+++ src/util/CMakeLists.txt
25
@@ -74,7 +74,9 @@ add_library(util
26
zstd_byte_stream.cpp
27
)
28
29
-target_precompile_headers(util PRIVATE "pch.h")
30
+if(NOT((CMAKE_SYSTEM_NAME MATCHES "FreeBSD") AND (CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")))
31
+ target_precompile_headers(util PRIVATE "pch.h")
32
+endif()
33
target_include_directories(util PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/..")
34
target_include_directories(util PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/..")
35
target_link_libraries(util PUBLIC common simpleini imgui)
36
--- src/core/CMakeLists.txt.orig 2024-06-14 05:59:32 UTC
37
+++ src/core/CMakeLists.txt
38
@@ -133,7 +133,9 @@ set(NEWREC_SOURCES
39
cpu_newrec_compiler.h
40
)
41
42
-target_precompile_headers(core PRIVATE "pch.h")
43
+if(NOT((CMAKE_SYSTEM_NAME MATCHES "FreeBSD") AND (CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")))
44
+ target_precompile_headers(core PRIVATE "pch.h")
45
+endif()
46
target_include_directories(core PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/..")
47
target_include_directories(core PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/..")
48
target_link_libraries(core PUBLIC Threads::Threads common util ZLIB::ZLIB)
49
--- src/duckstation-qt/CMakeLists.txt.orig 2024-06-14 05:59:32 UTC
50
+++ src/duckstation-qt/CMakeLists.txt
51
@@ -169,7 +169,9 @@ add_executable(duckstation-qt ${SRCS} ${QM_FILES})
52
)
53
54
add_executable(duckstation-qt ${SRCS} ${QM_FILES})
55
-target_precompile_headers(duckstation-qt PRIVATE "pch.h")
56
+if(NOT((CMAKE_SYSTEM_NAME MATCHES "FreeBSD") AND (CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")))
57
+ target_precompile_headers(duckstation-qt PRIVATE "pch.h")
58
+endif()
59
target_include_directories(duckstation-qt PRIVATE "${Qt6Gui_PRIVATE_INCLUDE_DIRS}" "${CMAKE_CURRENT_SOURCE_DIR}")
60
target_link_libraries(duckstation-qt PRIVATE core common imgui minizip scmversion Qt6::Core Qt6::Gui Qt6::Widgets)
61
62
63