[Scummvm-git-logs] scummvm master -> e094bef73b6e713c058d5f7e38e2698970a12614

sev- sev at scummvm.org
Sun Mar 14 17:42:57 UTC 2021


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
e094bef73b BUILD: Support LLD linker in configure (opt-in)


Commit: e094bef73b6e713c058d5f7e38e2698970a12614
    https://github.com/scummvm/scummvm/commit/e094bef73b6e713c058d5f7e38e2698970a12614
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-03-14T18:42:55+01:00

Commit Message:
BUILD: Support LLD linker in configure (opt-in)

Reduces link time significantly.

Times comparison:

Linux+SSD
=========
ld: 14.2s
gold: 4.5s
lld: 1.7s

Windows+HDD
===========
ld: 110s
lld: 7s

Changed paths:
    configure


diff --git a/configure b/configure
index 7c623a33d7..e3f0e5a2a4 100755
--- a/configure
+++ b/configure
@@ -196,6 +196,7 @@ _no_pragma_pack=no
 _bink=yes
 _cloud=auto
 _pandoc=no
+_lld=no
 # Default vkeybd/eventrec options
 _vkeybd=no
 _eventrec=no
@@ -278,6 +279,7 @@ add_feature lua "lua" "_lua"
 add_feature fribidi "FriBidi" "_fribidi"
 add_feature cxx11 "c++11" "_use_cxx11"
 add_feature test_cxx11 "Test C++11" "_test_cxx11"
+add_feature lld "Use LLD linker" "_lld"
 
 # Directories for installing ScummVM.
 # This list is closely based on what GNU autoconf does,
@@ -1309,6 +1311,7 @@ for ac_option in $@; do
 	--disable-libcurl)            _libcurl=no            ;;
 	--enable-cloud)               _cloud=yes             ;;
 	--disable-cloud)              _cloud=no              ;;
+	--enable-lld)                 _lld=yes               ;;
 	--enable-updates)             _updates=yes           ;;
 	--disable-updates)            _updates=no            ;;
 	--enable-libunity)            _libunity=yes          ;;
@@ -2389,7 +2392,11 @@ if test "$_debug_build" != no; then
 		append_var CXXFLAGS "-gsplit-dwarf"
 		add_line_to_config_mk "SPLIT_DWARF = 1"
 		echo_n -- " + split DWARF"
-		if cc_check_no_clean $debug_mode -gsplit-dwarf -fuse-ld=gold -Wl,--gdb-index; then
+		if test "$_lld" = yes && cc_check_no_clean $debug_mode -gsplit-dwarf -fuse-ld=lld -Wl,--gdb-index; then
+			append_var LDFLAGS "-fuse-ld=lld"
+			append_var LDFLAGS "-Wl,--gdb-index"
+			echo_n -- " + LLD"
+		elif cc_check_no_clean $debug_mode -gsplit-dwarf -fuse-ld=gold -Wl,--gdb-index; then
 			append_var LDFLAGS "-fuse-ld=gold"
 			append_var LDFLAGS "-Wl,--gdb-index"
 			echo_n -- " + Gold"
@@ -2404,6 +2411,13 @@ if test "$_debug_build" != no; then
 	echo ""
 fi
 
+if ! echo "$LDFLAGS" | grep -q -e -fuse-ld; then
+	echo "Using LLD linker... $_lld"
+	if test "$_lld" = yes ; then
+		append_var LDFLAGS -fuse-ld=lld
+	fi
+fi
+
 if test "$_release_build" = yes; then
 	# Add a define, which indicates we are doing
 	# an build for a release version.




More information about the Scummvm-git-logs mailing list