[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/29998] ld terminated with signal 11 [Segmentation fault] under m
From: |
medhefgo at web dot de |
Subject: |
[Bug ld/29998] ld terminated with signal 11 [Segmentation fault] under mingw with LTO |
Date: |
Tue, 24 Jan 2023 17:59:16 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=29998
--- Comment #18 from Jan Janssen <medhefgo at web dot de> ---
Compilation works now and the binary will run, but I get a miscompilation(?)
wrt popcount builtin.
Both cases are based on https://github.com/systemd/systemd/pull/26097, where I
originally encountered them, btw.
$ cat test1.c
void test1() {}
$ cat test2.c
void test1(); static void test2() { test1(); }
$ cat test3.c
int run(void) {
volatile unsigned i = 4278190080;
return __builtin_popcount(i);
}
$ rm -f test.exe libtest.a test[123].o
$ x86_64-w64-mingw32-gcc -c -flto test1.c test2.c test3.c
$ x86_64-w64-mingw32-gcc-ar csrDT libtest.a test1.o
$ x86_64-w64-mingw32-gcc -o test.exe -flto -nostdlib test2.o test3.o libtest.a
-lgcc
When I run the above build steps (with your path applied), they produce the
same assembly for run(), except for this line:
14000102b: e8 00 00 00 00 call 140001030 <run+0x1c>
vs this without -flto:
140001037: e8 24 00 00 00 call 140001060 <__popcountdi2>
The lto build doesn't even include popcount and the EFI binary either produces
a page fault or division error.
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug ld/29998] ld terminated with signal 11 [Segmentation fault] under mingw with LTO, (continued)
- [Bug ld/29998] ld terminated with signal 11 [Segmentation fault] under mingw with LTO, medhefgo at web dot de, 2023/01/17
- [Bug ld/29998] ld terminated with signal 11 [Segmentation fault] under mingw with LTO, nickc at redhat dot com, 2023/01/18
- [Bug ld/29998] ld terminated with signal 11 [Segmentation fault] under mingw with LTO, medhefgo at web dot de, 2023/01/18
- [Bug ld/29998] ld terminated with signal 11 [Segmentation fault] under mingw with LTO, nickc at redhat dot com, 2023/01/19
- [Bug ld/29998] ld terminated with signal 11 [Segmentation fault] under mingw with LTO, medhefgo at web dot de, 2023/01/19
- [Bug ld/29998] ld terminated with signal 11 [Segmentation fault] under mingw with LTO, medhefgo at web dot de, 2023/01/20
- [Bug ld/29998] ld terminated with signal 11 [Segmentation fault] under mingw with LTO, nickc at redhat dot com, 2023/01/23
- [Bug ld/29998] ld terminated with signal 11 [Segmentation fault] under mingw with LTO, medhefgo at web dot de, 2023/01/23
- [Bug ld/29998] ld terminated with signal 11 [Segmentation fault] under mingw with LTO, cvs-commit at gcc dot gnu.org, 2023/01/24
- [Bug ld/29998] ld terminated with signal 11 [Segmentation fault] under mingw with LTO, nickc at redhat dot com, 2023/01/24
- [Bug ld/29998] ld terminated with signal 11 [Segmentation fault] under mingw with LTO,
medhefgo at web dot de <=
- [Bug ld/29998] ld terminated with signal 11 [Segmentation fault] under mingw with LTO, nickc at redhat dot com, 2023/01/25
- [Bug ld/29998] ld terminated with signal 11 [Segmentation fault] under mingw with LTO, nickc at redhat dot com, 2023/01/25
- [Bug ld/29998] ld terminated with signal 11 [Segmentation fault] under mingw with LTO, medhefgo at web dot de, 2023/01/25
- [Bug ld/29998] ld terminated with signal 11 [Segmentation fault] under mingw with LTO, nickc at redhat dot com, 2023/01/25
- [Bug ld/29998] ld terminated with signal 11 [Segmentation fault] under mingw with LTO, nickc at redhat dot com, 2023/01/26
- [Bug ld/29998] ld terminated with signal 11 [Segmentation fault] under mingw with LTO, medhefgo at web dot de, 2023/01/27
- [Bug ld/29998] ld terminated with signal 11 [Segmentation fault] under mingw with LTO, cvs-commit at gcc dot gnu.org, 2023/01/27
- [Bug ld/29998] ld terminated with signal 11 [Segmentation fault] under mingw with LTO, nickc at redhat dot com, 2023/01/27
- [Bug ld/29998] ld terminated with signal 11 [Segmentation fault] under mingw with LTO, amodra at gmail dot com, 2023/01/30
- [Bug ld/29998] ld terminated with signal 11 [Segmentation fault] under mingw with LTO, amodra at gmail dot com, 2023/01/30