Bug 106266 - Libgo fails with recent glibc
Summary: Libgo fails with recent glibc
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: go (show other bugs)
Version: 13.0
: P3 normal
Target Milestone: 13.0
Assignee: Ian Lance Taylor
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-07-12 07:21 UTC by Martin Liška
Modified: 2024-01-06 05:38 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2022-07-12 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Liška 2022-07-12 07:21:53 UTC
Fails with:

[ 4342s] /home/abuild/rpmbuild/BUILD/gcc-13.0.0+git194331/obj-x86_64-suse-linux/./gcc/xgcc -B/home/abuild/rpmbuild/BUILD/gcc-13.0.0+git194331/obj-x86_64-suse-linux/./gcc/ -B/usr/x86_64-suse-linux/bin/ -B/usr/x86_64-suse-linux/lib/ -isystem /usr/x86_64-suse-linux/include -isystem /usr/x86_64-suse-linux/sys-include    -DHAVE_CONFIG_H -I. -I../../../libgo  -I ../../../libgo/runtime -I../../../libgo/../libffi/include -I../libffi/include -pthread -L../libatomic/.libs  -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O -fdump-go-spec=tmp-gen-sysinfo.go -std=gnu99 -S -o sysinfo.s ../../../libgo/sysinfo.c
[ 4342s] In file included from /usr/include/linux/fs.h:19,
[ 4342s]                  from ../../../libgo/sysinfo.c:162:
[ 4342s] /usr/include/linux/mount.h:95:6: error: redeclaration of 'enum fsconfig_command'
[ 4342s]    95 | enum fsconfig_command {
[ 4342s]       |      ^~~~~~~~~~~~~~~~
[ 4342s] In file included from ../../../libgo/sysinfo.c:141:
[ 4342s] /usr/include/sys/mount.h:189:6: note: originally defined here
[ 4342s]   189 | enum fsconfig_command
[ 4342s]       |      ^~~~~~~~~~~~~~~~

It's very similar to the following libsanitizer issue:
https://github.com/llvm/llvm-project/issues/56421
Comment 1 GCC Commits 2022-07-13 16:02:29 UTC
The master branch has been updated by Ian Lance Taylor <ian@gcc.gnu.org>:

https://gcc.gnu.org/g:f35d65517a59565758107c5b1a51a5fa382f8d1a

commit r13-1686-gf35d65517a59565758107c5b1a51a5fa382f8d1a
Author: Ian Lance Taylor <iant@golang.org>
Date:   Tue Jul 12 19:42:43 2022 -0700

    libgo: don't include <linux/fs.h> when building gen-sysinfo.go
    
    Removing this doesn't change anything at least with glibc 2.33.
    The include was added in https://go.dev/cl/6100049 but it's not
    clear why.
    
    Fixes PR go/106266
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/417294
Comment 2 Ian Lance Taylor 2022-07-13 16:03:43 UTC
Should be fixed.  Thanks.
Comment 3 GCC Commits 2022-07-21 11:53:16 UTC
The releases/gcc-12 branch has been updated by Martin Liska <marxin@gcc.gnu.org>:

https://gcc.gnu.org/g:4f15d2234608e82159d030dadb17af678cfad626

commit r12-8599-g4f15d2234608e82159d030dadb17af678cfad626
Author: Ian Lance Taylor <iant@golang.org>
Date:   Tue Jul 12 19:42:43 2022 -0700

    libgo: don't include <linux/fs.h> when building gen-sysinfo.go
    
    Removing this doesn't change anything at least with glibc 2.33.
    The include was added in https://go.dev/cl/6100049 but it's not
    clear why.
    
    Fixes PR go/106266
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/417294
    (cherry picked from commit f35d65517a59565758107c5b1a51a5fa382f8d1a)
Comment 4 GCC Commits 2022-07-21 11:59:24 UTC
The releases/gcc-11 branch has been updated by Martin Liska <marxin@gcc.gnu.org>:

https://gcc.gnu.org/g:a55184ada8e2887ca94c0ab07027617885beafc9

commit r11-10158-ga55184ada8e2887ca94c0ab07027617885beafc9
Author: Ian Lance Taylor <iant@golang.org>
Date:   Tue Jul 12 19:42:43 2022 -0700

    libgo: don't include <linux/fs.h> when building gen-sysinfo.go
    
    Removing this doesn't change anything at least with glibc 2.33.
    The include was added in https://go.dev/cl/6100049 but it's not
    clear why.
    
    Fixes PR go/106266
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/417294
    (cherry picked from commit f35d65517a59565758107c5b1a51a5fa382f8d1a)
Comment 5 GCC Commits 2022-07-21 12:09:23 UTC
The releases/gcc-10 branch has been updated by Martin Liska <marxin@gcc.gnu.org>:

https://gcc.gnu.org/g:8c3238510ce63c75024c0288eade5c933f6d322e

commit r10-10905-g8c3238510ce63c75024c0288eade5c933f6d322e
Author: Ian Lance Taylor <iant@golang.org>
Date:   Tue Jul 12 19:42:43 2022 -0700

    libgo: don't include <linux/fs.h> when building gen-sysinfo.go
    
    Removing this doesn't change anything at least with glibc 2.33.
    The include was added in https://go.dev/cl/6100049 but it's not
    clear why.
    
    Fixes PR go/106266
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/417294
    (cherry picked from commit f35d65517a59565758107c5b1a51a5fa382f8d1a)