Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] Disable _FORTIFY_SOURCE #5803

Closed
lhmouse opened this issue Sep 21, 2019 · 66 comments
Closed

[RFC] Disable _FORTIFY_SOURCE #5803

lhmouse opened this issue Sep 21, 2019 · 66 comments

Comments

@lhmouse
Copy link
Contributor

lhmouse commented Sep 21, 2019

This follows https://sourceforge.net/p/mingw-w64/mailman/message/36764708/ which I think there is no solution other than disabling -D_FORTIFY_SOURCE.

Rationale:

  1. Unlike glibc, mingw-w64 does not provide fortified functions at all. So fortification requires -lssp (or -fstack-protector which adds -lssp implicitly) to work.
  2. libssp is part of GCC libraries which is unavailable(??) when building GCC itself.
  3. When building everything else, -lssp must be added into LIBS explicitly.
  4. For this reason it had better be removed. Prior to the change in mingw-w64 it had no effect so there is no loss by removing it.
@revelator
Copy link
Contributor

revelator commented Sep 24, 2019

actually it does now, but its broken as hell :S

in mingw_mac.h in the latest update you will find this ->

#if _FORTIFY_SOURCE > 0 && __OPTIMIZE__ > 0 && __MINGW_GNUC_PREREQ(4, 1)
#  if _FORTIFY_SOURCE > 1
#    define __MINGW_FORTIFY_LEVEL 2
#  else
#    define __MINGW_FORTIFY_LEVEL 1
#  endif
#else
#  define __MINGW_FORTIFY_LEVEL 0
#endif

if you do a search in the headers for __MINGW_FORTIFY_LEVEL
you will notice some inlined __chk functions.

Unfortunatly these dont seem to work correctly at the moment and you will get errors about undefined __chk functions in some sources if you remove the -D_FORTIFY_SOURCE flag.

instead set it to -D_FORTIFY_SOURCE=0 to force it off.

@revelator
Copy link
Contributor

Yeah it seems these are SSP redirects so it gets a bit hairy.

unfortunatly setting -D_FORTIFY_SOURCE=0 is also not enough i discovered,

it still complains about __chk_fail being undefined :/ so the macro seems to be broken somehow.

@revelator
Copy link
Contributor

Urgh wait a sec, i know why it fails...

previous packages have all been built with -D_FORTIFY_SOURCE=2 and the flag was propagated to the config files for several libraries.

So it seems we will have to rebuild an unknown amount of packages with -D_FORTIFY_SOURCE=0 so that the compiler will not pick up this setting from some other library config.

@revelator
Copy link
Contributor

would building the crt against libssp with -fstack-protector-all be a workaround or would the redirects still require libssp to be linked in externally ?.

If it works it would unfortunatly make builds require yet another dll (libssp-0.dll) unless we linked in the static version.

Not sure if the libssp functions would at all be added to the crt libraries though seing that the redirects are mere macros for picking up libssp functions, and not real imports.

@lhmouse
Copy link
Contributor Author

lhmouse commented Sep 26, 2019

Before building libssp the CRT has to exist, so I don't think it is in principle correct to have the CRT link against libssp.

@revelator
Copy link
Contributor

Aye it would be a nasty workaround, would probably be better to just incorporate the ssp code in the crt.
But that might cause some nastiness when some source tries to use libssp :S eg. multiple definitions unless the function names are changed to follow the crt naming scheme like __chk_fail instead of __stack_chk_fail etc.

Just throwing around some ideas atm.

@lhmouse
Copy link
Contributor Author

lhmouse commented Sep 26, 2019

That could also bring licensing issues. Also if libssp code ever changes how should we synchronize with the upstream?

@lhmouse
Copy link
Contributor Author

lhmouse commented Oct 6, 2019

Let's see how everything goes for some moments. New packages should now be built without this option. Perhaps we will want to enable this in the future (it can't be enabled when building GCC but may be enable-able for others).

@revelator
Copy link
Contributor

Neither if building the crt it would seem.
Atleast the libc folks says to avoid doing that.

After rebuilding the affected packages without _FORTIFY_SOURCE i had no problems atleast.

@revelator
Copy link
Contributor

btw. the -fstack-protector* flags should autoinclude libssp so there should be no need to force linking to libssp with LIBS+=" -lssp". If it does not then there are other problems upstream.

@lhmouse
Copy link
Contributor Author

lhmouse commented Oct 7, 2019

Yes this thing should be only be enabled conditionally - mostly, but at least not always.

If ppl want to enable this thing they had better add it themselves.

@lhmouse
Copy link
Contributor Author

lhmouse commented Oct 8, 2019

gdb-git can't be built due to following errors:

lh_mouse@lhmouse-pc /e/GitHub/MINGW-packages-dev/mingw-w64-gdb-git/src/build-x86_64-w64-mingw32/gdb $ make V=1
CONFIG_HEADERS=config.h:config.in \
  CONFIG_COMMANDS="default depdir" \
  CONFIG_FILES= \
  CONFIG_LINKS= \
  /bin/sh config.status
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing default commands
config.status: executing depdir commands
make[1]: Entering directory '/e/GitHub/MINGW-packages-dev/mingw-w64-gdb-git/src/build-x86_64-w64-mingw32/gdb'
make[2]: Entering directory '/e/GitHub/MINGW-packages-dev/mingw-w64-gdb-git/src/build-x86_64-w64-mingw32/gdb/build-gnulib'
make[3]: Entering directory '/e/GitHub/MINGW-packages-dev/mingw-w64-gdb-git/src/build-x86_64-w64-mingw32/gdb/build-gnulib'
make[4]: Entering directory '/e/GitHub/MINGW-packages-dev/mingw-w64-gdb-git/src/build-x86_64-w64-mingw32/gdb/build-gnulib/import'
make  all-recursive
make[5]: Entering directory '/e/GitHub/MINGW-packages-dev/mingw-w64-gdb-git/src/build-x86_64-w64-mingw32/gdb/build-gnulib/import'
make[6]: Entering directory '/e/GitHub/MINGW-packages-dev/mingw-w64-gdb-git/src/build-x86_64-w64-mingw32/gdb/build-gnulib/import'
make[6]: Nothing to be done for 'all-am'.
make[6]: Leaving directory '/e/GitHub/MINGW-packages-dev/mingw-w64-gdb-git/src/build-x86_64-w64-mingw32/gdb/build-gnulib/import'
make[5]: Leaving directory '/e/GitHub/MINGW-packages-dev/mingw-w64-gdb-git/src/build-x86_64-w64-mingw32/gdb/build-gnulib/import'
make[4]: Leaving directory '/e/GitHub/MINGW-packages-dev/mingw-w64-gdb-git/src/build-x86_64-w64-mingw32/gdb/build-gnulib/import'
make[3]: Leaving directory '/e/GitHub/MINGW-packages-dev/mingw-w64-gdb-git/src/build-x86_64-w64-mingw32/gdb/build-gnulib'
make[2]: Leaving directory '/e/GitHub/MINGW-packages-dev/mingw-w64-gdb-git/src/build-x86_64-w64-mingw32/gdb/build-gnulib'
make[1]: Leaving directory '/e/GitHub/MINGW-packages-dev/mingw-w64-gdb-git/src/build-x86_64-w64-mingw32/gdb'
rm -f gdb.exe
x86_64-w64-mingw32-g++  -march=x86-64 -mtune=generic -O2 -pipe   -pipe -pthread -Wl,--stack,12582912   \
        -o gdb.exe gdb.o ada-exp.o ada-lang.o ada-tasks.o ada-typeprint.o ada-valprint.o ada-varobj.o addrmap.o agent.o amd64-tdep.o amd64-windows-nat.o amd64-windows-tdep.o annotate.o arch-utils.o arch/amd64.o arch/i386.o auto-load.o auxv.o ax-gdb.o ax-general.o bcache.o bfd-target.o block.o blockframe.o break-catch-sig.o break-catch-syscall.o break-catch-throw.o breakpoint.o btrace.o build-id.o buildsym-legacy.o buildsym.o c-exp.o c-lang.o c-typeprint.o c-valprint.o c-varobj.o charset.o cli-out.o cli/cli-cmds.o cli/cli-decode.o cli/cli-dump.o cli/cli-interp.o cli/cli-logging.o cli/cli-script.o cli/cli-setshow.o cli/cli-style.o cli/cli-utils.o coff-pe-read.o coffread.o common/agent.o common/btrace-common.o common/buffer.o common/cleanups.o common/common-debug.o common/common-exceptions.o common/common-regcache.o common/common-utils.o common/environ.o common/errors.o common/fileio.o common/filestuff.o common/format.o common/gdb_tilde_expand.o common/gdb_vecs.o common/job-control.o common/mingw-strerror.o common/netstuff.o common/new-op.o common/pathstuff.o common/print-utils.o common/ptid.o common/rsp-low.o common/run-time-clock.o common/scoped_mmap.o common/signals-state-save-restore.o common/signals.o common/tdesc.o common/vec.o common/xml-utils.o compile/compile-c-support.o compile/compile-c-symbols.o compile/compile-c-types.o compile/compile-cplus-symbols.o compile/compile-cplus-types.o compile/compile-loc2c.o compile/compile-object-load.o compile/compile-object-run.o compile/compile.o complaints.o completer.o continuations.o copying.o corefile.o corelow.o cp-abi.o cp-name-parser.o cp-namespace.o cp-support.o cp-valprint.o ctf.o d-exp.o d-lang.o d-namespace.o d-valprint.o dbxread.o dcache.o debug.o demangle.o dictionary.o disasm-selftests.o disasm.o dtrace-probe.o dummy-frame.o dwarf-index-cache.o dwarf-index-common.o dwarf-index-write.o dwarf2-frame-tailcall.o dwarf2-frame.o dwarf2expr.o dwarf2loc.o dwarf2read.o elfread.o eval.o event-loop.o event-top.o exceptions.o exec.o expprint.o extension.o f-exp.o f-lang.o f-typeprint.o f-valprint.o filename-seen-cache.o filesystem.o findcmd.o findvar.o frame-base.o frame-unwind.o frame.o gcore.o gdb-dlfcn.o gdb_bfd.o gdb_obstack.o gdb_regex.o gdb_usleep.o gdbarch-selftests.o gdbarch.o gdbtypes.o gnu-v2-abi.o gnu-v3-abi.o go-exp.o go-lang.o go-typeprint.o go-valprint.o guile/guile.o i386-cygwin-tdep.o i386-tdep.o i387-tdep.o inf-child.o inf-loop.o infcall.o infcmd.o inferior.o inflow.o infrun.o inline-frame.o interps.o jit.o language.o linespec.o location.o m2-exp.o m2-lang.o m2-typeprint.o m2-valprint.o macrocmd.o macroexp.o macroscope.o macrotab.o main.o maint.o mdebugread.o mem-break.o memattr.o memory-map.o memrange.o mi/mi-cmd-break.o mi/mi-cmd-catch.o mi/mi-cmd-disas.o mi/mi-cmd-env.o mi/mi-cmd-file.o mi/mi-cmd-info.o mi/mi-cmd-stack.o mi/mi-cmd-target.o mi/mi-cmd-var.o mi/mi-cmds.o mi/mi-common.o mi/mi-console.o mi/mi-getopt.o mi/mi-interp.o mi/mi-main.o mi/mi-out.o mi/mi-parse.o mi/mi-symbol-cmds.o mingw-hdep.o minidebug.o minsyms.o mipsread.o namespace.o nat/x86-dregs.o objc-lang.o objfiles.o observable.o opencl-lang.o osabi.o osdata.o p-exp.o p-lang.o p-typeprint.o p-valprint.o parse.o printcmd.o probe.o process-stratum-target.o producer.o progspace-and-thread.o progspace.o prologue-value.o psymtab.o python/py-arch.o python/py-auto-load.o python/py-block.o python/py-bpevent.o python/py-breakpoint.o python/py-cmd.o python/py-continueevent.o python/py-event.o python/py-evtregistry.o python/py-evts.o python/py-exitedevent.o python/py-finishbreakpoint.o python/py-frame.o python/py-framefilter.o python/py-function.o python/py-gdb-readline.o python/py-inferior.o python/py-infevents.o python/py-infthread.o python/py-instruction.o python/py-lazy-string.o python/py-linetable.o python/py-newobjfileevent.o python/py-objfile.o python/py-param.o python/py-prettyprint.o python/py-progspace.o python/py-record-btrace.o python/py-record-full.o python/py-record.o python/py-signalevent.o python/py-stopevent.o python/py-symbol.o python/py-symtab.o python/py-threadevent.o python/py-type.o python/py-unwind.o python/py-utils.o python/py-value.o python/py-varobj.o python/py-xmethods.o python/python.o record-btrace.o record-full.o record.o regcache-dump.o regcache.o reggroups.o registry.o remote-fileio.o remote-notif.o remote.o reverse.o rust-exp.o rust-lang.o sentinel-frame.o ser-base.o ser-event.o ser-mingw.o ser-tcp.o serial.o skip.o solib-target.o solib.o source-cache.o source.o stabsread.o stack.o stap-probe.o std-regs.o symfile-debug.o symfile.o symmisc.o symtab.o target-dcache.o target-descriptions.o target-float.o target-memory.o target.o target/waitstatus.o test-target.o thread-iter.o thread.o tid-parse.o top.o tracefile-tfile.o tracefile.o tracepoint.o trad-frame.o tramp-frame.o tui/tui-command.o tui/tui-data.o tui/tui-disasm.o tui/tui-file.o tui/tui-hooks.o tui/tui-interp.o tui/tui-io.o tui/tui-layout.o tui/tui-out.o tui/tui-regs.o tui/tui-source.o tui/tui-stack.o tui/tui-win.o tui/tui-windata.o tui/tui-wingeneral.o tui/tui-winsource.o tui/tui.o typeprint.o ui-file.o ui-out.o ui-style.o user-regs.o utils.o valarith.o valops.o valprint.o value.o varobj.o version.o windows-nat.o windows-tdep.o x86-nat.o x86-tdep.o xml-builtin.o xml-support.o xml-syscall.o xml-tdesc.o init.o \
           -lreadline ../opcodes/libopcodes.a ../bfd/libbfd.a -L./../zlib -lz /mingw64/lib/libintl.a /mingw64/lib/libiconv.a ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a   -lncursesw -lm   -lpython3.7m -lversion -lshlwapi -lm /mingw64/lib/libexpat.a /mingw64/lib/liblzma.a   ../libiberty/libiberty.a -lws2_32 build-gnulib/import/libgnu.a /mingw64/lib/libiconv.a /mingw64/lib/libmpfr.a /mingw64/lib/libgmp.a
C:/MinGW/MSYS2/mingw64/lib/gcc/x86_64-w64-mingw32/9.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: ada-tasks.o:ada-tasks.c:(.text+0xa63): undefined reference to `__memcpy_chk'
C:/MinGW/MSYS2/mingw64/lib/gcc/x86_64-w64-mingw32/9.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: amd64-tdep.o:amd64-tdep.c:(.text+0x1e99): undefined reference to `__memcpy_chk'
C:/MinGW/MSYS2/mingw64/lib/gcc/x86_64-w64-mingw32/9.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: amd64-windows-tdep.o:amd64-windows-tdep.c:(.text+0x14a9): undefined reference to `__memcpy_chk'
C:/MinGW/MSYS2/mingw64/lib/gcc/x86_64-w64-mingw32/9.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: breakpoint.o:breakpoint.c:(.text+0x1c94): undefined reference to `__strcpy_chk'
C:/MinGW/MSYS2/mingw64/lib/gcc/x86_64-w64-mingw32/9.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: breakpoint.o:breakpoint.c:(.text+0x1cb6): undefined reference to `__strcpy_chk'
C:/MinGW/MSYS2/mingw64/lib/gcc/x86_64-w64-mingw32/9.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: breakpoint.o:breakpoint.c:(.text+0x5371): undefined reference to `__memset_chk'
C:/MinGW/MSYS2/mingw64/lib/gcc/x86_64-w64-mingw32/9.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: breakpoint.o:breakpoint.c:(.text+0xcf81): undefined reference to `__chk_fail'
C:/MinGW/MSYS2/mingw64/lib/gcc/x86_64-w64-mingw32/9.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: cli/cli-decode.o:cli-decode.c:(.text+0x20e6): undefined reference to `__strcat_chk'
C:/MinGW/MSYS2/mingw64/lib/gcc/x86_64-w64-mingw32/9.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: cli/cli-decode.o:cli-decode.c:(.text+0x2159): undefined reference to `__memcpy_chk'
C:/MinGW/MSYS2/mingw64/lib/gcc/x86_64-w64-mingw32/9.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: cli/cli-decode.o:cli-decode.c:(.text+0x21af): undefined reference to `__memcpy_chk'
C:/MinGW/MSYS2/mingw64/lib/gcc/x86_64-w64-mingw32/9.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: coffread.o:coffread.c:(.text+0x2263): undefined reference to `__memcpy_chk'
C:/MinGW/MSYS2/mingw64/lib/gcc/x86_64-w64-mingw32/9.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: common/buffer.o:buffer.c:(.text+0x361): undefined reference to `__chk_fail'
C:/MinGW/MSYS2/mingw64/lib/gcc/x86_64-w64-mingw32/9.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: dbxread.o:dbxread.c:(.text+0x42d): undefined reference to `__memcpy_chk'
C:/MinGW/MSYS2/mingw64/lib/gcc/x86_64-w64-mingw32/9.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: dwarf2read.o:dwarf2read.c:(.text+0x2bee1): undefined reference to `__chk_fail'
C:/MinGW/MSYS2/mingw64/lib/gcc/x86_64-w64-mingw32/9.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: dwarf2read.o:dwarf2read.c:(.text+0x2bee9): undefined reference to `__chk_fail'
C:/MinGW/MSYS2/mingw64/lib/gcc/x86_64-w64-mingw32/9.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: exec.o:exec.c:(.text+0x18f6): undefined reference to `__strncpy_chk'
C:/MinGW/MSYS2/mingw64/lib/gcc/x86_64-w64-mingw32/9.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: i386-tdep.o:i386-tdep.c:(.text+0x5761): undefined reference to `__memcpy_chk'
C:/MinGW/MSYS2/mingw64/lib/gcc/x86_64-w64-mingw32/9.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: mem-break.o:mem-break.c:(.text+0x80): undefined reference to `__memcpy_chk'
C:/MinGW/MSYS2/mingw64/lib/gcc/x86_64-w64-mingw32/9.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: objc-lang.o:objc-lang.c:(.text+0x7a7): undefined reference to `__memcpy_chk'
C:/MinGW/MSYS2/mingw64/lib/gcc/x86_64-w64-mingw32/9.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: objc-lang.o:objc-lang.c:(.text+0xa83): undefined reference to `__memcpy_chk'
C:/MinGW/MSYS2/mingw64/lib/gcc/x86_64-w64-mingw32/9.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: objc-lang.o:objc-lang.c:(.text+0xbdd): undefined reference to `__memcpy_chk'
C:/MinGW/MSYS2/mingw64/lib/gcc/x86_64-w64-mingw32/9.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: objc-lang.o:objc-lang.c:(.text+0xf9b): more undefined references to `__memcpy_chk' follow
C:/MinGW/MSYS2/mingw64/lib/gcc/x86_64-w64-mingw32/9.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: remote-fileio.o:remote-fileio.c:(.text+0x4f8): undefined reference to `__strcat_chk'
C:/MinGW/MSYS2/mingw64/lib/gcc/x86_64-w64-mingw32/9.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: remote-fileio.o:remote-fileio.c:(.text+0x5ab): undefined reference to `__strcat_chk'
C:/MinGW/MSYS2/mingw64/lib/gcc/x86_64-w64-mingw32/9.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: remote.o:remote.c:(.text+0x9ba9): undefined reference to `__chk_fail'
C:/MinGW/MSYS2/mingw64/lib/gcc/x86_64-w64-mingw32/9.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: remote.o:remote.c:(.text+0x13317): undefined reference to `__chk_fail'
C:/MinGW/MSYS2/mingw64/lib/gcc/x86_64-w64-mingw32/9.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: remote.o:remote.c:(.text+0x13741): undefined reference to `__chk_fail'
C:/MinGW/MSYS2/mingw64/lib/gcc/x86_64-w64-mingw32/9.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: remote.o:remote.c:(.text+0x13841): undefined reference to `__chk_fail'
C:/MinGW/MSYS2/mingw64/lib/gcc/x86_64-w64-mingw32/9.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: ser-base.o:ser-base.c:(.text+0x61): undefined reference to `__chk_fail'
C:/MinGW/MSYS2/mingw64/lib/gcc/x86_64-w64-mingw32/9.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: solib.o:solib.c:(.text+0xa5): undefined reference to `__strcpy_chk'
C:/MinGW/MSYS2/mingw64/lib/gcc/x86_64-w64-mingw32/9.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: solib.o:solib.c:(.text+0x15f): undefined reference to `__memcpy_chk'
C:/MinGW/MSYS2/mingw64/lib/gcc/x86_64-w64-mingw32/9.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: target-float.o:target-float.c:(.text+0x58e): undefined reference to `__strcat_chk'
C:/MinGW/MSYS2/mingw64/lib/gcc/x86_64-w64-mingw32/9.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: target-float.o:target-float.c:(.text$_ZNK14host_float_opsIeE11from_targetEPK11floatformatPKhPe[_ZNK14host_float_opsIeE11from_targetEPK11floatformatPKhPe]+0x22a): undefined reference to `__memcpy_chk'
C:/MinGW/MSYS2/mingw64/lib/gcc/x86_64-w64-mingw32/9.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: target-float.o:target-float.c:(.text$_ZNK14host_float_opsIeE11from_targetEPK11floatformatPKhPe[_ZNK14host_float_opsIeE11from_targetEPK11floatformatPKhPe]+0x26b): undefined reference to `__memcpy_chk'
C:/MinGW/MSYS2/mingw64/lib/gcc/x86_64-w64-mingw32/9.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: target-float.o:target-float.c:(.text$_ZNK14host_float_opsIeE11from_targetEPK11floatformatPKhPe[_ZNK14host_float_opsIeE11from_targetEPK11floatformatPKhPe]+0x2a8): undefined reference to `__memcpy_chk'
C:/MinGW/MSYS2/mingw64/lib/gcc/x86_64-w64-mingw32/9.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: target-float.o:target-float.c:(.text$_ZNK14host_float_opsIdE11from_targetEPK11floatformatPKhPd[_ZNK14host_float_opsIdE11from_targetEPK11floatformatPKhPd]+0x21a): undefined reference to `__memcpy_chk'
C:/MinGW/MSYS2/mingw64/lib/gcc/x86_64-w64-mingw32/9.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: target-float.o:target-float.c:(.text$_ZNK14host_float_opsIdE11from_targetEPK11floatformatPKhPd[_ZNK14host_float_opsIdE11from_targetEPK11floatformatPKhPd]+0x263): undefined reference to `__memcpy_chk'
C:/MinGW/MSYS2/mingw64/lib/gcc/x86_64-w64-mingw32/9.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: target-float.o:target-float.c:(.text$_ZNK14host_float_opsIdE11from_targetEPK11floatformatPKhPd[_ZNK14host_float_opsIdE11from_targetEPK11floatformatPKhPd]+0x2a8): more undefined references to `__memcpy_chk' follow
C:/MinGW/MSYS2/mingw64/lib/gcc/x86_64-w64-mingw32/9.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: tracepoint.o:tracepoint.c:(.text+0x94ca): undefined reference to `__strcat_chk'
C:/MinGW/MSYS2/mingw64/lib/gcc/x86_64-w64-mingw32/9.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: tracepoint.o:tracepoint.c:(.text+0x980b): undefined reference to `__strcat_chk'
C:/MinGW/MSYS2/mingw64/lib/gcc/x86_64-w64-mingw32/9.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: valprint.o:valprint.c:(.text+0x48f8): undefined reference to `__memcpy_chk'
C:/MinGW/MSYS2/mingw64/lib/gcc/x86_64-w64-mingw32/9.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: valprint.o:valprint.c:(.text+0x49ad): undefined reference to `__memcpy_chk'
C:/MinGW/MSYS2/mingw64/lib/gcc/x86_64-w64-mingw32/9.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: windows-nat.o:windows-nat.c:(.text+0x6a0): undefined reference to `__strcpy_chk'
C:/MinGW/MSYS2/mingw64/lib/gcc/x86_64-w64-mingw32/9.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: windows-nat.o:windows-nat.c:(.text+0x744): undefined reference to `__strcpy_chk'
C:/MinGW/MSYS2/mingw64/lib/gcc/x86_64-w64-mingw32/9.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: windows-nat.o:windows-nat.c:(.text+0x75a): undefined reference to `__strcpy_chk'
C:/MinGW/MSYS2/mingw64/lib/gcc/x86_64-w64-mingw32/9.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: windows-nat.o:windows-nat.c:(.text+0x797): undefined reference to `__strcat_chk'
C:/MinGW/MSYS2/mingw64/lib/gcc/x86_64-w64-mingw32/9.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: windows-nat.o:windows-nat.c:(.text+0x7b2): undefined reference to `__strcpy_chk'
collect2.exe: error: ld returned 1 exit status
make: *** [Makefile:1889: gdb.exe] Error 1

@lhmouse
Copy link
Contributor Author

lhmouse commented Oct 8, 2019

Seems it is defined in gdb/common/common-defs.h:

/* Some distros enable _FORTIFY_SOURCE by default, which on occasion
   has caused build failures with -Wunused-result when a patch is
   developed on a distro that does not enable _FORTIFY_SOURCE.  We
   enable it here in order to try to catch these problems earlier;
   plus this seems like a reasonable safety measure.  The check for
   optimization is required because _FORTIFY_SOURCE only works when
   optimization is enabled.  If _FORTIFY_SOURCE is already defined,
   then we don't do anything.  */

#if !defined _FORTIFY_SOURCE && defined __OPTIMIZE__ && __OPTIMIZE__ > 0
#define _FORTIFY_SOURCE 2
#endif

@lhmouse
Copy link
Contributor Author

lhmouse commented Oct 9, 2019

New PR: msys2/MINGW-packages-dev#6

rurban added a commit to rurban/autoconf-archive that referenced this issue Oct 19, 2019
msys2 just dropped _FORTIFY_SOURCE support.
See msys2/MINGW-packages#5803
Try to actually link it.
rurban added a commit to rurban/autoconf-archive that referenced this issue Oct 19, 2019
msys2 just dropped _FORTIFY_SOURCE support.
See msys2/MINGW-packages#5803
Try to actually link it.
rurban added a commit to rurban/autoconf-archive that referenced this issue Oct 19, 2019
msys2 just dropped _FORTIFY_SOURCE support.
See msys2/MINGW-packages#5803
Try to actually link it.
rurban added a commit to rurban/autoconf-archive that referenced this issue Oct 19, 2019
msys2 just dropped _FORTIFY_SOURCE support.
See msys2/MINGW-packages#5803
Try to actually link it.
rurban added a commit to rurban/autoconf-archive that referenced this issue Oct 19, 2019
msys2 just dropped _FORTIFY_SOURCE support.
See msys2/MINGW-packages#5803
Try to actually link it.
rurban added a commit to rurban/autoconf-archive that referenced this issue Oct 19, 2019
msys2 just dropped _FORTIFY_SOURCE support.
See msys2/MINGW-packages#5803
Try to actually link it.
rurban added a commit to rurban/autoconf-archive that referenced this issue Oct 19, 2019
msys2 just dropped _FORTIFY_SOURCE support.
See msys2/MINGW-packages#5803
Try to actually link it.
rurban added a commit to rurban/autoconf-archive that referenced this issue Oct 19, 2019
msys2 just dropped _FORTIFY_SOURCE support.
See msys2/MINGW-packages#5803
Try to actually link it.
rurban added a commit to rurban/autoconf-archive that referenced this issue Oct 19, 2019
msys2 just dropped _FORTIFY_SOURCE support.
See msys2/MINGW-packages#5803
Try to actually link it.
Doy-lee added a commit to Doy-lee/loki that referenced this issue Oct 21, 2019
Enable -fstack-protector* on msys to get -lssp  implicitly.
mingw64 doesn't provide fortified functions which are required if you
define FORTIFY_SOURCES to be > 0. By enabling -fstack-protector* you
implicitly link against libssp which provides fortified variants of the
missing functions.

See: msys2/MINGW-packages#5803
Doy-lee added a commit to Doy-lee/loki that referenced this issue Oct 21, 2019
Enable -fstack-protector* on msys to get -lssp  implicitly.
mingw64 doesn't provide fortified functions which are required if you
define FORTIFY_SOURCES to be > 0. By enabling -fstack-protector* you
implicitly link against libssp which provides fortified variants of the
missing functions.

See: msys2/MINGW-packages#5803
Doy-lee added a commit to Doy-lee/loki that referenced this issue Oct 21, 2019
Enable -fstack-protector* on msys to get -lssp  implicitly.
mingw64 doesn't provide fortified functions which are required if you
define FORTIFY_SOURCES to be > 0. By enabling -fstack-protector* you
implicitly link against libssp which provides fortified variants of the
missing functions.

See: msys2/MINGW-packages#5803
@mati865
Copy link
Collaborator

mati865 commented Oct 12, 2022

One more thing, what is output of your gcc -v when you call it in the subsystem that you are building for?

@revelator
Copy link
Contributor

standard mingw64

$ gcc -v
Using built-in specs.
COLLECT_GCC=I:\Msys2\mingw32\bin\gcc.exe
COLLECT_LTO_WRAPPER=I:/Msys2/mingw32/bin/../lib/gcc/i686-w64-mingw32/12.2.0/lto-wrapper.exe
Target: i686-w64-mingw32
Configured with: ../gcc-12.2.0/configure --prefix=/mingw32 --with-local-prefix=/mingw32/local --build=i686-w64-mingw32 --host=i686-w64-mingw32 --target=i686-w64-mingw32 --with-native-system-header-dir=/mingw32/include --libexecdir=/mingw32/lib --enable-bootstrap --enable-checking=release --with-arch=i686 --with-tune=generic --enable-languages=c,lto,c++,fortran,ada,objc,obj-c++,jit --enable-shared --enable-static --enable-libatomic --enable-threads=posix --enable-graphite --enable-fully-dynamic-string --enable-libstdcxx-filesystem-ts --enable-libstdcxx-time --disable-libstdcxx-pch --enable-lto --enable-libgomp --disable-multilib --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-libiconv --with-system-zlib --with-gmp=/mingw32 --with-mpfr=/mingw32 --with-mpc=/mingw32 --with-isl=/mingw32 --with-pkgversion='Rev1, Built by MSYS2 project' --with-bugurl=https://github.com/msys2/MINGW-packages/issues --with-gnu-as --with-gnu-ld --disable-libstdcxx-debug --disable-sjlj-exceptions --with-dwarf2 --with-boot-ldflags=-static-libstdc++ --with-stage1-ldflags=-static-libstdc++
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.2.0 (Rev1, Built by MSYS2 project)

the TDM version

$ gcc -v
Using built-in specs.
COLLECT_GCC=I:\Msys2\tdm32\bin\gcc.exe
COLLECT_LTO_WRAPPER=I:/Msys2/tdm32/bin/../lib/gcc/i686-w64-mingw32/11.3.0/lto-wrapper.exe
Target: i686-w64-mingw32
Configured with: ../gcc-11.3.0/configure --prefix=/tdm32 --with-local-prefix=/tdm32/local --build=i686-w64-mingw32 --host=i686-w64-mingw32 --target=i686-w64-mingw32 --with-native-system-header-dir=/tdm32/i686-w64-mingw32/include --libexecdir=/tdm32/lib --enable-bootstrap --enable-checking=release --with-arch=i686 --with-tune=generic --enable-languages=c,lto,c++,fortran,ada,objc,obj-c++,jit --enable-shared --enable-static --enable-libatomic --enable-threads=posix --enable-graphite --enable-fully-dynamic-string --enable-libstdcxx-filesystem-ts --enable-libstdcxx-time --disable-libstdcxx-pch --enable-lto --enable-libgomp --disable-libssp --disable-multilib --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-libiconv --with-system-zlib --with-gmp=/tdm32 --with-mpfr=/tdm32 --with-mpc=/tdm32 --with-isl=/tdm32 --with-pkgversion='Rev2, Built by MSYS2 project' --with-bugurl=https://github.com/msys2/MINGW-packages/issues --with-gnu-as --with-gnu-ld --disable-libstdcxx-debug --enable-sjlj-exceptions --without-dwarf2
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.3.0 (Rev2, Built by MSYS2 project)

pretty similar though i use a bit older version for the TDM compiler the lack of --with-boot-ldflags=-static-libstdc++ --with-stage1-ldflags=-static-libstdc++ is because the TDM version links to the static runtimes by default.

ill try doing as you suggested.

@revelator
Copy link
Contributor

turns out the stpcpy symbol is from libgnu.a
stpcpy.o _stpcpy
ntlib-preprocessed.zip
libgnu.zip

@mstorsjo
Copy link
Contributor

turns out the stpcpy symbol is from libgnu.a
stpcpy.o _stpcpy
ntlib-preprocessed.zip

This file isn't preprocessed source, this is an object file. You would have needed to replace the -c option to the compiler with -E.

libgnu.zip

Where is the source to this libgnu?

@mstorsjo
Copy link
Contributor

Oh, also, when preprocessing the input files, add -dD to add even more valuable debugging info in the preprocessed output.

@mstorsjo
Copy link
Contributor

With those clues, I did find a discussion from 2014 about this same issue in a different form: https://lists.gnu.org/archive/html/emacs-devel/2014-12/msg02154.html

In short, the issue is the following:

  • emacs includes gnulib, which provides a fallback stpcpy function for systems that lack it
  • When GCC sees headers that declare the stpcpy function, GCC assumes (more or less correctly) that stpcpy is available, and can transform calls from strcpy into stpcpy as part of an optimization
  • Guessing: Since the fortify macro turns calls of strcpy into __strcpy_chk, the same GCC optimization that does strcpy->stpcpy probably also can change __strcpy_chk into __stpcpy_chk - even though there is no declaration of __stpcpy_chk anywhere.

So even if mingw-w64 itself doesn't provide stpcpy in any form, a third party provided version of stpcpy can trigger GCC to emit calls to __stpcpy_chk - which used to be provided by GCC's libssp, so everything was fine. But mingw-w64-crt's ssp routines lack this function.

So if we want to practically paper over this, I guess we'll need to just bite the bullet and provide __stpcpy_chk in mingw-w64-crt's ssp routines, just to make the transition from GCC's libssp smoother. But we shouldn't be adding the plain stpcpy in itself IMO. WDYT @mati865 ?

@mmuetzel When you test built it, did you build it with GCC or Clang? @revelator is building it with GCC for i686, in case that changes some factors in GCC's decisions about optimizing.

@mati865
Copy link
Collaborator

mati865 commented Oct 12, 2022

So if we want to practically paper over this, I guess we'll need to just bite the bullet and provide __stpcpy_chk in mingw-w64-crt's ssp routines, just to make the transition from GCC's libssp smoother. But we shouldn't be adding the plain stpcpy in itself IMO.
WDYT @mati865 ?

I'm not very fond of doing workarounds in mingw-w64 for downstream issues (IMO they should have handled the fallback differently) but if there is no other way...
Agree on stpcpy part.

When you test built it, did you build it with GCC or Clang? @revelator is building it with GCC for i686, in case that changes some factors in GCC's decisions about optimizing.

I have built it with i686 GCC 12.2 (the one provided by MSYS2) in MINGW32 subsystem but without changing configuration. If I manually modify CLFAGS like in msys2/MSYS2-packages#3222 then I can reproduce the issue.

@revelator
Copy link
Contributor

ah yeah i added the -E but did not replace the -c so thats why it looked different than what i expected.
looks like we are getting closer though, the libgnu.a was from emacs source.

@revelator
Copy link
Contributor

actually i built it with both the i686 and x86_64 versions same bug with both so rather consistent on my end.

@revelator
Copy link
Contributor

sorry if it became a bit more of a goosechase been years since i last did some serious coding so im rather rusty.

@mmuetzel
Copy link
Collaborator

@mmuetzel When you test built it, did you build it with GCC or Clang? @revelator is building it with GCC for i686, in case that changes some factors in GCC's decisions about optimizing.

I built these packages in the MINGW64 environment using makepkg-mingw -sLf, i.e., GCC for x86_64.
I can try to repeat in MINGW32.

@mstorsjo
Copy link
Contributor

@mmuetzel When you test built it, did you build it with GCC or Clang? @revelator is building it with GCC for i686, in case that changes some factors in GCC's decisions about optimizing.

I built these packages in the MINGW64 environment using makepkg-mingw -sLf, i.e., GCC for x86_64. I can try to repeat in MINGW32.

That shouldn't be necessary, as @mati865 reproduced the issue already - see above. Thanks anyway!

@lazka
Copy link
Member

lazka commented Oct 13, 2022

I've created #13544 for the celt issue, not sure if that is the same cause or not.

@mstorsjo
Copy link
Contributor

I've created #13544 for the celt issue, not sure if that is the same cause or not.

Thanks, that looks like an entirely different issue. Apparently the fortify macro/functions in mingw headers are incompatible with ... something .. in the way that project builds things.

@revelator
Copy link
Contributor

aye that is the same error i saw in celt so seems likely.
builds ok if FORTIFY_SOURCE is not set but probably better to find out why it fails.

@mstorsjo
Copy link
Contributor

I sent a patch to mingw-w64 now for implementing __stpcpy_chk.

I also did manage to reproduce the hypothesis about how this happens, with a minimal example:

char *strcpy(char *_Dest, const char *_Source);
char *stpcpy(char *_Dest, const char *_Source);
unsigned long long strlen(const char *_Str);

#ifdef _FORTIFY_SOURCE
extern __inline__ __attribute__((__always_inline__, __gnu_inline__)) __attribute__((__artificial__))
char *strcpy(char *__dst, const char *__src) {
  return __builtin___strcpy_chk(__dst, __src, __builtin_object_size(__dst, 1));
}
#endif

int func(const char* src) {
    char name[1000];
    strcpy(name, src);
    return strlen(name);
}
$ x86_64-w64-mingw32-gcc opt-strcpy.c -S -o - -O2  
[...]
func:
        pushq   %rbx
        .seh_pushreg    %rbx
        subq    $1040, %rsp
        .seh_stackalloc 1040
        .seh_endprologue
        leaq    32(%rsp), %rbx
        movq    %rcx, %rdx
        movq    %rbx, %rcx
        call    stpcpy
        subq    %rbx, %rax
        addq    $1040, %rsp
        popq    %rbx
        ret
[...]

As long as the declaration of stpcpy is visible, GCC (correctly) does the transformation from strcpy+strlen into stpcpy.

If we enable the fortification wrapper:

$ x86_64-w64-mingw32-gcc opt-strcpy.c -S -o - -O2  -D_FORTIFY_SOURCE=2
[...]
func:
        pushq   %rbx
        .seh_pushreg    %rbx
        subq    $1040, %rsp
        .seh_stackalloc 1040
        .seh_endprologue
        movl    $1000, %r8d
        leaq    32(%rsp), %rbx
        movq    %rcx, %rdx
        movq    %rbx, %rcx
        call    __stpcpy_chk
        subq    %rbx, %rax
        addq    $1040, %rsp
        popq    %rbx
        ret
[...]

Here, because GCC knows stpcpy is available, it does the rewrite from __builtin___strcpy_chk into __builtin___stpcpy_chk, which generates a call to __stpcpy_chk. If the declaration of stpcpy wouldn't be visible, it wouldn't do this rewrite.

@lazka
Copy link
Member

lazka commented Oct 14, 2022

I also did manage to reproduce the hypothesis about how this happens, with a minimal example:

thanks, I've added it as a test to our test suite: msys2/msys2-tests#13

Thanks, that looks like an entirely different issue. Apparently the fortify macro/functions in mingw headers are incompatible with ... something .. in the way that project builds things.

I've reduced it to one line now: #13544 (comment)

jon-y pushed a commit to mingw-w64/mingw-w64 that referenced this issue Oct 14, 2022
Initially, it may seem like this function might not be needed in any
form, since mingw-w64 lacks the main stpcpy function.

However, third party projects may contain their own implementation of
the stpcpy function. When GCC sees a declaration of the stpcpy function,
it assumes that it is legal to do optimizations on strcpy+strlen into
stpcpy.

When strcpy is wrapped with fortification wrappers, so that strcpy
ends up calling __builtin___strcpy_chk (which then calls __strcpy_chk),
GCC can also transform this into __builtin___stpcpy_chk, which can
generate a call to __stpcpy_chk.

GCC's libssp does provide an implementation of __stpcpy_chk, even if
the platform itself lacks stpcpy.

Therefore, mingw-w64-crt's implementation of the ssp routines also
does need an implementation of __stpcpy_chk, even if it is hard
to practically produce calls to it.

This should fix one issue discussed at
msys2/MINGW-packages#5803 (comment).

Signed-off-by: Martin Storsjö <martin@martin.st>
@revelator
Copy link
Contributor

speex also affected by #13544

@revelator
Copy link
Contributor

revelator commented Oct 19, 2022

after the fix applied to the crt for the stcpy function it now builds emacs all the way to this ->

../lib-src/make-docfile: line 55: typedef: command not found
  GEN      buildobj.h
../lib-src/make-docfile: line 62: typedef: command not found
../lib-src/make-docfile: line 67: syntax error near unexpected token `('
../lib-src/make-docfile: line 67: `void __attribute__((__cdecl__)) __debugbreak(void);'

then it fails...

@revelator
Copy link
Contributor

btw maybe a silly question but does the -fstack-protector flag still work after removing libssp ?.

@lazka
Copy link
Member

lazka commented Oct 22, 2022

btw maybe a silly question but does the -fstack-protector flag still work after removing libssp ?.

yes, see mingw-w64/mingw-w64@10394c9

@revelator
Copy link
Contributor

ah you added it as part of the stpcpy fix ok then :)

@revelator
Copy link
Contributor

atm only two packages give me grief emacs and vala-language-server, emacs does not seem to be able to build the documentation anymore and vala-language-server gives me a rather weird error ->

FAILED: src/vala-language-server.exe.p/analysis/codeanalyzer.c src/vala-language-server.exe.p/analysis/codelensanalyzer.c src/vala-language-server.exe.p/analysis/codestyleanalyzer.c src/vala-language-server.exe.p/analysis/inlayhintnodes.c src/vala-language-server.exe.p/analysis/symbolenumerator.c src/vala-language-server.exe.p/codeaction/baseconverteraction.c src/vala-language-server.exe.p/codeaction/implementmissingprereqsaction.c src/vala-language-server.exe.p/codehelp/callhierarchy.c src/vala-language-server.exe.p/codehelp/codeaction.c src/vala-language-server.exe.p/codehelp/codehelp.c src/vala-language-server.exe.p/codehelp/codelensengine.c src/vala-language-server.exe.p/codehelp/completionengine.c src/vala-language-server.exe.p/codehelp/find_scope.c src/vala-language-server.exe.p/codehelp/formatter.c src/vala-language-server.exe.p/codehelp/nodesearch.c src/vala-language-server.exe.p/codehelp/signaturehelpengine.c src/vala-language-server.exe.p/codehelp/symbolextractor.c src/vala-language-server.exe.p/codehelp/symbolreferences.c src/vala-language-server.exe.p/codehelp/symbolvisitor.c src/vala-language-server.exe.p/codehelp/typehierarchy.c src/vala-language-server.exe.p/documentation/cnamemapper.c src/vala-language-server.exe.p/documentation/doccomment.c src/vala-language-server.exe.p/documentation/girdocumentation.c src/vala-language-server.exe.p/projects/buildtarget.c src/vala-language-server.exe.p/projects/buildtask.c src/vala-language-server.exe.p/projects/ccproject.c src/vala-language-server.exe.p/projects/compilation.c src/vala-language-server.exe.p/projects/defaultproject.c src/vala-language-server.exe.p/projects/filecache.c src/vala-language-server.exe.p/projects/mesonproject.c src/vala-language-server.exe.p/projects/project.c src/vala-language-server.exe.p/projects/textdocument.c src/vala-language-server.exe.p/projects/types.c src/vala-language-server.exe.p/protocol.c src/vala-language-server.exe.p/reporter.c src/vala-language-server.exe.p/request.c src/vala-language-server.exe.p/server.c src/vala-language-server.exe.p/config.c src/vala-language-server.exe.p/util.c src/vala-language-server.exe.p/version.c 
"valac" "-C" "--define=WITH_JSONRPC_GLIB_3_30" "--target-glib=auto" "--enable-gobject-tracing" "--fatal-warnings" "--define=WINDOWS" "--pkg" "gio-windows-2.0" "--pkg" "posix" "--pkg" "libvala-0.56" "--pkg" "jsonrpc-glib-1.0" "--pkg" "json-glib-1.0" "--pkg" "gee-0.8" "--pkg" "gio-2.0" "--pkg" "gobject-2.0" "--pkg" "glib-2.0" "--color=always" "--directory" "src/vala-language-server.exe.p" "--basedir" "../vala-language-server-0.48.5/src" ../vala-language-server-0.48.5/src/windows.vapi ../vala-language-server-0.48.5/src/analysis/codeanalyzer.vala ../vala-language-server-0.48.5/src/analysis/codelensanalyzer.vala ../vala-language-server-0.48.5/src/analysis/codestyleanalyzer.vala ../vala-language-server-0.48.5/src/analysis/inlayhintnodes.vala ../vala-language-server-0.48.5/src/analysis/symbolenumerator.vala ../vala-language-server-0.48.5/src/codeaction/baseconverteraction.vala ../vala-language-server-0.48.5/src/codeaction/implementmissingprereqsaction.vala ../vala-language-server-0.48.5/src/codehelp/callhierarchy.vala ../vala-language-server-0.48.5/src/codehelp/codeaction.vala ../vala-language-server-0.48.5/src/codehelp/codehelp.vala ../vala-language-server-0.48.5/src/codehelp/codelensengine.vala ../vala-language-server-0.48.5/src/codehelp/completionengine.vala ../vala-language-server-0.48.5/src/codehelp/find_scope.vala ../vala-language-server-0.48.5/src/codehelp/formatter.vala ../vala-language-server-0.48.5/src/codehelp/nodesearch.vala ../vala-language-server-0.48.5/src/codehelp/signaturehelpengine.vala ../vala-language-server-0.48.5/src/codehelp/symbolextractor.vala ../vala-language-server-0.48.5/src/codehelp/symbolreferences.vala ../vala-language-server-0.48.5/src/codehelp/symbolvisitor.vala ../vala-language-server-0.48.5/src/codehelp/typehierarchy.vala ../vala-language-server-0.48.5/src/documentation/cnamemapper.vala ../vala-language-server-0.48.5/src/documentation/doccomment.vala ../vala-language-server-0.48.5/src/documentation/girdocumentation.vala ../vala-language-server-0.48.5/src/projects/buildtarget.vala ../vala-language-server-0.48.5/src/projects/buildtask.vala ../vala-language-server-0.48.5/src/projects/ccproject.vala ../vala-language-server-0.48.5/src/projects/compilation.vala ../vala-language-server-0.48.5/src/projects/defaultproject.vala ../vala-language-server-0.48.5/src/projects/filecache.vala ../vala-language-server-0.48.5/src/projects/mesonproject.vala ../vala-language-server-0.48.5/src/projects/project.vala ../vala-language-server-0.48.5/src/projects/textdocument.vala ../vala-language-server-0.48.5/src/projects/types.vala ../vala-language-server-0.48.5/src/protocol.vala ../vala-language-server-0.48.5/src/reporter.vala ../vala-language-server-0.48.5/src/request.vala ../vala-language-server-0.48.5/src/server.vala config.vala ../vala-language-server-0.48.5/src/util.vala version.vala
Compilation failed: 3 error(s), 0 warning(s)
../vala-language-server-0.48.5/src/documentation/girdocumentation.vala:359.29-359.57: error: Invalid regular expression `//!\[(.*?)\]\(([~:\/\\\w-.]+)\)'.
  359 |             comment_data = /!\[(.*?)\]\(([~:\/\\\w-.]+)\)/
      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
../vala-language-server-0.48.5/src/documentation/girdocumentation.vala:389.25-389.47: error: Invalid regular expression `//\[(.*?)\]\[([\w-\s]+)\]'.
  389 |         comment_data = /\[(.*?)\]\[([\w-\s]+)\]/
      |                         ^~~~~~~~~~~~~~~~~~~~~~~ 
../vala-language-server-0.48.5/src/documentation/doccomment.vala:132.17-132.59: error: Invalid regular expression `//(\[\[|{{)([~:\/\\\w-.]+)(\|(.*?))?(\]\]|}})'.
  132 |         body = /(\[\[|{{)([~:\/\\\w-.]+)(\|(.*?))?(\]\]|}})/

      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants