https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120145
--- Comment #40 from Kirill A. Korinsky <kirill at korins dot ky> --- After very long digging I had discovered that OpenBSD ports setups environment variable PICFLAG="-fPIC" on make stage, see, for example env at https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120145#c26 which leads to broken logic of the build. So, after I clean this up, I was able to start building gcc-15.2.0 with -fno-PIE flags, and it leads to /usr/local/bootstrap-gcc/bin/g++ -std=c++14 -fno-PIE -c -DIN_GCC_FRONTEND -g -DIN_GCC -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-error=narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wmissing-format-attribute -Wconditionally-supported -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -fno-PIE -I. -I. -I/usr/ports/pobj/gcc-15.2.0/gcc-15.2.0/gcc -I/usr/ports/pobj/gcc-15.2.0/gcc-15.2.0/gcc/. -I/usr/ports/pobj/gcc-15.2.0/gcc-15.2.0/gcc/../include -I/usr/ports/pobj/gcc-15.2.0/gcc-15.2.0/gcc/../libcpp/include -I/usr/ports/pobj/gcc-15.2.0/gcc-15.2.0/gcc/../libcody -I/usr/local/include -I/usr/ports/pobj/gcc-15.2.0/gcc-15.2.0/gcc/../libdecnumber -I/usr/ports/pobj/gcc-15.2.0/gcc-15.2.0/gcc/../libdecnumber/dpd -I../libdecnumber -I/usr/ports/pobj/gcc-15.2.0/gcc-15.2.0/gcc/../libbacktrace -o cc1-checksum.o -MT cc1-checksum.o -MMD -MP -MF ./.deps/cc1-checksum.TPo cc1-checksum.cc /usr/local/bootstrap-gcc/bin/g++ -std=c++14 -no-pie -g -DIN_GCC -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-error=narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wmissing-format-attribute -Wconditionally-supported -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -no-pie -static-libstdc++ -static-libgcc -o cc1 c/c-lang.o c-family/stub-objc.o attribs.o c/c-errors.o c/c-decl.o c/c-typeck.o c/c-convert.o c/c-aux-info.o c/c-objc-common.o c/c-parser.o c/c-fold.o c/gimple-parser.o c-family/c-common.o c-family/c-cppbuiltin.o c-family/c-dump.o c-family/c-format.o c-family/c-gimplify.o c-family/c-indentation.o c-family/c-lex.o c-family/c-omp.o c-family/c-opts.o c-family/c-pch.o c-family/c-ppoutput.o c-family/c-pragma.o c-family/c-pretty-print.o c-family/c-semantics.o c-family/c-ada-spec.o c-family/c-ubsan.o c-family/known-headers.o c-family/c-attribs.o c-family/c-warn.o c-family/c-spellcheck.o c-family/c-type-mismatch.o sparc-c.o default-c.o \ cc1-checksum.o simple-diagnostic-path.o lazy-diagnostic-path.o libbackend.a main.o libcommon-target.a libcommon.a ../libcpp/libcpp.a ../libdecnumber/libdecnumber.a libcommon.a ../libcpp/libcpp.a ../libbacktrace/.libs/libbacktrace.a ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a -L/usr/local/lib -lmpc -lmpfr -lgmp -rdynamic -lz collect2: fatal error: ld terminated with signal 11 [Segmentation fault], core dumped with absolutle useless stacktrace: Core was generated by `ld.bfd'. Program terminated with signal SIGSEGV, Segmentation fault. #0 0x00000099a352bb48 in bfd_putb64 () (gdb) bt #0 0x00000099a352bb48 in bfd_putb64 () #1 0x00000099a3544fb8 in bfd_elf64_swap_reloca_out () #2 0x00000099a353e644 in ?? () Backtrace stopped: previous frame identical to this frame (corrupt stack?) (gdb) anyway, it smells like original issue but with different symptop.