From patchwork Wed Jul 15 18:55:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Sidwell X-Patchwork-Id: 495979 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 0957714076D for ; Thu, 16 Jul 2015 04:55:58 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=RqQvnRTS; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:content-type; q=dns; s=default; b=uKLlIDi1FU5kdkuonf3CjVNNOiBlmlU7Hdvt5QdLQmc Q57Zfc70Kf7OFhyJg4fueLMM3CxyRymSdpRktPbuuSfUFSL7yPzdYi72/BLdYzwC Q7ErqMfpKNZ03RZyytKfQKRA6uDfCmPfD6gsW6bHf2JiFAS1sjIfWsliNn5iyqQU = 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 :message-id:date:from:mime-version:to:cc:subject:content-type; s=default; bh=7UL1//x2CPiVDkhoWpcvMruni/c=; b=RqQvnRTSFJFUB2gc9 quWBkMaMgVBbbD2COOj8RYbOVF9QvAmf82Ua7k5I1hoD8HSoslyoP7wQU2wonodl f3V5fAxAXHYFWall5TydYdmfIBycFQsn9un6wj9aRSFj6jgcsSUNE1ht3DjZtzrH F2/mvX+wp+vdCSS38YaOL2StMs= Received: (qmail 126266 invoked by alias); 15 Jul 2015 18:55:52 -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 126252 invoked by uid 89); 15 Jul 2015 18:55:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-qk0-f170.google.com Received: from mail-qk0-f170.google.com (HELO mail-qk0-f170.google.com) (209.85.220.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 15 Jul 2015 18:55:50 +0000 Received: by qkcl188 with SMTP id l188so34969149qkc.1 for ; Wed, 15 Jul 2015 11:55:47 -0700 (PDT) X-Received: by 10.140.239.136 with SMTP id k130mr4196643qhc.90.1436986547904; Wed, 15 Jul 2015 11:55:47 -0700 (PDT) Received: from ?IPv6:2601:181:c000:c497:a2a8:cdff:fe3e:b48? ([2601:181:c000:c497:a2a8:cdff:fe3e:b48]) by smtp.googlemail.com with ESMTPSA id 78sm2697927qhv.38.2015.07.15.11.55.46 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Jul 2015 11:55:47 -0700 (PDT) Message-ID: <55A6ACB2.5080501@acm.org> Date: Wed, 15 Jul 2015 14:55:46 -0400 From: Nathan Sidwell User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: GCC Patches CC: Bernd Schmidt Subject: [nvptx] C++ify mkoffloads I've applied this obvious patch to trunk to make mkoffloads work for C++. The equivalent is already on the gomp4 branch. nathan 2015-07-15 Nathan Sidwell * config/nvptx/mkoffload.c (process): Add C++ protection to emitted code. Index: config/nvptx/mkoffload.c =================================================================== --- config/nvptx/mkoffload.c (revision 225843) +++ config/nvptx/mkoffload.c (working copy) @@ -867,7 +867,13 @@ process (FILE *in, FILE *out) "func_mappings\n", nvars, nfuncs); fprintf (out, "};\n\n"); - fprintf (out, "extern void GOMP_offload_register (const void *, int, void *);\n"); + fprintf (out, "#ifdef __cplusplus\n" + "extern \"C\" {\n" + "#endif\n"); + fprintf (out, "extern void GOMP_offload_register (void *, int, void *);\n"); + fprintf (out, "#ifdef __cplusplus\n" + "}\n" + "#endif\n"); fprintf (out, "extern void *__OFFLOAD_TABLE__[];\n\n"); fprintf (out, "static __attribute__((constructor)) void init (void)\n{\n");