diff --git a/Toolchain/Patches/gcc.patch b/Toolchain/Patches/gcc.patch index adc641926a..62f1a3267e 100644 --- a/Toolchain/Patches/gcc.patch +++ b/Toolchain/Patches/gcc.patch @@ -68,10 +68,10 @@ index 357b0bed0..8e96b74e5 100644 case ${target} in +i[34567]86-*-serenity*) -+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h glibc-stdint.h i386/i386elf.h serenity.h" ++ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h glibc-stdint.h i386/i386elf.h serenity.h i386/serenity.h" + ;; +x86_64-*-serenity*) -+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h glibc-stdint.h i386/i386elf.h i386/x86-64.h serenity.h" ++ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h glibc-stdint.h i386/i386elf.h i386/x86-64.h serenity.h i386/serenity.h" + ;; +arm-*-serenity*) + tm_file="dbxelf.h elfos.h arm/elf.h arm/aout.h glibc-stdint.h arm/serenity-elf.h ${tm_file} serenity.h" @@ -154,6 +154,19 @@ index 000000000..24b29c3da + +#undef PTRDIFF_TYPE +#define PTRDIFF_TYPE "long int" +diff --git a/gcc/config/i386/serenity.h b/gcc/config/i386/serenity.h +new file mode 100644 +index 000000000..dc2f5361e +--- /dev/null ++++ b/gcc/config/i386/serenity.h +@@ -0,0 +1,7 @@ ++/* Ensure that we are using the SIZE_TYPE indicated by SysV */ ++#undef SIZE_TYPE ++#define SIZE_TYPE (TARGET_64BIT ? "long unsigned int" : "unsigned int") ++ ++/* Ensure that ptrdiff_t matches the actual pointer size */ ++#undef PTRDIFF_TYPE ++#define PTRDIFF_TYPE (TARGET_64BIT ? "long int" : "int") diff --git a/gcc/config/host-darwin.c b/gcc/config/host-darwin.c index 14a01fe71..3f8e44288 100644 --- a/gcc/config/host-darwin.c