GCC-12.1.0-2ubuntu1~22.04 (jammy) dav1d segfaults when building with -flto=auto
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gcc-12 (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
When building Dav1d with GCC 12.1.0 from the Ubuntu-toolchain-r ppa the resulting binary always segfaults when the -flto=auto flag is set.
Without the -flto=auto flag the resulting binary works as intended.
When using GCC 12.1.0 with -flto=auto in other distributions (debian for example) the resulting binary works fine.
The issue was first reported here: https:/
The Meson build system
Version: 0.62.2
Source dir: /home/ferdi/
Build dir: /home/ferdi/
Build type: native build
Project name: dav1d
Project version: 1.0.0
C compiler for the host machine: ccache cc (gcc 12.1.0 "cc (Ubuntu 12.1.0-
C linker for the host machine: cc ld.bfd 2.38
Host machine cpu family: x86_64
Host machine cpu: x86_64
Fetching value of define "__ILP32__" :
Run-time dependency threads found: YES
Checking for function "clock_gettime" : YES
Library dl found: YES
Checking for function "dlsym" with dependency -ldl: YES
Library m found: YES
Check usable header "stdatomic.h" : YES
Check usable header "unistd.h" : YES
Check usable header "io.h" : NO
Check usable header "pthread_np.h" : NO
Checking for function "getopt_long" : YES
Checking for function "_aligned_malloc" : NO
Checking for function "posix_memalign" : YES
Checking for function "pthread_
Compiler for C supports arguments -fvisibility=
Compiler for C supports arguments -Wundef: YES
Compiler for C supports arguments -Werror=vla: YES
Compiler for C supports arguments -Wno-maybe-
Compiler for C supports arguments -Wno-missing-
Compiler for C supports arguments -Wno-unused-
Compiler for C supports arguments -Wstrict-
Compiler for C supports arguments -Werror=
Compiler for C supports arguments -Wshorten-64-to-32: NO
Compiler for C supports arguments -fomit-
Compiler for C supports arguments -ffast-math: YES
Compiler for C supports arguments -mpreferred-
Fetching value of define "__AVX__" : 1
Program nasm found: YES (/home/
Configuring config.asm using configuration
Configuring config.h using configuration
Configuring version.h using configuration
Header <xxhash.h> has symbol "XXH3_createState" : YES
Configuring cli_config.h using configuration
Build targets in project: 10
dav1d 1.0.0
User defined options
default_
libdir : /home/ferdi/
prefix : /home/ferdi/
enable_tests : false
enable_tools : true
Found ninja-1.11.0 at /usr/bin/ninja
ferdi@Biodanza0
CXXFLAGS=
LDFLAGS=
CFLAGS=
ferdi@Biodanza0
[111/111] Linking target tools/dav1d
ferdi@Biodanza0
ferdi@Biodanza0
dav1d 1.0.0-46-gcd5e415 - by VideoLAN
Segmentation fault
summary: |
- GCC-12.1.0-2ubuntu1~22.04 (jammy) dav1d problem when building with + GCC-12.1.0-2ubuntu1~22.04 (jammy) dav1d segfaults when building with -flto=auto |
Changed in gcc-12 (Ubuntu): | |
status: | New → Fix Released |
This bug is not specific to Ubuntu. We can reproduce it with freedesktop-sdk's gcc 12.1.0, see https:/ /bugs.webkit. org/show_ bug.cgi? id=250477. It seems building with LTO changes the stack alignment.