-
Notifications
You must be signed in to change notification settings - Fork 124
Various improvements #102
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
Various improvements #102
Conversation
XZ archives are more modern and smaller.
…tool The libtool script is installed in a separate package on some systems and is not necessary for psptoolchain.
This is the most modern version of GCC. It also brings new C++ versions. patch-gcc_cp_cfns.h is not needed anymore, because the new GCC version uses C++, which removes the sole purpose of that file. I've also disposed of old GCC patches. I've added ISL to GCC build, because it seems to provide some optimizations.
Hello, you have to also fix "prepare scripts", I had to manually install isl on MacOS (brew install isl) |
I think it tries to load both includes and libs from the build root (the use of |
I also think that if the same fix were applied to GMP, MPFR and MPC, there would be no need to install them manually on the system. |
Have you tested the new gcc? |
@carstene1ns yes, the SDK was built successfully, newlib was built successfully and so were the libraries I mean, there was not a big load of changes in the patches. I've been trying to port new binutils, but this one is a bigger deal. Also, I think GCC 8 is a good idea, because it can highlight visually (not only by character positions) which part of the line causes a warning/error. |
Sure, using a new GCC brings a lot of benefits. Would be nice to know, if a compiled example works on hardware. |
Also fix srcdir/builddir usage. This effectively removes the dependency on GMP, MPFR, MPC and ISL installed on the machine.
I would have to look for my hardware 😆. Anyway, I'm just finishing getting rid of some of errors you've highlighted. EDIT: I've pushed two more commits. The first one fixes ISL build problems and makes the build process not require GMP, MPFR, MPC or ISL. The second one removes repeated MIPS_ATYPE_HI. |
Now, they're installed automatically under the hood.
Also made it a little more verbose. A skeleton was added for future support of more package managers on Linux. The system does not use sudo (generally, such scripts should not use sudo), but issues a warning if sudo is not used where it should. The warning message is customized for the system. Removed dependency for automake 1.9 - it is no longer in Debian, which means it's high time the package using it was updated. The script is now safe to be run with a shell other than bash, like dash. The shebang on the top was changed to #!/bin/sh.
Unfortunately I have compilation error on MacOS High Sierra 10.13.4: make[2]: *** [addsf3.o] Error 1 make[2]: *** Waiting for unfinished jobs.... xgcc: error: subsf3: No such file or directory make[2]: *** [subsf3.o] Error 1 xgcc: error: negsf2: No such file or directory make[2]: *** [negsf2.o] Error 1` |
@dsieradzki that's worth some investigation. Try building a compiler manually (get the tarball, configure and make it manually) to see if it is an issue in macOS or in my build scripts. I've gotten it to work in a Docker container, so this is definitely not a dependency issue. |
Might be a race condition/dependency issue with parallel builds. |
@carstene1ns I'm building a huge script update and I opt for building one task at a time by default and only selecting more tasks if requested. Then we can focus on making it work normally and just drop in some fixes for parallel builds later. Also I believe the number of issues depends on the number of parallel jobs. EDIT: I'd even dare say the issue is random. |
* Changed the scripts to work under any shell, not just Bash. As a side task, removed all these spaces at the beginning of the files. This wasn't funny, really. * Reworked dependency scripts. Now they're verbose, but I guess they will be silenced later. * Completely new&shiny toolchain.sh! Accepting options on command line and not using environment variables, this one is completely usable with no intervention. Things like PSPDEV or PATH are set based on the command-line options. Of course, toolchain-local.sh and toolchain-sudo.sh have been reworked accordingly and work perfectly with new toolchain.sh. * Removed all usages of sudo. This is NOT a command a script should run. The script instead warns of invalid UID. * Removed all usages of unzip. No ZIP archives are used at the moment and the unzip tool is not standarized and does not support stripping the prefix (I guess it could be done by hand, but it would be a mess). * Removed num_cpus from common.sh. Now scripts should take the number of jobs from the $JOBS variable, set by toolchain.sh. This allows to customize the number of jobs to one's liking. * Removed common.sh from toolchain.sh. export -f is a nonstandard feature anyway. Now each script that needs common.sh includes it. I guess some functions from there could be removed later. * Added run_make to common.sh. This allows to customize options to make in one place. Also removed the -r flag from make because this seems to wreck readline build. * Parametrized most build scripts (for example, 007-gdb-7.3.1.sh was changed to 007-gdb.sh and the version is defined in a variable in the file header). * Merged all the patches for all packages into two patches: - pkg-version-PSP.patch PSP support patch - pkg-version-fixes.patch Bug fix patch (like wrong compiler options, etc.) Not all packages have the fixes patch. For these that have it, its existence is optional and checked. * Disposed of /etc/profile generation script. It was weird and did some assumptions about the host. * Git repository cloning algorithm now checks if the repository is already cloned, is not corrupted and is has the same remote URL. Only then pulls. This should help guard against older repositories. Also changed merge pull to rebase pull. * Various minor changes.
OK I've pushed the scripting system rework. I've tested it and it works. It's not from scratch, but only a rework of the existing tools, so I guess there shouldn't be any problems. |
… after download was finished
I'm going to use it for local testing and if someone made a GitLab mirror, it would automatically start testing.
I've created a Docker image for building PSP toolchain (not containing PSP toolchain). It can be used to build and run PSP toolchain in a deterministic, lean and supported environment. You can view it here, but as I said these are only the dependencies of PSP toolchain, not the actual toolchain. |
Fixed readline.h dependency check on Manjaro.
The if check gave an error if $USER is not set.
Don't rely on USER variable existing
Enable plugin support
I see the repo has become active again. If I cherry-pick all relevant commits, will this get merged? @dbeef |
Because the problem I see is that new changes are made against the old scripts, which in turn causes the scripts from this pull request to have conflicts. |
@top-sekret I was thinking about this PR, as you already noticed there are multiple conflicting changes introduced. Thus you definitely have to rebase your GCC script changes, as it has been upgraded to 9.3.0, and the newlib as of now is shipped from pspdev/newlib. For the Here's how I see it - as there is a ton of changes in shell scripts, a development branch would be created on I am calling @carstene1ns and @ooPo to discuss this, as this is only an opinion of mine. |
@dbeef OK, I've updated GCC and Newlib. I've also removed GitLab CI.
I will address the stale automake patch in a minute, and this seems to be the last commit to rebase since I've forked. |
I've ported all changes to my fork. |
Ok, so now @ooPo please create |
I upgraded to just the last version I could get before 2.24 because 2.24 was a nontrivial rewrite. Addressing 2.24 will be a matter of its own.
Merged to development branch. Half way done, now we need to do some testing. I invite you to the PSP homebrew discord server, there's a channel called EDIT: Wrong link, mistakenly sent "PlayStation Homebrew" server, not PSP specific. |
I am in for merging specific changes, but I generally dislike stuff like "here, take my script. it is better than yours". |
To add to what @carstene1ns is saying about the dependency script, yesterday night I found that the current dependency installation script for Ubuntu can be run in an automatic way, while the one in this PR will always need user input. The current script for installing MacOS dependencies is really old and probably doesn't even work anymore, though, while the one in the PR should work better for that. |
@carstene1ns I am sorry. I did not intend to express such an attitude, but I believe you may be right, so my apologies for it. When it comes to the Docker image, I believe the official Docker image didn't exist back then when I wrote it. You're absolutely right that it needs to be fixed. I can even do it if you point me to the correct Docker image. When it comes to the dependency script, I separated it into sections and filtered it a little. If it introduces some unnecessary dependencies or does not check for some required, then I can fix it. I rewrote the preparation script to unify it for all platforms. Regardless whether your doubts concern the script itself or the dependency lists contained inside, just let me address these issues. @sharkwouter Could you show me at what stage it requests user input? Would it be fixed by adding the After all, that's the point of |
Also, I just noticed, the Line 126 in 699b0b1
if command -v wget >/dev/null 2>&1
then
wget --continue -O libusb-legacy.tar.gz "$LIBUSB_URL"
elif command -v curl >/dev/null 2>&1
then
curl --continue-at - -o libusb-legacy.tar.gz "$LIBUSB_URL"
else
cat >&2 <<_EOF_
Error: no suitable downloader found.
Install one of these:
* wget (preferred) <https://www.gnu.org/software/wget/>
* curl <https://curl.haxx.se/>
_EOF_
exit 77
fi |
Yes, it asks you if you're sure when running apt install. I wasn't sure if this is intended, the original script does this too. The difference is that you can pass arguments to the original script, so you can just run |
Various improvements enhancing psptoolchain