-
Notifications
You must be signed in to change notification settings - Fork 66
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
Libraryization #156
Libraryization #156
Conversation
NevolutionX.xbe shrunk by 0.2MiB, no files were added to the .iso - did I miss something or does this do magic? I also noted that I needed to add a link to |
(This was mostly answered in Discord already by others, but I'll still reply here for completeness)
This is expected, and one of the reasons behind this change. Atm the linker just links together all object files we pass to it, resulting in lots of dead code ending up in the binary. When using static libraries, lld is able to grab only the required object files from the libraries, resulting in the size reduction. When we switch all of nxdk to be built as libraries, I expect even higher gains.
I assume this is an issue of your setup - I didn't test on Debian, but the CI ran it on Ubuntu, macOS and Windows, where it worked fine. |
Sorry, I forgot for a moment that Debian is not one of this projects supported OSs, please disregard my comment about Anyhow, NevolutionX worked as expected with these changes - nice job! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Builds fine, runs fine and the makefile changes look sane.
@dracc I'm certainly interested in having nxdk build properly on Debian. What I meant was that I was suspecting it to be an issue of your specific setup - I have since tried the Debian Docker images though, and found out that it requires you to install the "llvm" package (in addition to clang and lld) to work. I added Debian-specific instructions to the Wiki. Interestingly, this doesn't seem to be an issue on Ubuntu - CI just installs the llvm package as a dependency. |
5e52c6f
to
c3db7ae
Compare
This has a conflict now. |
c3db7ae
to
25441ac
Compare
Which version of Ubuntu are you testing with? |
I've only tested Ubuntu via Travis CI, that should be 16.04. Do you have the package "llvm" installed (clang and lld don't seem to pull that in on Debian)? |
@@ -0,0 +1,18 @@ | |||
PDCLIB_SRCS := \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why isn't this in pdclib repository? It's ok to have here.
Why are you testing with such an old version? You can add a line in your config file to request that a more recent version be used.
Ya:
|
It's just the version nxdk currently uses. If I remember correctly the newer images weren't available when we first added CI. I looked into the issue in a Ubuntu Docker image, and it's a bug in Ubuntu's llvm-package, which I reported upstream. As a temporary workaround, |
25441ac
to
c1cabbf
Compare
Upstream contributor apparently has no intention of backporting a fix for this themselves. I also contacted doko (who uploaded the current revision) on freenode and they responded only with an URL (no context): "https://wiki.ubuntu.com/StableReleaseUpdates" - I believe they imply it does not qualify or we should contact the respective SRU people. We should have an issue about this after merge. I think this is fine and it should be merged; I have tested this and reviewed the code. |
Nice work, I think we can merge this as-is. @thrimbor are you planniing on doing this for the rest of the libraries as a seperate PR? |
@LukeUsher Yes, I plan to have all libraries actually build as libraries eventually. Some are more complicated to adjust though (like SDL, which has its Makefile in the submodule, so it requires an update to the submodule and nxdk before it can work) or were/are undergoing larger changes currently, so this PR is intentionally "incomplete" to avoid problems. |
This splits out
PDCLib
,hal
,Freetype
andSDL_ttf
to be built as libraries (others are untouched to avoid getting too many merge conflicts).I am well aware that this is still far from being a complete solution (everything is built with the same compiler flags, libs are automatically added by makefiles instead of the samples specifying their requirements, still the one large main Makefile, sub-Makefiles adding cleaning rules to the main Makefile via a variable etc.) - I consider this only a first step and, most importantly, a fix to get nxdk to build on msys2 again.