Author Topic: Qt6 Development  (Read 234748 times)

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2095
  • Karma: +160/-0
    • View Profile
Re: Qt6
« Reply #345 on: January 06, 2023, 10:01:34 am »
https://smedley.id.au/tmp/qt6webee.zip

Had a few drinks with my dad this afternoon so no progress this evening :)
« Last Edit: January 06, 2023, 10:27:17 am by Paul Smedley »

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4808
  • Karma: +100/-1
    • View Profile
Re: Qt6
« Reply #346 on: January 06, 2023, 04:19:04 pm »
Try something like this, (src/3rdparty/chromium/third_party/libjpeg_turbo/simd/jsimdext.inc, around line 62)
Code: [Select]
%elifdef OBJ32  ; ----(nasm -fobj -DOBJ32 ...)----------
; * Borland C++ (Win32)
+; * OS/2 using OMF format

; -- segment definition --
;
+%ifdef __OS2__
+%define SEG_TEXT    .TEXT32 align=16 public use32 class=CODE
+%define SEG_CONST   .DATA32 align=16 public use32 class=DATA
+%else
%define SEG_TEXT    _text  align=32 public use32 class=CODE
%define SEG_CONST   _data  align=32 public use32 class=DATA
%endif

%elifdef ELF    ; ----(nasm -felf[64] -DELF ...)------------

Not sure about the align, if you disable AVX, align=16 should be correct and I don't think we (OMF32) support align=32. IIRC, we do support align=64
The simd stuff in libvpx also seems to get its own segment and may need further tuning.


Dave Yeo

  • Hero Member
  • *****
  • Posts: 4808
  • Karma: +100/-1
    • View Profile
Re: Qt6
« Reply #347 on: January 06, 2023, 04:47:46 pm »
For src/3rdparty/chromium/third_party/libvpx/source/libvpx/vpx_ports/x86_abi_support.asm, around line 400,
Code: [Select]
%endmacro
%elifidn __OUTPUT_FORMAT__,aout
%define SECTION_RODATA section .data
%elifidn __OUTPUT_FORMAT__,obj
-%define SECTION_RODATA section .text
-section .text align=16 use32 class=CODE
-group CGROUP text
       +; OMF needs special handling to ensure everything is in the same segment
       +; and that the segment is 32 bit.
       +%define SECTION_RODATA section .TEXT32 use32 class=CODE
%else
%define SECTION_RODATA section .rodata
%endif

Once again not sure if an align should be in there, it wasn't in the old VPX in Mozilla

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2095
  • Karma: +160/-0
    • View Profile
Re: Qt6
« Reply #348 on: January 06, 2023, 10:13:35 pm »
Thanks trying these now - the 2x E2021 are my last remaining errors, I've hacked around the others.

Still get:
Error! E2021: size of segment text exceeds 64k by 470127 bytes
Error! E2021: size of segment data exceeds 64k by 8320 bytes
« Last Edit: January 06, 2023, 10:24:06 pm by Paul Smedley »

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4808
  • Karma: +100/-1
    • View Profile
Re: Qt6
« Reply #349 on: January 06, 2023, 10:49:04 pm »
Did they get rebuilt? Perhaps delete the object files.
Look at your map file, close to the beginning, at the end of the Segments, here there is,
Code: [Select]
text                                  AUTO           0003:00000000   00082c6f
rodata                                AUTO           0004:00000000   00000480
data                                  AUTO           0005:00000000   00012080

And then search for "0003:" and "0005:" to find which functions are at those segments, eg
Code: [Select]
Module: U:\dev\qt6-webengine-os2\build\src\core\Release\i386\obj\third_party\libvpx\libvpx_asm.a(../..../../../src/3rdparty/chromium/third_party/libvpx/source/
libvpx/vpx_dsp/x86/vpx_high_subpixel_bilinear_sse2.asm)
0003:00000000  _vpx_highbd_filter_block1d4_v2_sse2
0003:000000b8  _vpx_highbd_filter_block1d4_v2_avg_sse2
0003:00000179  _vpx_highbd_filter_block1d4_h2_sse2
0003:00000234  _vpx_highbd_filter_block1d4_h2_avg_sse2
...
Code: [Select]
Module: U:\dev\qt6-webengine-os2\build\src\core\Release\i386\obj\third_party\libjpeg_turbo\libsimd_asm.a(../../../../../src/3rdparty/chromium/third_party/libjpeg_turbo/simd/i386/jccolor-vx2.asm)
0005:00000000  _jconst_rgb_ycc_convert_avx2
0003:0005b500  _jsimd_rgb_ycc_convert_avx2
0003:0005b9a0  _jsimd_extrgb_ycc_convert_avx2
0003:0005be40  _jsimd_extrgbx_ycc_convert_avx2
0003:0005c2c0  _jsimd_extbgr_ycc_convert_avx2
0003:0005c760  _jsimd_extbgrx_ycc_convert_avx2
0003:0005cbe0  _jsimd_extxbgr_ycc_convert_avx2
0003:0005d060  _jsimd_extxrgb_ycc_convert_avx2
...

Edit: Maybe they also need the group declared?
« Last Edit: January 06, 2023, 10:53:44 pm by Dave Yeo »

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2095
  • Karma: +160/-0
    • View Profile
Re: Qt6
« Reply #350 on: January 07, 2023, 01:22:50 am »
OK I removed all *.o* and *.a from libvpx and libjpeg_turbo but still get the E2021 errors.

New map at https://smedley.id.au/tmp/qt6webee.zip which I'm about to go look at myself
« Last Edit: January 07, 2023, 03:12:28 am by Paul Smedley »

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4808
  • Karma: +100/-1
    • View Profile
Re: Qt6
« Reply #351 on: January 07, 2023, 02:46:46 am »
OK I removed all *.o* and *.a from libvpx and libjpeg_turbo but still get the E2021 errors.

New map at https://smedley.id.au/tmp/Qt6Webee.zip which I'm about to go look at myself

404 error

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2095
  • Karma: +160/-0
    • View Profile
Re: Qt6
« Reply #352 on: January 07, 2023, 03:13:12 am »
oops, link corrected... interesting is that we've made segment text _worse_ by about 60k...

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4808
  • Karma: +100/-1
    • View Profile
Re: Qt6
« Reply #353 on: January 07, 2023, 03:43:34 am »
oops, link corrected... interesting is that we've made segment text _worse_ by about 60k...

Where is tht 60k? The segments are the same size.
Hopefully something hasn't broken in NASM. Could try adding the FLAT keyword after use32, and perhaps change use32 to USE32. Probably won't help.
Pretty sure when building Mozilla, those obj defines worked. Looking at the map file for ESR38, I do see one small text segment,
Code: [Select]
text                                  AUTO           0003:00000000   000005c7
And both libvpx and libjpeg were compiled IIRC, with CFLAGS -Zomf.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4808
  • Karma: +100/-1
    • View Profile
Re: Qt6
« Reply #354 on: January 07, 2023, 03:48:34 am »
Lets try building a standalone libjpg and then libvpx, which took more patching to build the whole thing.

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2095
  • Karma: +160/-0
    • View Profile
Re: Qt6
« Reply #355 on: January 07, 2023, 03:49:37 am »
The 1st build attempt had:
Error! E2021: size of segment text exceeds 64k by 393007 bytes
Error! E2021: size of segment data exceeds 64k by 8320 bytes

Latest has:
Error! E2021: size of segment text exceeds 64k by 470127 bytes
Error! E2021: size of segment data exceeds 64k by 8320 bytes

so actually, text is worse by 77,120 bytes...

Edit: USE32 vs use32 made no difference, neither did FLAT...
« Last Edit: January 07, 2023, 04:12:19 am by Paul Smedley »

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2095
  • Karma: +160/-0
    • View Profile
Re: Qt6
« Reply #356 on: January 07, 2023, 04:52:11 am »
ok the following in libvpx\source\libvpx\vpx_ports\x86_abi_support.asm
Code: [Select]
%elifidn __OUTPUT_FORMAT__,obj
; OMF needs special handling to ensure everything is in the same segment
; and that the segment is 32 bit.
%define SECTION_RODATA section .text
section .text align=16 use32 class=CODE
group CGROUP text
got us back down to:
Error! E2021: size of segment text exceeds 64k by 393007 bytes

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2095
  • Karma: +160/-0
    • View Profile
Re: Qt6
« Reply #357 on: January 07, 2023, 05:23:51 am »
I suspect we need something for obj in https://github.com/psmedley/qt6-webengine-os2/blob/main/src/3rdparty/chromium/third_party/libvpx/source/libvpx/third_party/x86inc/x86inc.asm#L113

Edit: tried a few different things in here and it didn't change anything :(
« Last Edit: January 07, 2023, 06:12:52 am by Paul Smedley »

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4808
  • Karma: +100/-1
    • View Profile
Re: Qt6
« Reply #358 on: January 07, 2023, 06:08:16 am »
Yes, much like the patch in your last post.
Playing with libjpeg, my understanding of the obj format seems wrong as how I patch things doesn't make a difference. I am ending up with segments over 64k that link fine but too many segments and experimenting with group, after reading about it on nasm.us hasn't helped. So these patches I posted didn't change behaviour, which might be a nasm regression as it seems it used to, but the group should put them in a common segment, though no luck with it in libjpeg
I'm more used to aout with this stuff.

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2095
  • Karma: +160/-0
    • View Profile
Re: Qt6
« Reply #359 on: January 07, 2023, 06:20:11 am »
Thanks for trying :( I'm trying to build the vpx asm stuff with an older nasm to see if it changes anything....

Edit: older nasm didn't work - wouldn't build some of the included asm...

Edit2:  trying OS4User's definition from https://www.os2world.com/forum/index.php?topic=1735.120
« Last Edit: January 07, 2023, 07:14:19 am by Paul Smedley »