From 945a16442c291f5013f56b5186f76f9bfefdb0ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Tue, 7 May 2024 13:03:16 +0200 Subject: [PATCH] SCons: Fix Windows/MinGW TypeError with recent SCons Fixes #86484. --- methods.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/methods.py b/methods.py index 6ae22a84f..e6f4f5d3b 100644 --- a/methods.py +++ b/methods.py @@ -612,13 +612,15 @@ def split_lib(self, libname, src_list=None, env_lib=None): # As SCons doesn't give us much control over how inserting libs in LIBS # impacts the linker call, we need to hack our way into the linking commands # LINKCOM and SHLINKCOM to set those flags. + linkcom = str(env["LINKCOM"]) + shlinkcom = str(env["SHLINKCOM"]) - if "-Wl,--start-group" in env["LINKCOM"] and "-Wl,--start-group" in env["SHLINKCOM"]: + if "-Wl,--start-group" in linkcom and "-Wl,--start-group" in shlinkcom: # Already added by a previous call, skip. return - env["LINKCOM"] = str(env["LINKCOM"]).replace("$_LIBFLAGS", "-Wl,--start-group $_LIBFLAGS -Wl,--end-group") - env["SHLINKCOM"] = str(env["LINKCOM"]).replace("$_LIBFLAGS", "-Wl,--start-group $_LIBFLAGS -Wl,--end-group") + env["LINKCOM"] = linkcom.replace("$_LIBFLAGS", "-Wl,--start-group $_LIBFLAGS -Wl,--end-group") + env["SHLINKCOM"] = shlinkcom.replace("$_LIBFLAGS", "-Wl,--start-group $_LIBFLAGS -Wl,--end-group") def save_active_platforms(apnames, ap):