[Xcb] [PATCH xcb] Added more error states and removed global error_connection

Arvind Umrao arvind.umrao at oracle.com
Sat Oct 29 08:09:22 PDT 2011


  On 10/29/11 12:54, Uli Schlachter wrote:
> On 29.10.2011 05:42, Arvind Umrao wrote:
>> On 10/28/11 23:01, Uli Schlachter wrote:
>>> For https://bugs.freedesktop.org/show_bug.cgi?id=42304:
>>> Do you know what causes that bug? Why does gcc complain about a static global
>>> variable, but a static local one works fine?
>> I am getting following error without my code changes when I compile code
>> with gcc 4.3.3 on Solaris.   Even if we forget about compilation error,
>> then also we have to remove  "error_connection =1". There are
>> possibilities of other error states, as I have mentioned above.
>>
>> gcc -shared -Wl,-h -Wl,libxcb.so.1 -o .libs/libxcb.so.1.1.0
>> .libs/xcb_conn.o .libs/xcb_out.o .libs/xcb_in.o .libs/xcb_ext.o
>> .libs/xcb_xid.o .libs/xcb_list.o .libs/xcb_util.o .libs/xcb_auth.o
>> .libs/xproto.o .libs/bigreq.o .libs/xc_misc.o
>> -R/export/work/git/xorg/build/lib -R/export/work/git/xorg/build/lib
>> -L/export/work/git/xorg/build/lib
>> /export/work/git/xorg/build/lib/libXau.so
>> /export/work/git/xorg/build/lib/libXdmcp.so -lsocket -lc
>> ld: fatal: relocation error: R_386_GOTOFF: file .libs/xcb_conn.o: symbol
>> error_connection: a GOT relative relocation must reference a local symbol
>> ld: fatal: relocation error: R_386_GOTOFF: file .libs/xcb_conn.o: symbol
>> error_connection: a GOT relative relocation must reference a local symbol
>> ld: fatal: relocation error: R_386_GOTOFF: file .libs/xcb_conn.o: symbol
>> error_connection: a GOT relative relocation must reference a local symbol
>> collect2: ld returned 1 exit status
>> *** Error code 1
>> make: Fatal error: Command failed for target `libxcb.la'
>> Current working directory /export/work/git/xorg/src/xcb/libxcb/src
> Google finds lots of references for this problem on solaris with hidden symbol
> visibility, e.g.:
>
> https://github.com/trentm/libgit2/commit/34a29926651160568e95c864514b7fc7ccf0546c
>
> GCC's bug tracker says that this was fixed in 4.3, but you are using 4.3.3. Weird.
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32462
>
> I have no idea why it would help, but could you test the following patch?
>
> Uli
>
>
> diff --git a/src/xcbint.h b/src/xcbint.h
> index 096576c..738fc64 100644
> --- a/src/xcbint.h
> +++ b/src/xcbint.h
> @@ -34,6 +34,7 @@
>   #include "config.h"
>   #endif
>
> +#undef GCC_HAS_VISIBILITY
>   #ifdef GCC_HAS_VISIBILITY
>   #pragma GCC visibility push(hidden)
>   #endif
>

Yes code compiles when GCC_HAS_VISIBILITY  not defined at config.h.  But 
xcb should compile successfully, even with visisbilliy attribute hidden, 
GCC4.3.3 supports it. I have two versions of GCC installed at my machine 
GCC 3.3.3 and 4.3.3, but even then code should compile successfully. I 
will investigate more on a fresh machine having GCC 4.3.3 installed, only.

Thanks for the help.
-Arvind



More information about the Xcb mailing list