From f38162977e2b7efaa75233a0cba2a30a2b7f5132 Mon Sep 17 00:00:00 2001 From: melonedo Date: Mon, 19 Sep 2022 16:01:04 +0800 Subject: runtime: synchronize empty struct field handling In GCCGO and gollvm, the logic for allocating one byte for the last field is: 1. the last field has zero size 2. the struct itself does not have zero size 3. the last field is not blank this commit adds the last two conditions to runtime.structToFFI. For golang/go#55146 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/431735 --- gcc/go/gofrontend/MERGE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/go') diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index f7a7985..73aa712 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -42efec8c126cf3787bc7c89d9c7f224eff7c5a21 +0140cca9bc0fad1108c7ed369376ac71cc4bfecf The first line of this file holds the git revision number of the last merge done from the gofrontend repository. -- cgit v1.1 From e73d9fcafbd07bc3714fbaf8a82db71d50015c92 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Mon, 26 Sep 2022 15:03:53 -0400 Subject: runtime: portable access to sigev_notify_thread_id MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously, libgo relied on the _sigev_un implementation-specific field in struct sigevent, which is only available on glibc. This patch uses the sigev_notify_thread_id macro instead which is mandated by timer_create(2). In theory, this should work with any libc implementation for Linux. Unfortunately, there is an open glibc bug as glibc does not define this macro. For this reason, a glibc-specific workaround is required. Other libcs (such as musl) define the macro and don't require the workaround. See https://sourceware.org/bugzilla/show_bug.cgi?id=27417 This makes libgo compatible with musl libc. Based on patch by Sören Tempel. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/434755 --- gcc/go/gofrontend/MERGE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/go') diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 73aa712..4793c82 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -0140cca9bc0fad1108c7ed369376ac71cc4bfecf +8f1a91aeff400d572857895b7f5e863ec5a4d93e The first line of this file holds the git revision number of the last merge done from the gofrontend repository. -- cgit v1.1