Fix NetBSD build, more accurate readme instructions for BSD systems

This commit is contained in:
UnknownShadow200 2025-06-27 22:02:08 +10:00
parent 9069b33ded
commit c24ced908c
5 changed files with 23 additions and 48 deletions

View File

@ -35,7 +35,7 @@ jobs:
id: compile id: compile
shell: bash shell: bash
env: env:
COMMON_FLAGS: "-O1 -s -fno-stack-protector -fno-math-errno -Qn -Werror" COMMON_FLAGS: "-O1 -s -fno-stack-protector -fno-math-errno -Qn -Werror -Wl,-R/usr/X11R7/lib"
PLAT64_FLAGS: "-fno-pie -fvisibility=hidden -fcf-protection=none -rdynamic -I netbsd64/include -L netbsd64/lib -Wl,--unresolved-symbols=ignore-in-shared-libs" PLAT64_FLAGS: "-fno-pie -fvisibility=hidden -fcf-protection=none -rdynamic -I netbsd64/include -L netbsd64/lib -Wl,--unresolved-symbols=ignore-in-shared-libs"
run: | run: |
LATEST_FLAG=-DCC_COMMIT_SHA=\"${GITHUB_SHA::9}\" LATEST_FLAG=-DCC_COMMIT_SHA=\"${GITHUB_SHA::9}\"

View File

@ -116,7 +116,7 @@ endif
ifeq ($(PLAT),netbsd) ifeq ($(PLAT),netbsd)
CFLAGS += -I /usr/X11R7/include -I /usr/pkg/include CFLAGS += -I /usr/X11R7/include -I /usr/pkg/include
LDFLAGS = -L /usr/X11R7/lib -L /usr/pkg/lib -rdynamic LDFLAGS = -L /usr/X11R7/lib -L /usr/pkg/lib -rdynamic -Wl,-R/usr/X11R7/lib
LIBS = -lexecinfo -lGL -lX11 -lXi -lpthread LIBS = -lexecinfo -lGL -lX11 -lXi -lpthread
BUILD_DIR = build/netbsd BUILD_DIR = build/netbsd
BEARSSL = 1 BEARSSL = 1

View File

@ -2,6 +2,8 @@ Although most of the code is platform-independent, some per-platform functionali
By default `Core.h` tries to automatically define appropriate backends for your system. Define ```CC_BUILD_MANUAL``` to disable this. By default `Core.h` tries to automatically define appropriate backends for your system. Define ```CC_BUILD_MANUAL``` to disable this.
Note: Updating doesn't work properly in Windows 95 or Windows 98
## Before you start ## Before you start
* IEEE floating-point support is required. (Can be emulated in software, but will affect performance) * IEEE floating-point support is required. (Can be emulated in software, but will affect performance)
* The `int` data type must be 32-bits. * The `int` data type must be 32-bits.
@ -12,39 +14,6 @@ By default `Core.h` tries to automatically define appropriate backends for your
In summary, the codebase can theroetically be ported to any modern-ish hardware, but not stuff like a UNIVAC machine, the SuperFX chip on the SNES, or an 8-bit microcontroller. In summary, the codebase can theroetically be ported to any modern-ish hardware, but not stuff like a UNIVAC machine, the SuperFX chip on the SNES, or an 8-bit microcontroller.
## Supported platforms
#### Tier 1 support
These platforms are regularly tested on and have executables automatically compiled for.
|Platform|Testing|Support|
|--------|-------|-----|
|Windows x86/x64 | Mostly tested on 7+ | Should work in all Windows versions
|macOS x86/x64 | Mostly tested on 10.12 | Should work in all macOS versions since 10.3
|Linux x86/x64 | Mostly tested on Linux Mint | Should work in most Linux distributions
|Web client | Mostly tested in Chrome | Should work in all browsers with WebGL (including IE)
Note: Updating doesn't work properly in Windows 95 or Windows 98
#### Tier 2 support
The game has been compiled and run on these platforms before. It may or may not still compile for them.
I don't really test these platforms at all, only when I suspect some changes to the code might impact them.
|Platform|Machine|Notes|
|--------|-------|-----|
|macOS x86 | macOS 10.4 |
|FreeBSD x86 | FreeBSD | x64 should work too |
|NetBSD x86 | NetBSD | x64 should work too |
|OpenBSD x86 | OpenBSD | x64 should work too |
|Solaris x86 | OpenIndiana | x64 should work too |
|macOS PPC | macOS 10.3 | PPC64 completely untested |
|Linux PPC | Debian | Issues with colour channels incorrectly swapped? |
|Linux ARM | Raspberry pi | ARM64 should work too |
|Linux SPARC | Debian | Didn't really work due to lack of 24-bit colours |
|Linux Alpha | Debian |
|HaikuOS | Nightly |
## Porting ## Porting
Listed below are the requirements for implementing each platform-dependent file.<br> Listed below are the requirements for implementing each platform-dependent file.<br>
@ -116,3 +85,9 @@ Define:
- ```DEFAULT_NET_BACKEND CC_NET_BACKEND_LIBCURL``` - use libcurl for HTTP - ```DEFAULT_NET_BACKEND CC_NET_BACKEND_LIBCURL``` - use libcurl for HTTP
Supporting connection reuse is highly recommended. (but not required) Supporting connection reuse is highly recommended. (but not required)
### SSL
SSL and TLS support, plus basic certificate validation
Define:
- ```DEFAULT_SSL_BACKEND CC_SSL_BACKEND_BEARSSL``` - use BearSSL for SSL/TLS

View File

@ -323,31 +323,31 @@ Run `make saturn`. You'll need [libyaul](https://github.com/yaul-org/libyaul)
#### FreeBSD #### FreeBSD
1. Install `libxi`, `libexecinfo`, `curl` and `openal-soft` packages if needed 1. Install `gmake`, `libxi`, `libexecinfo`, `openssl` and `openal-soft` packages if needed
2. Run either: 2. Run either:
* `make freebsd` - produces a simple non-optimised executable, easier to debug * `gmake freebsd` - produces a simple non-optimised executable, easier to debug
* `make freebsd RELEASE=1` - produces an optimised executable, harder to debug * `gmake freebsd RELEASE=1` - produces an optimised executable, harder to debug
#### OpenBSD #### OpenBSD
1. Install `libexecinfo`, `curl` and `openal` packages if needed 1. Install `gmake`, `libexecinfo`, `openssl` and `openal` packages if needed
2. Run either: 2. Run either:
* `make openbsd` - produces a simple non-optimised executable, easier to debug * `gmake openbsd` - produces a simple non-optimised executable, easier to debug
* `make openbsd RELEASE=1` - produces an optimised executable, harder to debug * `gmake openbsd RELEASE=1` - produces an optimised executable, harder to debug
#### NetBSD #### NetBSD
1. Install `libexecinfo`, `curl` and `openal-soft` packages if needed 1. Install `gmake`, `libexecinfo`, `openssl` and `openal-soft` packages if needed
2. Run either: 2. Run either:
* `make netbsd` - produces a simple non-optimised executable, easier to debug * `gmake netbsd` - produces a simple non-optimised executable, easier to debug
* `make netbsd RELEASE=1` - produces an optimised executable, harder to debug * `gmake netbsd RELEASE=1` - produces an optimised executable, harder to debug
#### DragonflyBSD #### DragonflyBSD
1. Install `libxi`, `libexecinfo`, `curl` and `openal-soft` packages if needed 1. Install `gmake`, `libxi`, `libexecinfo`, `openssl` and `openal-soft` packages if needed
2. Run either: 2. Run either:
* `make dragonfly` - produces a simple non-optimised executable, easier to debug * `gmake dragonfly` - produces a simple non-optimised executable, easier to debug
* `make dragonfly RELEASE=1` - produces an optimised executable, harder to debug * `gmake dragonfly RELEASE=1` - produces an optimised executable, harder to debug
#### Solaris #### Solaris

View File

@ -1249,7 +1249,7 @@ void Logger_FailToStart(const char* raw_msg) {
#include <unwind.h> #include <unwind.h>
static _Unwind_Reason_Code UnwindFrame(struct _Unwind_Context* ctx, void* arg) { static _Unwind_Reason_Code UnwindFrame(struct _Unwind_Context* ctx, void* arg) {
cc_uintptr addr = _Unwind_GetIP(ctx); cc_uintptr addr = (cc_uintptr)_Unwind_GetIP(ctx);
if (!addr) return _URC_END_OF_STACK; if (!addr) return _URC_END_OF_STACK;
DumpFrame((cc_string*)arg, (void*)addr); DumpFrame((cc_string*)arg, (void*)addr);