From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 73A1A138334 for ; Tue, 18 Sep 2018 22:44:38 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 2C396E0978; Tue, 18 Sep 2018 22:44:36 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 089B7E0978 for ; Tue, 18 Sep 2018 22:44:34 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 649A6335D05 for ; Tue, 18 Sep 2018 22:44:32 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id BE3523F5 for ; Tue, 18 Sep 2018 22:44:30 +0000 (UTC) From: "Sergei Trofimovich" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sergei Trofimovich" Message-ID: <1537310208.a23e6057c94403e010a4ccd06091b59cc332e593.slyfox@gentoo> Subject: [gentoo-commits] proj/crossdev:master commit in: / X-VCS-Repository: proj/crossdev X-VCS-Files: crossdev X-VCS-Directories: / X-VCS-Committer: slyfox X-VCS-Committer-Name: Sergei Trofimovich X-VCS-Revision: a23e6057c94403e010a4ccd06091b59cc332e593 X-VCS-Branch: master Date: Tue, 18 Sep 2018 22:44:30 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 516fb9f1-a287-46ec-a6a8-04ff26dd2598 X-Archives-Hash: 23b43a057658cc930c2d1f9d9256f94c commit: a23e6057c94403e010a4ccd06091b59cc332e593 Author: Sergei Trofimovich gentoo org> AuthorDate: Tue Sep 18 22:36:48 2018 +0000 Commit: Sergei Trofimovich gentoo org> CommitDate: Tue Sep 18 22:36:48 2018 +0000 URL: https://gitweb.gentoo.org/proj/crossdev.git/commit/?id=a23e6057 crossdev: don't enable USE=pie by default on any bare-metal targets Unfortunately embedded world has a long way to go to adopt --enable-default-pie as a first class citizen. Note: --enable-default-pie enabled two things: - PIC-friendly code generation (-fPIE) - PIE executables (-pie) Normally one would expect firmware to pass compiler modes explicitly to gcc: -fPIC (or -mauto-pic, -fno-PIC), -ffreestanding, -nostdlib. Unfortunately upstreams are frequently reluctant to explicitly specify new moving parts available in gcc (in this case -no-pie) and expect gcc to behave as it used to in the world before --enable-default-pie. Unfortunate but not entirely unreasonable. Disable --enable-default-pie until user explicitly requests USE=pie. Reported-by: Bertrand Jacquin Reported-by: sklv Bug: https://lists.gnupg.org/pipermail/gnuk-users/2018-August/000086.html Bug: https://github.com/gl-sergei/u2f-token/issues/14 Signed-off-by: Sergei Trofimovich gentoo.org> crossdev | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/crossdev b/crossdev index 81bd50d..b8027a3 100755 --- a/crossdev +++ b/crossdev @@ -397,13 +397,14 @@ parse_target() { # [2.] mingw32 startup code is broken: bug #644930 # at least on i686-w64-mingw32 and x86_64-w64-mingw32 mingw*|*-mingw*) pie_support=no;; - # Some bare-metal targets don't work with pie as-is + # Many bare-metal targets don't work with pie as-is *-elf|*-eabi) - case ${CTARGET} in - # mips can't generate freestanding PIC: - # cc1: error: position-independent code requires ‘-mabicalls’ - mips*) pie_support=no;; - esac + # mips can't generate freestanding PIC: + # cc1: error: position-independent code requires ‘-mabicalls’ + # arm firmware packages don't expect pie-by-default: + # https://lists.gnupg.org/pipermail/gnuk-users/2018-August/000086.html + # https://github.com/gl-sergei/u2f-token/issues/14 + pie_support=no ;; esac if [[ $pie_support = "no" ]]; then