All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe Gerum <rpm@xenomai.org>
To: Giulio Moro <g.moro@qmul.ac.uk>,
	"xenomai@xenomai.org" <xenomai@xenomai.org>
Subject: Re: [Xenomai] Linking shared library which relies on bootstrap.o fails
Date: Tue, 28 Nov 2017 17:27:31 +0100	[thread overview]
Message-ID: <f76137b1-16c4-5a7d-fc21-98dfb541066b@xenomai.org> (raw)
In-Reply-To: <DB6PR0701MB2456EB08FE752DA5BF73FF6DB53A0@DB6PR0701MB2456.eurprd07.prod.outlook.com>

On 11/28/2017 05:18 PM, Giulio Moro wrote:
> armv7 (BeagleBone Black), Xenomai 3.0.5.
> 
> When linking a shared library with something like 
>   gcc `/usr/xenomai/bin/xeno-config --skin=alchemy --ldflags` -rdynamic -shared -o libmylib.so 
> 
> I get 
> 
> /usr/bin/ld: /usr/xenomai/lib/xenomai/bootstrap.o: relocation R_ARM_THM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
> /usr/xenomai/lib/xenomai/bootstrap.o: error adding symbols: Bad value
> 
> I understand this can be fixed by compiling the Xenomai library (or at least boostrap.o) with -fPIC. 
> 

No, please see the documentation about --auto-init, --auto-init-solib:
https://xenomai.org/documentation/xenomai-3/html/man1/xeno-config/index.html

> Should this not be made the default setting?

No, we need a non-PIC version for pure execs too. This is why we have
two builds of bootstrap.o - PIC and non-PIC, selected by the proper
xeno-config switch, depending on the link target.

-- 
Philippe.


  reply	other threads:[~2017-11-28 16:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-28 16:18 [Xenomai] Linking shared library which relies on bootstrap.o fails Giulio Moro
2017-11-28 16:27 ` Philippe Gerum [this message]
2017-11-28 23:24 ` [Xenomai] Library cannot be dlopen()ed Giulio Moro
2017-11-29  9:08   ` Philippe Gerum
2017-11-29 16:52     ` Giulio Moro
2017-12-11 14:03   ` Henning Schild

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f76137b1-16c4-5a7d-fc21-98dfb541066b@xenomai.org \
    --to=rpm@xenomai.org \
    --cc=g.moro@qmul.ac.uk \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.