From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) by sourceware.org (Postfix) with ESMTPS id 3975C3858C2C for ; Tue, 21 Dec 2021 14:37:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3975C3858C2C Received: by mail-lj1-x232.google.com with SMTP id a37so21710701ljq.13 for ; Tue, 21 Dec 2021 06:37:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=GDoZx5ZBV0IS9JPINdLu6fJpTvQQGRntLtBdIKorTEU=; b=ZiGuK05PTXJyDPXgeYZzD8h7W/DWz0yuXuaDg9lEi1er9WfiUNd8RgZZNEs42rdJ9c UqOkCTsKflORfINA5NmiTbiNq3KanExZPXHn4KYmCa2pRhk9Dj0qBzBnXct/D6bV06K1 O2eY3WuJ52e9HLMiHQdjL5feXbIP7oVuavTBTYlKrkT3DFOrpFTskOJ9aOcCVJ1i/CNJ +GszcRq1CXVgmlrQsBxVMtxalCIVxkJ+s3VaER9PQz/6ATnlUAUkBF3M6hC3I4YwzyW0 PVl63vcJjcNpWW92/UuWvxf0joaUpVZg5JtfxyGYpYQ8yDdOvfer5TQCmYmib/klxCKE mekg== X-Gm-Message-State: AOAM5320BoeIM5Ax1iHupzO0aQR/uR/9DaD4oj5cRcmnMiaa5XXWV/xP 82dBYRrclG2MHlEsL4XrfAJ3VSvzTGyK X-Google-Smtp-Source: ABdhPJzx3cbH95LinqpaExUJ8bKbWdKj5+q+75QSGAkphF/KAp4zUTA829kpSxR4nPBG+m7DA9DSIw== X-Received: by 2002:a2e:720b:: with SMTP id n11mr2719451ljc.351.1640097449771; Tue, 21 Dec 2021 06:37:29 -0800 (PST) Received: from [192.168.0.135] ([185.30.228.158]) by smtp.gmail.com with ESMTPSA id cf18sm1855776lfb.251.2021.12.21.06.37.28 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Dec 2021 06:37:29 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\)) Subject: Re: [TCWG CI] Regression caused by gcc: [PATCH] stddef.h: add support for musl typedef macro guards From: Maxim Kuvyrkov In-Reply-To: <286095228.5701.1639809711150@jenkins.jenkins> Date: Tue, 21 Dec 2021 17:37:28 +0300 Cc: gcc-regression@gcc.gnu.org Content-Transfer-Encoding: quoted-printable Message-Id: <4CE09406-04DB-4B6F-B8C9-8255DADA4924@linaro.org> References: <286095228.5701.1639809711150@jenkins.jenkins> To: =?utf-8?Q?S=C3=B6ren_Tempel?= X-Mailer: Apple Mail (2.3608.120.23.2.7) X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_LOTSOFHASH, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-regression@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-regression mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Dec 2021 14:37:33 -0000 Hi S=C3=B6ren, This was sent out due to a bug in our CI. Sorry for the noise. Regards, -- Maxim Kuvyrkov https://www.linaro.org > On 18 Dec 2021, at 09:41, ci_notify@linaro.org wrote: >=20 > [TCWG CI] Regression caused by gcc: [PATCH] stddef.h: add support for = musl typedef macro guards: > commit 85a438fc78dd12249ca854a3e5c577fefeb1a5cd > Author: S=C3=B6ren Tempel >=20 > [PATCH] stddef.h: add support for musl typedef macro guards >=20 > Results regressed to > # reset_artifacts: > -10 > # build_abe binutils: > -9 > # build_abe stage1 -- --set = gcc_override_configure=3D--disable-libsanitizer --set = gcc_override_configure=3D--disable-multilib --set = gcc_override_configure=3D--with-cpu=3Dcortex-m4 --set = gcc_override_configure=3D--with-mode=3Dthumb --set = gcc_override_configure=3D--with-float=3Dhard: > -8 > # build_abe newlib: > -6 > # build_abe stage2 -- --set = gcc_override_configure=3D--disable-libsanitizer --set = gcc_override_configure=3D--disable-multilib --set = gcc_override_configure=3D--with-cpu=3Dcortex-m4 --set = gcc_override_configure=3D--with-mode=3Dthumb --set = gcc_override_configure=3D--with-float=3Dhard: > -5 > # benchmark -- -O2_LTO_mthumb = artifacts/build-85a438fc78dd12249ca854a3e5c577fefeb1a5cd/results_id: > 1 >=20 > from > # reset_artifacts: > -10 > # build_abe binutils: > -9 > # build_abe stage1 -- --set = gcc_override_configure=3D--disable-libsanitizer --set = gcc_override_configure=3D--disable-multilib --set = gcc_override_configure=3D--with-cpu=3Dcortex-m4 --set = gcc_override_configure=3D--with-mode=3Dthumb --set = gcc_override_configure=3D--with-float=3Dhard: > -8 > # build_abe newlib: > -6 > # build_abe stage2 -- --set = gcc_override_configure=3D--disable-libsanitizer --set = gcc_override_configure=3D--disable-multilib --set = gcc_override_configure=3D--with-cpu=3Dcortex-m4 --set = gcc_override_configure=3D--with-mode=3Dthumb --set = gcc_override_configure=3D--with-float=3Dhard: > -5 > # benchmark -- -O2_LTO_mthumb artifacts/build-baseline/results_id: > 1 >=20 > THIS IS THE END OF INTERESTING STUFF. BELOW ARE LINKS TO BUILDS, = REPRODUCTION INSTRUCTIONS, AND THE RAW COMMIT. >=20 > This commit has regressed these CI configurations: > - tcwg_bmk_gnu_eabi_stm32/gnu_eabi-master-arm_eabi-coremark-O2_LTO >=20 > First_bad build: = https://ci.linaro.org/job/tcwg_bmk_ci_gnu_eabi-bisect-tcwg_bmk_stm32-gnu_e= abi-master-arm_eabi-coremark-O2_LTO/12/artifact/artifacts/build-85a438fc78= dd12249ca854a3e5c577fefeb1a5cd/ > Last_good build: = https://ci.linaro.org/job/tcwg_bmk_ci_gnu_eabi-bisect-tcwg_bmk_stm32-gnu_e= abi-master-arm_eabi-coremark-O2_LTO/12/artifact/artifacts/build-a888259a71= fbbb7f14923751251e056829d76342/ > Baseline build: = https://ci.linaro.org/job/tcwg_bmk_ci_gnu_eabi-bisect-tcwg_bmk_stm32-gnu_e= abi-master-arm_eabi-coremark-O2_LTO/12/artifact/artifacts/build-baseline/ > Even more details: = https://ci.linaro.org/job/tcwg_bmk_ci_gnu_eabi-bisect-tcwg_bmk_stm32-gnu_e= abi-master-arm_eabi-coremark-O2_LTO/12/artifact/artifacts/ >=20 > Reproduce builds: > > mkdir investigate-gcc-85a438fc78dd12249ca854a3e5c577fefeb1a5cd > cd investigate-gcc-85a438fc78dd12249ca854a3e5c577fefeb1a5cd >=20 > # Fetch scripts > git clone https://git.linaro.org/toolchain/jenkins-scripts >=20 > # Fetch manifests and test.sh script > mkdir -p artifacts/manifests > curl -o artifacts/manifests/build-baseline.sh = https://ci.linaro.org/job/tcwg_bmk_ci_gnu_eabi-bisect-tcwg_bmk_stm32-gnu_e= abi-master-arm_eabi-coremark-O2_LTO/12/artifact/artifacts/manifests/build-= baseline.sh --fail > curl -o artifacts/manifests/build-parameters.sh = https://ci.linaro.org/job/tcwg_bmk_ci_gnu_eabi-bisect-tcwg_bmk_stm32-gnu_e= abi-master-arm_eabi-coremark-O2_LTO/12/artifact/artifacts/manifests/build-= parameters.sh --fail > curl -o artifacts/test.sh = https://ci.linaro.org/job/tcwg_bmk_ci_gnu_eabi-bisect-tcwg_bmk_stm32-gnu_e= abi-master-arm_eabi-coremark-O2_LTO/12/artifact/artifacts/test.sh --fail > chmod +x artifacts/test.sh >=20 > # Reproduce the baseline build (build all pre-requisites) > ./jenkins-scripts/tcwg_bmk-build.sh @@ = artifacts/manifests/build-baseline.sh >=20 > # Save baseline build state (which is then restored in = artifacts/test.sh) > mkdir -p ./bisect > rsync -a --del --delete-excluded --exclude /bisect/ --exclude = /artifacts/ --exclude /gcc/ ./ ./bisect/baseline/ >=20 > cd gcc >=20 > # Reproduce first_bad build > git checkout --detach 85a438fc78dd12249ca854a3e5c577fefeb1a5cd > ../artifacts/test.sh >=20 > # Reproduce last_good build > git checkout --detach a888259a71fbbb7f14923751251e056829d76342 > ../artifacts/test.sh >=20 > cd .. > >=20 > Full commit (up to 1000 lines): > > commit 85a438fc78dd12249ca854a3e5c577fefeb1a5cd > Author: S=C3=B6ren Tempel > Date: Tue Dec 14 18:07:47 2021 -0500 >=20 > [PATCH] stddef.h: add support for musl typedef macro guards >=20 > The stddef.h header checks/sets various hardcoded toolchain/os = specific > macro guards to prevent redefining types such as ptrdiff_t, = wchar_t, or > size_t. However, without this patch, the file does not check/set = the > typedef macro guards for musl libc. This causes types such as = size_t to > be defined twice for files which include both musl's stdlib.h as = well as > GCC's ginclude/stddef.h. This is, for example, the case for > libgo/sysinfo.c. If libgo/sysinfo.c has multiple typedefs for = size_t > this confuses -fdump-go-spec and causes size_t not to be included = in the > generated type definitions thereby causing a gcc-go compilation = failure > on Alpine Linux Edge (which uses musl libc) with the following = error: >=20 > sysinfo.go:7765:13: error: use of undefined type '_size_t' > 7765 | type Size_t _size_t > | ^ > libcall_posix.go:49:35: error: non-integer len argument in = make > 49 | b :=3D make([]byte, len) > | >=20 > This commit fixes this issue by ensuring that ptrdiff_t, wchar_t, = and size_t > are only defined once in the pre-processed libgo/sysinfo.c file by = enhancing > gcc/ginclude/stddef.h with musl-specific typedef macro guards. >=20 > gcc/ChangeLog: >=20 > * ginclude/stddef.h (__DEFINED_ptrdiff_t): Add support for = musl > libc typedef macro guard. > (__DEFINED_size_t): Ditto. > (__DEFINED_wchar_t): Ditto. > --- > gcc/ginclude/stddef.h | 9 +++++++++ > 1 file changed, 9 insertions(+) >=20 > diff --git a/gcc/ginclude/stddef.h b/gcc/ginclude/stddef.h > index 66619fe43b1..50d710a5ab9 100644 > --- a/gcc/ginclude/stddef.h > +++ b/gcc/ginclude/stddef.h > @@ -128,6 +128,7 @@ _TYPE_wchar_t; > #ifndef ___int_ptrdiff_t_h > #ifndef _GCC_PTRDIFF_T > #ifndef _PTRDIFF_T_DECLARED /* DragonFly */ > +#ifndef __DEFINED_ptrdiff_t /* musl libc */ > #define _PTRDIFF_T > #define _T_PTRDIFF_ > #define _T_PTRDIFF > @@ -137,10 +138,12 @@ _TYPE_wchar_t; > #define ___int_ptrdiff_t_h > #define _GCC_PTRDIFF_T > #define _PTRDIFF_T_DECLARED > +#define __DEFINED_ptrdiff_t > #ifndef __PTRDIFF_TYPE__ > #define __PTRDIFF_TYPE__ long int > #endif > typedef __PTRDIFF_TYPE__ ptrdiff_t; > +#endif /* __DEFINED_ptrdiff_t */ > #endif /* _PTRDIFF_T_DECLARED */ > #endif /* _GCC_PTRDIFF_T */ > #endif /* ___int_ptrdiff_t_h */ > @@ -174,6 +177,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t; > #ifndef _SIZE_T_DEFINED > #ifndef _BSD_SIZE_T_DEFINED_ /* Darwin */ > #ifndef _SIZE_T_DECLARED /* FreeBSD 5 */ > +#ifndef __DEFINED_size_t /* musl libc */ > #ifndef ___int_size_t_h > #ifndef _GCC_SIZE_T > #ifndef _SIZET_ > @@ -191,6 +195,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t; > #define _SIZE_T_DEFINED > #define _BSD_SIZE_T_DEFINED_ /* Darwin */ > #define _SIZE_T_DECLARED /* FreeBSD 5 */ > +#define __DEFINED_size_t /* musl libc */ > #define ___int_size_t_h > #define _GCC_SIZE_T > #define _SIZET_ > @@ -215,6 +220,7 @@ typedef long ssize_t; > #endif /* _SIZET_ */ > #endif /* _GCC_SIZE_T */ > #endif /* ___int_size_t_h */ > +#endif /* __DEFINED_size_t */ > #endif /* _SIZE_T_DECLARED */ > #endif /* _BSD_SIZE_T_DEFINED_ */ > #endif /* _SIZE_T_DEFINED */ > @@ -251,6 +257,7 @@ typedef long ssize_t; > #ifndef _BSD_WCHAR_T_DEFINED_ /* Darwin */ > #ifndef _BSD_RUNE_T_DEFINED_ /* Darwin */ > #ifndef _WCHAR_T_DECLARED /* FreeBSD 5 */ > +#ifndef __DEFINED_wchar_t /* musl libc */ > #ifndef _WCHAR_T_DEFINED_ > #ifndef _WCHAR_T_DEFINED > #ifndef _WCHAR_T_H > @@ -272,6 +279,7 @@ typedef long ssize_t; > #define __INT_WCHAR_T_H > #define _GCC_WCHAR_T > #define _WCHAR_T_DECLARED > +#define __DEFINED_wchar_t >=20 > /* On BSD/386 1.1, at least, machine/ansi.h defines _BSD_WCHAR_T_ > instead of _WCHAR_T_, and _BSD_RUNE_T_ (which, unlike the other > @@ -326,6 +334,7 @@ typedef __WCHAR_TYPE__ wchar_t; > #endif > #endif > #endif > +#endif /* __DEFINED_wchar_t */ > #endif /* _WCHAR_T_DECLARED */ > #endif /* _BSD_RUNE_T_DEFINED_ */ > #endif >