Author Topic: Qt6 Development  (Read 232982 times)

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2095
  • Karma: +160/-0
    • View Profile
Re: Qt6
« Reply #270 on: December 24, 2022, 09:18:09 am »
OK latest commits seem to take care of this...

However, things still aren't quite right...

on linux, node myfirst.js opens a connection on port 8080 and I can connect to it with curl, and it returns 'Hello World!'

On OS/2, I can't connect to localhost :(

Edit: It's supposed to listen on port 8080 - running netstat, I noticed something was listening on port 52871

curl http://localhost:52871 returned:
Hello World!
« Last Edit: December 24, 2022, 09:24:34 am by Paul Smedley »

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2095
  • Karma: +160/-0
    • View Profile
Re: Qt6
« Reply #271 on: December 25, 2022, 10:23:40 pm »
Hey Lars,

Thanks Lars, your option 1 is what I vaguely recall from some other port!

Yeah and maybe 2) is the better option. At least it has no quirky preconditions on use ...

I stole your implementation from the bww github - there's a small issue with it - corrected in https://github.com/psmedley/node-os2/commit/ffae745f9b6cc92209bc956d2058b0db7b53b3bb

I couldn't raise an issue in bithub as they're not enabled, so hopefully you see this.

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2095
  • Karma: +160/-0
    • View Profile
Re: Qt6
« Reply #272 on: December 25, 2022, 10:30:42 pm »
Progress update, node seems to be mostly working...now trying to get npm (node package manager) working so we can install modules.. for qtwebengine, I think we need at least typescript...

running npm -f install typescript gives the log attached

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2095
  • Karma: +160/-0
    • View Profile
Re: Qt6
« Reply #273 on: December 26, 2022, 09:03:46 am »
Hey all... well I hand installed typescript - and cobbled together enough that tsc works to convert a .ts file into .js - which I think is what my qtwebengine build is stuck doing..

test build at https://smedley.id.au/tmp/node-10.19-os2-20221226.zip

Needs a libcn0 from 2022 (from netlabs-exp)

To test - create a helloworld.ts:
Code: [Select]
let message: string = 'Hello World';
console.log(message);

Compile it with ./tsc helloworld.ts

A helloworld.js should get created...
Running node.exe helloworld.js should produce:
Hello World

Now to see if qtwebengine gets any further :)

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2095
  • Karma: +160/-0
    • View Profile
Re: Qt6
« Reply #274 on: December 26, 2022, 09:07:24 am »
OK it got a bit further, then got stuck at:
Code: [Select]
Traceback (most recent call last):
  File "../../../../../src/3rdparty/chromium/third_party/node/node.py", line 63, in <module>
    RunNode(sys.argv[1:])
  File "../../../../../src/3rdparty/chromium/third_party/node/node.py", line 58, in RunNode
    raise RuntimeError('%s failed: %s' % (cmd, stderr))
RuntimeError: ['C:/USR/LOCAL/BIN/node.exe', '../../../../../src/3rdparty/chromium/third_party/devtools-frontend/src/node_modules/rollup/dist/bin/rollup', '--silent', '--plugin', 'terser', '--config', '../../../../../src/3rdparty/chromium/third_party/devtools-frontend/src/front_end/rollup.config.js', '--input', 'gen/third_party/devtools-frontend/src/front_end/formatter_worker/FormatterActions.prebundle.js', '--file', 'gen/third_party/devtools-frontend/src/front_end/formatter_worker/FormatterActions.js'] failed: [!] (plugin terser) TypeError: Cannot read property 'length' of undefined
TypeError: Cannot read property 'length' of undefined
    at new JestWorker (U:\dev\qt6-webengine-os2\src\3rdparty\chromium\third_party\devtools-frontend\src\node_modules\jest-worker\build\index.js:131:39)
    at Object.renderChunk (U:\dev\qt6-webengine-os2\src\3rdparty\chromium\third_party\devtools-frontend\src\node_modules\rollup-plugin-terser\rollup-plugin-terser.js:22:23)
    at Promise.resolve.then (U:\dev\qt6-webengine-os2\src\3rdparty\chromium\third_party\devtools-frontend\src\node_modules\rollup\dist\shared\rollup.js:18988:25)



Paul Smedley

  • Hero Member
  • *****
  • Posts: 2095
  • Karma: +160/-0
    • View Profile
Re: Qt6
« Reply #275 on: December 26, 2022, 09:58:38 pm »
of course, this exact command works fine on linux, so clearly a problem with my node port :(

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2095
  • Karma: +160/-0
    • View Profile
Re: Qt6
« Reply #276 on: December 27, 2022, 01:14:42 am »
OK got past this.... A hack of a .js file had gone bad - of course the hack was not present when I checked out the source on linux..

Next prob is that sometimes node generates no output - on linux, we get a 0 byte file, on OS/2, I'm getting NO file...

I hacked around this by manually creating these as I got build failures. Now back to building c++ and fixing build breaks, which is much more enjoyable than hacking nodejs...

Edit: quick afteroon update - 15,565 actions to go - so ~39% complete based on the 25,370 total when I started...

Edit2: the no output file issue is really annoying - but need a fresh head to investigate that!
« Last Edit: December 27, 2022, 07:39:43 am by Paul Smedley »

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2095
  • Karma: +160/-0
    • View Profile
Re: Qt6
« Reply #277 on: December 27, 2022, 09:47:45 am »
OK this seems a good place to break for the day....

Code: [Select]
C:/USR/BIN/python2.7.exe ../../../../../src/3rdparty/chromium/build/gn_run_binary.py nasm.exe -DPREFIX -fobj -I../../../../../src/3rdparty/chromium/third_party/libvpx/source/config/ -I../../../../../src/3rdparty/chromium/third_party/libvpx/source/config/linux/ia32/ -I../../../../../src/3rdparty/chromium/third_party/libvpx/source/libvpx/ -I./ -I../../../../../src/3rdparty/chromium/ -Igen/ -DCHROMIUM -MD obj/third_party/libvpx/libvpx_asm/idctllm_mmx.obj.d -o obj/third_party/libvpx/libvpx_asm/idctllm_mmx.obj ../../../../../src/3rdparty/chromium/third_party/libvpx/source/libvpx/vp8/common/x86/idctllm_mmx.asm
../../../../../src/3rdparty/chromium/third_party/libvpx/source/libvpx/vp8/common/x86/idctllm_mmx.asm:48: error: impossible combination of address sizes
../../../../../src/3rdparty/chromium/third_party/libvpx/source/libvpx/vp8/common/x86/idctllm_mmx.asm:49: error: impossible combination of address sizes
../../../../../src/3rdparty/chromium/third_party/libvpx/source/libvpx/vp8/common/x86/idctllm_mmx.asm:51: error: impossible combination of address sizes
../../../../../src/3rdparty/chromium/third_party/libvpx/source/libvpx/vp8/common/x86/idctllm_mmx.asm:51: error: invalid effective address
../../../../../src/3rdparty/chromium/third_party/libvpx/source/libvpx/vp8/common/x86/idctllm_mmx.asm:52: error: impossible combination of address sizes
../../../../../src/3rdparty/chromium/third_party/libvpx/source/libvpx/vp8/common/x86/idctllm_mmx.asm:52: error: invalid effective address
../../../../../src/3rdparty/chromium/third_party/libvpx/source/libvpx/vp8/common/x86/idctllm_mmx.asm:53: error: impossible combination of address sizes
../../../../../src/3rdparty/chromium/third_party/libvpx/source/libvpx/vp8/common/x86/idctllm_mmx.asm:53: error: invalid effective address
../../../../../src/3rdparty/chromium/third_party/libvpx/source/libvpx/vp8/common/x86/idctllm_mmx.asm:54: error: impossible combination of address sizes
../../../../../src/3rdparty/chromium/third_party/libvpx/source/libvpx/vp8/common/x86/idctllm_mmx.asm:54: error: invalid effective address
../../../../../src/3rdparty/chromium/third_party/libvpx/source/libvpx/vp8/common/x86/idctllm_mmx.asm:63: error: impossible combination of address sizes
../../../../../src/3rdparty/chromium/third_party/libvpx/source/libvpx/vp8/common/x86/idctllm_mmx.asm:64: error: impossible combination of address sizes
../../../../../src/3rdparty/chromium/third_party/libvpx/source/libvpx/vp8/common/x86/idctllm_mmx.asm:65: error: impossible combination of address sizes
../../../../../src/3rdparty/chromium/third_party/libvpx/source/libvpx/vp8/common/x86/idctllm_mmx.asm:187: error: impossible combination of address sizes
../../../../../src/3rdparty/chromium/third_party/libvpx/source/libvpx/vp8/common/x86/idctllm_mmx.asm:187: error: invalid effective address
../../../../../src/3rdparty/chromium/third_party/libvpx/source/libvpx/vp8/common/x86/idctllm_mmx.asm:191: error: impossible combination of address sizes
../../../../../src/3rdparty/chromium/third_party/libvpx/source/libvpx/vp8/common/x86/idctllm_mmx.asm:191: error: invalid effective address
../../../../../src/3rdparty/chromium/third_party/libvpx/source/libvpx/vp8/common/x86/idctllm_mmx.asm:193: error: impossible combination of address sizes
../../../../../src/3rdparty/chromium/third_party/libvpx/source/libvpx/vp8/common/x86/idctllm_mmx.asm:193: error: invalid effective address
../../../../../src/3rdparty/chromium/third_party/libvpx/source/libvpx/vp8/common/x86/idctllm_mmx.asm:197: error: impossible combination of address sizes
../../../../../src/3rdparty/chromium/third_party/libvpx/source/libvpx/vp8/common/x86/idctllm_mmx.asm:197: error: invalid effective address
../../../../../src/3rdparty/chromium/third_party/libvpx/source/libvpx/vp8/common/x86/idctllm_mmx.asm:199: error: impossible combination of address sizes
../../../../../src/3rdparty/chromium/third_party/libvpx/source/libvpx/vp8/common/x86/idctllm_mmx.asm:199: error: invalid effective address
../../../../../src/3rdparty/chromium/third_party/libvpx/source/libvpx/vp8/common/x86/idctllm_mmx.asm:203: error: impossible combination of address sizes
../../../../../src/3rdparty/chromium/third_party/libvpx/source/libvpx/vp8/common/x86/idctllm_mmx.asm:203: error: invalid effective address
../../../../../src/3rdparty/chromium/third_party/libvpx/source/libvpx/vp8/common/x86/idctllm_mmx.asm:208: error: impossible combination of address sizes
../../../../../src/3rdparty/chromium/third_party/libvpx/source/libvpx/vp8/common/x86/idctllm_mmx.asm:208: error: invalid effective address
../../../../../src/3rdparty/chromium/third_party/libvpx/source/libvpx/vp8/common/x86/idctllm_mmx.asm:212: error: impossible combination of address sizes
../../../../../src/3rdparty/chromium/third_party/libvpx/source/libvpx/vp8/common/x86/idctllm_mmx.asm:212: error: invalid effective address
../../../../../src/3rdparty/chromium/third_party/libvpx/source/libvpx/vp8/common/x86/idctllm_mmx.asm:236: error: impossible combination of address sizes
../../../../../src/3rdparty/chromium/third_party/libvpx/source/libvpx/vp8/common/x86/idctllm_mmx.asm:236: error: invalid effective address
../../../../../src/3rdparty/chromium/third_party/libvpx/source/libvpx/vp8/common/x86/idctllm_mmx.asm:237: error: impossible combination of address sizes
../../../../../src/3rdparty/chromium/third_party/libvpx/source/libvpx/vp8/common/x86/idctllm_mmx.asm:238: error: impossible combination of address sizes
../../../../../src/3rdparty/chromium/third_party/libvpx/source/libvpx/vp8/common/x86/idctllm_mmx.asm:243: error: impossible combination of address sizes
../../../../../src/3rdparty/chromium/third_party/libvpx/source/libvpx/vp8/common/x86/idctllm_mmx.asm:251: error: impossible combination of address sizes
../../../../../src/3rdparty/chromium/third_party/libvpx/source/libvpx/vp8/common/x86/idctllm_mmx.asm:251: error: invalid effective address
../../../../../src/3rdparty/chromium/third_party/libvpx/source/libvpx/vp8/common/x86/idctllm_mmx.asm:252: error: impossible combination of address sizes
../../../../../src/3rdparty/chromium/third_party/libvpx/source/libvpx/vp8/common/x86/idctllm_mmx.asm:252: error: invalid effective address
../../../../../src/3rdparty/chromium/third_party/libvpx/source/libvpx/vp8/common/x86/idctllm_mmx.asm:253: error: impossible combination of address sizes
../../../../../src/3rdparty/chromium/third_party/libvpx/source/libvpx/vp8/common/x86/idctllm_mmx.asm:253: error: invalid effective address
../../../../../src/3rdparty/chromium/third_party/libvpx/source/libvpx/vp8/common/x86/idctllm_mmx.asm:254: error: impossible combination of address sizes
../../../../../src/3rdparty/chromium/third_party/libvpx/source/libvpx/vp8/common/x86/idctllm_mmx.asm:254: error: invalid effective address
../../../../../src/3rdparty/chromium/third_party/libvpx/source/libvpx/vp8/common/x86/idctllm_mmx.asm:256: error: impossible combination of address sizes
../../../../../src/3rdparty/chromium/third_party/libvpx/source/libvpx/vp8/common/x86/idctllm_mmx.asm:257: error: impossible combination of address sizes
../../../../../src/3rdparty/chromium/third_party/libvpx/source/libvpx/vp8/common/x86/idctllm_mmx.asm:262: error: impossible combination of address sizes
../../../../../src/3rdparty/chromium/third_party/libvpx/source/libvpx/vp8/common/x86/idctllm_mmx.asm:276: error: impossible combination of address sizes
../../../../../src/3rdparty/chromium/third_party/libvpx/source/libvpx/vp8/common/x86/idctllm_mmx.asm:276: error: invalid effective address
../../../../../src/3rdparty/chromium/third_party/libvpx/source/libvpx/vp8/common/x86/idctllm_mmx.asm:277: error: impossible combination of address sizes
../../../../../src/3rdparty/chromium/third_party/libvpx/source/libvpx/vp8/common/x86/idctllm_mmx.asm:277: error: invalid effective address
../../../../../src/3rdparty/chromium/third_party/libvpx/source/libvpx/vp8/common/x86/idctllm_mmx.asm:278: error: impossible combination of address sizes
../../../../../src/3rdparty/chromium/third_party/libvpx/source/libvpx/vp8/common/x86/idctllm_mmx.asm:278: error: invalid effective address
../../../../../src/3rdparty/chromium/third_party/libvpx/source/libvpx/vp8/common/x86/idctllm_mmx.asm:279: error: impossible combination of address sizes
../../../../../src/3rdparty/chromium/third_party/libvpx/source/libvpx/vp8/common/x86/idctllm_mmx.asm:279: error: invalid effective address
nasm.exe failed with exit code 1
[65/12295] ACTION //ui/gfx/mojom:native_handle_types_js__generator(//build/toolchain/os2:x86)

On the positive side - 12,230 actions remaining - so around 50% done.

Looks like they changed from yasm to nasm....

More tomorrow...
« Last Edit: December 27, 2022, 09:50:58 am by Paul Smedley »

Lars

  • Hero Member
  • *****
  • Posts: 1272
  • Karma: +65/-0
    • View Profile
Re: Qt6
« Reply #278 on: December 27, 2022, 02:46:39 pm »
1) need to define ABI_IS_32BIT (x86_abi_support.asm).
You might be able to hack that latter file to specify the __OUTPUT_FORMAT__ to match what the OS/2 port of NASM uses, would be something like "obj". That will then set ABI_IS_32BIT. You might need to be forced to call NASM with the -fobj switch.
2) about some convenience macros (to access arguments), I think our port of NASM is too old to provide/support these.
« Last Edit: December 27, 2022, 03:00:01 pm by Lars »

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4805
  • Karma: +99/-1
    • View Profile
Re: Qt6
« Reply #279 on: December 27, 2022, 05:45:48 pm »
Yes, it looks like your using 16bit code. Somethnig like defining the segments for 32 bit,
Code: [Select]
.TEXT32 align=16 public use32 class=CODE
.DATA32 align=16 public use32 class=DATA

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4805
  • Karma: +99/-1
    • View Profile
Re: Qt6
« Reply #280 on: December 27, 2022, 05:49:00 pm »
2) about some convenience macros (to access arguments), I think our port of NASM is too old to provide/support these.

Nasm shoud just build if a newer one is needed.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4805
  • Karma: +99/-1
    • View Profile
Re: Qt6
« Reply #281 on: December 27, 2022, 06:30:41 pm »
Can you not use the system VPX? Or else get the source from Bitwise's port, doing it yourself would be time consuming.

Lars

  • Hero Member
  • *****
  • Posts: 1272
  • Karma: +65/-0
    • View Profile
Re: Qt6
« Reply #282 on: December 27, 2022, 07:47:16 pm »
Yes, it looks like your using 16bit code. Somethnig like defining the segments for 32 bit,
Code: [Select]
.TEXT32 align=16 public use32 class=CODE
.DATA32 align=16 public use32 class=DATA

No, the assembler code is written as 64-bit code. But the define will override register names to its 32-bit counterparts (the general register set). I am not sure about the section/segment defaults though. For OS/2, it is recommended to use the FLAT keyword in the section/segment declaration.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4805
  • Karma: +99/-1
    • View Profile
Re: Qt6
« Reply #283 on: December 27, 2022, 08:47:37 pm »
Last I looked, libvpx supported 32 bit. For the assembler, basically adding an obj (obj32) section to x86inc.asm. Lots of the versions floating around have aout support already for us and some obj support. It is a shame the x264 people refused to support OS/2.
Anyways for the Qt5 webengine, we just use the native libvpx, same with Firefox now.
BTW, IIRC, flat is no longer needed and it might have been the cause for using a different segment, not that it matters much with flat addressing.

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2095
  • Karma: +160/-0
    • View Profile
Re: Qt6
« Reply #284 on: December 27, 2022, 09:04:39 pm »
Thanks Lars and Dave, I was starting to think I was talking to myself in here :)

I was too brain dead last night to do much investigation - so it was good to wake this morning to some tips ;)

1) System vpx - I don't think this is an option, as our vpx is too old:
    pkg_check_modules(VPX vpx>=1.10.0 IMPORTED_TARGET)
- our vpx is 1.8.x
2) nasm is already using the -fobj switch
3) setting ABI_IS_32BIT looks to be the solution - the code hadn't been adapted from the switch from yasm to nasm - so there is code for:
Code: [Select]
%macro SECTION_RODATA 0-1 16
    %ifidn __OUTPUT_FORMAT__,win32
        SECTION .rdata align=%1
    %elif WIN64
        SECTION .rdata align=%1
    %elifidn __OUTPUT_FORMAT__,macho32
        SECTION .text align=%1
        fakegot:
    %elifidn __OUTPUT_FORMAT__,aout
        SECTION .text
    %else
        SECTION .rodata align=%1
    %endif
%endmacro

; PIC macros from vpx_ports/x86_abi_support.asm.
%ifidn __OUTPUT_FORMAT__,elf32
%define ABI_IS_32BIT 1
%elifidn __OUTPUT_FORMAT__,macho32
%define ABI_IS_32BIT 1
%elifidn __OUTPUT_FORMAT__,win32
%define ABI_IS_32BIT 1
%elifidn __OUTPUT_FORMAT__,aout
%define ABI_IS_32BIT 1
%else
%define ABI_IS_32BIT 0
%endif

That will need tweaking for obj :)

Will try fix this today.

Cheers,

Paul

Edit: the attached makes the code build (not sure it's 100% correct though)
« Last Edit: December 27, 2022, 09:19:16 pm by Paul Smedley »