Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Waldemar Brodkorb <wbx@openadk.org>
To: buildroot@busybox.net
Subject: [Buildroot] [uclibc-ng-devel] Static + PIE support
Date: Thu, 9 Jun 2016 23:17:43 +0200	[thread overview]
Message-ID: <20160609211743.GR6825@waldemar-brodkorb.de> (raw)
In-Reply-To: <20160609231005.6b289f42@free-electrons.com>

Hi Thomas,
Thomas Petazzoni wrote,

> Hello,
> 
> On Thu, 9 Jun 2016 23:01:30 +0200, Waldemar Brodkorb wrote:
> 
> > > It would be good if you could investigate why uClibc doesn't produce
> > > Scrt1.o when HAVE_SHARED is disabled.  
> > 
> > At the moment Scrt1.o is only build under following condition:
> > ifeq ($(HAVE_SHARED)$(UCLIBC_FORMAT_SHARED_FLAT),y)
> > 
> > I tried to compile a simple hello world as static PIE for ARM and
> > this is not really straight forward. You need at least binutils 2.26
> > to use -W,--no-dynamic-linker otherwise PT_INTERP is added to the
> > resulting executable. After that I tried to run it in Qemu (system
> > and user level tried) and the binary fails to execute with a
> > segmentation fault.
> > So even if we add Scrt1.o somehow to the toolchains, the binaries
> > will not work on the target. Scrt1.o is just PIC version of crt1.c.
> > So the PIC assembly in uClibc-ng might be just broken.
> > 
> > Is it really required for flannel to work to use static PIE?
> 
> flannel is written in Go, so it's always built statically. So even when
> a dynamically-linked capable toolchain is used (which provides
> Scrt1.o), flannel is built as a static binary. Why would it work in
> this case, and not a fully static toolchain ?

I mean "Why flannel requires static PIE?"
In any case, if a fully static toolchain or a dynamic toolchain is
used, the static PIE ARM binary will not be working until a ARM
assembly expert make a fix.
 
> > In my point of view it is some kind of security feature used on
> > Linux together with address space layout randomization.
> > I don't know flannel, but security related software as OpenSSH
> > does allow to build with and without PIE.
> 
> I agree that PIE should be optional, but I'm not sure if it's flannel
> itself that decides to be built with PIE, or just the whole Go stuff.

Okay.
The short-term solution is to ask the go people to make pie
optional.

best regards
 Waldemar

      parent reply	other threads:[~2016-06-09 21:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-08 22:09 [Buildroot] Static + PIE support Thomas Petazzoni
2016-06-09 21:01 ` Waldemar Brodkorb
2016-06-09 21:10   ` Thomas Petazzoni
2016-06-09 21:11     ` Thomas Petazzoni
2016-06-09 21:17     ` Waldemar Brodkorb [this message]

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=20160609211743.GR6825@waldemar-brodkorb.de \
    --to=wbx@openadk.org \
    --cc=buildroot@busybox.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox