All of lore.kernel.org
 help / color / mirror / Atom feed
* Building master on Debian systems fails at linking "check".
@ 2011-11-14 14:56 Antonio Ospite
  2011-11-14 18:12 ` Brian Gix
  0 siblings, 1 reply; 9+ messages in thread
From: Antonio Ospite @ 2011-11-14 14:56 UTC (permalink / raw)
  To: linux-bluetooth

[-- Attachment #1: Type: text/plain, Size: 1931 bytes --]

Hi,

building the master branch (a267bc2) on Debian systems fails when 
linking the unit tests to the "check" library with this error:

  CCLD   unit/test-eir
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../lib/libcheck.a
(check.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be
used when making a shared object; recompile with
-fPIC /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../lib/libcheck.a:
could not read symbols: Bad value collect2: ld returned 1 exit status
make[1]: *** [unit/test-eir] Error 1 make: *** [all] Error 2


AFAIU this is a Debian quirk, the facts of the issue are more or less
these (please correct me if I am wrong):
  - libcheck.a, as per upstream default, is generally built with -fPIC
  - Debian policy tells that by default .a are not expected to be
    built with -fPIC, so they provide libcheck_pic.a as alternative
    instead.
  - BlueZ build system tries to dynamically link the unit tests to
    libcheck.a, but on Debian systems this is a non-PIC library and on
    X86_64 linking to non PIC as shared library is not allowed.

After a little bit of research I found out that gstreamer people also
had run into that issue and they have a m4 macro to pickup
libcheck_pic.a if present:

  http://cgit.freedesktop.org/gstreamer/common/tree/m4/check.m4

I have no idea if you BlueZ dev too want to handle this in-tree or
leave the burden to distributors.

The workaround I use for now is:
  - run "make" and let the build system fail
  - show the  failing command with "make V=1"
  - change -lcheck to -lcheck_pic and rerun the command
  - "make" will now proceed with the build

Regards,
   Antonio 

-- 
Antonio Ospite
http://ao2.it

PGP public key ID: 0x4553B001

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-11-18  9:37 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-14 14:56 Building master on Debian systems fails at linking "check" Antonio Ospite
2011-11-14 18:12 ` Brian Gix
2011-11-14 21:51   ` Antonio Ospite
2011-11-15  2:25     ` Marcel Holtmann
2011-11-15  2:31       ` Brian Gix
2011-11-15  2:53         ` Marcel Holtmann
2011-11-15  2:58           ` Brian Gix
2011-11-15  2:59             ` Marcel Holtmann
2011-11-18  9:37               ` Antonio Ospite

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.