Build error 4.6.1 for x86_64
Jonathan Wakely
jwakely.gcc@gmail.com
Tue Aug 9 17:11:00 GMT 2011
On 8 August 2011 23:17, Jonathan Wakely wrote:
> On 8 August 2011 23:03, <david.hagood@gmail.com> wrote:
>>> Why don't you look in the libc headers and see how it defines
>>> uintptr_t. In my native x86_64 system I see:
>>>
>>> /* Types for `void *' pointers. */
>>> #if __WORDSIZE == 64
>>> ...
>>> typedef unsigned long int uintptr_t;
>>> #else
>>> ...
>>> typedef unsigned int uintptr_t;
>>> #endif
>>>
>>> If your headers look sensible, figure out what is wrong when you
>>> compile libmudflap such that the wrong definition is used.
>>
>> xgcc is pointing at my sysroot, and the libraries are there. This looks
>> like a problem when cross-compiling gcc for X86_64.
>>
>>
>>> Noone else
>>> has access to the files on your system so you're in the best position
>>> to investigate it.
>>>
>> That's easy to fix. I've attached the makefile I use to do this, and the
>> one patch file I created (incorporating Ian's suggestion about patching
>> mf-runtime.c). All the other files are either straight from the gnu.org
>> servers:
>> binutils-2.20.1.tar.bz2, gcc-4.6.1.tar.bz2, glibc-2.14.tar.bz2,
>> make-3.81.tar.bz2
>> or straight from kernel.org:
>> linux-2.6.39.4.tar.bz2
>>
>> Drop the patch and tarballs into ~/Downloads (or where-ever, and set
>> TARBALL_SOURCE to point there), and do a "make clean all" on an X86-64
>> machine.
>
> No thanks, I'm busy :)
>
> Why don't you add some debugging to the files that are failing to
> compile, figure out which preprocessor macros are defined, add
> #warning or #error lines to your sysroot headers, see what's defined
> and if it seems correct. Check the typedefs are correct.
Any progress?
You could repeat the last compilation command that fails, adding -E
-dD to the end of the command, and inspecting the output file to see
what the preprocessor output is.
Check the contents of your $SYSROOT/usr/include/bits/wordsize.h, it
should look like:
#if defined __x86_64__
# define __WORDSIZE 64
# define __WORDSIZE_COMPAT32 1
#else
# define __WORDSIZE 32
#endif
to work for a biarch x86_64 compiler.
What does your bits/wordsize.h look like? If it's wrong you'd get the
wrong type defined as uintptr_t.
In your makefile you have:
build_glibc: build_glibc_main build_glibc32
Does that mean you overwrite the 64-bit glibc with a 32-bit one?
Does that result in a broken bits/wordsize.h file?
More information about the Gcc-help
mailing list