GPM 1.20.1 problems

Bruce Dubbs bdubbs at swbell.net
Tue Jan 21 19:17:50 PST 2003


Greg Schafer wrote:

>On Wed, Jan 22, 2003 at 10:37:35AM +1100, Greg Schafer wrote:
>  
>
>>On Tue, Jan 21, 2003 at 05:45:57PM -0500, Billy O'Connor wrote:
>>    
>>
>>>No, wait, this has nothing to do with gcc, the configure.in file
>>>needs -lm, that's all.  We can use the export command until they put
>>>up a new tarball.
>>>      
>>>
>>Yep, best to add the -lm coz that seems like the right thing to do. But I'd
>>still like to understand the cause of the weirdness (which IMHO may indeed
>>be gcc)
>>    
>>
>
>Ok, I don't think it's a gcc bug. I've just distilled a test case and
>compiled it on gcc-{2.95.4, 3.2.1, 3.3, 3.4} and they all behave the same.
>
>--------------------
>#include <math.h>
>
>static int foo = 0;
>static float bar = 0.5;
>static int baz = 5;
>
>int main()
>{
>    foo = ceil(bar * baz);
>    return (0);
>}
>--------------------
>
>gws at tigers-lfs:~/src/temp1$ gcc -Os -save-temps foo.c
>foo.o(.text+0x16): In function `main':
>: undefined reference to `ceil'
>collect2: ld returned 1 exit status
>gws at tigers-lfs:~/src/temp1$
>
>gws at tigers-lfs:~/src/temp1$ gcc -O0 -save-temps foo.c
>foo.o(.text+0x20): In function `main':
>: undefined reference to `ceil'
>collect2: ld returned 1 exit status
>gws at tigers-lfs:~/src/temp1$
>
>gws at tigers-lfs:~/src/temp1$ gcc -O1 -save-temps foo.c
>gws at tigers-lfs:~/src/temp1$
>
>
>If you have a look at the preprocessed source you'll see the difference.
>Essentially, the optimized case includes a whole lot of extra "extern
>__inline" math stuff.
>
>Still don't fully understand it.. but at least it makes me feel a bit
>better :/  MSB, Kelledin, anyone? Can you explain it in layman's terms for
>the rest of us weenies?
>

Interesting.  It sounds like ceil is indeed optimized away.  Can you 
post your -Os preproccesed source?
  -- Bruce


-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe blfs-dev' in the subject header of the message



More information about the blfs-dev mailing list