zoukankan      html  css  js  c++  java
  • lfs 无知

    sysdeps/ieee754/flt-32/s_isnanf.c:37:1: error: '__EI___isnanf' aliased to external symbol '__GI___isnanf' · Need general guide on how to build Linux Stream ...

    注释37行就可以进行了, 不知道怎么解决, 跟一天了

    On 31/08/2012, at 8:08 AM, Richard Henderson wrote:
    
    > Dunno if alpha is going to be the only glibc port to encounter this, if it should be considered a gcc bug, or what.
    
    For problems like this it is very helpful to see the post-processed source of the file with macro definitions, i.e., output from the command line with appended "-E -dD" options.
    
    > 
    > Without this patch, using mainline gcc, I get
    > 
    > ./../include/libc-symbols.h:485:26: error: ‘__EI___isnanf’ aliased to external symbol ‘__GI___isnanf’
    >   extern __typeof (name) __EI_##name 
    >                          ^
    > ./../include/libc-symbols.h:489:29: note: in expansion of macro '__hidden_ver1'
    > #  define hidden_def(name)  __hidden_ver1(__GI_##name, name, name);
    >                             ^
    > ../ports/sysdeps/alpha/fpu/s_isnan.c:48:1: note: in expansion of macro 'hidden_def'
    > hidden_def (__isnanf)
    > ^
    > 
    > We get this because I chained aliases from __isnan to __isnanf to __GI___isnanf.
    > 
    > The patch works around this by defining both __isnanf and __GI___isnanf in terms of the original __isnan.
    > 
    > This isn't 100% correct since the __GI___isnanf symbol gets defined in the object file with visibility default, but it doesn't matter in practice because the users of the symbol still see the hidden_proto and so when the symbols are merged in the linker and link map applied, it acquires hidden visibility.
    > 
    > I'm looking for opinions as to whether (1) this is a gcc bug and (2) whether the patch should be applied to glibc regardless.
    > 
    > 
    > 
    > r~
    > <0001-alpha-Work-around-gcc-4.8-aliasing-difference-bug.patch>
    
    > From 9b0aca04145daf0d22d607e88d6fa2df8c49f11b Mon Sep 17 00:00:00 2001
    > From: Richard Henderson <rth@twiddle.net>
    > Date: Thu, 30 Aug 2012 12:02:50 -0700
    > Subject: [PATCH] alpha: Work around gcc 4.8 aliasing difference/bug
    > 
    > ---
    >  ports/ChangeLog.alpha             |  5 +++++
    >  ports/sysdeps/alpha/fpu/s_isnan.c | 12 +++++-------
    >  2 files changed, 10 insertions(+), 7 deletions(-)
    > 
    > diff --git a/ports/ChangeLog.alpha b/ports/ChangeLog.alpha
    > index 19edf6f..9589dd3 100644
    > --- a/ports/ChangeLog.alpha
    > +++ b/ports/ChangeLog.alpha
    > @@ -1,3 +1,8 @@
    > +2012-08-30  Richard Henderson  <rth@redhat.com>
    > +
    > +	* sysdeps/alpha/fpu/s_isnan.c: Define all aliases in terms of
    > +	the original __isnan symbol.
    > +
    >  2012-08-27  Mike Frysinger  <vapier@gentoo.org>
    >  
    >  	[BZ #5400]
    > diff --git a/ports/sysdeps/alpha/fpu/s_isnan.c b/ports/sysdeps/alpha/fpu/s_isnan.c
    > index b18c7bb..1f239ac 100644
    > --- a/ports/sysdeps/alpha/fpu/s_isnan.c
    > +++ b/ports/sysdeps/alpha/fpu/s_isnan.c
    > @@ -28,11 +28,6 @@
    >  #undef isnanf
    >  #undef __GI___isnanf
    >  
    > -/* The hidden_proto in include/math.h was obscured by the macro hackery.  */
    > -__typeof (__isnan) __isnanf;
    > -hidden_proto (__isnanf)
    > -
    > -
    
    This part seems to be a good thing regardless of anything else.
    
    >  int
    >  __isnan (double x)
    >  {
    > @@ -45,8 +40,11 @@ weak_alias (__isnan, isnan)
    >  /* It turns out that the 'double' version will also always work for
    >     single-precision.  */
    >  strong_alias (__isnan, __isnanf)
    > -hidden_def (__isnanf)
    > -weak_alias (__isnanf, isnanf)
    > +weak_alias (__isnan, isnanf)
    > +
    > +/* ??? GCC 4.8 fails to look through chains of aliases with asm names
    > +   attached.  Work around this for now.  */
    > +hidden_ver (__isnan, __isnanf)
    
    Why do you need both weak_alias and hidden_ver here?  Maybe hidden_weak is what you want instead?  Again, this may be easier to understand from "-E -dD" output.
    
    --
    Maxim Kuvyrkov
    CodeSourcery / Mentor Graphics


    还是报错, 是链接错误
    我复制了一份函数

    int __GI___isnanf(float x)
    {
            int32_t ix;
            GET_FLOAT_WORD(ix,x);
            ix &= 0x7fffffff;
            ix = 0x7f800000 - ix;
            return (int)(((u_int32_t)(ix))>>31);
    }


    // hidden_def (__isnanf)
    hidden_proto (__isnanf)
    // #define hidden_def(name) __hidden_ver1(__GI_##name, name, name);
    #ifndef __isnandf
    weak_alias (__isnanf, isnanf)
    #endif

    编译是通过了, 不知道是否正确

    debian的 补丁还看不懂 ??? 惭愧

    lfs 这个连接有点疏忽

    ln -sv libgcc.a `$LFS_TGT-gcc -print-libgcc-file-name | sed 's/libgcc/&_eh/'`
    再编译一遍好了


    ln -sv `$LFS_TGT-gcc -print-libgcc-file-name` `$LFS_TGT-gcc -print-libgcc-file-name | sed 's/libgcc/&_eh/'`



  • 相关阅读:
    C#数组添加元素
    C#数组排序方法
    C#遍历数组
    C#动态数组ArrayList
    C#传递数组参数
    基础题(四)
    基础题(三)
    CMDB概述(二)
    CMDB概述(一)
    Django(基础篇)
  • 原文地址:https://www.cnblogs.com/kwingmei/p/3264834.html
Copyright © 2011-2022 走看看