Skip to content

generate 64-bit DLLs (and update gcc for it to work)#2

Open
dgruss wants to merge 1 commit intoUltraStar-Deluxe:ultrastardxfrom
dgruss:ultrastardx
Open

generate 64-bit DLLs (and update gcc for it to work)#2
dgruss wants to merge 1 commit intoUltraStar-Deluxe:ultrastardxfrom
dgruss:ultrastardx

Conversation

@dgruss
Copy link
Copy Markdown

@dgruss dgruss commented Jan 26, 2026

With this change we hopefully switch to x64_64 and do not need the old 32-bit dlls anymore. Therefore:

  • replaced 32bit constants with 64bit equivalents everywhere
  • on my system exporting PATH again was necessary, can remove if it is wrong for other systems
  • ramped up from -j2 to -j8 for faster builds
  • remaining changes and gcc update to 13.3 for things to even just compile

Copy link
Copy Markdown
Collaborator

@s09bQ5 s09bQ5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 32 bit build contains some patches to force the DLLs to specific non-overlapping virtual address regions (linker parameter --image-base and --disable-dynamicbase) to ease debugging. Did you check if the chosen addresses still work?

@dgruss
Copy link
Copy Markdown
Author

dgruss commented Feb 8, 2026

The 32 bit build contains some patches to force the DLLs to specific non-overlapping virtual address regions (linker parameter --image-base and --disable-dynamicbase) to ease debugging. Did you check if the chosen addresses still work?

i have only seen that in some ffmpeg patch, not anywhere else?
also: 64-bit virtual addresses (48-bit actually) look quite different than 32-bit virtual addresses and we shouldn't place things at the same location. lastly, by doing that we circumvent the ASLR security feature that is enabled by default on all modern OSes. maybe we shouldn't do that anyways.

@dgruss
Copy link
Copy Markdown
Author

dgruss commented Feb 26, 2026

changed it and the local compile worked fine

@dgruss
Copy link
Copy Markdown
Author

dgruss commented Mar 27, 2026

@s09bQ5 i basically only need to adjust the urls and then it could be merged, right? that would allow to proceed in the USDX repo then

@dgruss
Copy link
Copy Markdown
Author

dgruss commented Mar 27, 2026

it is a bit of a chicken-egg problem.

this PR needs the 64-bit PR's code, but the USDX 64-bit PR needs the build artifacts / release zip from this PR.

So, we could/should maybe:

  1. merge this PR with the URL pointing to the 64-bit branch as is, then it will build working artifacts
  2. merge the 64-bit PR in the USDX repo with this repo's mxe release url
  3. update this repo again with the USDX master branch URL, building new working artifacts
  4. rebuild the USDX repo with the new dlls

@s09bQ5
Copy link
Copy Markdown
Collaborator

s09bQ5 commented Mar 27, 2026

To solve that chicken-egg-problem, I suggest you make a separate PR in USDX for your changes to the projectM wrapper and the OpenCV wrapper def file.
Once that has been merged, you can use that commit to fetch the wrapper sources here.

@dgruss
Copy link
Copy Markdown
Author

dgruss commented Mar 27, 2026

Not sure I need the opencvwrapper.def file in there - mxe does not pull that from the USDX repo

@s09bQ5
Copy link
Copy Markdown
Collaborator

s09bQ5 commented Mar 27, 2026

Actually, you are right. The def file is needed only to generate a static library that contains the import section for code that wants to use the dll. But Free Pascal creates the import section from the function declaration.

@dgruss
Copy link
Copy Markdown
Author

dgruss commented Mar 28, 2026

tested it, the mxe part works, the game runs without issues. as soon as this is merged i will adjust the x64 PR in the other repo

@dgruss
Copy link
Copy Markdown
Author

dgruss commented Mar 28, 2026

all discussed changes implemented, tested it again, works still fine

@dgruss
Copy link
Copy Markdown
Author

dgruss commented Mar 28, 2026

tested the CI built dlls locally and they work (all but libopencv_core460.dll are byte-identical to my local build, and that one just has a few bytes of difference)

@dgruss
Copy link
Copy Markdown
Author

dgruss commented Mar 28, 2026

should i make a force push to make it 1 commit? or do you want to squash it?

x86_64 wrapper DLL build for USDX dependencies


Extend the MXE-based Windows dependency build to produce the x86_64 DLL
set needed by 64-bit USDX, including the OpenCV and projectM wrapper
DLLs.

Update build.sh to target x86_64, fetch the USDX wrapper sources from
the USDX repository, build the new wrapper packages, and collect the
resulting DLL bundle in the format expected by USDX.

Refresh the surrounding toolchain and package setup:
- update GCC to 13.4.0 and adjust the MinGW header layout patching
- force DWARF-friendly settings for the x86_64 build where needed
- trim OpenCV to the smaller feature set required by the wrapper and add
  an MXE package for the USDX OpenCV wrapper
- add MXE packaging and MinGW compatibility fixes for projectM,
  including autoreconf-based build fixes used on other platforms
  and the USDX projectM C wrapper

This prepares the MXE repo for the upcoming USDX Windows x86_64
builds.

or so?

@s09bQ5
Copy link
Copy Markdown
Collaborator

s09bQ5 commented Mar 28, 2026

Make a force push so that we get that nice commit message

Extend the MXE-based Windows dependency build to produce the x86_64 DLL
set needed by 64-bit USDX, including the OpenCV and projectM wrapper
DLLs.

Update build.sh to target x86_64, fetch the USDX wrapper sources from
the USDX repository, build the new wrapper packages, and collect the
resulting DLL bundle in the format expected by USDX.

Refresh the surrounding toolchain and package setup:
- update GCC to 13.4.0 and adjust the MinGW header layout patching
- force DWARF-friendly settings for the x86_64 build where needed
- trim OpenCV to the smaller feature set required by the wrapper and add
  an MXE package for the USDX OpenCV wrapper
- add MXE packaging and MinGW compatibility fixes for projectM,
  including autoreconf-based build fixes used on other platforms
  and the USDX projectM C wrapper

This prepares the MXE repo for the upcoming USDX Windows x86_64
builds.
@dgruss
Copy link
Copy Markdown
Author

dgruss commented Mar 28, 2026

done

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

Successfully merging this pull request may close these issues.

2 participants