Skip to content

New tcc, full 64 bits, work and tested on Windows, Linux and MacOS#200

Merged
RetroAntho merged 133 commits intoalekmaul:upgradefrom
kobenairb:pvsneslib_runners
Apr 17, 2023
Merged

New tcc, full 64 bits, work and tested on Windows, Linux and MacOS#200
RetroAntho merged 133 commits intoalekmaul:upgradefrom
kobenairb:pvsneslib_runners

Conversation

@kobenairb
Copy link
Copy Markdown
Contributor

@kobenairb kobenairb commented Apr 16, 2023

Overview

This release includes significant updates and optimizations, primarily focused on refactoring and improving the build process. It also includes improvements to the optimization tools for tcc.

Changes

  • Refactored almost all the Makefiles:
    • Added parallel compilation for the compiler part (not working for tools due to snesbrr priorities, I'll check it later. Same for snes-examples)
    • Refactored and optimized
    • All the tools are now static (except snesbbr) for Windows and Linux. For Mac, it's not feasible because it doesn't provide any static library :(.
    • Updated the PHONY. Now everything is clean before building.
  • Optimized the optimization tool for tcc:
    • 816-opt is now in C language and use pcre instead of regex for better portability. So python is not needed.
    • Added version information, consistent with other tools.
  • Removed warnings during the compilation of snesbrr.
  • Full 64-bit support.
  • TCC is now in version 0.9.26 and 64-bit. I will continue to update to 0.9.27 later.
  • New runner pvsneslib_build_package.yml.
    • All is managed. The name of the release changed a bit. Now it's in this form:
      • For Linux: pvsneslib_x86_64_linux.zip
      • For Windows: pvsneslib_x86_64_windows.zip
      • For MacOS: pvsneslib_x86_64_darwin.zip
        What about the version? "it's like the port-salut, it's written on it". Sorry, it's a French reference on cheeses.
        In this case, it is written in the version file. Right I stuck to make the upload part working, I'll take a look later.
        I have no idea what is supposed to do. I'll try it later.

Testing

The release has been tested on:

  • Fedora 37 (locally)
  • Windows, Ubuntu and MacOS in latest version (via runner pvsneslib_build_package). See my runners here.
  • Each ROM provided in the examples was manually tested locally.

Caveats

  • This version has not yet been tested on Mac M1.
  • This version is not likely to work on 32-bit operating systems. But it's maybe already working. I checked for all libs dependencies and it seems it only uses native lib on linux and system32 libs on windows. For Mac, it's not possible.
  • Additional testing is required on a representative game.
  • the upload part for the runners is like blurry for me, I'll try to do it later.
  • Windows: the build process may not work on Windows in native windows, mingw or MSVC.
    • Here more details from my last comment with @RetroAntho:

    Finally my workaround is to remove "MSYS Makefiles". Why? because it's only working when we use the
    mingw toolchain on Windows which is not POSIX, then "MSYS Makefiles" is not available. As I built wla-dx by using the POSIX package in MSYS2, this generator doesn't exist. I tried to switch on the mingw toolchain but it procuced a lot of warning during compilation: I have to modify tcc because the -ldl is not recognized by the no posix linker. For 816-opt when I had to modify -lpcre and -lpcreposix by respectively -lpcre.dll and -lpcreposix.dll (and then even with static, the pcre.dll became non static). I had the best results by using the POSIX version for MSYS2.

here the report of 'is it static or dynamic' in my last runner : See the step "Build & Release PVSNESLIB for xxxx" for each OS. Now snesbrr is indeed full static.

  • I haven't harmonized the docker containers yet. I do this for the first few days:
    • remove the 32 bit part
    • add pcre dependencies and build tools from docs
    • change the release function to use make release
  • The wiki is not up to date, I will check with @anthretro as soon as it becomes available.
  • This version uses MSYS2 for windows. I have no idea if it works on mingw. It should but I haven't tested it. To my knowledge, the main difference between the two is that mingw already contains a set of compilation tools where MSYS2 is an empty box with just the binutils.
  • The pvsneslib_build_package.yml uses the branch pvsneslib_runners. So an adaptation is need (maybe change it to the develop branch).
  • documentation using latex and texi2html is only tested for Linux and MacOS. I'll take a look later in add it to Windows.
  • the Macos runner can be long to run. It's due to the brew update, sometimes it can be very fast, sometimes not.

Pitfalls

  • A 64-bit operating system is required. Maybe not because Windows seems to use 32 libs (system32) and linux uses native libs, so it should be work on 32 or 64 bits platforms. For MacOS, it's no way.
  • Those who were using XP 32-bit and made their .bat instead of using make may encounter issues.
  • heavily tested via different ways but I may have missed something

I will continue updating tcc in the next few days, but I really need community feedback on this release. I am confident in its stability, but one can never be too sure.

If this PR seems too important, can you create a testing branch, I will rebase my PR on this one. The cherry pick here seems quite tense to me to achieve.

Feedback from people who work on big games would really be a plus. I can eventually build a release for each OS and put them on a drive for those who don't have the time or don't want to do it themselves.

The main advantage of this change is to erase the technical debt of this project due to its legacy.

Please contact me with any issues or feedback here or on discord.

Peace.

A big thank you to @RetroAntho for his availability and his feedback.

@RetroAntho RetroAntho changed the base branch from develop to upgrade April 17, 2023 12:37
@RetroAntho RetroAntho merged commit bec12ca into alekmaul:upgrade Apr 17, 2023
@kobenairb kobenairb mentioned this pull request Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants