Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it build #1

Closed
dmik opened this issue Nov 12, 2019 · 40 comments
Closed

Make it build #1

dmik opened this issue Nov 12, 2019 · 40 comments
Assignees

Comments

@dmik
Copy link
Contributor

dmik commented Nov 12, 2019

A generic task for building this module.

Needed for bitwiseworks/qt5-os2#10.

@dmik dmik self-assigned this Nov 12, 2019
@dmik
Copy link
Contributor Author

dmik commented Nov 12, 2019

The first problem: qtwebengine requires at least GCC 5 while we still have GCC 4.9. So far, I disabled this check and we will see where it gets us. Porting a fresh version of GCC is a todo since long so we might want to finally do that.

@dmik
Copy link
Contributor Author

dmik commented Nov 12, 2019

And the second separate task is porting the ninja build tool used by the Chromium source code. It definitely requires some aligning but nothing fancy. Will create a separate ticket for it.

This was referenced Nov 12, 2019
@dmik
Copy link
Contributor Author

dmik commented Feb 4, 2020

All necessary tools are ported and now I'm fully concentrated on building Chromium itself. I have some work in progress which I will be committing in pieces as I go and report to this ticket (creating separate tickets as needed).

@dmik
Copy link
Contributor Author

dmik commented Feb 5, 2020

I'm getting fork failures when running Python from GN:

Running: D:/Coding/qt5/qt5-dev-build/qtwebengine/src/3rdparty/gn/out/Release/gn.exe gen D:/Coding/qt5/qt5-dev-build/qtwebengine/src/core/debug --script-executable=C:/USR/BIN/python.exe --args='use_qt=true closure_compile=false is_component_build=false is_shared=true enable_message_center=false enable_mus=false enable_nacl=false enable_remoting=false enable_reporting=false enable_swiftshader=false enable_web_auth=false enable_web_speech=false enable_widevine=true has_native_accessibility=false enable_debugallocation=false use_allocator_shim=false use_allocator="none" use_custom_libcxx=false v8_use_external_startup_data=false toolkit_views=false treat_warnings_as_errors=false safe_browsing_mode=0 optimize_webui=false use_jumbo_build=true jumbo_file_merge_limit=8 jumbo_build_excluded=["browser"] enable_basic_printing=true enable_print_preview=true enable_pdf=true enable_plugins=true enable_spellcheck=true enable_webrtc=true proprietary_codecs=true ffmpeg_branding="Chrome" enable_extensions=true enable_precompiled_headers=false is_official_build=false is_debug=true use_debug_fission=false remove_webcore_debug_symbols=true remove_v8base_debug_symbols=true v8_use_snapshot=true use_kerberos=false use_sysroot=false enable_session_service=false ninja_use_custom_environment_files=false is_multi_dll_chrome=false is_clang=false use_lld=false use_incremental_linking=true pkg_config="pkg-config" host_pkg_config="" qtwebengine_target="D:/Coding/qt5/qt5-dev-build/qtwebengine/src/core/debug:QtWebEngineCore"' --root=D:/Coding/qt5/qt5/qtwebengine/src/3rdparty/chromium 

LIBC PANIC!!
LIBC fork: Child aborting fork()! rc=0xfffffffc
pid=0x377b ppid=0x377a tid=0x0001 slot=0x00c1 pri=0x0200 mc=0x0001 ps=0x0010
D:\CODING\QT5\QT5-DEV-BUILD\QTWEBENGINE\SRC\3RDPARTY\GN\OUT\RELEASE\GN.EXE
LIBCN0 0:00002520
cs:eip=005b:1def2520      ss:esp=0053:0031ff14      ebp=0031ff5c
 ds=0053      es=0053      fs=150b      gs=0000     efl=00010206
eax=025cfff0 ebx=5e7a0000 ecx=00000000 edx=025cd000 edi=025ce964 esi=00000001
Process dumping was disabled, use DUMPPROC / PROCDUMP to enable it.

LIBC PANIC!!
LIBC fork: Child aborting fork()! rc=0xfffffffc
pid=0x377c ppid=0x377a tid=0x0001 slot=0x00c1 pri=0x0200 mc=0x0001 ps=0x0010
D:\CODING\QT5\QT5-DEV-BUILD\QTWEBENGINE\SRC\3RDPARTY\GN\OUT\RELEASE\GN.EXE
LIBCN0 0:00002520
cs:eip=005b:1def2520      ss:esp=0053:0031ff14      ebp=0031ff5c
 ds=0053      es=0053      fs=150b      gs=0000     efl=00010206
eax=029cfff0 ebx=5e7a0000 ecx=00000000 edx=029cd000 edi=029ce964 esi=00000001
Process dumping was disabled, use DUMPPROC / PROCDUMP to enable it.

LIBC PANIC!!
LIBC fork: Child aborting fork()! rc=0xfffffffc
pid=0x377d ppid=0x377a tid=0x0001 slot=0x00c1 pri=0x0200 mc=0x0001 ps=0x0010
D:\CODING\QT5\QT5-DEV-BUILD\QTWEBENGINE\SRC\3RDPARTY\GN\OUT\RELEASE\GN.EXE
LIBCN0 0:00002520
cs:eip=005b:1def2520      ss:esp=0053:0031ff14      ebp=0031ff5c
 ds=0053      es=0053      fs=150b      gs=0000     efl=00010206
eax=028cfff0 ebx=5e7a0000 ecx=00000000 edx=028cd000 edi=028ce964 esi=00000001
Process dumping was disabled, use DUMPPROC / PROCDUMP to enable it.
ERROR at //build/util/version.gni:27:11: Could not execute interpreter.
_result = exec_script("version.py",
          ^----------
I was trying to execute "C:/USR/BIN/python.exe".
See //components/cronet/BUILD.gn:9:1: whence it was imported.
import("//build/util/version.gni")
^--------------------------------
See //BUILD.gn:182:7: which caused the file to be included.
      "//components/cronet:cronet_tests",
      ^---------------------------------

This is kind of weird. 0xfffffffc is -4 which might mean be EINTR. Why — not clear so far.

@dmik
Copy link
Contributor Author

dmik commented Feb 10, 2020

Tests show that GN indeed calls fork on multilpe threads and the child process crashes somewhere LIBC code with EXCEPTION_ACCESS_VIOLATION before returning from fork — hence the parent returns -EINTR (0xfffffffc).

I think that the best way to overcome it right now is use LIBCx spawn2 instead of fork. As fixing fork in LIBC might be challenging and fork is a bad choice on OS/2 anyway so should be avoided in general.

dmik added a commit to bitwiseworks/qtwebengine-chromium-os2 that referenced this issue Feb 10, 2020
LIBC fork is not thread safe and GN starts a lot of threads.
Use spawn2 from LIBCx instead.

Needed for bitwiseworks/qtwebengine-os2#1.
Closes #1.
dmik added a commit to bitwiseworks/qtwebengine-chromium-os2 that referenced this issue Feb 10, 2020
dmik added a commit that referenced this issue Feb 10, 2020
LFLAGS may contain quotes on some platforms (e.g. on OS/2 in switches
like -Zlinker "DISABLE 1121").

Needed for #1.
dmik added a commit that referenced this issue Feb 10, 2020
@dmik
Copy link
Contributor Author

dmik commented Feb 10, 2020

All build toolchain (GN/Qmake) issues are solved. It's time to fix various build breaks here and there now.

@dmik
Copy link
Contributor Author

dmik commented Feb 11, 2020

I'm getting problems with linking libraries because GN apparently creates response files with all contents on a single line. I guess I have to hack GN to make it do it per-line (it should be libiberty compatible and work on all platforms).

dmik added a commit to bitwiseworks/qtwebengine-chromium-os2 that referenced this issue Feb 11, 2020
This is necesasry since EMX tools expect arguments one per line
(LIBC _response/-Zargs-resp API logic).

This commit also removes unsupported options for emxomfar.

Needed for bitwiseworks/qtwebengine-os2#1.
dmik added a commit to bitwiseworks/qtwebengine-chromium-os2 that referenced this issue Feb 11, 2020
@dmik
Copy link
Contributor Author

dmik commented Feb 11, 2020

The above commit fixes link issues, going further.

@dmik
Copy link
Contributor Author

dmik commented Feb 12, 2020

I discovered one more LIBC flaw, isblank is BSD only while it's part of POSIX since long:

FAILED: obj/third_party/boringssl/boringssl/ssl_versions.o 
g++ -MMD -MF obj/third_party/boringssl/boringssl/ssl_versions.o.d -DNO_TCMALLOC -DCHROMIUM_BUILD -DTOOLKIT_QT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_DEBUG -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DWTF_USE_DYNAMIC_ANNOTATIONS=1 -DBORINGSSL_ALLOW_CXX_RUNTIME -DBORINGSSL_IMPLEMENTATION -DBORINGSSL_NO_STATIC_INITIALIZER -DOPENSSL_SMALL -D_XOPEN_SOURCE=700 -DOPENSSL_NO_ASM -Igen -I../../../../../qt5/qtwebengine/src/3rdparty/chromium -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/include -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -funwind-tables -Zomf -m32 -msse2 -mfpmath=sse -mmmx -O0 -fno-omit-frame-pointer -g2 -Wno-unused-local-typedefs -Wno-maybe-uninitialized -Wno-deprecated-declarations -Wno-comments -Wno-dangling-else -Wno-packed-not-aligned -Wno-missing-field-initializers -Wno-unused-parameter -std=c++14 -fno-exceptions -fno-rtti -Wno-narrowing -Wno-attributes -Wno-class-memaccess -Wno-subobject-linkage -Wno-invalid-offsetof -c ../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/ssl/ssl_versions.cc -o obj/third_party/boringssl/boringssl/ssl_versions.o
In file included from C:/usr/include/c++/9/bits/localefwd.h:42,
                 from C:/usr/include/c++/9/string:43,
                 from C:/usr/include/c++/9/stdexcept:39,
                 from C:/usr/include/c++/9/array:39,
                 from C:/usr/include/c++/9/tuple:39,
                 from C:/usr/include/c++/9/bits/unique_ptr.h:37,
                 from C:/usr/include/c++/9/memory:80,
                 from D:/Coding/qt5/qt5/qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/include/openssl/base.h:446,
                 from D:/Coding/qt5/qt5/qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/include/openssl/ssl.h:145,
                 from ../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/ssl/ssl_versions.cc:15:
C:/usr/include/c++/9/cctype:87:11: error: '::isblank' has not been declared
   87 |   using ::isblank;
      |           ^~~~~~~

@dmik
Copy link
Contributor Author

dmik commented Feb 14, 2020

A new build break in boringssl due to missing socklen_t in LIBC. Created bitwiseworks/libc#62 for that.

@dmik
Copy link
Contributor Author

dmik commented Feb 20, 2020

Several more helper libraries built. Now I'm facing a preconfigure problem in a third party library again. libevent this time. The chromium guys drag its source in but instead of configuring the library at build time they preconfigure it somewhere else and just commit the configure products (like config.h) to the tree along with the sources. And the OS/2 part is missing, of course.

One could think that running autoreconf + configure would solve the problem, but it's not the case. The Chromium folks remove parts of the original source tree they don't need so either autoreconf or configure (or both) fails to complete. This is really NOT a wise decision, given the circumstances.

The only way to go here is to take the original source tree (of exactly the same version) and add missing files. It's a boring monkey work. Thanks, Chromium guys.

@dmik
Copy link
Contributor Author

dmik commented Feb 21, 2020

We decided to roll out libevent as a separate repository (https://github.com/bitwiseworks/libevent-os2) and we will always use a system libevent library on OS/2 when building Chromium to avoid code duplication and monkey work.

I will also create a dedicated ticket for building Chromium (in the respective repository) and this one will cover porting the rest of the Qt wrapper part.

dmik added a commit to bitwiseworks/qtwebengine-chromium-os2 that referenced this issue Feb 21, 2020
dmik added a commit that referenced this issue Jun 12, 2020
This also includes usual DLL name shortening with TARGET_SHORT.

Needed for #1 and for bitwiseworks/qtwebengine-chromium-os2#3.
@dmik
Copy link
Contributor Author

dmik commented Jun 18, 2020

Hard to say exactly. Some debugging needed. Weakld is still reading objects from liibraries here, I'm not interrupting it. I will leave it overnight. What I can say now is that this procedure is very slow. It's taking many seconds for some object files. No surprise it's taking that long. It has to be optimized. Impossible to go on like that.

Even a second per one object file is way too much. It gives us 15k seconds which is 4 hours...

@dmik
Copy link
Contributor Author

dmik commented Jun 19, 2020

It didn't end with anything good. Overall it took 9 (!!!) hours to get to the point where I found it dead (hard system hang with cold reboot). The log file is 432 MB and here are its last lines:

LIBRARY 'D:\Temp\ldconv_ssp_dll_a_cabe5eeba7ea177240.lib'
LIBRARY 'D:\Coding\gcc\master-install\lib\gcc\i686-pc-os2-emx\9\libgcc_so_d.lib'
LIBRARY 'C:\usr\lib\libc_alias.lib'
LIBRARY 'C:\usr\lib\libc_dll.lib'
LIBRARY 'C:\usr\lib\libos2.lib'
LIBRARY 'C:\usr\lib\libend.lib'
OPTION MODNAME='Qt5WebCd'

--- End of Response File

This looks like some debug messages from WL.EXE (due to -t in EMXOMFLD invocation) so I expect it was WL.EXE which brought it all down. No POPUPLOG or such so I expect it faced the infamous OOM condition.

I could try ILINK isntead of WL but chances are low that it will succeed. And first I have to optimize EMXOMFLD — no way to wait for many hours upon each try.

@dmik
Copy link
Contributor Author

dmik commented Jun 22, 2020

This is the list of undefined symbols I get from a semi-successive run of WL (see bitwiseworks/libc#84 (comment)):

Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEC1Ev is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEC1EOS4_ is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEED1Ev is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE6insertEjRKS4_ is an undefined reference
Error! E2028: __ZNKSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE4sizeEv is an undefined reference
Error! E2028: __ZNKSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE4dataEv is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEC1EPKwRKS3_ is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE6resizeEj is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE5beginEv is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEaSEOS4_ is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE5clearEv is an undefined reference
Error! E2028: __ZNKSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE6lengthEv is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEC1ERKS4_ is an undefined reference
Error! E2028: __ZNKSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE5emptyEv is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEaSERKS4_ is an undefined reference
Error! E2028: __ZN3gfx19GetFontRenderParamsERKNS_21FontRenderParamsQueryEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE is an undefined reference
Error! E2028: __ZNKSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE7compareERKS4_ is an undefined reference
Error! E2028: __ZNKSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEixEj is an undefined reference
Error! E2028: __ZNKSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE6substrEjj is an undefined reference
Error! E2028: __ZN8printing15PrintingContext6CreateEPNS0_8DelegateE is an undefined reference
Error! E2028: __ZN8printing15PrintedDocument21RenderPrintedDocumentEPNS_15PrintingContextE is an undefined reference
Error! E2028: __ZN4base15FilePathWatcherC1Ev is an undefined reference
Error! E2028: __ZN9SkFontMgr7FactoryEv is an undefined reference
Error! E2028: __ZN5media18CreateAudioManagerESt10unique_ptrINS_11AudioThreadESt14default_deleteIS1_EEPNS_15AudioLogFactoryE is an undefined reference
Error! E2028: __ZN2gl4init15CreateGLContextEPNS_12GLShareGroupEPNS_9GLSurfaceERKNS_16GLContextAttribsE is an undefined reference
Error! E2028: __ZN3gpu24CollectBasicGraphicsInfoEPNS_7GPUInfoE is an undefined reference
Error! E2028: __ZN2gl4init28GetGLWindowSystemBindingInfoEPNS_25GLWindowSystemBindingInfoE is an undefined reference
Error! E2028: __ZNKSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE5beginEv is an undefined reference
Error! E2028: __ZNKSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE3endEv is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE6assignEPKwj is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE3endEv is an undefined reference
Error! E2028: __ZNKSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE7_M_dataEv is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE10_M_replaceEjjPKwj is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE13_M_local_dataEv is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE12_Alloc_hiderC1EPwRKS3_ is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE9_M_createERjj is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE7_M_dataEPw is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE11_M_capacityEj is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE13_M_set_lengthEj is an undefined reference
Error! E2028: __ZN7content9WebCursor16InitPlatformDataEv is an undefined reference
Error! E2028: __ZNK7content9WebCursor19IsPlatformDataEqualERKS0_ is an undefined reference
Error! E2028: __ZN7content9WebCursor19CleanupPlatformDataEv is an undefined reference
Error! E2028: __ZN7content9WebCursor16CopyPlatformDataERKS0_ is an undefined reference
Error! E2028: __ZN7content9WebCursor17GetPlatformCursorERKN2ui6CursorE is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEC1EPKwjRKS3_ is an undefined reference
Error! E2028: __ZN3gpu21ImageTransportSurface19CreateNativeSurfaceEN4base7WeakPtrINS_29ImageTransportSurfaceDelegateEEEmN2gl15GLSurfaceFormatE is an undefined reference
Error! E2028: __ZN5angle17GetEnvironmentVarB5cxx11EPKc is an undefined reference
Error! E2028: __ZN5angle16GetPathSeparatorEv is an undefined reference
Error! E2028: __ZN5angle17SetEnvironmentVarEPKcS1_ is an undefined reference
Error! E2028: _v8_Default_embedded_blob_ is an undefined reference
Error! E2028: _v8_Default_embedded_blob_size_ is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE10_M_disposeEv is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEC1EjwRKS3_ is an undefined reference
Error! E2028: __ZNKSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE4findERKS4_j is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEpLERKS4_ is an undefined reference
Error! E2028: __ZNKSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE5c_strEv is an undefined reference
Error! E2028: __ZN7content17SwapMetricsDriver6CreateESt10unique_ptrINS0_8DelegateESt14default_deleteIS2_EEN4base9TimeDeltaE is an undefined reference
Error! E2028: __ZN7content8internal26ChildProcessLauncherHelper34SetProcessPriorityOnLauncherThreadEN4base7ProcessERKNS_28ChildProcessLauncherPriorityE is an undefined reference
Error! E2028: __ZN7content8internal26ChildProcessLauncherHelper18GetTerminationInfoERKNS1_7ProcessEb is an undefined reference
Error! E2028: __ZN7content8internal26ChildProcessLauncherHelper16TerminateProcessERKN4base7ProcessEi is an undefined reference
Error! E2028: __ZN7content8internal26ChildProcessLauncherHelper28SetRegisteredFilesForServiceERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt3mapIS7_N4base8FilePathESt4lessIS7_ESaISt4pairIS8_SC_EEE is an undefined reference
Error! E2028: __ZN7content8internal26ChildProcessLauncherHelper30ResetRegisteredFilesForTestingEv is an undefined reference
Error! E2028: __ZN7content8internal26ChildProcessLauncherHelper26BeforeLaunchOnClientThreadEv is an undefined reference
Error! E2028: __ZN7content8internal26ChildProcessLauncherHelper40CreateNamedPlatformChannelOnClientThreadEv is an undefined reference
Error! E2028: __ZN7content8internal26ChildProcessLauncherHelper13GetFilesToMapEv is an undefined reference
Error! E2028: __ZN7content8internal26ChildProcessLauncherHelper28BeforeLaunchOnLauncherThreadERKNS_23PosixFileDescriptorInfoEPN4base13LaunchOptionsE is an undefined reference
Error! E2028: __ZN7content8internal26ChildProcessLauncherHelper29LaunchProcessOnLauncherThreadERKN4base13LaunchOptionsESt10unique_ptrINS_23PosixFileDescriptorInfoESt14default_deleteIS7_EEPbPi is an undefined reference
Error! E2028: __ZN7content8internal26ChildProcessLauncherHelper27AfterLaunchOnLauncherThreadERKNS1_7ProcessERKN4base13LaunchOptionsE is an undefined reference
Error! E2028: __ZN7content8internal26ChildProcessLauncherHelper33ForceNormalProcessTerminationSyncENS1_7ProcessE is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEixEj is an undefined reference
Error! E2028: __ZNKSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE4findEwj is an undefined reference
Error! E2028: __ZNKSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE5rfindEwj is an undefined reference
Error! E2028: __ZN2ui17CalculateIdleTimeEv is an undefined reference
Error! E2028: __ZN2ui22CheckIdleStateIsLockedEv is an undefined reference
Error! E2028: __ZNKSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE8capacityEv is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE6appendERKS4_ is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE7reserveEj is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE9push_backEw is an undefined reference
Error! E2028: __ZN7content14responsiveness19NativeEventObserver16RegisterObserverEv is an undefined reference
Error! E2028: __ZN7content14responsiveness19NativeEventObserver18DeregisterObserverEv is an undefined reference
Error! E2028: __ZN7content8internal15OpenFileToShareERKN4base8FilePathEPNS1_16MemoryMappedFile6RegionE is an undefined reference
Error! E2028: __ZN7content18PepperTrueTypeFont6CreateEv is an undefined reference
Error! E2028: __ZNK4base7Process12CreationTimeEv is an undefined reference
Error! E2028: __ZN6device15TimeZoneMonitor6CreateE13scoped_refptrIN4base19SequencedTaskRunnerEE is an undefined reference
Error! E2028: __ZN6device25NewSystemLocationProviderEv is an undefined reference
Error! E2028: __ZN6device16PowerSaveBlockerC1ENS_5mojom12WakeLockTypeENS1_14WakeLockReasonERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE13scoped_refptrIN4base19SequencedTaskRunnerEESC_INSD_22SingleThreadTaskRunnerEE is an undefined reference
Error! E2028: __ZNKSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE7compareEjjRKS4_ is an undefined reference
Error! E2028: __ZNSt13basic_ostreamIwSt11char_traitsIwEE5writeEPKwi is an undefined reference
Error! E2028: __ZN12CFX_GEModule15DestroyPlatformEv is an undefined reference
Error! E2028: __ZN12CFX_GEModule12InitPlatformEv is an undefined reference
Error! E2028: __ZNKSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE12find_last_ofEwj is an undefined reference
Error! E2028: __ZNKSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE12find_last_ofEPKwj is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE5eraseEjj is an undefined reference
Error! E2028: __ZNKSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE7compareEPKw is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE6insertEN9__gnu_cxx17__normal_iteratorIPKwS4_EEw is an undefined reference
Error! E2028: __ZNKSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE4findEPKwj is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEpLEPKw is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE5eraseEN9__gnu_cxx17__normal_iteratorIPKwS4_EE is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE5eraseEN9__gnu_cxx17__normal_iteratorIPKwS4_EES9_ is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE7replaceEjjPKw is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEaSEPKw is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE7replaceEjjPKwj is an undefined reference
Error! E2028: __ZNKSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE13get_allocatorEv is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEC1ERKS3_ is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE4swapERS4_ is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE6appendERKS4_jj is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE6appendEPKwj is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE7replaceEjjRKS4_jj is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE13shrink_to_fitEv is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE7replaceEN9__gnu_cxx17__normal_iteratorIPKwS4_EES9_S8_S8_ is an undefined reference
Error! E2028: __ZNKSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE4findEPKwjj is an undefined reference
Error! E2028: __ZNKSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE13find_first_ofEPKwjj is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE13_S_copy_charsEPwPKwS7_ is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE6insertEjjw is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEpLEw is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE2atEj is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE6assignERKS4_ is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE13_S_copy_charsEPwS5_S5_ is an undefined reference
Error! E2028: __ZN2ui12CursorLoader6CreateEv is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE6assignEOS4_ is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE4backEv is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE6appendEPKw is an undefined reference
Error! E2028: __ZN8printing22PrintRenderFrameHelper16PrintPagesNativeEPN5blink13WebLocalFrameEib is an undefined reference
Error! E2028: __ZN2gl4init34CreateOffscreenGLSurfaceWithFormatERKN3gfx4SizeENS_15GLSurfaceFormatE is an undefined reference
Error! E2028: __ZN3gpu26CollectContextGraphicsInfoEPNS_7GPUInfoERKNS_14GpuPreferencesE is an undefined reference
Error! E2028: __ZN2gl4init29SetDisabledExtensionsPlatformERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE is an undefined reference
Error! E2028: __ZN2gl4init41InitializeExtensionSettingsOneOffPlatformEv is an undefined reference
Error! E2028: __ZN19SystemFontInfoIface13CreateDefaultEPPKc is an undefined reference
Error! E2028: __ZNK3net16PlatformMimeUtil40GetPlatformPreferredExtensionForMimeTypeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPS6_ is an undefined reference
Error! E2028: __ZNK3net16PlatformMimeUtil32GetPlatformMimeTypeFromExtensionERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPS6_ is an undefined reference
Error! E2028: __ZNK3net16PlatformMimeUtil32GetPlatformExtensionsForMimeTypeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPSt13unordered_setIS6_St4hashIS6_ESt8equal_toIS6_ESaIS6_EE is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE7replaceEN9__gnu_cxx17__normal_iteratorIPKwS4_EES9_jw is an undefined reference
Error! E2028: __ZN2gl14NoContextGLApi24glDebugMessageCallbackFnEPFvjjjjiPKcPKvES4_ is an undefined reference
Error! E2028: __ZN2gl10DebugGLApi24glDebugMessageCallbackFnEPFvjjjjiPKcPKvES4_ is an undefined reference
Error! E2028: __ZN2gl10TraceGLApi24glDebugMessageCallbackFnEPFvjjjjiPKcPKvES4_ is an undefined reference
Error! E2028: __ZN2gl9GLApiBase24glDebugMessageCallbackFnEPFvjjjjiPKcPKvES4_ is an undefined reference
Error! E2028: __ZN2gl4init27GetAllowedGLImplementationsEv is an undefined reference
Error! E2028: __ZN2gl4init26InitializeStaticGLBindingsENS_16GLImplementationE is an undefined reference
Error! E2028: __ZN2gl4init26InitializeGLOneOffPlatformEv is an undefined reference
Error! E2028: __ZN2gl4init25InitializeDebugGLBindingsEv is an undefined reference
Error! E2028: __ZN2gl4init18ShutdownGLPlatformEv is an undefined reference
Error! E2028: __ZN3gfx12PlatformFont13CreateDefaultEv is an undefined reference
Error! E2028: __ZN3gfx12PlatformFont21CreateFromNameAndSizeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi is an undefined reference
Error! E2028: __ZN2ui6Cursor15RefCustomCursorEv is an undefined reference
Error! E2028: __ZN2ui6Cursor17UnrefCustomCursorEv is an undefined reference
Error! E2028: __ZN2gl10GLFenceEGL17SetIgnoreFailuresEv is an undefined reference
Error! E2028: __ZN2gl10GLFenceEGL6CreateEv is an undefined reference
Error! E2028: __ZN5blink9FontCache32PlatformFallbackFontForCharacterERKNS_15FontDescriptionEiPKNS_14SimpleFontDataENS_20FontFallbackPriorityE is an undefined reference
Error! E2028: __ZN5blink9FontCache16SystemFontFamilyEv is an undefined reference
Error! E2028: __ZN2ui12KeyboardHook26CreateModifierKeyboardHookEN4base8OptionalINS1_8internal9flat_treeINS_7DomCodeES5_NS3_23GetKeyFromValueIdentityIS5_EESt4lessIvEEEEEmNS1_17RepeatingCallbackIFvPNS_8KeyEventEEEE is an undefined reference
Error! E2028: __ZN22memory_instrumentation9OSMetrics16FillOSMemoryDumpEiPNS_5mojom12RawOSMemDumpE is an undefined reference
Error! E2028: __ZN2ui22CreateSelectFileDialogEPNS_16SelectFileDialog8ListenerESt10unique_ptrINS_16SelectFilePolicyESt14default_deleteIS4_EE is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE6appendEjw is an undefined reference
Error! E2028: __ZN7content28RendererMainPlatformDelegateC1ERKNS_18MainFunctionParamsE is an undefined reference
Error! E2028: __ZN7content28RendererMainPlatformDelegate18PlatformInitializeEv is an undefined reference
Error! E2028: __ZN7content28RendererMainPlatformDelegate13EnableSandboxEv is an undefined reference
Error! E2028: __ZN7content28RendererMainPlatformDelegate20PlatformUninitializeEv is an undefined reference
Error! E2028: __ZN7content28RendererMainPlatformDelegateD1Ev is an undefined reference
Error! E2028: __ZN7content14RenderViewImpl36UpdateFontRenderingFromRendererPrefsEv is an undefined reference
Error! E2028: __ZNKSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE17find_first_not_ofERKS4_j is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE6assignEjw is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE7replaceEjjRKS4_ is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE4nposE is an undefined reference
Error! E2028: __ZN3gfx16GetFallbackFontsERKNS_4FontE is an undefined reference
Error! E2028: __ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE6insertEjPKw is an undefined reference
Error! E2028: __ZN7metrics20DriveMetricsProvider14HasSeekPenaltyERKN4base8FilePathEPb is an undefined reference
Error! E2028: __ZN3net24WebSocketErrorToNetErrorENS_14WebSocketErrorE is an undefined reference
Error! E2028: __ZNKSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE5rfindERKS4_j is an undefined reference
Error! E2028: __ZN5blink11LayoutTheme11NativeThemeEv is an undefined reference
Error! E2028: __ZN5blink11Hyphenation22PlatformGetHyphenationERKN3WTF12AtomicStringE is an undefined reference
Error! E2028: __ZN5blink9FontCache20device_scale_factor_E is an undefined reference
Error! E2028: __ZNKSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE4copyEPwjj is an undefined reference
Error! E2028: __ZN21SkFontConfigInterface9RefGlobalEv is an undefined reference
Error! E2028: __ZN5blink9FontCache19SetSystemFontFamilyERKN3WTF12AtomicStringE is an undefined reference
Error! E2028: __ZN22memory_instrumentation9OSMetrics20GetProcessMemoryMapsEi is an undefined reference
Error! E2028: __ZNKSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE6rbeginEv is an undefined reference
Error! E2028: __ZNKSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE5frontEv is an undefined reference
Error! E2028: __ZNKSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE4backEv is an undefined reference
Error! E2028: _setproctitle is an undefined reference

It's 180 symbols, not that much. Not only Chromium itself, but our C++ library seems to miss something.

@dmik
Copy link
Contributor Author

dmik commented Jun 22, 2020

Missing libstdc exports is quite strange as I see them in the original stdc++_dll.a library as well as in its .lib counterpart, both located in /usr/lib. However, WL uses a .lib library converted by emxomfld for it from the .a library and this one doesn't have some exports... Really strange. Both why emxomfld decides to do a conversion instead of using an existing .lib file and why this conversion is different from what we do at GCC RPM build stage.

@dmik
Copy link
Contributor Author

dmik commented Jun 23, 2020

It turned to be the old C++ library from some test build of GCC which got on the way. Removing a path to it from EMXOMFLD options made the problem go away: this means, that EMXOMFLD does not convert the library now and simply uses the .lib version as it should.

@dmik
Copy link
Contributor Author

dmik commented Jun 23, 2020

Ok, with the right library, all missing cxx entries are gone the list of missing symbols is down to 91. Not bad. Switching to working on them.

@dmik
Copy link
Contributor Author

dmik commented Jun 30, 2020

Status update: I've fixed more than a half of missing symbols (mostly by adapting Fuchsia stubs to OS/2 to speed it up). However, I have to recompile hundreds and hundreds of source files (as headers change in many cases) and I'm constantly experiencing OOM issues from both EMXOMF and WL so it's going really slow.

@dmik
Copy link
Contributor Author

dmik commented Jul 1, 2020

I'm trying the release build now and it's going much faster. Approximately, 2500 compilation units in 30 min. Which gives a total duration of 3 hours per 15k of them. Not bad, 2-3 times faster than the debug build (may be even more).

@dmik
Copy link
Contributor Author

dmik commented Jul 1, 2020

I was way too optimistic it seems. The first 10k units were built in roughly 2.5 hours but then I had a build break and performance significantly degraded down to just 500 units in the next 3 hours. I have no idea if it's just the complexity of C++ or something else. Judging by the CPU load, it still loads it almost completely. I will try to break the build and reboot to see if it helps.

@dmik
Copy link
Contributor Author

dmik commented Jul 3, 2020

Note that the original release build failed with OOM too. And looking at options shows that it uses -g1 (debug info w/o local vars). Our EMXOMF ignores debug level and also does everything hence an OOM on big files (bitwiseworks/libc#82 -- I guess we should add such support, it meets the task mentioned in that ticket and could be a partial solution). I had to hack the release config to explicitly use -s.

After that I got a single build run of the whole QtWebEngine module in 14 hours 30 min w/o any OOMs. It failed on linking but that's expected as not all symbols are there yet. But I must say that the fixed WL from bitwiseworks/libc#84 runs much, much faster. Just several minutes. Yes, it's w/o the debug info but still.

Good results, I will finish the missing symbols now.

@dmik
Copy link
Contributor Author

dmik commented Jul 9, 2020

All missing symbols are finished within bitwiseworks/qtwebengine-chromium-os2#3. There are also a few bits on the Qt side to compile (the Qt Web Engine Widgets DLL) but they should be pretty straight forward since we have everything now.

dmik added a commit that referenced this issue Jul 11, 2020
dmik added a commit that referenced this issue Jul 11, 2020
This, toghether with b65b035 finally makes everything built (including examples and test cases).

Needed for #1.
@dmik
Copy link
Contributor Author

dmik commented Jul 11, 2020

With the above commits, EVERYTHING is successfully built now. Including examples and tests.

Starting examples/webenginewidgets/simplebrowser (a very simple web browser example) fails like this:

D:>qt5d sh -c ./simplebrowser.exe
[489-1:01:17:03.230] unknown:0: Could not find QtWebEngineProcess

Killed by SIGABRT
pid=0x01e9 ppid=0x01e8 tid=0x0001 slot=0x008d pri=0x0200 mc=0x0001 ps=0x0010
D:\CODING\QT5\QT5-DEV-BUILD\QTWEBENGINE\EXAMPLES\WEBENGINEWIDGETS\SIMPLEBROWSER\RELEASE\SIMPLEBROWSER.EXE
Process dumping was disabled, use DUMPPROC / PROCDUMP to enable it.

Somewhat expected.

I need to see where this error comes from but the fact is that OS/2 successfully loads all Qt DLLs for this executable including Qt5WebC.dll which contains Chromium and is of 250 MB in size! And I'm not using the high memory bit so far.

I will debug that on Monday, doesn't look serious.

@dmik
Copy link
Contributor Author

dmik commented Jul 13, 2020

Above was a usual lack of the .exe extension. With that fixed, I can run further but getting some problems with IPC communication between the Qt app and the web process (also expected):

[18461:10236064:0713/175825.815000:ERROR:network_change_notifier.cc(224)] Not implemented reached in static net::NetworkChangeNotifier* net::NetworkChangeNotifier::Create()
[warn] poll: Invalid argument
[warn] poll: Invalid argument
[warn] poll: Invalid argument

We need to align it to use socketpair instead of poll (or a proper poll impl) etc.
I"m also getting one missing export in Qt5WebC.dll for some reason (MOC-related):

07-13-2020  17:58:26  SYS2070  PID 481d  TID 0001  Slot 0094
D:\CODING\QT5\QT5-DEV-BUILD\QTWEBENGINE\EXAMPLES\WEBENGINEWIDGETS\SIMPLEBROWSER\RELEASE\SIMPLEBROWSER.EXE
QT5WEBC->QT5WEBC.__ZNK28QWebChannelAbstractTransport10metaObjectEv
127

@dmik
Copy link
Contributor Author

dmik commented Jul 13, 2020

Also, seems that EMXEXP doesn't like Qt5WebC.dll:

D:>emxexp Qt5WebC.dll
emxexp: OMF record too long in `Qt5WebC.dll'

@dmik
Copy link
Contributor Author

dmik commented Jul 13, 2020

Also, both EXEHDR from OS/2 Toolkit and WDUMP from OpenWatcom 1.9 fail to show all the exports from Qt5WebC.dll. EXEHDR also fails (crashes) even on Qt5Wdgt.dll (which is fine per se and works well). So, we're definitely hitting some limit there...

@StevenLevine
Copy link

StevenLevine commented Jul 13, 2020 via email

dmik added a commit to bitwiseworks/qtwebchannel-os2 that referenced this issue Jul 13, 2020
@dmik
Copy link
Contributor Author

dmik commented Jul 13, 2020

Turns out that the DLL is loaded (and resolved by OS/2) fine. The cause for error 127 in POPUPLOG is different: there was a DLL name clash with QtWebChannel (the one that actually exports __ZNK28QWebChannelAbstractTransport10metaObjectEv). Resolving the clash by renaming it to QtWebH (see the commit above) fixes this problem. So, now I only have to fix broken IPC.

Steven, thanks for the help! I've uploaded the Qt5WebC.DLL for you for checking as http://rpm.netlabs.org/test/Qt5WebC.zip. Note that WDUMP seems to work fine now (it's just 648 exports in that DLL and this is normal -- all Chromium code is "private" there, Qt only exports its own APIs). EXEHDR and EMXEXP still fail. But they don't prevent me from going further at least: EMXEXP is not used in Qt. We use EMXIMP to generate import libraries and EMXIMP works fine with this huge DLL. I'm pretty sure EMXEXP is easily fixable though. But anyway, it's interesting what your checking of this DLL will tell us in terms of possible future problems.

@StevenLevine
Copy link

StevenLevine commented Jul 14, 2020 via email

@dmik
Copy link
Contributor Author

dmik commented Jul 14, 2020

Re EXEHDR, I wonder where you got this. I have:

Version 4.01.001 Oct  4 2001

(from the OS/2 4.5 TK coming with eCS 2.0).

Re uncommitted changes. In EMXOMF there is an uncommitted hack which breaks linking of some OBJ and I'm not going to commit it. In EMXOMFLD - yes, I have fixes for hash tables but they need some brushup. Will do it today.

I was also thinking about counting the symbols in EMXOMFLD/WEAKLD and making the hash table size dependent on it but then I decided it's not worth it. If there is a large number of symbols, we will need the largest hash table anyway. And if there is not, then allocating even 4MB will not hurt at all (as there will be plenty of free memory and no need for it elsewhere). So I'm going to make it constant (with a 49999 prime, see bitwiseworks/libc#83). What I am going to do though is make this allocation dynamic. EMXOMFLD starts WL after it's done weak symbol processing and that guy will need as much as possible for huge things like Chromium so every MB counts. My plan is to free those tables before launching the actual linker executable.

@dmik
Copy link
Contributor Author

dmik commented Jul 14, 2020

As everything builds now, it's time to close this issue. Runtime issues are to be reported via separate tickets.

@dmik dmik closed this as completed Jul 14, 2020
@StevenLevine
Copy link

StevenLevine commented Jul 22, 2020 via email

@dmik
Copy link
Contributor Author

dmik commented Jul 23, 2020

Thanks for the link, Steve!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants