Bruce Dubbs wrote:
> hauradou wrote:
>    
>> Bruce Dubbs wrote:
>>      
>>> hauradou wrote:
>>>
>>>
>>>        
>>>> well, the difference between a big patch and just one option to pass to
>>>> the compiler...
>>>>
>>>>          
>>> I don't consider a 49 line patch big.  It is really only adding 8 lines
>>> and the rest is explanation.  I believe the patch came from upstream.
>>>
>>>
>>>        
>> when I look inside the patch, that's not what I see:
>>
>> Upstream Status:   Not Submitted
>> Origin:            http://www.eglibc.org/archives/patches/msg00073.html
>>
>> Looks like a patch for eglibc, written in year 2007
>>      
> That's upstream or at least related to upstream.
>
>    
>> yes. But why do you assume this method implies less optimal code ? Which
>> part of glibc's code would get sub-optimal?
>>      
> Looking more deeply, I think your method disables the assembly code
> completely.  The error that it's fixing is:
>
> ./sysdeps/i386/fpu/s_frexp.S: Assembler messages:
> ./sysdeps/i386/fpu/s_frexp.S:66: Error: invalid identifier for ".ifdef"
>
> Tracing that code to a macro (sysdeps/i386/sysdep.h, line 137):
>
>     .ifndef __i686.get_pc_thunk.reg;
>
> Undefining __i686 is an error for the assembler just as setting to '1'
> is.  It would lead to:
>
>     .ifndef .get_pc_thunk.reg;
>
> It looks like (I am not an expert here and don't know for sure) the
> difference in gcc-4.5 is that the define substitutes in the line above
> and older version of gcc don't due to the dot after the __i686.  This is
> a change in behavior.   The patch does:
>
> +asm ("\n#if defined __i686&&  defined __ASSEMBLER__");
> +asm ("\n#undef __i686");
> +asm ("\n#define __i686 __i686");
> +asm ("\n#endif");
>
> If undefining __i686 alone did the right thing, then the 3rd line
> wouldn't be needed.
>
>     -- Bruce
>
>
>    
hmm, I'm not an expert either ;) I like to read gcc doc, though.
What you're saying about completely undefining __i686 makes sense. 
Reading the doc, it appears clearly that if you pass to preprocessor '-D 
name', then it would predefine name as a macro, with definition 1. Doc 
says also that if you want name to expand to a definition, you have to 
pass '-D name=definition'. The doc also says that -D and -U prepocessor 
options are processed in the order they are given on the command line. 
So, I'm going to experiment with '-U __i686 -D __i686=__i686' as asm 
preprocessor options. It looks so simple(and self explanatory) as a 
solution! Does it look good to you?
Best regards,
boloco
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to