Jump to content

Alpha 5 Not Compiling In Chakra


Gallaecio
 Share

Recommended Posts

I'm getting this:

==== Building test ====
main.cpp
precompiled.cpp
Linking pyrogenesis
test_root.cpp
test_setup.cpp
test_MD5.cpp
test_Bound.cpp
test_Sqrt.cpp
test_FixedVector3D.cpp
test_Matrix3d.cpp
test_FixedVector2D.cpp
test_Fixed.cpp
test_ComponentManager.cpp
test_CmpTemplateManager.cpp
../../../binaries/system/libengine_dbg.a(Profile.o): In function `malloc':
/home/user/games/0ad/src/0ad-r09530-alpha/build/workspaces/gcc/../../../source/ps/Profile.cpp:509: undefined reference to `cpu_AtomicAdd(int volatile*, int)'
../../../binaries/system/libengine_dbg.a(Profile.o): In function `realloc':
/home/user/games/0ad/src/0ad-r09530-alpha/build/workspaces/gcc/../../../source/ps/Profile.cpp:526: undefined reference to `cpu_AtomicAdd(int volatile*, int)'
../../../binaries/system/libengine_dbg.a(Profile.o): In function `calloc':
/home/user/games/0ad/src/0ad-r09530-alpha/build/workspaces/gcc/../../../source/ps/Profile.cpp:543: undefined reference to `cpu_AtomicAdd(int volatile*, int)'
../../../binaries/system/libengine_dbg.a(GameSetup.o): In function `EarlyInit()':
/home/user/games/0ad/src/0ad-r09530-alpha/build/workspaces/gcc/../../../source/ps/GameSetup/GameSetup.cpp:743: undefined reference to `cpu_ConfigureFloatingPoint()'
../../../binaries/system/liblowlevel_dbg.a(timer.o): In function `EnsureMonotonic':
/home/user/games/0ad/src/0ad-r09530-alpha/build/workspaces/gcc/../../../source/lib/timer.cpp:109: undefined reference to `cpu_CAS64(long long volatile*, long long, long long)'
../../../binaries/system/liblowlevel_dbg.a(debug.o): In function `PerformErrorReaction':
/home/user/games/0ad/src/0ad-r09530-alpha/build/workspaces/gcc/../../../source/lib/debug.cpp:401: undefined reference to `cpu_CAS(int volatile*, int, int)'
../../../binaries/system/liblowlevel_dbg.a(debug.o): In function `debug_WriteCrashlog(wchar_t const*)':
/home/user/games/0ad/src/0ad-r09530-alpha/build/workspaces/gcc/../../../source/lib/debug.cpp:175: undefined reference to `cpu_CAS(int volatile*, int, int)'
../../../binaries/system/liblowlevel_dbg.a(debug.o): In function `ShouldSkipError':
/home/user/games/0ad/src/0ad-r09530-alpha/build/workspaces/gcc/../../../source/lib/debug.cpp:519: undefined reference to `cpu_CAS(int volatile*, int, int)'
../../../binaries/system/liblowlevel_dbg.a(debug.o): In function `debug_StopSkippingErrors()':
/home/user/games/0ad/src/0ad-r09530-alpha/build/workspaces/gcc/../../../source/lib/debug.cpp:503: undefined reference to `cpu_CAS(int volatile*, int, int)'
../../../binaries/system/liblowlevel_dbg.a(debug.o): In function `debug_SkipErrors(long long)':
/home/user/games/0ad/src/0ad-r09530-alpha/build/workspaces/gcc/../../../source/lib/debug.cpp:490: undefined reference to `cpu_CAS(int volatile*, int, int)'
../../../binaries/system/liblowlevel_dbg.a(module_init.o):/home/user/games/0ad/src/0ad-r09530-alpha/build/workspaces/gcc/../../../source/lib/module_init.cpp:44: more undefined references to `cpu_CAS(int volatile*, int, int)' follow
../../../binaries/system/liblowlevel_dbg.a(x86_x64.o): In function `cpuid':
/home/user/games/0ad/src/0ad-r09530-alpha/build/workspaces/gcc/../../../source/lib/sysdep/arch/x86_x64/x86_x64.cpp:83: undefined reference to `ia32_asm_cpuid'
/home/user/games/0ad/src/0ad-r09530-alpha/build/workspaces/gcc/../../../source/lib/sysdep/arch/x86_x64/x86_x64.cpp:83: undefined reference to `ia32_asm_cpuid'
/home/user/games/0ad/src/0ad-r09530-alpha/build/workspaces/gcc/../../../source/lib/sysdep/arch/x86_x64/x86_x64.cpp:83: undefined reference to `ia32_asm_cpuid'
/home/user/games/0ad/src/0ad-r09530-alpha/build/workspaces/gcc/../../../source/lib/sysdep/arch/x86_x64/x86_x64.cpp:83: undefined reference to `ia32_asm_cpuid'
/home/user/games/0ad/src/0ad-r09530-alpha/build/workspaces/gcc/../../../source/lib/sysdep/arch/x86_x64/x86_x64.cpp:83: undefined reference to `ia32_asm_cpuid'
../../../binaries/system/liblowlevel_dbg.a(unique_range.o): In function `AddUniqueRangeDeleter(void (*)(void*, unsigned int))':
/home/user/games/0ad/src/0ad-r09530-alpha/build/workspaces/gcc/../../../source/lib/allocators/unique_range.cpp:27: undefined reference to `cpu_AtomicAdd(int volatile*, int)'
../../../binaries/system/liblowlevel_dbg.a(vfs_tree.o): In function `VfsDirectory::SetAssociatedDirectory(boost::shared_ptr<RealDirectory> const&)':
/home/user/games/0ad/src/0ad-r09530-alpha/build/workspaces/gcc/../../../source/lib/file/vfs/vfs_tree.cpp:129: undefined reference to `cpu_CAS(int volatile*, int, int)'
../../../binaries/system/liblowlevel_dbg.a(vfs_tree.o): In function `VfsDirectory::ShouldPopulate()':
/home/user/games/0ad/src/0ad-r09530-alpha/build/workspaces/gcc/../../../source/lib/file/vfs/vfs_tree.cpp:137: undefined reference to `cpu_CAS(int volatile*, int, int)'
collect2: ld returned 1 exit status
make[1]: *** [../../../binaries/system/pyrogenesis_dbg] Error 1
make: *** [pyrogenesis] Error 2
make: *** Waiting for unfinished jobs....
test_Serializer.cpp
test_ParamNode.cpp
test_Simulation2.cpp
test_Position.cpp
test_scripts.cpp
test_Pathfinder.cpp
test_CommandQueue.cpp
test_MeshManager.cpp
test_Color.cpp
test_Terrain.cpp
test_TextureManager.cpp
test_LOSTexture.cpp
test_TextureConverter.cpp
test_CmdLineArgs.cpp
test_test.cpp
test_CLogger.cpp
test_Parser.cpp
test_CStr.cpp
stub_impl_hack.cpp
test_XMLWriter.cpp
test_Xeromyces.cpp
test_RelaxNG.cpp
test_XeroXMB.cpp
test_Net.cpp
test_NetMessage.cpp
test_ScriptVal.cpp
test_ScriptConversions.cpp
test_ScriptInterface.cpp
In file included from ../../../source/scriptinterface/tests/test_ScriptConversions.cpp:14:0:
../../../source/scriptinterface/tests/../../../source/scriptinterface/tests/test_ScriptConversions.h:132:3: warning: this decimal constant is unsigned only in ISO C90
../../../source/scriptinterface/tests/../../../source/scriptinterface/tests/test_ScriptConversions.h:138:3: warning: this decimal constant is unsigned only in ISO C90
test_allocators.cpp
test_headerless.cpp
test_posix.cpp
test_sysdep.cpp
test_printf.cpp
test_rtl.cpp
test_topology.cpp
test_rand.cpp
test_byte_order.cpp
test_cache_adt.cpp
test_secure_crt.cpp
test_path_util.cpp
test_wchar.cpp
test_base32.cpp
test_lib.cpp
test_adts.cpp
test_bits.cpp
test_fnv_hash.cpp
test_regex.cpp
test_trace.cpp
test_tex.cpp
Linking test
../../../binaries/system/libengine_dbg.a(Profile.o): In function `malloc':
/home/user/games/0ad/src/0ad-r09530-alpha/build/workspaces/gcc/../../../source/ps/Profile.cpp:509: undefined reference to `cpu_AtomicAdd(int volatile*, int)'
../../../binaries/system/libengine_dbg.a(Profile.o): In function `realloc':
/home/user/games/0ad/src/0ad-r09530-alpha/build/workspaces/gcc/../../../source/ps/Profile.cpp:526: undefined reference to `cpu_AtomicAdd(int volatile*, int)'
../../../binaries/system/libengine_dbg.a(Profile.o): In function `calloc':
/home/user/games/0ad/src/0ad-r09530-alpha/build/workspaces/gcc/../../../source/ps/Profile.cpp:543: undefined reference to `cpu_AtomicAdd(int volatile*, int)'
../../../binaries/system/libengine_dbg.a(GameSetup.o): In function `EarlyInit()':
/home/user/games/0ad/src/0ad-r09530-alpha/build/workspaces/gcc/../../../source/ps/GameSetup/GameSetup.cpp:743: undefined reference to `cpu_ConfigureFloatingPoint()'
../../../binaries/system/liblowlevel_dbg.a(timer.o): In function `EnsureMonotonic':
/home/user/games/0ad/src/0ad-r09530-alpha/build/workspaces/gcc/../../../source/lib/timer.cpp:109: undefined reference to `cpu_CAS64(long long volatile*, long long, long long)'
../../../binaries/system/liblowlevel_dbg.a(debug.o): In function `PerformErrorReaction':
/home/user/games/0ad/src/0ad-r09530-alpha/build/workspaces/gcc/../../../source/lib/debug.cpp:401: undefined reference to `cpu_CAS(int volatile*, int, int)'
../../../binaries/system/liblowlevel_dbg.a(debug.o): In function `debug_WriteCrashlog(wchar_t const*)':
/home/user/games/0ad/src/0ad-r09530-alpha/build/workspaces/gcc/../../../source/lib/debug.cpp:175: undefined reference to `cpu_CAS(int volatile*, int, int)'
../../../binaries/system/liblowlevel_dbg.a(debug.o): In function `ShouldSkipError':
/home/user/games/0ad/src/0ad-r09530-alpha/build/workspaces/gcc/../../../source/lib/debug.cpp:519: undefined reference to `cpu_CAS(int volatile*, int, int)'
../../../binaries/system/liblowlevel_dbg.a(debug.o): In function `debug_StopSkippingErrors()':
/home/user/games/0ad/src/0ad-r09530-alpha/build/workspaces/gcc/../../../source/lib/debug.cpp:503: undefined reference to `cpu_CAS(int volatile*, int, int)'
../../../binaries/system/liblowlevel_dbg.a(debug.o): In function `debug_SkipErrors(long long)':
/home/user/games/0ad/src/0ad-r09530-alpha/build/workspaces/gcc/../../../source/lib/debug.cpp:490: undefined reference to `cpu_CAS(int volatile*, int, int)'
../../../binaries/system/liblowlevel_dbg.a(module_init.o):/home/user/games/0ad/src/0ad-r09530-alpha/build/workspaces/gcc/../../../source/lib/module_init.cpp:44: more undefined references to `cpu_CAS(int volatile*, int, int)' follow
../../../binaries/system/liblowlevel_dbg.a(x86_x64.o): In function `cpuid':
/home/user/games/0ad/src/0ad-r09530-alpha/build/workspaces/gcc/../../../source/lib/sysdep/arch/x86_x64/x86_x64.cpp:83: undefined reference to `ia32_asm_cpuid'
/home/user/games/0ad/src/0ad-r09530-alpha/build/workspaces/gcc/../../../source/lib/sysdep/arch/x86_x64/x86_x64.cpp:83: undefined reference to `ia32_asm_cpuid'
/home/user/games/0ad/src/0ad-r09530-alpha/build/workspaces/gcc/../../../source/lib/sysdep/arch/x86_x64/x86_x64.cpp:83: undefined reference to `ia32_asm_cpuid'
/home/user/games/0ad/src/0ad-r09530-alpha/build/workspaces/gcc/../../../source/lib/sysdep/arch/x86_x64/x86_x64.cpp:83: undefined reference to `ia32_asm_cpuid'
/home/user/games/0ad/src/0ad-r09530-alpha/build/workspaces/gcc/../../../source/lib/sysdep/arch/x86_x64/x86_x64.cpp:83: undefined reference to `ia32_asm_cpuid'
../../../binaries/system/liblowlevel_dbg.a(unique_range.o): In function `AddUniqueRangeDeleter(void (*)(void*, unsigned int))':
/home/user/games/0ad/src/0ad-r09530-alpha/build/workspaces/gcc/../../../source/lib/allocators/unique_range.cpp:27: undefined reference to `cpu_AtomicAdd(int volatile*, int)'
../../../binaries/system/liblowlevel_dbg.a(vfs_tree.o): In function `VfsDirectory::SetAssociatedDirectory(boost::shared_ptr<RealDirectory> const&)':
/home/user/games/0ad/src/0ad-r09530-alpha/build/workspaces/gcc/../../../source/lib/file/vfs/vfs_tree.cpp:129: undefined reference to `cpu_CAS(int volatile*, int, int)'
../../../binaries/system/liblowlevel_dbg.a(vfs_tree.o): In function `VfsDirectory::ShouldPopulate()':
/home/user/games/0ad/src/0ad-r09530-alpha/build/workspaces/gcc/../../../source/lib/file/vfs/vfs_tree.cpp:137: undefined reference to `cpu_CAS(int volatile*, int, int)'
collect2: ld returned 1 exit status
make[1]: *** [../../../binaries/system/test_dbg] Error 1
make: *** [test] Error 2
Aborting...

Any idea?

Link to comment
Share on other sites

Is that the first error message when you run "make"? (I'd expect it to have complained when compiling ia32.cpp/amd64.cpp or something, if it's ending up without those symbols defined.)

Do you have a 32-bit or 64-bit kernel, and do you have a 32-bit or 64-bit userspace? ("uname -m" and "echo $HOSTTYPE" might say.)

Link to comment
Share on other sites

Hmm, that says it's compiling amd64.cpp and amd64_asm.asm so it seems to think it's a 64-bit system when running update-workspaces.sh. build/premake/premake.lua makes that decision based on $HOSTTYPE and "gcc -dumpmachine" - what values do those have? (Our architecture detection system is definitely a bit fragile :()

Link to comment
Share on other sites

Then it's my system’s fault, completely:

[user@denix ~]$ echo $HOSTTYPE
x86_64
[user@denix ~]$ gcc -dumpmachine
i686-pc-linux-gnu

I'll try to find out why has $HOSTTYPE that value in my system and fix it. Thanks a lot for the help.

Edited by Gallaecio
Link to comment
Share on other sites

Someone at Chakra (Manuel Tortosa) told my that $HOSTTYPE is not about software architecture, but about hardware. So, although my (software) system is i686, my processor seems to be x86_64, so $HOSTTYPE value would be right. In that case, I guess it might not make much sense to use $HOSTTYPE to determine architecture, since what it matters is the software architecture the system is using. It would be good if, at least, gcc -dumpmachine has priority over $HOSTTYPE. Manu also told me to use $CARCH instead when patching the code, maybe that's a good option too. (that's Chakra only)

EDIT: another Chakra developer ([jmc]) suggested asking the kernel, since software has to have the same arch as it: uname -m.

Edited by Gallaecio
Link to comment
Share on other sites

  • 2 weeks later...
another Chakra developer ([jmc]) suggested asking the kernel, since software has to have the same arch as it: uname -m.

Hmm, I don't think that's true - some people run 32-bit userspace on 64-bit kernels. It seems the most reliable option is to actually run the compiler and see if sizeof(void*) is 4 or 8, since running the compiler is what matters in the end. Premake doesn't seem to make that particularly easy though, since it expects the compiler to be specified when running make rather than when running premake, and you have to implement the checks with low-level Lua. (CMake seems to handle it automatically with the CMAKE_SIZEOF_VOID_P variable which is nicer.)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...