Subject: Modular X11 (or GCC or something else) bug
To: None <current-users@netbsd.org, tech-pkg@netbsd.org>
From: Vincent <10.50@free.fr>
List: tech-pkg
Date: 02/26/2007 22:13:47
Hi there,

on my old Celeron box, that I updated today to 4.99.12 with a fresh 
userland and kernel, I stumbling once more on a old "chap" error, while 
upgrading to modular_xorg 1.2.0:

../../os-support/.libs/libxorgos.a(i386_video.o)(.text.__i686.get_pc_thunk.bx+0x0): 
In function `__i686.get_pc_thunk.bx':
: multiple definition of `__i686.get_pc_thunk.bx'
/usr/lib/crt0.o(.gnu.linkonce.t.__i686.get_pc_thunk.bx+0x0): first 
defined here

It appears that compiling that i386_video.c (or any .c file) with the 
-fPIC flag attaches that __i686.get_pc_thunk.bx which ends up as a 
normal 'T' symbol as nm reveals, whereas it should (maybe?) be local or 
at least 'weak' or be part of a 'gnu.linkonce.t' section like in crt0.o.

For reference, this is the assembler code inserted by -fPIC:

.section 
.text.__i686.get_pc_thunk.bx,"axG",@progbits,__i686.get_pc_thunk.bx,comdat

.globl __i686.get_pc_thunk.bx
         .hidden __i686.get_pc_thunk.bx
         .type   __i686.get_pc_thunk.bx, @function
__i686.get_pc_thunk.bx:
         movl    (%esp), %ebx
         ret

What should I do?

Vincent