wget-windows icon indicating copy to clipboard operation
wget-windows copied to clipboard

gmp: Cannot determine executable suffix

Open rockdaboot opened this issue 3 years ago • 4 comments

Do you have any idea why the gmp build fails on Debian unstable (config.log is attached) ?

gmp-6.2.1.tar.xz.3              100%[=====================================================>]   1.93M  2.64MB/s    in 0.7s    

2022-01-30 19:20:32 (2.64 MB/s) - 'gmp-6.2.1.tar.xz.3' saved [2027316/2027316]

checking build system type... zen2-pc-linux-gnu
checking host system type... x86_64-w64-mingw32
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for x86_64-w64-mingw32-strip... x86_64-w64-mingw32-strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking ABI=64
checking compiler x86_64-w64-mingw32-gcc -g -ggdb3 -Og -Wall -Wextra ... yes
checking compiler x86_64-w64-mingw32-gcc -g -ggdb3 -Og -Wall -Wextra  has long long... yes
checking for x86_64-w64-mingw32-gcc... x86_64-w64-mingw32-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether x86_64-w64-mingw32-gcc accepts -g... yes
checking for x86_64-w64-mingw32-gcc option to accept ISO C89... none needed
checking whether x86_64-w64-mingw32-gcc understands -c and -o together... yes
checking for x86_64-w64-mingw32-gcc option to accept ISO C99... none needed
checking how to run the C preprocessor... x86_64-w64-mingw32-gcc -E
checking build system compiler x86_64-w64-mingw32-gcc... yes
checking for build system preprocessor... x86_64-w64-mingw32-gcc -E
checking for build system executable suffix... configure: error: Cannot determine executable suffix
[gmp] configure failed

$ x86_64-w64-mingw32-gcc --version
x86_64-w64-mingw32-gcc (GCC) 10-win32 20210110

config.log

rockdaboot avatar Jan 30 '22 18:01 rockdaboot

Hello @rockdaboot

Thanks for the bug report.

Our host environment uses Ubuntu to build wget. I installed clean Debian to my PC which is hosted on VM.

I installed necessary tool chain.

bootstrap.sh

sudo apt-get install -y git
sudo apt-get install -y gcc
sudo apt-get install -y mingw-w64 mingw-w64-tools
sudo apt-get install -y make m4 pkg-config automake gettext

Build Environment

root@debian:~# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 11 (bullseye)
Release:        11
Codename:       bullseye
root@debian:~# cat /etc/debian_version                           
11.2
root@debian# x86_64-w64-mingw32-gcc --version
x86_64-w64-mingw32-gcc (GCC) 10-win32 20210110
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Then I cloned the wget-windows and executed ./build.sh Everything worked well and I successfully build the wget.exe

Then I digged more and searched the Net find more information reproduce the problem.

I found a Japanese blog with same build error while building gmp on Microsoft Windows 10 WSL [1]. Author suggests to set CC_FOR_BUILD to host compiler to cc build cross compile gmp (x64/Windows).

After more research a found another cross compile gmp build script and this author also suggest to use CC_FOR_BUILD to fix similar bug [2][3].

After this research, I build the wget with CC_FOR_BUILD=gcc and both OpenSSL and GNUTLS worked perfectly.

Then I cloned the wget-windows and try to build wget with a dummy/invalid CC_FOR_BUILD=foobar env. variable. Build terminated with an exact same error message: "Cannot determine executable suffix"

I hope that setting CC_FOR_BUILD env. variable will be fix your problem. Let me know if you still can't build gmp.

References:

[1] https://signal--flag--z-blogspot-com.translate.goog/2019/07/ffmpeg-windows-build-helpersgmperror.html?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp

[2] https://github.com/rdp/ffmpeg-windows-build-helpers/blob/master/cross_compile_ffmpeg.sh#L1099

[3] https://github.com/rdp/ffmpeg-windows-build-helpers/issues/414

[4] CC_FOR_BUILD usage from GMP doc: https://gmplib.org/manual/Build-Options

[5] Similar problem reported to GMP mailing list: https://www.mail-archive.com/[email protected]&q=subject:%22Re%5C%3A+%5C%5BSOLVED%5C%5D+Re%5C%3A+setting+CPU_TYPE+when+cross%5C-compiling+from+Linux+to+Windows%22&o=newest&f=1

webfolderio avatar Jan 31 '22 12:01 webfolderio

Thanks for all your hints !

CC_FOR_BUILD=gcc doesn't solve my build issue. It looks like gmp's configure script and my bash version doesn't like each other =D.

checking build system compiler gcc... no
configure: error: Specified CC_FOR_BUILD doesn't seem to work

In configure there basically just is $CC_FOR_BUILD conftest.c and the c file just contains a main() with a return 0. $CC_FOR_BUILD is definitely set to gcc. On the command line this works as expected. In config.log there is

configure:9924: checking build system compiler gcc
configure:9938: gcc conftest.c
/tmp/cc7c7i9R.s: Assembler messages:
/tmp/cc7c7i9R.s:4: Warning: .type pseudo-op used outside of .def/.endef: ignored.
/tmp/cc7c7i9R.s:4: Error: junk at end of line, first unrecognized character is `m'
/tmp/cc7c7i9R.s:19: Warning: .size pseudo-op used outside of .def/.endef: ignored.
/tmp/cc7c7i9R.s:19: Error: junk at end of line, first unrecognized character is `m'
/tmp/cc7c7i9R.s:21: Error: junk at end of line, first unrecognized character is `-'
configure:9941: $? = 1
configure:9948: result: no
configure:9953: error: Specified CC_FOR_BUILD doesn't seem to work

I interpret it as "some env variable influences gcc to behave unexpected". But I have no clue which one this could be.

After the above, some varibales are printed, but I can't see anything unusual (maybe you do ?):

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_build=x86_64-pc-linux-gnu
ac_cv_c_compiler_gnu=yes
ac_cv_env_ABI_set=
ac_cv_env_ABI_value=
ac_cv_env_CCC_set=
ac_cv_env_CCC_value=
ac_cv_env_CC_FOR_BUILD_set=set
ac_cv_env_CC_FOR_BUILD_value=gcc
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=set
ac_cv_env_CPPFLAGS_value=-I/home/tim/src/wget2/x86_64-w64-mingw32/include
ac_cv_env_CPP_FOR_BUILD_set=
ac_cv_env_CPP_FOR_BUILD_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_CXXCPP_set=
ac_cv_env_CXXCPP_value=
ac_cv_env_CXXFLAGS_set=
ac_cv_env_CXXFLAGS_value=
ac_cv_env_CXX_set=
ac_cv_env_CXX_value=
ac_cv_env_LDFLAGS_set=set
ac_cv_env_LDFLAGS_value=-L/home/tim/src/wget2/x86_64-w64-mingw32/lib
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_LT_SYS_LIBRARY_PATH_set=
ac_cv_env_LT_SYS_LIBRARY_PATH_value=
ac_cv_env_M4_set=
ac_cv_env_M4_value=
ac_cv_env_YACC_set=
ac_cv_env_YACC_value=
ac_cv_env_YFLAGS_set=
ac_cv_env_YFLAGS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=set
ac_cv_env_host_alias_value=x86_64-w64-mingw32
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_exeext=.exe
ac_cv_host=x86_64-w64-mingw32
ac_cv_objext=o
ac_cv_path_install='/usr/bin/install -c'
ac_cv_path_mkdir=/bin/mkdir
ac_cv_prog_AWK=gawk
ac_cv_prog_CC=x86_64-w64-mingw32-gcc
ac_cv_prog_CPP='x86_64-w64-mingw32-gcc -E'
ac_cv_prog_STRIP=x86_64-w64-mingw32-strip
ac_cv_prog_cc_c89=
ac_cv_prog_cc_c99=
ac_cv_prog_cc_g=yes
ac_cv_prog_make_make_set=yes
am_cv_make_support_nested_variables=yes
am_cv_prog_cc_c_o=yes

## ----------------- ##
## Output variables. ##
## ----------------- ##

ABI='64'
ACLOCAL='${SHELL} /home/tim/src/wget2/gmp-6.2.1/missing aclocal-1.15'
AMTAR='$${TAR-tar}'
AM_BACKSLASH='\'
AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
AM_DEFAULT_VERBOSITY='1'
AM_V='$(V)'
AR=''
AS=''
ASMFLAGS=''
AUTOCONF='${SHELL} /home/tim/src/wget2/gmp-6.2.1/missing autoconf'
AUTOHEADER='${SHELL} /home/tim/src/wget2/gmp-6.2.1/missing autoheader'
AUTOMAKE='${SHELL} /home/tim/src/wget2/gmp-6.2.1/missing automake-1.15'
AWK='gawk'
CALLING_CONVENTIONS_OBJS=''
CC='x86_64-w64-mingw32-gcc'
CCAS=''
CC_FOR_BUILD='gcc'
CFLAGS='-O2 -pedantic -fomit-frame-pointer -m64 -mtune=k8 -march=k8'
CPP='x86_64-w64-mingw32-gcc -E'
CPPFLAGS='-I/home/tim/src/wget2/x86_64-w64-mingw32/include'
CPP_FOR_BUILD=''
CXX=''
CXXCPP=''
CXXFLAGS=''
CYGPATH_W='echo'
DEFN_LONG_LONG_LIMB='#define _LONG_LONG_LIMB 1'
DEFS=''
DLLTOOL=''
DSYMUTIL=''
DUMPBIN=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
ENABLE_STATIC_FALSE=''
ENABLE_STATIC_TRUE=''
EXEEXT='.exe'
EXEEXT_FOR_BUILD=''
FGREP=''
GMP_LDFLAGS=''
GMP_LIMB_BITS=''
GMP_NAIL_BITS='0'
GREP=''
HAVE_CLOCK_01=''
HAVE_CPUTIME_01=''
HAVE_GETRUSAGE_01=''
HAVE_GETTIMEOFDAY_01=''
HAVE_HOST_CPU_FAMILY_power='0'
HAVE_HOST_CPU_FAMILY_powerpc='0'
HAVE_SIGACTION_01=''
HAVE_SIGALTSTACK_01=''
HAVE_SIGSTACK_01=''
HAVE_STACK_T_01=''
HAVE_SYS_RESOURCE_H_01=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
INSTALL_STRIP_PROGRAM='$(install_sh) -c -s'
LD=''
LDFLAGS='-L/home/tim/src/wget2/x86_64-w64-mingw32/lib'
LEX=''
LEXLIB=''
LEX_OUTPUT_ROOT=''
LIBCURSES=''
LIBGMPXX_LDFLAGS=''
LIBGMP_DLL=''
LIBGMP_LDFLAGS=''
LIBM=''
LIBM_FOR_BUILD=''
LIBOBJS=''
LIBREADLINE=''
LIBS=''
LIBTOOL=''
LIPO=''
LN_S=''
LTLIBOBJS=''
LT_SYS_LIBRARY_PATH=''
M4=''
MAINT='#'
MAINTAINER_MODE_FALSE=''
MAINTAINER_MODE_TRUE='#'
MAKEINFO='${SHELL} /home/tim/src/wget2/gmp-6.2.1/missing makeinfo'
MANIFEST_TOOL=''
MKDIR_P='/bin/mkdir -p'
NM=''
NMEDIT=''
OBJDUMP=''
OBJEXT='o'
OTOOL64=''
OTOOL=''
PACKAGE='gmp'
PACKAGE_BUGREPORT='[email protected], see https://gmplib.org/manual/Reporting-Bugs.html'
PACKAGE_NAME='GNU MP'
PACKAGE_STRING='GNU MP 6.2.1'
PACKAGE_TARNAME='gmp'
PACKAGE_URL='http://www.gnu.org/software/gmp/'
PACKAGE_VERSION='6.2.1'
PATH_SEPARATOR=':'
RANLIB=''
SED=''
SET_MAKE=''
SHELL='/bin/bash'
SPEED_CYCLECOUNTER_OBJ='x86_64.lo'
STRIP='x86_64-w64-mingw32-strip'
TAL_OBJECT=''
TUNE_LIBS=''
TUNE_SQR_OBJ=''
U_FOR_BUILD=''
VERSION='6.2.1'
WANT_CXX_FALSE=''
WANT_CXX_TRUE=''
WITH_READLINE_01=''
YACC=''
YFLAGS=''
ac_ct_AR=''
ac_ct_CC=''
ac_ct_CXX=''
ac_ct_DUMPBIN=''
am__EXEEXT_FALSE=''
am__EXEEXT_TRUE=''
am__isrc=''
am__leading_dot='.'
am__tar='$${TAR-tar} chof - "$$tardir"'
am__untar='$${TAR-tar} xf -'
bindir='${exec_prefix}/bin'
build='x86_64-pc-linux-gnu'
build_alias=''
build_cpu='x86_64'
build_os='linux-gnu'
build_vendor='pc'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='NONE'
gmp_srclinks=''
host='x86_64-w64-mingw32'
host_alias='x86_64-w64-mingw32'
host_cpu='x86_64'
host_os='mingw32'
host_vendor='w64'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
install_sh='${SHELL} /home/tim/src/wget2/gmp-6.2.1/install-sh'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
mkdir_p='$(MKDIR_P)'
mpn_objects=''
mpn_objs_in_libgmp=''
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='/home/tim/src/wget2/x86_64-w64-mingw32'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''

## ----------- ##
## confdefs.h. ##
## ----------- ##

/* confdefs.h */
#define PACKAGE_NAME "GNU MP"
#define PACKAGE_TARNAME "gmp"
#define PACKAGE_VERSION "6.2.1"
#define PACKAGE_STRING "GNU MP 6.2.1"
#define PACKAGE_BUGREPORT "[email protected], see https://gmplib.org/manual/Reporting-Bugs.html"
#define PACKAGE_URL "http://www.gnu.org/software/gmp/"
#define PACKAGE "gmp"
#define VERSION "6.2.1"
#define WANT_FFT 1
#define HAVE_HOST_CPU_x86_64 1
#define HOST_DOS64 1
#define HAVE_SPEED_CYCLECOUNTER 2

rockdaboot avatar Mar 13 '22 19:03 rockdaboot

Hm, I wonder where these CFLAGS come from

CFLAGS='-O2 -pedantic -fomit-frame-pointer -m64 -mtune=k8 -march=k8'

rockdaboot avatar Mar 13 '22 19:03 rockdaboot

Do you have any idea why the gmp build fails on Debian unstable (config.log is attached) ?

gmp-6.2.1.tar.xz.3              100%[=====================================================>]   1.93M  2.64MB/s    in 0.7s    

2022-01-30 19:20:32 (2.64 MB/s) - 'gmp-6.2.1.tar.xz.3' saved [2027316/2027316]

checking build system type... zen2-pc-linux-gnu
checking host system type... x86_64-w64-mingw32
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for x86_64-w64-mingw32-strip... x86_64-w64-mingw32-strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking ABI=64
checking compiler x86_64-w64-mingw32-gcc -g -ggdb3 -Og -Wall -Wextra ... yes
checking compiler x86_64-w64-mingw32-gcc -g -ggdb3 -Og -Wall -Wextra  has long long... yes
checking for x86_64-w64-mingw32-gcc... x86_64-w64-mingw32-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether x86_64-w64-mingw32-gcc accepts -g... yes
checking for x86_64-w64-mingw32-gcc option to accept ISO C89... none needed
checking whether x86_64-w64-mingw32-gcc understands -c and -o together... yes
checking for x86_64-w64-mingw32-gcc option to accept ISO C99... none needed
checking how to run the C preprocessor... x86_64-w64-mingw32-gcc -E
checking build system compiler x86_64-w64-mingw32-gcc... yes
checking for build system preprocessor... x86_64-w64-mingw32-gcc -E
checking for build system executable suffix... configure: error: Cannot determine executable suffix
[gmp] configure failed

$ x86_64-w64-mingw32-gcc --version
x86_64-w64-mingw32-gcc (GCC) 10-win32 20210110

config.log

sudo bash -c "echo 0 > /proc/sys/fs/binfmt_misc/status"

syssitia avatar Dec 26 '22 00:12 syssitia