Closed sl1pkn07 closed 6 years ago
How did you build and install your toolchain? Did you move the files after building the toolchain? I don't really know why it seems to find stdlib.h, but yet it cannot find your other header files (from common/include)....
Is bin2c from the PS2SDK in your path?
You probably need to update ps2toolchain.
Is bin2c from the PS2SDK in your path?
need test this. by default, search /usr/bin/bin2c, rigth?
in my system, bin2c is provide by other package (psp-sdk) i think need set in the makefile
BIN2C = bin2c
to
BIN2C = $(PS2SDK)/bin/bin2c
for use the rigth bin2c
greetings
EDIT: tested and works with BIN2C = $(PS2SDK)/bin/bin2c
in the main makefile (also with add the includes in the stubs makefiles, if not, fail like the first post)
I can make PR with this correction?
I think a change to the BIN2C variable within the Makefile is acceptable, but I still cannot understand why your toolchain has a problem with include paths.
@uyjulian, the Makefiles in question were last updated 14 years ago. If you can still build ps2-packer now and they could back then, then whether the toolchain was built in 2004 or not, is perhaps not an issue.
I have tested on Debian 9, with Make 4.1. I am able to build ps2-packer with no additional help. At the top-level (the whole ps2-packer), just the stubs and even just the zlib stub itself...
The Makefile for zlib does not specify additional instructions to include the actual PS2SDK headers, while GCC's internal paths will point to the Newlib headers. I think the stubs like the zlib stub are built with Newlib's headers, since GCC won't find the PS2SDK header files.
nozomi@Cephalon:~/ps2-packer$ echo | ee-gcc -E -Wp,-v -
GNU CPP version 3.2.3 (cpplib) [AL 1.1, MM 40] (MIPSel R5900 ELF)
#include "..." search starts here:
#include <...> search starts here:
/usr/local/ps2dev/ee/include
/usr/local/ps2dev/ee/lib/gcc-lib/ee/3.2.3/include
/usr/local/ps2dev/ee/ee/sys-include
/usr/local/ps2dev/ee/ee/include
End of search list.
# 1 "<stdin>"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "<stdin>"
If you somehow merged your PS2SDK EE header files with the ones from Newlib (but the header files under common/include are not included), then that would explain the error.
this is my output:
└───╼ echo | LC_ALL=C ee-gcc -E -Wp,-v -
GNU CPP version 3.2.3 (cpplib) [AL 1.1, MM 40] (MIPSel R5900 ELF)
ignoring nonexistent directory "/usr/lib/gcc-lib/ee/3.2.3/include"
ignoring nonexistent directory "/usr/lib/gcc-lib/ee/3.2.3/../../../../ee/sys-include"
ignoring nonexistent directory "/usr/lib/gcc-lib/ee/3.2.3/../../../../ee/include"
ignoring nonexistent directory "/usr/ps2/sdk/ee/ee/sys-include"
#include "..." search starts here:
#include <...> search starts here:
/usr/ps2/sdk/ee/include
/usr/ps2/sdk/ee/lib/gcc-lib/ee/3.2.3/include
/usr/ps2/sdk/ee/ee/include
End of search list.
# 1 "<stdin>"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "<stdin>"
It seems to me that your toolchain isn't installed properly (or at least, just not in the usual way):
So this implies that your $PS2SDK variable was set to $PS2DEV.
Personally, I don't think it's necessarily wrong... but because it doesn't allow common/include to be scanned while ps2sdk/ee/include/stdlib.h depends on files like tamtypes.h (which are in common/include), compilation of ps2-packer will break. This also causes the include paths to include header files from both Newlib and the PS2SDK's libc, which can cause problems.
└───╼ cat /etc/profile.d/ps2-sdk.sh
export PS2DEV="/usr/ps2"
export PS2SDK="$PS2DEV/sdk"
export PATH="$PATH:$PS2DEV/bin:$PS2SDK/bin"
Well then, I don't know why your GCC paths are as such. For example, if you have " /usr/ps2/sdk" as $PS2SDK, then why does "/usr/ps2/sdk/ee/ee/include" exist? Usually, that should exist under $PS2DEV.
I think rebuilding GCC with the correct $PS2DEV definition should fix your problem. But I'm not very proficient with diagnosing problems with GCC.
maybe because this?
ps2-gcc-base:
--prefix="/usr/ps2/sdk/${i}" \
ps2-gcc:
--with-headers="/usr/ps2/sdk/${i}/${i}/include"
i have my own script for use with my package manager
binutils: PKGBUILD.txt gcc-base: PKGBUILD.txt newlib: PKGBUILD.txt gcc: PKGBUILD.txt ps2sdk: PKGBUILD.txt
Yes, then that would make sense. I still don't know why you (and/or Ragnarok2040) must change the build directories, but that is the source of your problem. Perhaps Ragnarok2040 was using one of his custom SDKs.
It is true that our SDK has a problem with having 2 libc libraries which share similar files, but are not compatible with each other. But this unusual configuration only made that problem worse. Hence I cannot consider this an issue. But I wish you all the best with finding a good solution.
then the (full)paths of the includes is hardcoded in the code?
When you build GCC, the options you specify will be recorded and used for GCC's built-in header paths (include <...>). I think it is recorded in the GCC specs file, but it is not an environmental variable.
Since your $PS2SDK variable points to where your GCC and Newlib are installed to, you are having the EE headers for PS2SDK mixed up with Newlib's and GCC's. For now, this is not a good idea.
when try to build as-sis (with the latest ps2-sdk)
seems need add the ps2-sdk includes in the stubs makefile
then:
---cut---
how can fix it?
using linux and make 4.2.1
greetings