From patchwork Mon Nov 5 19:04:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 993356 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-489083-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="Ku+57zMY"; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="WCblDR3k"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42phvR2R8vz9sDb for ; Tue, 6 Nov 2018 06:05:05 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id; q=dns; s=default; b=wQjk9oTf5uAD voWvD45Zhv/lCUBZ5ohzflNCw0hugTwp2BZrN5w5cLs5vmkavhclztl82pXTjuOk RtOABfmVK1r3Th9OujjoT5Ogfkgf1vPv7h1e9guvecS78cjO2bWuhdYE2KbcT5oX QJykkArnqo3BXGf4qaR8msapqnT3Rvg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id; s=default; bh=LjtVgdXxUA/MD1L1ui nAZP/Qkhk=; b=Ku+57zMYQQbexaELZajEkLPK4+s6M/KmnmLMirFY2uUU8PXN3H 8Xpl45V5LpN/aLIjUETvwMpTwE2J8D5ctSZ7FAcvjQTI8mGNfCxIPc8jIAxr7TbS 1jodrQnrcwNu4zn8/gd4FYXtS+5Aqtn0dJL5JCitJkSo/7zF7IEkZsit0= Received: (qmail 29704 invoked by alias); 5 Nov 2018 19:04:59 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 29694 invoked by uid 89); 5 Nov 2018 19:04:58 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.4 required=5.0 tests=BAYES_00, FREEMAIL_FROM, FROM_LOCAL_NOVOWEL, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, HK_RANDOM_ENVFROM, HK_RANDOM_FROM, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=2110, H*r:2001, Hx-languages-length:1042, Max X-HELO: mail-lf1-f67.google.com Received: from mail-lf1-f67.google.com (HELO mail-lf1-f67.google.com) (209.85.167.67) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 05 Nov 2018 19:04:57 +0000 Received: by mail-lf1-f67.google.com with SMTP id u18so6955025lff.10 for ; Mon, 05 Nov 2018 11:04:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=kFQ3Y0KvJdsL5YWzUz+7NtChgd6HAd7qX4KC5/nsk1E=; b=WCblDR3k7Qi9fCi9vvmYFdQ1ZYhRnTVgZiXKkkMM7FLLURqlJSRjib6s+TX3GZ68a/ mJAgIixMHO6cyKqqdpI/46O9dWy0GyLYwsO59nyELpdLnA4YI3QWQbwMdVuzeqQW2Klz 2ZpgL7ihc6WmXUqMTAc7HIRpOvUikWvisHC/LUBVG0X/3vNPGFJqm2ejRaFAb8D7ykqA KJq9xZyznzj2ccdwsGxrSZV2Bl9bk4EO9Y1zuPpcBPLWSjTxXyivIHsjlc6h1eT9uyAf b8h9ns2f8Q3NjpDOqCF/J3OKll3JAvDVQcmWEkm29IN0aYX8ghZpZ8wpjMTwU1r5Zasu nypA== Received: from octofox.cadence.com (jcmvbkbc-1-pt.tunnel.tserv24.sto1.ipv6.he.net. [2001:470:27:1fa::2]) by smtp.gmail.com with ESMTPSA id d126-v6sm7046934lfe.75.2018.11.05.11.04.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Nov 2018 11:04:53 -0800 (PST) From: Max Filippov To: gcc-patches@gcc.gnu.org Cc: linux-xtensa@linux-xtensa.org, Sterling Augustine , Max Filippov Subject: [PATCH] gcc: xtensa: don't force PIC for uclinux target Date: Mon, 5 Nov 2018 11:04:42 -0800 Message-Id: <20181105190442.4346-1-jcmvbkbc@gmail.com> X-IsSubscribed: yes xtensa-uclinux uses bFLT executable file format that cannot relocate fields representing offsets from data to code. C++ objects built as PIC use offsets to encode FDE structures. As a result C++ exception handling doesn't work correctly on xtensa-uclinux. Don't use PIC by default on xtensa-uclinux. gcc/ 2018-11-04 Max Filippov * config/xtensa/uclinux.h (XTENSA_ALWAYS_PIC): Change to 0. --- gcc/config/xtensa/uclinux.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/config/xtensa/uclinux.h b/gcc/config/xtensa/uclinux.h index ba26187c8f7a..1cb334919c7c 100644 --- a/gcc/config/xtensa/uclinux.h +++ b/gcc/config/xtensa/uclinux.h @@ -60,7 +60,7 @@ along with GCC; see the file COPYING3. If not see #define LOCAL_LABEL_PREFIX "." /* Always enable "-fpic" for Xtensa Linux. */ -#define XTENSA_ALWAYS_PIC 1 +#define XTENSA_ALWAYS_PIC 0 #undef TARGET_LIBC_HAS_FUNCTION #define TARGET_LIBC_HAS_FUNCTION no_c99_libc_has_function