- 论坛徽章:
- 0
|
一个C++的程序在连接的时候报告wchar_t类型冲突, 已经突破了我的传统观念,ld看来对类型定义也是蛮关心的.
不过参考这封邮件,应该能找到解决的办法.
http://sourceware.org/ml/binutils/2007-06/msg00279.html
Conflicting wchar_t attributes
- From: Khem Raj
- To: Paul Brook
- Cc: binutils at sourceware dot org
- Date: Tue, 26 Jun 2007 17:41:17 -0700
- Subject: Conflicting wchar_t attributes
Hi Paul
While trying out this patch
http://gcc.gnu.org/ml/gcc-patches/2007-06/msg01500.html
The test gcc.dg/fshort-wchar.c is failing with this message from linker.
ERROR: /tmp/cc6isX9R.o: Conflicting definitions of wchar_t
This error is because the test forces to have wchar_t length of 2
but when linking it has the other objects which have wchar_t length of 4
from other objects (first one is crti.o)
ld fails now because it finds that size of wchar_t is not matching
when it opens fshort-wchar object and fails to merge the attributes
in elf32_arm_merge_eabi_attributes ()
Looking at EABI 2.0 addendum it describes this attribute under section
Procedure Call related attributes.
My question is should merging on the sizes be allowed while linking ?
As of now ld just rejects it.
Thanks for your help
-Khem
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/79526/showart_1284716.html |
|