From 1b1a39708cf1bfbd85c8de9c13912338c5fd50be Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Wed, 22 Jul 2020 21:40:39 +0000 Subject: [PATCH] [build] Use frameworks instead of libs Newer GN doesn't allow `*.framework` elements in `libs`. It requires using `frameworks` instead. The toolchain definitions need to pass the new substituted variable to the link to make use of the new required way to express these dependencies. Bug: fxbug.dev/56683 Change-Id: I62e68a8e5bdfef095b72b38d9d41f757e510012b Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155482 Auto-Submit: Roland McGrath Reviewed-by: Ryan Macnak Commit-Queue: Ryan Macnak --- build/toolchain/mac/BUILD.gn | 4 ++-- runtime/bin/BUILD.gn | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build/toolchain/mac/BUILD.gn b/build/toolchain/mac/BUILD.gn index 2c1839fffe8..c6f28d30db4 100644 --- a/build/toolchain/mac/BUILD.gn +++ b/build/toolchain/mac/BUILD.gn @@ -130,7 +130,7 @@ template("mac_toolchain") { temporary_tocname = dylib + ".tmp" does_reexport_command = "[ ! -e $dylib -o ! -e $tocname ] || otool -l $dylib | grep -q LC_REEXPORT_DYLIB" - link_command = "$ld -shared $sysroot_flags $toolchain_flags {{ldflags}} -o $dylib -Wl,-filelist,$rspfile {{solibs}} {{libs}}" + link_command = "$ld -shared $sysroot_flags $toolchain_flags {{ldflags}} -o $dylib -Wl,-filelist,$rspfile {{solibs}} {{libs}} {{frameworks}}" replace_command = "if ! cmp -s $temporary_tocname $tocname; then mv $temporary_tocname $tocname" extract_toc_command = "{ otool -l $dylib | grep LC_ID_DYLIB -A 5; nm -gP $dylib | cut -f1-2 -d' ' | grep -v U\$\$; true; }" @@ -171,7 +171,7 @@ template("mac_toolchain") { stripped_outfile = "{{root_out_dir}}/exe.stripped/$exename" } - command = "$ld $sysroot_flags $toolchain_flags {{ldflags}} -Xlinker -rpath -Xlinker @executable_path/Frameworks -o $outfile -Wl,-filelist,$rspfile {{solibs}} {{libs}}" + command = "$ld $sysroot_flags $toolchain_flags {{ldflags}} -Xlinker -rpath -Xlinker @executable_path/Frameworks -o $outfile -Wl,-filelist,$rspfile {{solibs}} {{libs}} {{frameworks}}" if (defined(invoker.strip)) { strip = invoker.strip strip_command = "${strip} -x -o $stripped_outfile $outfile" diff --git a/runtime/bin/BUILD.gn b/runtime/bin/BUILD.gn index 609fa4210e4..fb682c0dd85 100644 --- a/runtime/bin/BUILD.gn +++ b/runtime/bin/BUILD.gn @@ -199,7 +199,7 @@ template("build_gen_snapshot") { } if (is_mac) { - libs = [ + frameworks = [ "CoreFoundation.framework", "CoreServices.framework", ] @@ -445,13 +445,13 @@ template("dart_io") { defines = [] deps = [ "//third_party/zlib" ] + extra_deps if (is_mac || is_ios) { - libs = [ + frameworks = [ "CoreFoundation.framework", "Security.framework", ] if (is_mac) { - libs += [ "CoreServices.framework" ] + frameworks += [ "CoreServices.framework" ] } }