[Bug c/19031] New: #pragma weak handling changes in 4.0.0
pth at suse dot de
gcc-bugzilla@gcc.gnu.org
Thu Dec 16 10:43:00 GMT 2004
compiling Xorg's X11 with gcc 4.0.0 20041215 (experimental) fails because the
handling of '#pragma weak' seems to hve changed. The testcode, derived from
xc/lib/xtrans/Xtranssock.c:
------------------cut-----------------
extern int foo;
static const int bar = 1;
#pragma weak foo=bar
--------------------------------------
when compiled with gcc 3.3.4 the resulting object shows
0000000000000000 r bar
0000000000000000 V foo
i.e. bar as local symbol and foo as a weak alias.
When compiled with 4.0.0 20041215, the object only has bar listed
as an undefined Symbol.
The X.org Xtranssock.c code is doing the above trick to define a weak alias for
in6addr_any to provide compatibility for apps linked against system libraries
that don't have IPv6 support.
Now the question is, who is wrong. If it's the X11 code, how could the code
possibly be changed?
--
Summary: #pragma weak handling changes in 4.0.0
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pth at suse dot de
CC: aj at suse dot de,gcc-bugs at gcc dot gnu dot org
GCC build triplet: x86_64-suse-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19031
More information about the Gcc-bugs
mailing list