#8415: [patch] Fix x86_64 toolchain ----------------------------+---------------------------- Reporter: xyzzy | Owner: bonefish Type: bug | Status: new Priority: normal | Milestone: R1 Component: Build System | Version: R1/Development Resolution: | Keywords: gsoc2012 Blocked By: | Blocking: Has a Patch: 1 | Platform: x86-64 ----------------------------+---------------------------- Comment (by xyzzy): I don't claim to be an expert in GCC either ;) Basically what I did was changed it so that it matches the existing i386 Haiku target when generating 32-bit code, and changed some things to match x86-64.h for 64-bit code. I'll go through each change in the buildtools patch: * First one just changes TARGET_64BIT to TARGET_64BIT_DEFAULT, as I said TARGET_64BIT is not a compile-time constant. * Second one just changes the comment to say that DEFAULT_PCC_STRUCT_RETURN is necessary: it is currently set on the Haiku i386 target, the ABI specifies that structs and unions must be returned in memory. When compiling 64-bit code, GCC just ignores this definition. * Third one just changes the builtin definitions to not treat TARGET_64BIT as a constant. Also removes the definition of !__x86_64!__, this is set in GCC's i386-c.c. * Fourth one changes LINK_SPEC not to be set using TARGET_64BIT. I've also removed -z max-page-size as I don't believe it should be necessary: the default page size is 2MB but this won't result in large binaries, it just changes the alignment of the sections and would make it easier to map binaries using large pages in the future. * The next changes change it to match x86-64.h to handle some x86_64 ABI stuff. * Finally, the last change just removes TARGET_64BIT around the debugging definitions. These are all set for the i386 target anyway so there's no need for a conditional round them. -- Ticket URL: <http://dev.haiku-os.org/ticket/8415#comment:4> Haiku <http://dev.haiku-os.org> Haiku - the operating system.