From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26560 invoked by alias); 19 Dec 2016 18:00:51 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 23744 invoked by uid 89); 19 Dec 2016 18:00:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.2 required=5.0 tests=AWL,BAYES_50,KAM_ASCII_DIVIDERS,RCVD_IN_DNSWL_LOW,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=blocked, unblock, H*Ad:D*googlegroups.com, HTo:D*googlegroups.com X-HELO: mail-io0-f174.google.com Received: from mail-io0-f174.google.com (HELO mail-io0-f174.google.com) (209.85.223.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 19 Dec 2016 18:00:40 +0000 Received: by mail-io0-f174.google.com with SMTP id d9so158898435ioe.0 for ; Mon, 19 Dec 2016 10:00:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=TkOSbmXfIXtsLWRqnRj61T5gxc5x3lJy2TxiMCfl190=; b=dpkXLuJGHxC8aSdGo18NjGkU/HHfqRk3oXsoPdQoX5/aGHF4njVOwcp1lFd2TzjGDt cGXvmT106j6poPtukDVRYC6ECG6ZVSad/UARoSx3qPIvJkOQJCtkyeBOriUnAfjGQamk +FAvsONGJRAszbKL8bHYiB1FJWzo6NpGPVoAGZ27YAVeFZZdJDw55XfbACLr91QdpJ3k 9BKqwQ5a4/OK4gqzGj5S2iD/iJbxz3vJlt2CoC0h5zEEsaTAGQsn3qvpeM2x/JyXsBCa sDvR0bDP7ATx9ZTsGTg4ScFxKmlMYcBk5CRBdu8Nilwvv6yWW5J/VqnG/Ug4/WRXA6DH i4qQ== X-Gm-Message-State: AIkVDXIQILQtLGFvVgUG2BhuQ9Q6J6gIo6EhXnpGvEzmnKJ6LwZJKtJ8gmYedRKkuefn0lvxBDd8wDHkIDE1tA== X-Received: by 10.107.176.197 with SMTP id z188mr18297514ioe.7.1482170438202; Mon, 19 Dec 2016 10:00:38 -0800 (PST) MIME-Version: 1.0 Received: by 10.64.19.241 with HTTP; Mon, 19 Dec 2016 10:00:37 -0800 (PST) From: Ian Lance Taylor Date: Mon, 19 Dec 2016 18:00:00 -0000 Message-ID: Subject: libgo patch committed: Copy/rewrite cgo support code from Go 1.7 runtime To: gcc-patches , "gofrontend-dev@googlegroups.com" Content-Type: multipart/mixed; boundary=001a1145363877ecb2054406b2d7 X-SW-Source: 2016-12/txt/msg01641.txt.bz2 --001a1145363877ecb2054406b2d7 Content-Type: text/plain; charset=UTF-8 Content-length: 396 This patch copies the cgo support code from the Go 1.7 runtime to libgo. The cgo support in gccgo is rather different, so all the code in cgo_gccgo.go is gccgo-specific. The rest of the code is similar but slightly different. This drops _cgo_allocate, which was removed from the gc toolchain back in 1.5. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline. Ian --001a1145363877ecb2054406b2d7 Content-Type: text/plain; charset=US-ASCII; name="patch.txt" Content-Disposition: attachment; filename="patch.txt" Content-Transfer-Encoding: base64 X-Attachment-Id: f_iwwe04on0 Content-length: 71163 SW5kZXg6IGdjYy9nby9nb2Zyb250ZW5kL01FUkdFCj09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT0KLS0tIGdjYy9nby9nb2Zyb250ZW5kL01FUkdFCShyZXZpc2lv biAyNDM3NjYpCisrKyBnY2MvZ28vZ29mcm9udGVuZC9NRVJHRQkod29ya2lu ZyBjb3B5KQpAQCAtMSw0ICsxLDQgQEAKLWU2ZmI2MjljNWIyNDZiY2VhYjVm YzhlODYxM2NmMmNmODJiMWU5OGYKK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9Cb29sIHJ1bnRpbWVfY2dvSGFzRXh0cmFNOwpJbmRleDogbGliZ28v cnVudGltZS9nby1saWJtYWluLmMKPT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQot LS0gbGliZ28vcnVudGltZS9nby1saWJtYWluLmMJKHJldmlzaW9uIDI0MzQ0 NSkKKysrIGxpYmdvL3J1bnRpbWUvZ28tbGlibWFpbi5jCSh3b3JraW5nIGNv cHkpCkBAIC02MSw2ICs2MSw3IEBAIGluaXRmbiAoaW50IGFyZ2MsIGNoYXIg Kiphcmd2LCBjaGFyKiogZW4KIAogICBydW50aW1lX2lzYXJjaGl2ZSA9IHRy dWU7CiAKKyAgc2V0SXNDZ28gKCk7CiAgIHJ1bnRpbWVfY3B1aW5pdCAoKTsK ICAgcnVudGltZV9pbml0c2lnKHRydWUpOwogCkluZGV4OiBsaWJnby9ydW50 aW1lL2dvLW1haW4uYwo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBsaWJn by9ydW50aW1lL2dvLW1haW4uYwkocmV2aXNpb24gMjQzNDQ1KQorKysgbGli Z28vcnVudGltZS9nby1tYWluLmMJKHdvcmtpbmcgY29weSkKQEAgLTQ2LDYg KzQ2LDkgQEAgbWFpbiAoaW50IGFyZ2MsIGNoYXIgKiphcmd2KQogICAgIHJl dHVybiAwOwogICBydW50aW1lX2lzc3RhcnRlZCA9IHRydWU7CiAKKyAgaWYg KHJ1bnRpbWVfaXNjZ28pCisgICAgc2V0SXNDZ28gKCk7CisKICAgX19nb19l bmQgPSAodWludHB0cilfZW5kOwogICBydW50aW1lX2NwdWluaXQgKCk7CiAg IHJ1bnRpbWVfY2hlY2sgKCk7CkluZGV4OiBsaWJnby9ydW50aW1lL21hbGxv Yy5oCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09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ldWUxKShzdHJ1Y3QgV29ya2J1ZioqLCBPYmopKQotewotCWVucXVl dWUxKHdidWZwLCAoT2JqKXsoYnl0ZSopJnJ1bnRpbWVfbWFpbl9pbml0X2Rv bmUsIHNpemVvZiBydW50aW1lX21haW5faW5pdF9kb25lLCAwfSk7Ci19Ci0K IC8vIFJldHVybiB3aGV0aGVyIHdlIGFyZSB3YWl0aW5nIGZvciBhIEdDLiAg VGhpcyBnYyB0b29sY2hhaW4gdXNlcwogLy8gcHJlZW1wdGlvbiBpbnN0ZWFk LgogYm9vbApJbmRleDogbGliZ28vcnVudGltZS9ydW50aW1lLmgKPT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PQotLS0gbGliZ28vcnVudGltZS9ydW50aW1lLmgJ KHJldmlzaW9uIDI0MzQ0NSkKKysrIGxpYmdvL3J1bnRpbWUvcnVudGltZS5o CSh3b3JraW5nIGNvcHkpCkBAIC01Miw3ICs1Miw3IEBAIHR5cGVkZWYgdWlu dHB0cgkJdWludHJlZzsKIAogLyogRGVmaW5lZCB0eXBlcy4gICovCiAKLXR5 cGVkZWYJdWludDgJCQlib29sOwordHlwZWRlZglfQm9vbAkJCWJvb2w7CiB0 eXBlZGVmCXVpbnQ4CQkJYnl0ZTsKIHR5cGVkZWYJc3RydWN0CWcJCUc7CiB0 eXBlZGVmCXN0cnVjdAltdXRleAkJTG9jazsKQEAgLTI0MCw3ICsyNDAsNiBA QCBleHRlcm4JTSoJcnVudGltZV9hbGxtOwogZXh0ZXJuCVAqKglydW50aW1l X2FsbHA7CiBleHRlcm4JU2NoZWQqICBydW50aW1lX3NjaGVkOwogZXh0ZXJu CWludDMyCXJ1bnRpbWVfZ29tYXhwcm9jczsKLWV4dGVybgl1aW50MzIJcnVu dGltZV9uZWVkZXh0cmFtOwogZXh0ZXJuCXVpbnQzMglydW50aW1lX3Bhbmlj a2luZyh2b2lkKQogICBfX2FzbV9fIChHT1NZT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JFRklYICJydW50aW1lLnNldElzQ2dvIik7CiBleHRlcm4g dm9pZCBzZXRDcHVpZEVDWCh1aW50MzIpCiAgIF9fYXNtX18gKEdPU1lNX1BS RUZJWCAicnVudGltZS5zZXRDcHVpZEVDWCIpOworZXh0ZXJuIHZvaWQgbWFr ZU1haW5Jbml0RG9uZSh2b2lkKQorICBfX2FzbV9fIChHT1NZTV9QUkVGSVgg InJ1bnRpbWUubWFrZU1haW5Jbml0RG9uZSIpOworZXh0ZXJuIHZvaWQgY2xv c2VNYWluSW5pdERvbmUodm9pZCkKKyAgX19hc21fXyAoR09TWU1fUFJFRklY ICJydW50aW1lLmNsb3NlTWFpbkluaXREb25lIik7CkluZGV4OiBsaWJnby9y dW50aW1lL3J1bnRpbWVfYy5jCj09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0t IGxpYmdvL3J1bnRpbWUvcnVudGltZV9jLmMJKHJldmlzaW9uIDI0MzQ0NSkK KysrIGxpYmdvL3J1bnRpbWUvcnVudGltZV9jLmMJKHdvcmtpbmcgY29weSkK QEAgLTk5LDQzICs5OSwxMiBAQCBydW50aW1lX2NwdXRpY2tzKHZvaWQpCiB2 b2lkCiBydW50aW1lX21wcmVpbml0KE0gKm1wKQogewotCWludDMyIHN0YWNr c2l6ZSA9IDMyICogMTAyNDsJLy8gT1MgWCB3YW50cyA+PThLLCBMaW51eCA+ PTJLCi0KLSNpZmRlZiBTSUdTVEtTWgotCWlmKHN0YWNrc2l6ZSA8IFNJR1NU S1NaKQotCQlzdGFja3NpemUgPSBTSUdTVEtTWjsKLSNlbmRpZgotCi0JbXAt PmdzaWduYWwgPSBydW50aW1lX21hbGcoc3RhY2tzaXplLCAoYnl0ZSoqKSZt cC0+Z3NpZ25hbHN0YWNrLCAmbXAtPmdzaWduYWxzdGFja3NpemUpOworCW1w LT5nc2lnbmFsID0gcnVudGltZV9tYWxnKHRydWUsIHRydWUsIChieX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