免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2762 | 回复: 6
打印 上一主题 下一主题

[学习分享] 继续问编译libX11的问题,编译arm-gtk时遇到的 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2012-07-21 15:51 |只看该作者 |倒序浏览
本帖最后由 abnerle 于 2012-07-21 15:51 编辑

/usr/include/pthread.h:722: warning: '__regparm__' attribute directive ignored
xcb_io.c: In function 'check_internal_connections':
xcb_io.c:90: error: impossible constraint in 'asm'
xcb_io.c:112: error: impossible constraint in 'asm'
make[3]: *** [xcb_io.lo] 错误 1
make[3]: Leaving directory `/home/gtk/libX11-1.4.2/src'
make[2]: *** [all-recursive] 错误 1

看源代码,没什么问题,什么问题?

static void check_internal_connections(Display *dpy)
{
        struct _XConnectionInfo *ilist;
        fd_set r_mask;
        struct timeval tv;
        int result;
        int highest_fd = -1;

        if(dpy->flags & XlibDisplayProcConni || !dpy->im_fd_info)
                return;

        FD_ZERO(&r_mask); //第90行的内容,没看出什么问题
        for(ilist = dpy->im_fd_info; ilist; ilist = ilist->next)
        {
                assert(ilist->fd >= 0);
                FD_SET(ilist->fd, &r_mask);
                if(ilist->fd > highest_fd)
                        highest_fd = ilist->fd;
        }
        assert(highest_fd >= 0);

        tv.tv_sec = 0;
        tv.tv_usec = 0;
        result = select(highest_fd + 1, &r_mask, NULL, NULL, &tv);

        if(result == -1)
        {
                if(errno == EINTR)
                        return;
                _XIOError(dpy);
        }

        for(ilist = dpy->im_fd_info; result && ilist; ilist = ilist->next)
                if(FD_ISSET(ilist->fd, &r_mask))
                {
                        _XProcessInternalConnection(dpy, ilist);
                        --result;
                }
}

static PendingRequest *append_pending_request(Display *dpy, unsigned long sequence)
{
        PendingRequest *node = malloc(sizeof(PendingRequest));
        assert(node);
        node->next = NULL;
        node->sequence = sequence;
        node->reply_waiter = 0;
        if(dpy->xcb->pending_requests_tail)
        {
                assert(XLIB_SEQUENCE_COMPARE(dpy->xcb->pending_requests_tail->sequence, <, node->sequence));
                assert(dpy->xcb->pending_requests_tail->next == NULL);
                dpy->xcb->pending_requests_tail->next = node;
        }
        else
                dpy->xcb->pending_requests = node;
        dpy->xcb->pending_requests_tail = node;
        return node;
}

论坛徽章:
1
2015年辞旧岁徽章
日期:2015-03-03 16:54:15
2 [报告]
发表于 2012-07-21 16:27 |只看该作者
把 112 行内容也贴出来看看?

貌似俺也木有看出问题在哪里啊。

论坛徽章:
0
3 [报告]
发表于 2012-07-21 21:49 |只看该作者
回复 2# snow888

79 static void check_internal_connections(Display *dpy)
     80 {
     81         struct _XConnectionInfo *ilist;
     82         fd_set r_mask;
     83         struct timeval tv;
     84         int result;
     85         int highest_fd = -1;
     86
     87         if(dpy->flags & XlibDisplayProcConni || !dpy->im_fd_info)
     88                 return;
     89
     90         FD_ZERO(&r_mask);
     91         for(ilist = dpy->im_fd_info; ilist; ilist = ilist->next)
     92         {
     93                 assert(ilist->fd >= 0);
     94                 FD_SET(ilist->fd, &r_mask);
     95                 if(ilist->fd > highest_fd)
     96                         highest_fd = ilist->fd;
     97         }
     98         assert(highest_fd >= 0);
     99
    100         tv.tv_sec = 0;
    101         tv.tv_usec = 0;
    102         result = select(highest_fd + 1, &r_mask, NULL, NULL, &tv);
    103
    104         if(result == -1)
    105         {
    106                 if(errno == EINTR)
    107                         return;
    108                 _XIOError(dpy);
    109         }
    110
    111         for(ilist = dpy->im_fd_info; result && ilist; ilist = ilist->next)
    112                if(FD_ISSET(ilist->fd, &r_mask))         //112行内容,也没有问题
    113                 {
    114                         _XProcessInternalConnection(dpy, ilist);
    115                         --result;
    116                 }
    117 }
   
实在看不出什么问题,google了半天,没找到类似的情况

论坛徽章:
1
2015年辞旧岁徽章
日期:2015-03-03 16:54:15
4 [报告]
发表于 2012-07-21 22:47 |只看该作者
看一看这个数据类型的原型定义。

fd_set

论坛徽章:
0
5 [报告]
发表于 2012-07-23 22:35 |只看该作者
回复 4# snow888


    谢谢了,是头文件的问题,看网上有个办法就是用编译器下面的同名文件替换,然后就好了

论坛徽章:
0
6 [报告]
发表于 2012-07-24 09:25 |只看该作者
头文件可能有问题.baidu一下看看

论坛徽章:
1
2015年辞旧岁徽章
日期:2015-03-03 16:54:15
7 [报告]
发表于 2012-07-27 21:29 |只看该作者
回复 5# abnerle


    不客气,问题解决了就好。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP