bug-make
[Top][All Lists]
Advanced

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

Re: REGRESSION: cross compile 4.3 fail on mingw-w64 7.0/GCC 9.3


From: Liviu Ionescu
Subject: Re: REGRESSION: cross compile 4.3 fail on mingw-w64 7.0/GCC 9.3
Date: Mon, 28 Dec 2020 19:07:14 +0200


> On 28 Dec 2020, at 17:44, Eli Zaretskii <eliz@gnu.org> wrote:
> 
>> Date: Mon, 28 Dec 2020 17:22:57 +0200
>> From: Eli Zaretskii <eliz@gnu.org>
>> Cc: bug-make@gnu.org
>> 
>> In general, I'd say that the Posix configury in Make doesn't include
>> support for cross-building the MinGW port, so it will have to be
>> added, because manually setting gl_cv_* variables is hardly a
>> convenient way of building Make...
> 
> Alternatively, and perhaps more easily, maybe you or someone else
> could convert build_w32.bat into a Unix shell script that invokes the
> MinGW cross-tools.  After all, the batch file is quite simple and
> should be straightforward to convert.  We could then include it in the
> distribution.

Yes, I'd be glad to contribute to the project, but my experience with Windows 
scripts is close to none, and tha build_w32.bat script looks quite difficult to 
digest.

Plus that in my opinion the correct approach would be to use configure, as 
usually on Linux/macOS.

I checked some hacks, but they were not very successful. :-(

First, in my previous message I made a copy/paste mistake, the shown code to 
build make was from another package.


The actual script used with 4.2.1 used configure:

bash 
/Host/Users/ilg/Work/windows-build-tools-4.3.0-1/win32-x64/sources/make-4.3/configure
 \
--prefix=/Host/Users/ilg/Work/windows-build-tools-4.3.0-1/win32-x64/install/windows-build-tools
 \
--build=x86_64-unknown-linux-gnu \
--host=x86_64-w64-mingw32 \
--target=x86_64-w64-mingw32 \
--without-guile \
--without-libintl-prefix \
--without-libiconv-prefix \
ac_cv_dos_paths=yes 

make
make install-strip


With 4.3 this fails, complaining that my automake is too old. I compiled the 
latest "1.16.3", and then I had to `autoreconf -fi`.


I then patched 'm4/fcntl.m4'

gl_cv_func_fcntl_f_dupfd_works=no
gl_cv_func_fcntl_f_dupfd_cloexec=no

and got another error:

/Host/Users/ilg/Work/windows-build-tools-4.3.0-1/win32-x64/sources/make-4.3/configure:
 line 16544: PKG_PROG_PKG_CONFIG: command not found
/Host/Users/ilg/Work/windows-build-tools-4.3.0-1/win32-x64/sources/make-4.3/configure:
 line 16553: syntax error near unexpected token `guile-$v,'
/Host/Users/ilg/Work/windows-build-tools-4.3.0-1/win32-x64/sources/make-4.3/configure:
 line 16553: `    PKG_CHECK_EXISTS(guile-$v, guile_version=$v; have_guile=yes; 
break, )'


I removed the weird guile check from configure, and got:

x86_64-w64-mingw32-gcc -DHAVE_CONFIG_H   -Isrc 
-I/Host/Users/ilg/Work/windows-build-tools-4.3.0-1/win32-x64/sources/make-4.3/src
 -Ilib 
-I/Host/Users/ilg/Work/windows-build-tools-4.3.0-1/win32-x64/sources/make-4.3/lib
 
-DLIBDIR=\"/Host/Users/ilg/Work/windows-build-tools-4.3.0-1/win32-x64/install/windows-build-tools/lib\"
 
-DINCLUDEDIR=\"/Host/Users/ilg/Work/windows-build-tools-4.3.0-1/win32-x64/install/windows-build-tools/include\"
 
-DLOCALEDIR=\"/Host/Users/ilg/Work/windows-build-tools-4.3.0-1/win32-x64/install/windows-build-tools/share/locale\"
 -I 
/Host/Users/ilg/Work/windows-build-tools-4.3.0-1/win32-x64/sources/make-4.3/src/w32/include
   -ffunction-sections -fdata-sections -pipe -m64 -O2 -w -MT src/arscan.o -MD 
-MP -MF $depbase.Tpo -c -o src/arscan.o 
/Host/Users/ilg/Work/windows-build-tools-4.3.0-1/win32-x64/sources/make-4.3/src/arscan.c
 &&\
mv -f $depbase.Tpo $depbase.Po
In file included from 
/Host/Users/ilg/Work/windows-build-tools-4.3.0-1/win32-x64/sources/make-4.3/src/arscan.c:379:
/Host/Users/ilg/Work/windows-build-tools-4.3.0-1/win32-x64/sources/make-4.3/src/output.h:92:5:
 error: conflicting types for ‘fcntl’
   92 | int fcntl (intptr_t fd, int cmd, ...);
      |     ^~~~~
In file included from /opt/xbb/usr/x86_64-w64-mingw32/include/io.h:10,
                 from /opt/xbb/usr/x86_64-w64-mingw32/include/sys/stat.h:14,
                 from 
/Host/Users/ilg/Work/windows-build-tools-4.3.0-1/win32-x64/sources/make-4.3/src/makeint.h:72,
                 from 
/Host/Users/ilg/Work/windows-build-tools-4.3.0-1/win32-x64/sources/make-4.3/src/arscan.c:17:
lib/fcntl.h:595:1: note: previous declaration of ‘fcntl’ was here
  595 | _GL_FUNCDECL_SYS (fcntl, int, (int fd, int action, ...));
      | ^~~~~~~~~~~~~~~~
make[1]: *** [Makefile:1352: src/arscan.o] Error 1
make[1]: Leaving directory 
'/Host/Users/ilg/Work/windows-build-tools-4.3.0-1/win32-x64/build/make-4.3'


This happens because HAVE_FCNTL_H remains defined even if I disabled HAVE_FCNTL:

#define HAVE_FCNTL_H 1


I commented it out in config.h but the problem persists, there seems to be 
places which do not check for HAVE_FCNTL_H.


I'm afraid things got too hectic for a quick workaround, and require a more 
knowledgeable person to fix it.


Regards,

Liviu







reply via email to

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