[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

avahi FTBS on mips due to pthread ``weirdness?''



Hi,

  I just spent some time debugging the avahi FTBS on mips [0] and mipsel [1],
  there seems to be an inconsitency in how gcc on mips{,el} handles the -pthread
  flag and how it's handled on other platfroms.

  The problem is the following: Avahi first builds a common library as basis
  for most of it's other libraries and the daemon. This contains some code
  using pthreads so it's build as follows:

    gcc -shared  <lots of .o files> -pthread -Wl,-soname 
      -Wl,libavahi-common.so.3 -o .libs/libavahi-common.so.3.2.0

  On other platforms this result in libavahi-common.so being linked against
  libpthread, but not on mipsel..

  On mips: 
    $ ldd .libs/libavahi-common.so
        libc.so.6 => /lib/libc.so.6 (0x2ab00000)
        /lib/ld.so.1 (0x55550000)

  On ppc:
    $  .libs/libavahi-common.so
        libpthread.so.0 => /lib/tls/libpthread.so.0 (0x6ff9f000)
        libc.so.6 => /lib/tls/libc.so.6 (0x6fe3e000)
        /lib/ld.so.1 (0x08000000)

  Now further on the avahi-daemon program is linked against
  .libs/libavahi-common.so, but as the deamon doesn't use pthreads, 
  -pthreads isn't in the compiler options. This obviously fails on mips but 
  works on other platforms (as can be seen in the build logs)

  There are various ways to work around this problem, but i would like to know
  what the real cause is there? Is avahi using the -pthreads flag wrong or is
  gcc not hanlding it the right way on mips ?

  Btw avahi decides to use the -pthread flag because configure finds out that
  it can successfully build pthread apps on mips. See [2] for the exact
  autoconfig script avahi uses..

  Sjoerd

0: http://buildd.debian.org/fetch.php?&pkg=avahi&ver=0.6.4-1&arch=mips&stamp=1137509680&file=log&as=raw
1: http://buildd.debian.org/fetch.php?&pkg=avahi&ver=0.6.4-1&arch=mipsel&stamp=1137505777&file=log&as=raw
2: http://ac-archive.sourceforge.net/Installed_Packages/acx_pthread.html
-- 
If you push the "extra ice" button on the soft drink vending machine, you won't
get any ice.  If you push the "no ice" button, you'll get ice, but no cup.



Reply to: