From 61956d41bd2efd5db5458d5726083898a5264668 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Fri, 28 Jul 2023 07:05:09 -0700 Subject: [PATCH] Fix a few misordered Windows libraries Due to https://github.com/pkgconf/pkgconf/issues/268, we manually worked around Windows link order issues by adding abseil libraries manually. However, a few libraries were missed from that list, which are added only in Windows builds: * dbghelp * advapi32 This commit adds these libraries to the right location, which fixes `x86-mingw32` builds. Note there is an existing issue with abseil including `-ldbghelp` before `-labsl_symbolize`, which this commit corrects: https://github.com/abseil/abseil-cpp/issues/1497 --- ext/re2/extconf.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ext/re2/extconf.rb b/ext/re2/extconf.rb index d3b53a4..5662244 100644 --- a/ext/re2/extconf.rb +++ b/ext/re2/extconf.rb @@ -270,6 +270,9 @@ def build_with_system_libraries # --libs --static`, resulting in build failures: https://github.com/pkgconf/pkgconf/issues/268. # To work around the issue, store the correct order of abseil flags here and add them manually # for Windows. +# +# Note that `-ldbghelp` is incorrectly added before `-labsl_symbolize` in abseil: +# https://github.com/abseil/abseil-cpp/issues/1497 ABSL_LDFLAGS = %w[ -labsl_flags -labsl_flags_internal @@ -302,6 +305,7 @@ def build_with_system_libraries -labsl_graphcycles_internal -labsl_stacktrace -labsl_symbolize + -ldbghelp -labsl_debugging_internal -labsl_demangle_internal -labsl_malloc_internal @@ -309,6 +313,7 @@ def build_with_system_libraries -labsl_civil_time -labsl_strings -labsl_strings_internal + -ladvapi32 -labsl_base -labsl_spinlock_wait -labsl_int128