Skip to content

Early support of the Saigo toolchain #981

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

Merged
merged 4 commits into from
Nov 23, 2024
Merged

Conversation

illwieckz
Copy link
Member

@illwieckz illwieckz commented Dec 3, 2023

Continuing the work done in:

How to use

Use this game branch too:

Get the Saigo toolchain, see:

Symlink the native_client/toolchain/linux_x86/saigo_newlib folder into external_deps/linux-amd64-default_10.

Then do:

mkdir build/vms-saigo
cd build/vms-saigo
cmake ../.. -DUSE_NACL_SAIGO=ON -DBUILD_GAME_NACL=ON -DBUILD_GAME_NACL_TARGETS=native \
	-DBUILD_GAME_NATIVE_DLL=OFF -DBUILD_GAME_NATIVE_EXE=OFF \
	-DBUILD_CLIENT=OFF -DBUILD_SERVER=OFF -DBUILD_TTY_CLIENT=OFF \
&& make -j$(nproc)

Current status

  • ✅️: success
  • ❌️: failure
  • ❔️: not tested
sgame amd64 i686 armhf
build ✅️ ✅️ ✅️
link ✅️ ✅️ ✅️
run ✅️ ❔️ ❔️
cgame amd64 i686 armhf
build ✅️ ✅️ ✅️
link ✅️ ✅️ ✅️
run ✅️ ❔️ ❔️

@illwieckz
Copy link
Member Author

illwieckz commented Dec 3, 2023

sgame status

Currently the sgame builds and links for all architectures.

I have tested the amd64 sgame and it runs.

cgame status

The cgame builds for all architectures but the final linkage fails.

To fix this we may build freetype, libpng and lua with Saigo (PNaCl provided a pexe .a for them we can't use since Saigo directly builds nexe without any pexe intermediary step).

It is believed this is the last thing required to achieve cgame building with Saigo.

@illwieckz illwieckz force-pushed the illwieckz/saigo/sync branch 3 times, most recently from 7144715 to 61b44c2 Compare December 3, 2023 02:52
@slipher
Copy link
Member

slipher commented Dec 3, 2023

You can find the old repository with scripts and sometimes patches for building the PNaCl libraries here. Also there is a nice summary.

@illwieckz
Copy link
Member Author

At first I hoped this was for building the NaCl libc. 🥲️

@illwieckz illwieckz force-pushed the illwieckz/saigo/sync branch from 61b44c2 to 4e5b48c Compare December 3, 2023 23:57
@illwieckz illwieckz force-pushed the illwieckz/saigo/sync branch 2 times, most recently from fca5c0f to 4f754ac Compare November 15, 2024 23:04
@illwieckz illwieckz changed the title WIP: Saigo toolchain Early support of the Saigo toolchain Nov 15, 2024
@illwieckz illwieckz marked this pull request as ready for review November 15, 2024 23:06
@illwieckz
Copy link
Member Author

More should be done later. The cgame still doesn't build because we would also need to build some dependencies like zlib with Saigo, but the current status is good enough to be merged and avoid piling merge conflicts with it in the future.

@@ -335,8 +337,10 @@ static void CrashHandler(const void* data, size_t n)

void SetupCrashHandler()
{
#if !defined(__saigo__)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this removed? It's the only debugging mechanism we have for NaCl.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably because I didn't make it work.

@slipher
Copy link
Member

slipher commented Nov 17, 2024

I think we should be able to avoid zlib by adjusting the Freetype configuration. zlib is only depended on from functions concerning gzip support. Don't think that's something we need but I could be wrong

@illwieckz
Copy link
Member Author

I think we should be able to avoid zlib by adjusting the Freetype configuration. zlib is only depended on from functions concerning gzip support. Don't think that's something we need but I could be wrong

I can build with Saigo freetype without libpng and without zlib in cgame and get it run properly.

@illwieckz
Copy link
Member Author

illwieckz commented Nov 19, 2024

So, this looks ready to me, it is known to be able to build a full game (cgame+sgame) that runs once other PRs taking care of other topic are merged. So these two PRs centered on the toolchain itself are good.

Improvements, like investigating and possibly re-enabling SetupCrashHandler() with Saigo can be done later in future PRs.

@illwieckz
Copy link
Member Author

illwieckz commented Nov 19, 2024

sgame status

The sgame builds and links for all architectures.

I have tested the amd64 sgame and it runs.

cgame status

The cgame builds and links for all architectures.

I have tested the amd64 cgame and it runs.

The cgame also requires this to build:

@illwieckz illwieckz force-pushed the illwieckz/saigo/sync branch from b05ea3c to 8fe1b18 Compare November 19, 2024 23:38
@illwieckz illwieckz force-pushed the illwieckz/saigo/sync branch 5 times, most recently from 3c91fa0 to 2faaeba Compare November 20, 2024 01:15
@slipher
Copy link
Member

slipher commented Nov 22, 2024

LGTM

@illwieckz illwieckz force-pushed the illwieckz/saigo/sync branch from 2faaeba to 80e8006 Compare November 23, 2024 18:58
@illwieckz illwieckz merged commit e124fe0 into master Nov 23, 2024
9 checks passed
@illwieckz illwieckz deleted the illwieckz/saigo/sync branch November 23, 2024 19:23
@illwieckz illwieckz restored the illwieckz/saigo/sync branch November 23, 2024 19:23
@illwieckz illwieckz deleted the illwieckz/saigo/sync branch November 23, 2024 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants