Opened 3 years ago
Closed 3 years ago
#63725 closed defect (fixed)
qt5-qtwebengine @5.15.2 build error on Monterey
Reported by: | amake (Aaron Madlon-Kay) | Owned by: | MarcusCalhoun-Lopez (Marcus Calhoun-Lopez) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | |
Keywords: | Cc: | mf2k (Frank Schima), abey79 (Antoine Beyeler), chrstphrchvz (Christopher Chavez), arietis (Sergei Guselnikov) | |
Port: | qt5-qtwebengine |
Description
After using the `use_xcode yes` workaround to get qt5-qtbase installed, I find that qt5-qtwebengine fails with the following:
:info:build TOOL_VERSION=1604712156 ../../3rdparty/chromium/build/toolchain/mac/linker_driver.py -Wcrl,strippath,/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip ../../../../../../../../../../../../Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -B /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ -Wcrl,dsym,. -Wcrl,dsymutilpath,../../../../../../../../../../../../Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/dsymutil -Wl,-fatal_warnings -stdlib=libc++ -arch x86_64 -Wl,-no_data_in_code_info -Wl,-no_function_starts -isysroot ../../../../../../../../../../../../Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk -mmacosx-version-min=12.0 -Wl,-ObjC -Wcrl,strip,-x,-S -o "./transport_security_state_generator" -Wl,-filelist,"./transport_security_state_generator.rsp" -framework ApplicationServices -framework AppKit -lbsm -framework CoreFoundation -framework IOKit -framework OpenDirectory -lpmenergy -lpmsample -framework Security :info:build Undefined symbols for architecture x86_64: :info:build "std::__1::basic_string<unsigned short, base::string16_internals::string16_char_traits, std::__1::allocator<unsigned short> >::shrink_to_fit()", referenced from: :info:build base::UTF8ToUTF16(char const*, unsigned long, std::__1::basic_string<unsigned short, base::string16_internals::string16_char_traits, std::__1::allocator<unsigned short> >*) in libbase.a(base_jumbo_20.o) :info:build base::WideToUTF16(wchar_t const*, unsigned long, std::__1::basic_string<unsigned short, base::string16_internals::string16_char_traits, std::__1::allocator<unsigned short> >*) in libbase.a(base_jumbo_20.o) :info:build ld: symbol(s) not found for architecture x86_64 :info:build clang: error: linker command failed with exit code 1 (use -v to see invocation) :info:build Traceback (most recent call last): :info:build File "../../3rdparty/chromium/build/toolchain/mac/linker_driver.py", line 287, in <module> :info:build Main(sys.argv) :info:build File "../../3rdparty/chromium/build/toolchain/mac/linker_driver.py", line 97, in Main :info:build subprocess.check_call(compiler_driver_args, env=env) :info:build File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 190, in check_call :info:build raise CalledProcessError(retcode, cmd) :info:build subprocess.CalledProcessError: Command '['../../../../../../../../../../../../Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++', '-B', '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/', '-Wl,-fatal_warnings', '-stdlib=libc++', '-arch', 'x86_64', '-Wl,-no_data_in_code_info', '-Wl,-no_function_starts', '-isysroot', '../../../../../../../../../../../../Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk', '-mmacosx-version-min=12.0', '-Wl,-ObjC', '-o', './transport_security_state_generator', '-Wl,-filelist,./transport_security_state_generator.rsp', '-framework', 'ApplicationServices', '-framework', 'AppKit', '-lbsm', '-framework', 'CoreFoundation', '-framework', 'IOKit', '-framework', 'OpenDirectory', '-lpmenergy', '-lpmsample', '-framework', 'Security']' returned non-zero exit status 1
Attachments (1)
Change History (16)
Changed 3 years ago by amake (Aaron Madlon-Kay)
Attachment: | main.log.zip added |
---|
comment:1 Changed 3 years ago by mf2k (Frank Schima)
Cc: | MarcusCalhoun-Lopez removed |
---|---|
Owner: | set to MarcusCalhoun-Lopez |
Status: | new → assigned |
comment:2 Changed 3 years ago by mf2k (Frank Schima)
Cc: | mf2k added |
---|
comment:3 follow-up: 6 Changed 3 years ago by abey79 (Antoine Beyeler)
comment:4 Changed 3 years ago by abey79 (Antoine Beyeler)
Cc: | abey79 added |
---|
comment:5 Changed 3 years ago by chrstphrchvz (Christopher Chavez)
Cc: | chrstphrchvz added |
---|
comment:6 Changed 3 years ago by chrstphrchvz (Christopher Chavez)
comment:7 Changed 3 years ago by arietis (Sergei Guselnikov)
Cc: | arietis added |
---|
comment:8 follow-up: 10 Changed 3 years ago by jmroot (Joshua Root)
Given that this spends 4 hours building before it finally fails, can we please mark it as known_fail
in the meantime?
comment:9 Changed 3 years ago by chrstphrchvz (Christopher Chavez)
As I mentioned on https://github.com/macports/macports-ports/pull/12595#issuecomment-973304948:
I’ve not made any progress on the linker error. I might be wrong about it having sonething to do with system libc++: maybe it instead involves very recent Xcode clang, or a subtle bug in chromium code exposed by newer clang. One reason similar issues aren’t being widely reported could be that the relevant code basically no longer exists in newer chromium and qtwebengine:
string16
was replaced bystd::u16string
. I would guess that change is not something trivial to backport.At the moment I can only think of trying to separate out the relevant source file chromium/src/base/strings/utf_string_conversions.cc from the “jumbo” build, but I don’t expect the error to go away. Something else to try for investigating this more deeply would be to see if the issue also exists in some version of mini_chromium.
comment:10 Changed 3 years ago by chrstphrchvz (Christopher Chavez)
Replying to jmroot:
Given that this spends 4 hours building before it finally fails, can we please mark it as
known_fail
in the meantime?
comment:11 Changed 3 years ago by chrstphrchvz (Christopher Chavez)
comment:12 Changed 3 years ago by chrstphrchvz (Christopher Chavez)
I may have identified a workaround for this issue. Compiling src/3rdparty/chromium/base/strings/string16.cc separately (by adding it to jumbo_excluded_sources
in src/3rdparty/chromium/base/BUILD.gn) outputs src/core/release/obj/base/base/string16.o, which appears to reliably contain base::string16::reserve(unsigned long)
. shrink_to_fit()
, reserve()
, and reserve(0)
are equivalent in C++17 and earlier (various versions of libc++ have even implemented shrink_to_fit()
as reserve()
or vice versa in the include/c++/v1/string header file). Since string16.cc is currently being compiled with -std=c++14
, I would try replacing dest_str->shrink_to_fit()
with dest_str->reserve(0)
in src/3rdparty/chromium/base/strings/utf_string_conversions.cc (I don’t know if it looks silly to do edit: misread reserve(0)
right after doing reserve(dest_len32)
resize(dest_len32)
, which would not be the same as reserve(dest_len32)
).
I’m not sure what the right conditions are for getting string16.o to contain a symbol for base::string16::shrink_to_fit()
. So far the only way I’ve managed to do so is to add a dummy function Edit: I don’t think I was careful with which version I used for different steps. I think it may make a difference since MacPorts’ clang seems to use its own libc++ headers by default.
void Dummy(string16& str) { str->shrink_to_fit(); }
to base::string16_internals
in string16.cc (with corresponding declaration in string16.h), and compile string16.cc with the macOS 10.15 SDK. The clang version/vendor did not seem to matter (tried Xcode clang 13.2, MacPorts LLVM clang 9, and MacPorts LLVM clang 11); maybe that suggests this is more likely to be a libc++ bug in the macOS 12 SDKs.
comment:13 Changed 3 years ago by chrstphrchvz (Christopher Chavez)
Someone reported a very similar issue to Qt: https://bugreports.qt.io/browse/QTBUG-98813
comment:14 Changed 3 years ago by cgilles (HumanDynamo)
Qt5-qwebengine build fail too for me with the same error, for target x86_64 and MacOS SDK 10.13. MacOS host version : Big Sur 11.6.1, Xcode version : 13.1 (13A1030d)
comment:15 Changed 3 years ago by chrstphrchvz (Christopher Chavez)
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
I too have an error when installating qt5-qtwebengine on Monterey/M1, although the error is different:
I wonder if https://github.com/macports/macports-ports/pull/12595 solves this issue.