From patchwork Thu Nov 22 13:31:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Corbin X-Patchwork-Id: 1001779 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=embecosm.com header.i=@embecosm.com header.b="DjwprShC"; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4310kR1Yg3z9s29 for ; Fri, 23 Nov 2018 00:33:02 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 1CBA888A96; Thu, 22 Nov 2018 13:32:59 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VVeKU8JaTVUd; Thu, 22 Nov 2018 13:32:58 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id EAC9F88A90; Thu, 22 Nov 2018 13:32:57 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 28AC51BF3C5 for ; Thu, 22 Nov 2018 13:32:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 2562A88A90 for ; Thu, 22 Nov 2018 13:32:56 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nauB-4ymyDcS for ; Thu, 22 Nov 2018 13:32:55 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by whitealder.osuosl.org (Postfix) with ESMTPS id 57BFA88A8F for ; Thu, 22 Nov 2018 13:32:55 +0000 (UTC) Received: by mail-wr1-f67.google.com with SMTP id z5so4990486wrt.11 for ; Thu, 22 Nov 2018 05:32:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=oYZ12Z1OTiIobk5XW/tfK+oJFdTof52iPP5YaZaMD74=; b=DjwprShCtifxTYmJ5h+KVIl0KdWoeOn05orSnUOuv9SYkPzwBujE67kUZ/l34diOII su1zbxNwHoj6Kanug/Qc3+icL6Q1ryigBKJw+cPWlcIJVKjQOd+RdIpquYH7DkQAqpPA 7++VHahAk7cS442pDHEp0cS0GZGcq2/rb54IZiTDIHEhDkFwLQgIZERWPfdkWf8QHgJ/ KepJtFmD8hgBasOw3qMQdgBOi5Ifu6mmHrxowxhhMEI261+V+y17eKZcTQo4Uuj2MtmN ownSVVzw3W5VmKaWrMs8J9xUFAcPPzDADS2jP+ILw96AOPmpMXXC+Jist2SLyapLLuYx 4c5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=oYZ12Z1OTiIobk5XW/tfK+oJFdTof52iPP5YaZaMD74=; b=BGuxDHpPsc2wiYazQE2uu1oqMvkXypMZLX8pB1tc/a3dGhDRn7FnHzoMea8qt/reFC n3GvgUX9bY8tfapzKUm4eSAgeRxT4ltEPW5zdowz25wgckRCcAdmAxhy3tTainRSNH2q Pz3GbFF2hF5mjdOv6X9nw5Y/KOzCweKxmwhpFqSHPCWUbF+Mai9oC4Q0XQ3hEs96KmfH ZWyuoxmqw2RrLCRa0dvkqS/MHDX14RxiwothzNzyP05FLq2sCR0Rqr4fzJnbWbL/J+YQ LS/kAyHOng1dFvuliIfDb2xP10/xjFRZxQ/1yKJ7DQt5WXEA4HfUg3b4W5K+MdGsnmiZ Rksg== X-Gm-Message-State: AA+aEWZ9lapeHmEZ8brx+lF1VLkzfX+qpiZcijetETid4I0/CZRilrYV fEigULHwkEwBpsxf89Tsx2KbNnZdNTU= X-Google-Smtp-Source: AFSGD/XtAMLw7qmF5+imY2E2Ss2pfaVkmjSTxm7leKSKzuCN3KgV1jVUaUf13uk/NcGWwg7JZKDGRA== X-Received: by 2002:adf:e6ce:: with SMTP id y14mr10073288wrm.239.1542893573652; Thu, 22 Nov 2018 05:32:53 -0800 (PST) Received: from godzilla.lym.embecosm.com ([2a02:390:741d:1:29ac:679:7c41:4c74]) by smtp.gmail.com with ESMTPSA id h203-v6sm7825679wma.38.2018.11.22.05.32.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Nov 2018 05:32:52 -0800 (PST) From: Mark Corbin To: buildroot@buildroot.org Date: Thu, 22 Nov 2018 13:31:12 +0000 Message-Id: <20181122133112.26701-1-mark.corbin@embecosm.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH 1/1] gcc/config/riscv: define _REENTRANT for RISC-V when -pthread is passed X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Corbin , Thomas Petazzoni Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" The detection of pthread support fails on RISC-V unless _REENTRANT is defined. Added the CPP_SPEC definition from gcc 8.1.0 to correct this. Signed-off-by: Mark Corbin --- ...TRANT-for-RISC-V-when-pthread-is-pas.patch | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 package/gcc/7.3.0/1001-gcc-define-_REENTRANT-for-RISC-V-when-pthread-is-pas.patch diff --git a/package/gcc/7.3.0/1001-gcc-define-_REENTRANT-for-RISC-V-when-pthread-is-pas.patch b/package/gcc/7.3.0/1001-gcc-define-_REENTRANT-for-RISC-V-when-pthread-is-pas.patch new file mode 100644 index 0000000000..4f96bf7d81 --- /dev/null +++ b/package/gcc/7.3.0/1001-gcc-define-_REENTRANT-for-RISC-V-when-pthread-is-pas.patch @@ -0,0 +1,30 @@ +From 6ea832d09415cd82b744d0cf168cdd728c43df47 Mon Sep 17 00:00:00 2001 +From: Mark Corbin +Date: Thu, 22 Nov 2018 12:19:11 +0000 +Subject: [PATCH 1/1] gcc: define _REENTRANT for RISC-V when -pthread is passed + +The detection of pthread support fails on RISC-V unless _REENTRANT +is defined. Added the CPP_SPEC definition from gcc 8.1.0 to correct +this. + +Signed-off-by: Mark Corbin +--- + gcc/config/riscv/linux.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/gcc/config/riscv/linux.h b/gcc/config/riscv/linux.h +index 4b2f7b6e1fd..b00d23ddfa0 100644 +--- a/gcc/config/riscv/linux.h ++++ b/gcc/config/riscv/linux.h +@@ -47,6 +47,8 @@ along with GCC; see the file COPYING3. If not see + + #define ICACHE_FLUSH_FUNC "__riscv_flush_icache" + ++#define CPP_SPEC "%{pthread:-D_REENTRANT}" ++ + #define LINK_SPEC "\ + -melf" XLEN_SPEC "lriscv \ + %{shared} \ +-- +2.19.1 +