64 bit woes

Trying to compile juce on gcc with -m64 (x86-IA64) but it fails directly on juce_linux_Network.cpp:

[ 1%] Building CXX object ext/juce-1.45/CMakeFiles/JUCE_core.dir/build/linux/platform_specific_code/juce_linux_Network.o /tmp/ccWbhNo7.s: Assembler messages: /tmp/ccWbhNo7.s:86: Error: Incorrect register `%rax' used with `l' suffix /tmp/ccWbhNo7.s:796: Error: Incorrect register `%rax' used with `l' suffix make[3]: *** [ext/juce-1.45/CMakeFiles/JUCE_core.dir/build/linux/platform_specific_code/juce_linux_Network.o] Error make[2]: *** [ext/juce-1.45/CMakeFiles/JUCE_core.dir/all] Error 2 make[1]: *** [mixRenderer/CMakeFiles/mixRenderer.dir/rule] Error 2 make: *** [mixRenderer] Error 2

Have you tried Jules to compile in 64 bit mode?

Ok, narrowed it down to FD_SET and asm-i386/posix_types.h . Why is that included if the -m64 is set? Shouldn’t asm-x86_64/posix_types.h be used instead??

no idea… I’d have expected that sort of thing to just work too…

my try to build svn juce for amd64 on linux just worked.
well actually somethings did not work correctly.

  1. the svg graphics was not drawn correctly, but everytime i check out from svn the graphic is another thing, maybe thats the cause.
  2. this is a commmon linux problem i think, my hardy heron beta did not play sound because of error with alsa. i think it conflict with the pulseaudio.
    maybe support for pulseaudio or another lib like libao, which supports pulseaudio could be made.

regards,
gunnar

Think its my bad, the ubuntu system is 32 bit (although with a 64-bit CPU) so x86_64 is not defined. Not being all that gcc-savvy, I don’t know how to change the configuration. But now I have access to a 64-bit ubuntu machine, so I guess it’ll play nicer.

IA64 is Itanium, and i think this is ONLY 64 bit, so actually i think you have and x64( or AMD64) prozessor like core 2 duo.
what you want is a 64 bit crosscompile, but the executable would not run on your 32 bit OS.

regards, gunnar

[quote=“gunnar”]IA64 is Itanium, and i think this is ONLY 64 bit, so actually i think you have and x64( or AMD64) prozessor like core 2 duo.
what you want is a 64 bit crosscompile…[/quote]

Yes, think so to. How to do that eludes me I’m afraid… :frowning:

Hi Jules.
your last checkin has messed up the 64 bitbuild for linux.

i am getting errors like this:
In file included from platform_specific_code/juce_linux_Files.cpp:68:
platform_specific_code/…/…/macosx/platform_specific_code/juce_posix_SharedCode.cpp: In function ‘void juce::juce_fileClose(void*)’:
platform_specific_code/…/…/macosx/platform_specific_code/juce_posix_SharedCode.cpp:302: error: cast from ‘void*’ to ‘int’ loses precision
platform_specific_code/…/…/macosx/platform_specific_code/juce_posix_SharedCode.cpp: In function ‘int juce::juce_fileRead(void*, void*, int)’:
platform_specific_code/…/…/macosx/platform_specific_code/juce_posix_SharedCode.cpp:308: error: cast from ‘void*’ to ‘int’ loses precision
platform_specific_code/…/…/macosx/platform_specific_code/juce_posix_SharedCode.cpp: In function ‘int juce::juce_fileWrite(void*, const void*, int)’:
platform_specific_code/…/…/macosx/platform_specific_code/juce_posix_SharedCode.cpp:316: error: cast from ‘void*’ to ‘int’ loses precision
platform_specific_code/…/…/macosx/platform_specific_code/juce_posix_SharedCode.cpp: In function ‘juce::int64 juce::juce_fileSetPosition(void*, juce::int64)’:
platform_specific_code/…/…/macosx/platform_specific_code/juce_posix_SharedCode.cpp:323: error: cast from ‘void*’ to ‘int’ loses precision
platform_specific_code/…/…/macosx/platform_specific_code/juce_posix_SharedCode.cpp: In function ‘juce::int64 juce::juce_fileGetPosition(void*)’:
platform_specific_code/…/…/macosx/platform_specific_code/juce_posix_SharedCode.cpp:332: error: cast from ‘void*’ to ‘int’ loses precision
platform_specific_code/…/…/macosx/platform_specific_code/juce_posix_SharedCode.cpp: In function ‘void juce::juce_fileFlush(void*)’:
platform_specific_code/…/…/macosx/platform_specific_code/juce_posix_SharedCode.cpp:340: error: cast from ‘void*’ to ‘int’

to fix this you have to do something like this:

void juce_fileClose (void* handle) throw()

{

if (handle != 0)

    close ((int)handle);

}

chang into:

void juce_fileClose (void* handle) throw()

{

if (handle != 0)

    close ((int)(intptr_t) handle);

}

maybe you should change these nasty void * into intptr_t instead. intpr_t is a type which can be an int or a ptr. on 32bit and 64 bit platforms. its 4 byte on 32bit and 8 byte on 64 bit platforms . it is castable into an int while void * is not ( on 64 bit)

regards,
gunnar

Thanks, yes, I wrote that stuff on the mac, so didn’t spot the problem. I’ve already got a pointer_sized_int type in juce that should work fine for casting these.