public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "bugdal at aerifal dot cx" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug other/67812] New: Default-PIE patch broke building compiler as PIE and on esp toolchains
Date: Fri, 02 Oct 2015 00:06:00 -0000	[thread overview]
Message-ID: <bug-67812-4@http.gcc.gnu.org/bugzilla/> (raw)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67812

            Bug ID: 67812
           Summary: Default-PIE patch broke building compiler as PIE and
                    on esp toolchains
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bugdal at aerifal dot cx
  Target Milestone: ---

The default-pie patch added the following to gcc/Makefile.in:

+# We don't want to compile the compilers with -fPIE, it make PCH fail.
+COMPILER += @NO_PIE_CFLAGS@
+
+# Link with -no-pie since we compile the compiler with -fno-PIE.
+LINKER += @NO_PIE_FLAG@

This precludes building the compiler as PIE, which leads to multiple problems:

1. On existing PIE-by-default toolchains (ESP patches), -fno-PIE gets added to
NO_PIE_CFLAGS, but NO_PIE_FLAG remains blank, because the negative option was
called -nopie rather than -no-pie. Using -fno-PIE without -no-pie/-nopie
results in link errors on some host archs.

2. Refusal to build as PIE may violate distro policy of shipping only PIE
binaries.

3. For nommu systems, building as PIE is mandatory; non-PIE binaries simply
cannot run.

If there's an issue where PCH does not work with PIE then PCH should just be
disabled when the compiler is built as PIE. This worked fine before, and is
completely orthogonal to whether the compiler produces PIE by default; one is a
host issue and the other is a target issue.


             reply	other threads:[~2015-10-02  0:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-02  0:06 bugdal at aerifal dot cx [this message]
2015-10-02  0:11 ` [Bug other/67812] " pinskia at gcc dot gnu.org
2015-10-02  0:20 ` bugdal at aerifal dot cx
2015-10-02  3:18 ` bugdal at aerifal dot cx

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=bug-67812-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).