ccrypt icon indicating copy to clipboard operation
ccrypt copied to clipboard

Can't compile

Open Lunyyx opened this issue 4 years ago • 0 comments

Hello, when I try to compile, I get this error:

mkdir -p obj
arm-none-eabi-gcc -c -o obj/compat.o src/compat.c -fshort-wchar -fomit-frame-pointer -ffast-math -std=gnu99 -Os -ffunction-sections -g -mword-relocations -march=armv6k -mtune=mpcore -mlittle-endian -I../include
arm-none-eabi-gcc -c -o obj/main.o src/main.c -fshort-wchar -fomit-frame-pointer -ffast-math -std=gnu99 -Os -ffunction-sections -g -mword-relocations -march=armv6k -mtune=mpcore -mlittle-endian -I../include
arm-none-eabi-gcc -c -o obj/mkhax.o src/mkhax.c -fshort-wchar -fomit-frame-pointer -ffast-math -std=gnu99 -Os -ffunction-sections -g -mword-relocations -march=armv6k -mtune=mpcore -mlittle-endian -I../include
src/mkhax.c: In function 'do_gshax_copy':
src/mkhax.c:93:21: warning: passing argument 1 of 'compat.app.memcpy' makes pointer from integer without a cast [-Wint-conversion]
   93 |   compat.app.memcpy(0x18401000, 0x18401000, 0x10000);
      |                     ^~~~~~~~~~
      |                     |
      |                     int
src/mkhax.c:93:21: note: expected 'void *' but argument is of type 'int'
src/mkhax.c:93:33: warning: passing argument 2 of 'compat.app.memcpy' makes pointer from integer without a cast [-Wint-conversion]
   93 |   compat.app.memcpy(0x18401000, 0x18401000, 0x10000);
      |                                 ^~~~~~~~~~
      |                                 |
      |                                 int
src/mkhax.c:93:33: note: expected 'const void *' but argument is of type 'int'
src/mkhax.c:94:36: warning: passing argument 1 of 'compat.app.GSPGPU_FlushDataCache' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
   94 |   compat.app.GSPGPU_FlushDataCache(src, len);
      |                                    ^~~
src/mkhax.c:94:36: note: expected 'void *' but argument is of type 'const void *'
src/mkhax.c:97:36: warning: passing argument 1 of 'compat.app.GSPGPU_FlushDataCache' makes pointer from integer without a cast [-Wint-conversion]
   97 |   compat.app.GSPGPU_FlushDataCache(0x18401000, 16);
      |                                    ^~~~~~~~~~
      |                                    |
      |                                    int
src/mkhax.c:97:36: note: expected 'void *' but argument is of type 'int'
src/mkhax.c:98:37: warning: passing argument 2 of 'compat.app.GX_SetTextureCopy' makes pointer from integer without a cast [-Wint-conversion]
   98 |   compat.app.GX_SetTextureCopy(dst, 0x18401000, 0x40, 0, 0, 0, 0, 8);
      |                                     ^~~~~~~~~~
      |                                     |
      |                                     int
src/mkhax.c:98:37: note: expected 'void *' but argument is of type 'int'
src/mkhax.c:99:21: warning: passing argument 1 of 'compat.app.memcpy' makes pointer from integer without a cast [-Wint-conversion]
   99 |   compat.app.memcpy(0x18401000, 0x18401000, 0x10000);
      |                     ^~~~~~~~~~
      |                     |
      |                     int
src/mkhax.c:99:21: note: expected 'void *' but argument is of type 'int'
src/mkhax.c:99:33: warning: passing argument 2 of 'compat.app.memcpy' makes pointer from integer without a cast [-Wint-conversion]
   99 |   compat.app.memcpy(0x18401000, 0x18401000, 0x10000);
      |                                 ^~~~~~~~~~
      |                                 |
      |                                 int
src/mkhax.c:99:33: note: expected 'const void *' but argument is of type 'int'
src/mkhax.c: In function 'arm11_kernel_exploit_setup':
src/mkhax.c:132:53: warning: passing argument 2 of 'compat.app.svcControlMemory' makes integer from pointer without a cast [-Wint-conversion]
  132 |  compat.app.svcControlMemory(&tmp_addr, mem_hax_mem + 0x4000, 0, 0x1000, 1, 0); // free page
      |                                         ~~~~~~~~~~~~^~~~~~~~
      |                                                     |
      |                                                     void *
src/mkhax.c:132:53: note: expected 'unsigned int' but argument is of type 'void *'
src/mkhax.c:133:53: warning: passing argument 2 of 'compat.app.svcControlMemory' makes integer from pointer without a cast [-Wint-conversion]
  133 |  compat.app.svcControlMemory(&tmp_addr, mem_hax_mem + 0x1000, 0, 0x2000, 1, 0); // free page
      |                                         ~~~~~~~~~~~~^~~~~~~~
      |                                                     |
      |                                                     void *
src/mkhax.c:133:53: note: expected 'unsigned int' but argument is of type 'void *'
src/mkhax.c:143:53: warning: passing argument 2 of 'compat.app.svcControlMemory' makes integer from pointer without a cast [-Wint-conversion]
  143 |  compat.app.svcControlMemory(&tmp_addr, mem_hax_mem + 0x1000, 0, 0x2000, 0x10003, 1 | 2);
      |                                         ~~~~~~~~~~~~^~~~~~~~
      |                                                     |
      |                                                     void *
src/mkhax.c:143:53: note: expected 'unsigned int' but argument is of type 'void *'
src/mkhax.c:144:53: warning: passing argument 2 of 'compat.app.svcControlMemory' makes integer from pointer without a cast [-Wint-conversion]
  144 |  compat.app.svcControlMemory(&tmp_addr, mem_hax_mem + 0x2000, 0, 0x1000, 1, 0); // free page
      |                                         ~~~~~~~~~~~~^~~~~~~~
      |                                                     |
      |                                                     void *
src/mkhax.c:144:53: note: expected 'unsigned int' but argument is of type 'void *'
src/mkhax.c:160:53: warning: passing argument 2 of 'compat.app.svcControlMemory' makes integer from pointer without a cast [-Wint-conversion]
  160 |  compat.app.svcControlMemory(&tmp_addr, mem_hax_mem + 0x1000, 0, 0x1000, 1, 0);
      |                                         ~~~~~~~~~~~~^~~~~~~~
      |                                                     |
      |                                                     void *
src/mkhax.c:160:53: note: expected 'unsigned int' but argument is of type 'void *'
src/mkhax.c: In function 'patch_srv_access':
src/mkhax.c:309:28: warning: passing argument 1 of 'arm11_kernel_exploit_exec' from incompatible pointer type [-Wincompatible-pointer-types]
  309 |  arm11_kernel_exploit_exec(patch_kernel);
      |                            ^~~~~~~~~~~~
      |                            |
      |                            s32 (*)(void) {aka long int (*)(void)}
src/mkhax.c:106:37: note: expected 'int (*)(void)' but argument is of type 's32 (*)(void)' {aka 'long int (*)(void)'}
  106 | int arm11_kernel_exploit_exec(int (*func)(void))
      |                               ~~~~~~^~~~~~~~~~~
src/mkhax.c:323:28: warning: passing argument 1 of 'arm11_kernel_exploit_exec' from incompatible pointer type [-Wincompatible-pointer-types]
  323 |  arm11_kernel_exploit_exec(unpatch_pid);
      |                            ^~~~~~~~~~~
      |                            |
      |                            s32 (*)(void) {aka long int (*)(void)}
src/mkhax.c:106:37: note: expected 'int (*)(void)' but argument is of type 's32 (*)(void)' {aka 'long int (*)(void)'}
  106 | int arm11_kernel_exploit_exec(int (*func)(void))
      |                               ~~~~~~^~~~~~~~~~~
arm-none-eabi-gcc -c -o obj/ctru.o src/ctru.c -fshort-wchar -fomit-frame-pointer -ffast-math -std=gnu99 -Os -ffunction-sections -g -mword-relocations -march=armv6k -mtune=mpcore -mlittle-endian -I../include
arm-none-eabi-gcc -x assembler-with-cpp -march=armv6k -mtune=mpcore -mlittle-endian -c src/svc.s -o obj/svc.o
arm-none-eabi-gcc -o code.elf obj/compat.o obj/main.o obj/mkhax.o obj/ctru.o obj/svc.o -nostartfiles --specs=crs.specs -Wl,-gc-sections -march=armv6k -mtune=mpcore -mlittle-endian
/usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: obj/mkhax.o: in function `patch_kernel':
/root/ccrypt/src/mkhax.c:218: undefined reference to `invalidate_icache'
/usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: /root/ccrypt/src/mkhax.c:219: undefined reference to `invalidate_dcache'
/usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: obj/mkhax.o: in function `unpatch_pid':
/root/ccrypt/src/mkhax.c:265: undefined reference to `invalidate_icache'
/usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: /root/ccrypt/src/mkhax.c:266: undefined reference to `invalidate_dcache'
collect2: error: ld returned 1 exit status
make: *** [Makefile:30: code.elf] Error 1

I don't know if this program is still working or not but I really wanted to use it... Thanks

Lunyyx avatar Jun 11 '21 17:06 Lunyyx