[PATCH] libgo: Recognize off64_t / loff_t type definition of musl libc

2022-04-24 Thread soeren--- via Gcc-patches
From: Sören Tempel The libgo code assumes both off64_t and loff_t to be present. For example, for the splice(2) function prototype. Similar to glibc, musl libc supports these types but defines them as macros, not as typedefs. Unfortunately, -fdump-go-spec only recognizes types defined using typed

Re: libgo: Recognize off64_t / loff_t type definition of musl libc

2022-05-07 Thread Sören Tempel via Gcc-patches
PING. Summary: gcc-go currently assumes that both loff_t and off64_t are defined as a typedef. However, musl defines them as a CPP macro causing gccgo to not compile with musl libc. See: https://gcc.gnu.org/pipermail/gcc-patches/2022-April/593527.html If an alternative solution to the problem is

Re: [PATCH] libgo: Recognize off64_t / loff_t type definition of musl libc

2022-06-17 Thread Ian Lance Taylor via Gcc-patches
On Tue, May 31, 2022 at 12:41 PM Sören Tempel wrote: > > PING. > > If there is anything else that needs to be addressed please let me know. Thanks. Committed as follows. Sorry for the delay. Ian e584afe7976a40df42eed4df6ce6852abab74030 diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/M

Re: [PATCH] libgo: Recognize off64_t / loff_t type definition of musl libc

2022-06-18 Thread Andreas Schwab
../../../libgo/go/syscall/libcall_linux.go:220:25: error: reference to undefined name '_libgo_loff_t_type' 220 | lroff = _libgo_loff_t_type(*roff) | ^ ../../../libgo/go/syscall/libcall_linux.go:226:25: error: reference to undefined name '_libgo_loff

Re: [PATCH] libgo: Recognize off64_t / loff_t type definition of musl libc

2022-06-18 Thread Ian Lance Taylor via Gcc-patches
On Sat, Jun 18, 2022 at 12:19 AM Andreas Schwab wrote: > > ../../../libgo/go/syscall/libcall_linux.go:220:25: error: reference to > undefined name '_libgo_loff_t_type' > 220 | lroff = _libgo_loff_t_type(*roff) > | ^ > ../../../libgo/go/syscall/libca

Re: [PATCH] libgo: Recognize off64_t / loff_t type definition of musl libc

2022-06-18 Thread Andreas Schwab
On Jun 18 2022, Ian Lance Taylor wrote: > What target? aarch64-suse-linux, of course. > What is the output of > > grep loff_t TARGET/libgo/gen-sysinfo.go type ___loff_t int64 type _loff_t int64 type ___kernel_loff_t int64 -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 7578 EB4

Re: [PATCH] libgo: Recognize off64_t / loff_t type definition of musl libc

2022-06-20 Thread Eric Botcazou via Gcc-patches
> aarch64-suse-linux, of course. Likewise on x86_64-suse-linux. > > What is the output of > > > > grep loff_t TARGET/libgo/gen-sysinfo.go > > type ___loff_t int64 > type _loff_t int64 > type ___kernel_loff_t int64 Ditto. -- Eric Botcazou

Re: [PATCH] libgo: Recognize off64_t / loff_t type definition of musl libc

2022-06-21 Thread Sören Tempel via Gcc-patches
Hi, The problem is: glibc defines loff_t in sys/types.h, not fcntl.h (where musl defines it). I falsely assumed that the newly committed AC_CHECK_TYPES invocation would include fcntl.h *in addition to* AC_INCLUDES_DEFAULT. However, as it turns out specifying includes for AC_CHECK_TYPES overwrites

Re: [PATCH] libgo: Recognize off64_t / loff_t type definition of musl libc

2022-06-21 Thread Franz Sirl
Am 2022-06-21 um 09:34 schrieb Sören Tempel via Gcc-patches: Hi, The problem is: glibc defines loff_t in sys/types.h, not fcntl.h (where musl defines it). I falsely assumed that the newly committed AC_CHECK_TYPES invocation would include fcntl.h *in addition to* AC_INCLUDES_DEFAULT. However, as

Re: [PATCH] libgo: Recognize off64_t / loff_t type definition of musl libc

2022-06-21 Thread Ian Lance Taylor via Gcc-patches
On Sat, Jun 18, 2022 at 8:59 AM Andreas Schwab wrote: > > On Jun 18 2022, Ian Lance Taylor wrote: > > > What target? > > aarch64-suse-linux, of course. Thanks. Sorry for missing that. > > What is the output of > > > > grep loff_t TARGET/libgo/gen-sysinfo.go > > type ___loff_t int64 > type _lof

Re: [PATCH] libgo: Recognize off64_t / loff_t type definition of musl libc

2022-06-21 Thread Andreas Schwab
On Jun 21 2022, Ian Lance Taylor via Gcc-patches wrote: > which seems to be Linux 3.13 and glibc 4.8.4. On that system I see That's stone age. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely dif

Re: [PATCH] libgo: Recognize off64_t / loff_t type definition of musl libc

2022-06-21 Thread Ian Lance Taylor via Gcc-patches
On Tue, Jun 21, 2022 at 8:16 AM Andreas Schwab wrote: > > On Jun 21 2022, Ian Lance Taylor via Gcc-patches wrote: > > > which seems to be Linux 3.13 and glibc 4.8.4. On that system I see > > That's stone age. I don't know who maintains these systems on the GCC compile farm. Ian

Re: [PATCH] libgo: Recognize off64_t / loff_t type definition of musl libc

2022-05-09 Thread Ian Lance Taylor via Gcc-patches
On Sun, Apr 24, 2022 at 3:20 AM wrote: > > From: Sören Tempel > > The libgo code assumes both off64_t and loff_t to be present. For > example, for the splice(2) function prototype. Similar to glibc, > musl libc supports these types but defines them as macros, not as > typedefs. Unfortunately, -fd

Re: [PATCH] libgo: Recognize off64_t / loff_t type definition of musl libc

2022-05-12 Thread Sören Tempel via Gcc-patches
Hi Ian, Thanks for following up on this, comments below. Ian Lance Taylor wrote: > I see uses of loff_t but I don't see any uses of off64_t. The off64_t type is used for defining Offset_t: https://github.com/golang/gofrontend/blob/4bdff733a0c2a9ddc3eff104b1be03df058a79c4/libgo/mksysin

Re: [PATCH] libgo: Recognize off64_t / loff_t type definition of musl libc

2022-05-12 Thread Ian Lance Taylor via Gcc-patches
On Thu, May 12, 2022 at 11:23 AM Sören Tempel via Gcc-patches wrote: > > The off64_t type is used for defining Offset_t: > > > https://github.com/golang/gofrontend/blob/4bdff733a0c2a9ddc3eff104b1be03df058a79c4/libgo/mksysinfo.sh#L406-L410 > > On musl, _HAVE_OFF64_T is defined since autoco

Re: [PATCH] libgo: Recognize off64_t / loff_t type definition of musl libc

2022-05-18 Thread Sören Tempel via Gcc-patches
I modified your patch to also define libgo_off_t_type (along to libgo_loff_t_type) and used that to define Offset_t in mksysinfo.sh. Furthermore, I fixed the include for the loff_t feature check. With those two modifications your patch works for me (see attachment). Greetings, Sören Ian Lance Ta

Re: [PATCH] libgo: Recognize off64_t / loff_t type definition of musl libc

2022-05-31 Thread Sören Tempel via Gcc-patches
PING. If there is anything else that needs to be addressed please let me know. Sören Tempel wrote: > I modified your patch to also define libgo_off_t_type (along to > libgo_loff_t_type) and used that to define Offset_t in mksysinfo.sh. > Furthermore, I fixed the include for the loff_t feature ch