Menu

#1294 Need to patch m_target_type in build.cpp for amd64

3.0 Series
open
nobody
None
5
2023-03-31
2023-03-24
No

We set TARGET_ARCH to amd64, but it is not enough, as we get a build error.

We need to change Source/build.cpp with this command:

sed -i 's/m_target_type=TARGET_X86UNICODE/m_target_type=TARGET_AMD64/' Source/build.cpp

We cross compile with mingw-w64/GCC on Linux.

Discussion

  • Jason

    Jason - 2023-03-25

    At the moment we don't support setting 64 bit stubs from linux as a default, I have looked at fixing this in the past but I haven't found a nice way of doing it yet.

    The easiest way to fix this is to compile the source code twice: first in 32bit mode, then in 64 bit mode to the same directory. Then in the script you can use an undocumented command to change the target: "Target amd64-unicode".

    As an alternative, if you don't want to compile a 32 bit version first, just create a dummy x86 unicode stub manually instead so that makensis doesn't throw an error, then use "Target amd64-unicode" in the script or on the command line to change it.

     
  • Anders

    Anders - 2023-03-31

    There was a specific reason why 64-bit POSIX makensis does not default to 64-bit installer generation but I don't remember why anymore.

    As Jason says, makensis can generate 32 and 64-bit installers if you know how to ask it.

     

Log in to post a comment.