Successfully identified regression in *gcc* in CI configuration 
tcwg_gnu_cross_build/master-arm.  So far, this commit has regressed CI 
configurations:
 - tcwg_gnu_cross_build/master-arm

Culprit:
<cut>
commit caf81d3b57501b1f58dcd9b1ef9d7b4bc76f4ab1
Author: Sebastian Huber <sebastian.hu...@embedded-brains.de>
Date:   Tue Aug 17 09:53:43 2021 +0200

    Use __builtin_trap() for abort() if inhibit_libc
    
    abort() is used in gcc_assert() and gcc_unreachable() which is used by 
target
    libraries such as libgcov.a.  This patch changes the abort() definition 
under
    certain conditions.  If inhibit_libc is defined and abort is not already
    defined, then abort() is defined to __builtin_trap().
    
    The inhibit_libc define is usually defined if GCC is built for targets 
running
    in embedded systems which may optionally use a C standard library.  If
    inhibit_libc is defined, then there may be still a full featured abort()
    available.  abort() is a heavy weight function which depends on signals and
    file streams.  For statically linked applications, this means that a 
dependency
    on gcc_assert() pulls in the support for signals and file streams.  This 
could
    prevent using gcov to test low end targets for example.  Using 
__builtin_trap()
    avoids these dependencies if the target implements a "trap" instruction.  
The
    application or operating system could use a trap handler to react to failed 
GCC
    runtime checks which caused a trap.
    
    gcc/
    
            * tsystem.h (abort): Define abort() if inhibit_libc is defined and 
it
            is not already defined.
</cut>

Results regressed to (for first_bad == caf81d3b57501b1f58dcd9b1ef9d7b4bc76f4ab1)
# reset_artifacts:
-10
# true:
0
# build_abe binutils:
1
# First few build errors in logs:
# 00:01:44 cc1: error: no include path in which to search for stdc-predef.h
# 00:02:05 
/home/tcwg-buildslave/workspace/tcwg_gnu_1/abe/snapshots/gcc.git~master/libgcc/unwind-arm-common.inc:55:24:
 error: macro  passed 1 arguments, but takes just 0
# 00:02:05 make[2]: *** 
[/home/tcwg-buildslave/workspace/tcwg_gnu_1/abe/snapshots/gcc.git~master/libgcc/static-object.mk:17:
 unwind-arm.o] Error 1
# 00:02:06 make[1]: *** [Makefile:12484: all-target-libgcc] Error 2
# 00:02:06 make: *** [Makefile:953: all] Error 2

from (for last_good == d7e56b084d0b230ae5ee280f569d679fa0f09f4d)
# reset_artifacts:
-10
# true:
0
# build_abe binutils:
1
# build_abe stage1:
2
# build_abe linux:
3
# build_abe glibc:
4
# build_abe stage2:
5
# build_abe gdb:
6
# build_abe qemu:
7

Artifacts of last_good build: 
https://ci.linaro.org/job/tcwg_gnu_cross_build-bisect-master-arm/1/artifact/artifacts/build-d7e56b084d0b230ae5ee280f569d679fa0f09f4d/
Artifacts of first_bad build: 
https://ci.linaro.org/job/tcwg_gnu_cross_build-bisect-master-arm/1/artifact/artifacts/build-caf81d3b57501b1f58dcd9b1ef9d7b4bc76f4ab1/
Build top page/logs: 
https://ci.linaro.org/job/tcwg_gnu_cross_build-bisect-master-arm/1/

Configuration details:


Reproduce builds:
<cut>
mkdir investigate-gcc-caf81d3b57501b1f58dcd9b1ef9d7b4bc76f4ab1
cd investigate-gcc-caf81d3b57501b1f58dcd9b1ef9d7b4bc76f4ab1

git clone https://git.linaro.org/toolchain/jenkins-scripts

mkdir -p artifacts/manifests
curl -o artifacts/manifests/build-baseline.sh 
https://ci.linaro.org/job/tcwg_gnu_cross_build-bisect-master-arm/1/artifact/artifacts/manifests/build-baseline.sh
 --fail
curl -o artifacts/manifests/build-parameters.sh 
https://ci.linaro.org/job/tcwg_gnu_cross_build-bisect-master-arm/1/artifact/artifacts/manifests/build-parameters.sh
 --fail
curl -o artifacts/test.sh 
https://ci.linaro.org/job/tcwg_gnu_cross_build-bisect-master-arm/1/artifact/artifacts/test.sh
 --fail
chmod +x artifacts/test.sh

# Reproduce the baseline build (build all pre-requisites)
./jenkins-scripts/tcwg_gnu-build.sh @@ artifacts/manifests/build-baseline.sh

# 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/

cd gcc

# Reproduce first_bad build
git checkout --detach caf81d3b57501b1f58dcd9b1ef9d7b4bc76f4ab1
../artifacts/test.sh

# Reproduce last_good build
git checkout --detach d7e56b084d0b230ae5ee280f569d679fa0f09f4d
../artifacts/test.sh

cd ..
</cut>

History of pending regressions and results: 
https://git.linaro.org/toolchain/ci/base-artifacts.git/log/?h=linaro-local/ci/tcwg_gnu_cross_build/master-arm

Artifacts: 
https://ci.linaro.org/job/tcwg_gnu_cross_build-bisect-master-arm/1/artifact/artifacts/
Build log: 
https://ci.linaro.org/job/tcwg_gnu_cross_build-bisect-master-arm/1/consoleText

Full commit (up to 1000 lines):
<cut>
commit caf81d3b57501b1f58dcd9b1ef9d7b4bc76f4ab1
Author: Sebastian Huber <sebastian.hu...@embedded-brains.de>
Date:   Tue Aug 17 09:53:43 2021 +0200

    Use __builtin_trap() for abort() if inhibit_libc
    
    abort() is used in gcc_assert() and gcc_unreachable() which is used by 
target
    libraries such as libgcov.a.  This patch changes the abort() definition 
under
    certain conditions.  If inhibit_libc is defined and abort is not already
    defined, then abort() is defined to __builtin_trap().
    
    The inhibit_libc define is usually defined if GCC is built for targets 
running
    in embedded systems which may optionally use a C standard library.  If
    inhibit_libc is defined, then there may be still a full featured abort()
    available.  abort() is a heavy weight function which depends on signals and
    file streams.  For statically linked applications, this means that a 
dependency
    on gcc_assert() pulls in the support for signals and file streams.  This 
could
    prevent using gcov to test low end targets for example.  Using 
__builtin_trap()
    avoids these dependencies if the target implements a "trap" instruction.  
The
    application or operating system could use a trap handler to react to failed 
GCC
    runtime checks which caused a trap.
    
    gcc/
    
            * tsystem.h (abort): Define abort() if inhibit_libc is defined and 
it
            is not already defined.
---
 gcc/tsystem.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/tsystem.h b/gcc/tsystem.h
index e1e6a96a4f4..5c72c69ff3e 100644
--- a/gcc/tsystem.h
+++ b/gcc/tsystem.h
@@ -59,7 +59,7 @@ extern int atexit (void (*)(void));
 #endif
 
 #ifndef abort
-extern void abort (void) __attribute__ ((__noreturn__));
+#define abort() __builtin_trap ()
 #endif
 
 #ifndef strlen
</cut>
_______________________________________________
linaro-toolchain mailing list
linaro-toolchain@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/linaro-toolchain

Reply via email to