Talk:PSL1GHT

From PS3 Developer wiki
Revision as of 11:28, 10 February 2012 by Defyboy (talk | contribs) (Created page with "I had trouble compiling the toolchain in cygwin, the issue was with binutils failing with this error: <pre> checking for int_least32_t... ../../libiberty/pex-unix.c: In funct...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

I had trouble compiling the toolchain in cygwin, the issue was with binutils failing with this error:

checking for int_least32_t... ../../libiberty/pex-unix.c: In function ‘pex_unix_exec_child’:
../../libiberty/pex-unix.c:549:2: warning: implicit declaration of function ‘spawnvpe’
../../libiberty/pex-unix.c:549:18: error: ‘_P_NOWAITO’ undeclared (first use in this function)
../../libiberty/pex-unix.c:549:18: note: each undeclared identifier is reported only once for each function it appears in
../../libiberty/pex-unix.c:551:2: warning: implicit declaration of function ‘spawnve’
Makefile:887: recipe for target `pex-unix.o' failed
make[2]: *** [pex-unix.o] Error 1
make[2]: Leaving directory `/home/TroyGerrie/ps3toolchain/build/binutils-2.21.1/build-ppu/libiberty'
Makefile:9242: recipe for target `all-libiberty' failed
make[1]: *** [all-libiberty] Error 2
make[1]: *** Waiting for unfinished jobs....

I managed to fix this with a dirty HACK on pex-unix.c to include the correct value, in retrospect I should have just defined it. You can replace patches/binutils-2.22-PS3.patch with this (you might wan't to clean the unpacked files out of your build/ dir first):

diff -burN --exclude=.git binutils-2.22/ld/emultempl/spuelf.em binutils-2.22-PS3/ld/emultempl/spuelf.em
--- binutils-2.22/ld/emultempl/spuelf.em	2011-01-13 08:06:22.000000000 -0500
+++ binutils-2.22-PS3/ld/emultempl/spuelf.em	2012-01-25 18:30:17.000000000 -0500
@@ -397,7 +397,11 @@
   argv[my_argc++] = "-T";
   argv[my_argc++] = auto_overlay_file;
   argv[my_argc] = 0;
+#if defined(_WIN32)
+  execvp (argv[0], (const char* const*) argv);
+#else
   execvp (argv[0], (char *const *) argv);
+#endif
   perror (argv[0]);
   _exit (127);
 }
diff -burN --exclude=.git binutils-2.22/libiberty/pex-unix.c binutils-2.22-PS3/libiberty/pex-unix.c
--- binutils-2.22/libiberty/pex-unix.c	2011-01-04 10:05:58.000000000 +1300
+++ binutils-2.22-PS3/libiberty/pex-unix.c	2012-02-10 22:07:45.443501700 +1300
@@ -546,9 +546,9 @@
       typedef const char * const *cc_cp;
 
       if (flags & PEX_SEARCH)
-	pid = spawnvpe (_P_NOWAITO, executable, (cc_cp)argv, (cc_cp)env);
+	pid = spawnvpe (3, executable, (cc_cp)argv, (cc_cp)env);
       else
-	pid = spawnve (_P_NOWAITO, executable, (cc_cp)argv, (cc_cp)env);
+	pid = spawnve (3, executable, (cc_cp)argv, (cc_cp)env);
 
       if (pid > 0)
 	break;