Game Development Community

OpenSUSE 11.0 Processor issues while linking.

by Ben Payne · in Torque Game Engine · 09/24/2008 (7:43 pm) · 6 replies

When trying to link the binary the following error occurs:

--> Linking out.GCC4.RELEASE/torqueDemo.bin
out.GCC4.RELEASE/platformX86UNIX/x86UNIXCPUInfo.obj: In function 'Processor::init()':
x86UNIXCPUInfo.cc:(.text+0x1bc): undefined reference to 'timeHi'
x86UNIXCPUInfo.cc:(.text+0x1c2): undefined reference to 'timeLo'
x86UNIXCPUInfo.cc:(.text+0x1c7): undefined reference to 'clockticks'
collect2: ld returned 1 exit status
make[1]: *** [out.GCC4.RELEASE/torqueDemo.bin] Error 1
make: *** [default] Error 2

I think it may have to do with this warning that shows up after every line:

'-mcpu=' is deprecated. Use '-mtune=' or '-march=' instead.

I don't really know the engine that well so I'm not sure how to fix this.

Any (more) help work be great. Thanks,

-BP

About the author

Recent Threads

  • Linking issue with -lGLU

  • #1
    09/25/2008 (1:14 pm)
    The deprecated warning is something different.

    That specifically, looks like your compiler doesn't like how they're passing those items into the assembly code. You could try cheesing it to use the alternative passing method to see if that works:
    Index: x86UNIXCPUInfo.cc
    ===================================================================
    --- x86UNIXCPUInfo.cc	(revision 46)
    +++ x86UNIXCPUInfo.cc	(working copy)
    @@ -75,7 +76,8 @@
           while ( Platform::getRealMilliseconds() < ms+MS_INTERVAL )
           { /* empty */ }
           ms = Platform::getRealMilliseconds()-ms;
    -#if defined(TORQUE_COMPILER_GCC) && ((__GNUC__ >= 3) && (__GNUC_MINOR__ >= 4)) || ((__GNUC__ >= 4) && (__GNUC_MINOR__ >=0))
    +#if 0
    +	  // defined(TORQUE_COMPILER_GCC) && ((__GNUC__ >= 3) && (__GNUC_MINOR__ >= 4)) || ((__GNUC__ >= 4) && (__GNUC_MINOR__ >=0))
           asm(
              "pushl  %eax\n"
              "pushl  %edx\n"

    But I doubt that would work since it still passes a variable [just a different one] in a similar manner. Worth a try, just in case. If it doesn't work, you could try this one instead [revert that change]:

    Index: x86UNIXCPUInfo.cc
    ===================================================================
    --- x86UNIXCPUInfo.cc	(revision 46)
    +++ x86UNIXCPUInfo.cc	(working copy)
    @@ -23,17 +23,18 @@
     void detectX86CPUInfo(char *vendor, U32 *processor, U32 *properties);
     }
     
    -/* used in the asm */
    -static U32 time[2];
    -static U32 clockticks = 0;
    -static char vendor[13] = {0,};
    -static U32 properties = 0;
    -static U32 processor  = 0;
    -static U32 timeHi = 0;
    -static U32 timeLo = 0;
     
     void Processor::init()
     {
    +	/* used in the asm */
    +	U32 time[2];
    +	U32 clockticks = 0;
    +	char vendor[13] = {0,};
    +	U32 properties = 0;
    +	U32 processor  = 0;
    +	U32 timeHi = 0;
    +	U32 timeLo = 0;
    +
        // Reference:
        //    www.cyrix.com
        //    www.amd.com

    Gary (-;
    #2
    09/25/2008 (4:10 pm)
    Thanks Gary, I'll give that a shot as soon as I get a chance.
    #3
    09/27/2008 (12:21 pm)
    Gary,
    Thanks again for the information, and sorry it's been so long since I last posted. The 2nd thing did nothing what-so-ever. :( I got the exact same error. I even did a make clean and started the make from the beginning. (Note that I did try a make from where it left off before doing a make clean. It seems that a make clean would wipe out those files.).

    The first one however seems to have eliminated all but the clockticks 'undefined reference' I wish I understood a little more of what was going on but I was hoping for some more insight to see if I can get this working.

    Thanks for all your help so far.

    -BP
    #4
    09/28/2008 (7:04 pm)
    If clockticks is all that's left, uh... a quick read of the source implies that it's always set to zero at that point in the code, so you could just change line line 97:
    "mov    %eax, (clockticks)\n"
    to
    "mov    %eax, 0\n"
    Obviously this carefully avoids the actual issue, but hey, it wouldn't be the first hakky bit of code in torque :-)

    Gary (-;
    #5
    11/06/2008 (6:07 am)
    I somehow overlooked this thread when I had the same issue. I wouldn't recommend putting the 0 there as above; this is the code that sets clockticks. I got it to work by changing to a different set of gcc assembly syntax: www.garagegames.com/mg/forums/result.thread.php?qt=80528. Best of luck.
    #6
    11/07/2008 (10:10 am)
    Thanks Jonathan. I've been pulled from this project for a bit, but I intend to implement your fix as soon as I get back to it.