Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2022-02-16
07:36 • Ticket [d109376adf] Cross-compilation for windows-arm64 status still Closed ... artifact: 64327e450b user: niyassait
2022-02-15
08:59 • Ticket [d109376adf]: 5 changes artifact: 3231cc10de user: niyassait
2022-02-14
21:46 • Ticket [d109376adf]: 6 changes artifact: 37e8c851ed user: jan.nijtmans
15:44
Fix regression caused by [d109376ad]: Move nmakehlp target down, so it doesn't become the default ta... check-in: c1f5640ee0 user: jan.nijtmans tags: core-8-6-branch
2022-02-13
20:52 • Closed ticket [d109376adf]: Cross-compilation for windows-arm64 plus 5 other... artifact: e7b7e29035 user: niyassait
2022-02-11
12:47 • Ticket [d109376adf]: 3 changes artifact: 2afce6d059 user: niyassait
2022-02-10
14:41 • Ticket [d109376adf]: 3 changes artifact: 4c5d0c6eec user: niyassait
13:52 • Ticket [d109376adf]: 3 changes artifact: 3b8f016b33 user: jan.nijtmans
12:55 • New ticket [d109376adf]. artifact: e277033a9b user: niyassait

Cross-compilation for windows-arm64

Closed / Fixedd109376adf418ce6d047fb0017d40848272a518fCreated 5 years agoUpdated 5 years ago
Descriptionplain2022-02-10 12:55:17
Recently windows-arm64 support has been added to tcl and native compilation for win/arm64 works fine.

However, it is still not possible to cross-compile for win/arm64 from a win/x64 machine using nmake.

The main issue seems to be due to `nmakehlp` compiled for the target architecture rather than the host architecture and cannot be executed during the build step.

It is not clear what is the best way to add support for it.
jan.nijtmanswiki2022-02-10 13:52:16

See also this (very old) ticket: [1020445] which describes a workaroud:

> What's wrong with building for Win32 first, then running the 
> clean target?  That should remove Release\Tcl_Dynamic\*.*, 
> but leave nmakehlp.exe

I also have no idea how to add support for it (neither to I have a windows-arm64 system around to test it), but if someone knowns: patches will be gladly accepted.

Thanks for the report!

niyassaitplain2022-02-10 14:41:19
Thanks. One workaround I can think of is to introduce a separate Host compiler option in rules.vc. See https://github.com/tcltk/tcl/pull/11 for details.

And we could compile with the following command for example

nmake -f makefile.vc OPTS=static MACHINE=AMD64 HOST_CC=host_cc.bat all
niyassaitplain2022-02-11 12:47:30
Another approach would be to add a new separate target for nmakehlp and an option to skip building nmakehlp during the normal build.

I've prepared a PR : https://github.com/tcltk/tcl/pull/11

@jan.nijtmans: Could you help with Review please ?
niyassaitplain2022-02-13 20:52:58
This has been fixed and updated the documentation.

If you want to Cross-compile with Visual Studio (e.g. for X86 or ARM64+targets, but running on AMD64), first set up the environment for your host machine and compile nmakehlp.exe:
      C:\tcl_source\win\>nmake -f makefile.vc nmakehlp

Then go to your cross-compile environment and run the nmake command again for whatever you want to build.
jan.nijtmans Ticket [d109376adf]: 6 changes [History diff]2022-02-14 21:46:36
niyassaitplain2022-02-15 08:59:57
I think we could potentially simplify the explicit nmakehlp build step for x86 target as x86 binaries works on all architecture. Here is a patch: https://github.com/tcltk/tcl/pull/12
niyassaitplain2022-02-16 07:36:10
I think we need to apply the latest changes to Tk as well. Especially adding x86_64-w64-mingw32-nmakehlp.exe and changes to rules.vc to skip nmakehlp for cross-compilation.
Log in (anonymous is fine) to add a comment.