bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unable to cross build for Windows


From: Torbjorn SVENSSON
Subject: Re: Unable to cross build for Windows
Date: Thu, 8 Jun 2023 20:39:43 +0200
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1



On 2023-06-08 17:05, Eli Zaretskii wrote:
Date: Thu, 8 Jun 2023 16:19:04 +0200
CC: <bug-make@gnu.org>
From: Torbjorn SVENSSON <torbjorn.svensson@foss.st.com>

On 2023-06-08 16:14, Eli Zaretskii wrote:
Date: Thu, 8 Jun 2023 14:44:35 +0200
From: Torbjorn SVENSSON <torbjorn.svensson@foss.st.com>

/build/gnu-make_4.4.1-45-g07fcee35/src/function.c: In function 
'windows32_openpipe':
/build/gnu-make_4.4.1-45-g07fcee35/src/function.c:1676:12: error: cast from 
function call of type 'intptr_t {aka long long int}' to non-matching type 'void 
*' [-Werror=bad-function-cast]
      tmpErr = (HANDLE)_get_osfhandle (errfd);
               ^


/build/gnu-make_4.4.1-45-g07fcee35/src/job.c: In function 'create_batch_file':
/build/gnu-make_4.4.1-45-g07fcee35/src/job.c:365:3: error: format not a string 
literal and no format arguments [-Werror=format-security]
      O (fatal, NILF, error_string);
      ^


On the MSDN page for _get_osfhandle, they recommend to case the return value
to HANDLE, but GCC apparently thinks this is not allowed.
Any idea on how to get around this issue?


For the O()-macro; is it correct to use the macro with a variable?
Maybe it's more appropriate to fall fatal directly with the arguments?

Is this with x86_64 being the target or i686?  I'm guessing the
latter, since for 64-bit Windows 'long long' and 'void *' are of the
same width.  If it's indeed for i686, are you sure the MinGW64 headers
you have support 32-bit builds?  Because AFAIR MinGW64 tossed
supported for old Windows versions, which basically means they don't
support 32-bit Windows.

The idea is to have a 64-bit make application. I just included the i686
log for completeness.

If you get the error about casting _get_osfhandle to HANDLE only for
the 32-bit build, and you don't care about that build, then just
ignore it.  But if that error is emitted for the 64-bit build, then
there's something strange here, since on 64-bit Windows 'long long'
should be compatible with 'void *'.

The error is emitted in both builds, but let's ignore 32-bit for now.
Both the errors that I pasted above are emitted using
x86_64-w64-mingw32 and need to have some kind of fix to have a successful
build.

Any idea what could be done except disabling the warning for the cast.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]