When running make for the different libs I got warnings for implicit declaration of functions.
I am not an expert on C/C++, but I understand these are because the source code is not including the declaration of the functions.
So, I searched for the proper header files and modified the source code to include them.
source/elfloader.c:690:3: warning: implicit declaration of function 'munmap' is invalid in C99 [-Wimplicit-function-declaration]
munmap(elf->data,elf->size);
^
For libps4link:
source/jailbreak.c:119:2: warning: implicit declaration of function 'debugNetPrintf' is invalid in C99 [-Wimplicit-function-declaration]
debugNetPrintf(3,"td %x",td);
^
source/jailbreak.c:126:6: warning: implicit declaration of function 'syscall' is invalid in C99 [-Wimplicit-function-declaration]
ret=syscall(11,jailbreak,td,dump);
^
For liborbisAudio:
source/orbisAudio.c:381:3: warning: implicit declaration of function 'sleep' is invalid in C99 [-Wimplicit-function-declaration]
sleep(2);
^
For liborbisKeyboard:
source/orbisKeyboard.c:619:2: warning: implicit declaration of function 'sleep' is invalid in C99 [-Wimplicit-function-declaration]
sleep(1);
^
Pending implicit declarations
There are two pending implicit declarations that I don't know how to solve properly. These are not solved by this PR:
For libps4link:
source/commands.c:679:6: warning: implicit declaration of function 'sysctl' is invalid in C99 [-Wimplicit-function-declaration]
if(sysctl(mib,4,NULL,&len,NULL,0)!=-1)
^
source/commands.c:732:6: warning: implicit declaration of function 'ptrace' is invalid in C99 [-Wimplicit-function-declaration]
ret=ptrace(PT_ATTACH,i,NULL,NULL);
^
ps4/kernel.h is included on source/commands.c:27 (before sys/sysctl.h and sys/ptrace.h)
Based on this I conclude that including ps4/kernel.h before sys/sysctl.h and sys/ptrace.h makes sysctl and ptrace to not be defined.
I tried moving the #include <sys/sysctl.h> before the #include <ps4/kernel.h>. This seems to work for sysctl.
I also tried moving the #include <sys/ptrace.h> before the #include <ps4/kernel.h>. But this resulted in 4 errors:
source/commands.c:500:10: error: use of undeclared identifier 'TRUE'
return TRUE;
^
source/commands.c:505:10: error: use of undeclared identifier 'FALSE'
return FALSE;
^
source/commands.c:524:13: error: use of undeclared identifier 'TRUE'
return TRUE;
^
source/commands.c:529:9: error: use of undeclared identifier 'FALSE'
return FALSE;
^
source/jailbreak.c is deprecated is old stuff for dlopen for 1.76 and it is not used. Many fuctions used on libraries are resolved on linking time against kernel and sce stubs libraries so dont worry.
When running
make
for the different libs I got warnings for implicit declaration of functions. I am not an expert on C/C++, but I understand these are because the source code is not including the declaration of the functions. So, I searched for the proper header files and modified the source code to include them.Used dependencies
firmware505
branch of https://github.com/psxdev/ps4sdk (at commit df03b9fd274ec5dabf105a07e6cb9f0bf6685801).Solved implicit declarations
For
libelfloader
:For
libps4link
:For
liborbisAudio
:For
liborbisKeyboard
:Pending implicit declarations
There are two pending implicit declarations that I don't know how to solve properly. These are not solved by this PR: For
libps4link
:In my attempts of solving these, I figured:
sys/sysctl.h
is already included on source/commands.c:34sys/ptrace.h
is already included on source/commands.c:36sysctl
is on sys/sysctl.h:793 when_KERNEL
is not defined sys/sysctl.h:789ptrace
is on sys/ptrace.h:188 when_KERNEL
is not defined sys/ptrace.h:183_KERNEL
is defined on ps4/kernel.h:3ps4/kernel.h
is included on source/commands.c:27 (beforesys/sysctl.h
andsys/ptrace.h
)Based on this I conclude that including
ps4/kernel.h
beforesys/sysctl.h
andsys/ptrace.h
makessysctl
andptrace
to not be defined.I tried moving the
#include <sys/sysctl.h>
before the#include <ps4/kernel.h>
. This seems to work forsysctl
. I also tried moving the#include <sys/ptrace.h>
before the#include <ps4/kernel.h>
. But this resulted in 4 errors:For this I figured:
sys/param.h
TRUE
andFALSE
are defined from sys/param.h:101 only when_KERNEL
is defined on sys/param.h:93Based on this I conclude that including
sys/ptrace.h
beforeps4/kernel.h
makesTRUE
andFALSE
to not be defined.I don't see a solution to this problem without modifying
sys/ptrace.h
orps4/kernel.h
. Any ideas?