https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118495

--- Comment #10 from Brecht Sanders <brechtsanders at users dot 
sourceforge.net> ---
Looks like _pgmptr was superseded by _get_pgmptr().

So I tried this quick and dirty fix to get past the issue:
patch -ulbf libbacktrace/fileline.c << EOF
@@ -262,3 +262,7 @@
             to the wine binary (and thus doesn't work).  */
+#if HAVE_DECL__PGMPTR
+         if (_get_pgmptr((char**)&filename) != 0) filename = NULL;
+#else
          filename = windows_executable_filename ();
+#endif
          break;
EOF

But then the next error is:
x86_64-w64-mingw32-g++ -no-pie   -g -O2     -DIN_GCC    -fno-exceptions
-fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-error=narrowing
-Wwrite-strings -Wcast-qual -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 -Wl,--stack,12582912
-Wl,--undefined=HOST_EXTRA_OBJS_SYMBOL -o cc1plus.exe \
      cp/cp-lang.o c-family/stub-objc.o cp/call.o cp/class.o cp/constexpr.o
cp/constraint.o cp/coroutines.o cp/cp-gimplify.o cp/cp-objcp-common.o
cp/cp-ubsan.o cp/cvt.o cp/contracts.o cp/cxx-pretty-print.o cp/decl.o
cp/decl2.o cp/dump.o cp/error.o cp/except.o cp/expr.o cp/friend.o cp/init.o
cp/lambda.o cp/lex.o cp/logic.o cp/mangle.o cp/mapper-client.o
cp/mapper-resolver.o cp/method.o cp/module.o cp/name-lookup.o cp/optimize.o
cp/parser.o cp/pt.o cp/ptree.o cp/rtti.o cp/search.o cp/semantics.o cp/tree.o
cp/typeck.o cp/typeck2.o cp/vtable-class-hierarchy.o attribs.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 i386-c.o winnt-c.o
winnt-cxx.o msformat-c.o cc1plus-checksum.o libbackend.a main.o
libcommon-target.a libcommon.a ../libcpp/libcpp.a
../libdecnumber/libdecnumber.a ../libcody/libcody.a \
        libcommon.a ../libcpp/libcpp.a   ../libbacktrace/.libs/libbacktrace.a
../libiberty//libiberty.a ../libdecnumber/libdecnumber.a 
-L/home/brecht/build-gcc/gcc-x86_64-w64-mingw32/lib -lisl
-L/home/brecht/build-gcc/gcc-x86_64-w64-mingw32/lib
-L/home/brecht/build-gcc/gcc-x86_64-w64-mingw32/lib
-L/home/brecht/build-gcc/gcc-x86_64-w64-mingw32/lib
-L/home/brecht/build-gcc/gcc-x86_64-w64-mingw32/lib
-L/home/brecht/build-gcc/gcc-x86_64-w64-mingw32/lib
-L/home/brecht/build-gcc/gcc-x86_64-w64-mingw32/lib -lmpc -lmpfr -lgmp  
-L./../zlib -lz
/home/brecht/build-gcc/gcc-cross/lib/gcc/x86_64-w64-mingw32/15.0.1/../../../../x86_64-w64-mingw32/bin/ld:
cp/module.o: in function `void va_heap::reserve<char const*>(vec<char const*,
va_heap, vl_embed>*&, unsigned int, bool)':
/home/brecht/build-gcc/build_stage2-gcc-x86_64-w64-mingw32/gcc/../../gcc-15-20250119/gcc/vec.h:318:(.text+0x9ee2):
undefined reference to `__imp___p__environ'
collect2: error: ld returned 1 exit status

Reply via email to