Build failure d8 with v8_static_library option on Mac

120 views
Skip to first unread message

Taeho Nam

unread,
Dec 10, 2020, 9:44:26 PM12/10/20
to v8-users
Hello,

I tried to build latest d8 with v8_static_library option.
macOS version is 10.15.6 and Xcode version is 12.

 $ gn gen out/Default --args='v8_static_library=true is_clang=true'

Without v8_static_library option, the build works fine.
but it fails with following errors.
and obj/libv8_wrappers.a.rsp was empty.

rm -f obj/libv8_wrappers.a && TOOL_VERSION=1606449216 python ../../build/toolchain/mac/filter_libtool.py /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static -D  -o obj/libv8_wrappers.a "@obj/libv8_wrappers.a.rsp"
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: no files specified
Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-sacLT] [-no_warning_for_no_symbols]
Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -dynamic [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-o output] [-install_name name] [-compatibility_version #] [-current_version #] [-seg1addr 0x#] [-segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [-seg_addr_table <filename>] [-seg_addr_table_filename <file_system_path>] [-all_load] [-noall_load]

Thanks.


Alex Kodat

unread,
Jan 11, 2021, 1:59:44 PM1/11/21
to v8-users
I've hit this same issue and a similar issue on Windows. To my limited understanding, the problem is in BUILD.gn:

v8_source_set("v8_wrappers") {
  configs = [ ":internal_config" ]
  sources = [ "src/base/platform/wrappers.h" ]
}

It seems like maybe this should be a v8_header_set as there's no actual source associated with this set? On linux it appears that ar happily builds an effectively empty archive but macOS and Windows are somewhat less happy with this. When I changed the above to use v8_header_set, my Mac and Windows static builds worked OK. I'll file a bug report but don't feel comfortable coding a fix as I'll admit I don't fully understand the build machinery.

Cheers

Taeho Nam

unread,
Jan 12, 2021, 9:42:20 PM1/12/21
to v8-users
As you said, it worked fine on Linux.
But with solution you suggested, it worked fine on my Mac too.
Thanks.

2021년 1월 12일 화요일 오전 3시 59분 44초 UTC+9에 alex...@gmail.com님이 작성:
Reply all
Reply to author
Forward
0 new messages