bug-make
[Top][All Lists]
Advanced

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

[bug #61399] multiple definition of `_isatty'; src/w32/compat/posixfcn.o


From: Liviu Ionescu
Subject: [bug #61399] multiple definition of `_isatty'; src/w32/compat/posixfcn.o:posixfcn.c
Date: Sat, 30 Oct 2021 05:41:03 -0400 (EDT)
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.0 Safari/605.1.15

Follow-up Comment #3, bug #61399 (project make):

You are right, I am not using the build_w32.bat script because I am running
the build on Linux.

I checked the sources of the latest mingw-w64, and there is no implementation
of isatty(), there are only lots of references in the .def files, so you were
right again.

Since you mentioned that the provided implementation of isatty() is needed, I
removed my patch; after re-examining the the error message, I could not
identify multiple conflicting implementations of isatty(), so I concluded that
the same definition is presented to the linker via multiple paths; I added
-Wl,--allow-multiple-definition and the linker no longer complained.

As for the build, I used GCC 11.2 with mingw-w64 9.0.0 / UCRT; in a common
Linux cross-build scenario:

git clone https://git.savannah.gnu.org/git/make.git
cd make
git checkout -qf f8f9d371ff58a7195ca4abc9413f435c2bf2b998
bootstrap
bash configure --prefix=.../win32-x64/install/windows-build-tools
--build=x86_64-pc-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 -j
make install-strip


The output of the verbose link command is:

x86_64-w64-mingw32-gcc  -C -Wall -Wextra -Werror -Wwrite-strings -Wshadow
-Wdeclaration-after-statement -Wbad-function-cast -Wformat-security
-Wtype-limits -Wunused-but-set-parameter -Wlogical-op -Wpointer-arith
-Wignored-qualifiers -Wformat-signedness -Wduplicated-cond -ffunction-sections
-fdata-sections -pipe -m64 -O2 -w -mthreads -std=gnu99  -O2 -v
-Wl,--gc-sections -mthreads -std=gnu99 -Wl,--allow-multiple-definition -o
make.exe src/ar.o src/arscan.o src/commands.o src/default.o src/dir.o
src/expand.o src/file.o src/function.o src/getopt.o src/getopt1.o src/guile.o
src/hash.o src/implicit.o src/job.o src/load.o src/loadapi.o src/main.o
src/misc.o src/output.o src/read.o src/remake.o src/rule.o src/signame.o
src/strcache.o src/variable.o src/version.o src/vpath.o src/w32/pathstuff.o
src/w32/w32os.o src/w32/compat/dirent.o src/w32/compat/posixfcn.o
src/w32/subproc/misc.o src/w32/subproc/sub_proc.o src/w32/subproc/w32err.o  
src/remote-stub.o   lib/libgnu.a   
Using built-in specs.
COLLECT_GCC=x86_64-w64-mingw32-gcc
COLLECT_LTO_WRAPPER=/opt/xbb/usr/libexec/gcc/x86_64-w64-mingw32/11.2.0/lto-wrapper
Target: x86_64-w64-mingw32
Configured with:
/root/Work/xbb-3.3-ubuntu-12.04-x86_64/sources/gcc-11.2.0/configure
--prefix=/opt/xbb/usr --build=x86_64-linux-gnu --target=x86_64-w64-mingw32
--with-sysroot=/opt/xbb --with-pkgversion='xPack Build Box x86_64 Mingw-w64
GCC' --enable-languages=c,c++,fortran,objc,obj-c++ --enable-shared
--enable-static --enable-threads=posix --enable-fully-dynamic-string
--enable-libstdcxx-time=yes --enable-cloog-backend=isl --enable-lto
--enable-libgomp --enable-checking=release --disable-dw2-exceptions
--disable-multilib --disable-rpath ac_cv_header_sys_mman_h=no
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 11.2.0 (xPack Build Box x86_64 Mingw-w64 GCC) 
COMPILER_PATH=/opt/xbb/usr/libexec/gcc/x86_64-w64-mingw32/11.2.0/:/opt/xbb/usr/libexec/gcc/x86_64-w64-mingw32/11.2.0/:/opt/xbb/usr/libexec/gcc/x86_64-w64-mingw32/:/opt/xbb/usr/lib/gcc/x86_64-w64-mingw32/11.2.0/:/opt/xbb/usr/lib/gcc/x86_64-w64-mingw32/:/opt/xbb/usr/lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/
LIBRARY_PATH=/opt/xbb/usr/lib/gcc/x86_64-w64-mingw32/11.2.0/:/opt/xbb/usr/lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/lib/../lib/:/opt/xbb/mingw/lib/../lib/:/opt/xbb/usr/lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/lib/:/opt/xbb/mingw/lib/
COLLECT_GCC_OPTIONS='-C' '-Wall' '-Wextra' '-Werror' '-Wwrite-strings'
'-Wshadow' '-Wdeclaration-after-statement' '-Wbad-function-cast'
'-Wformat-security' '-Wtype-limits' '-Wunused-but-set-parameter'
'-Wlogical-op' '-Wpointer-arith' '-Wignored-qualifiers' '-Wformat-signedness'
'-Wduplicated-cond' '-ffunction-sections' '-fdata-sections' '-pipe' '-m64'
'-O2' '-w' '-mthreads' '-std=gnu99' '-O2' '-v' '-mthreads' '-std=gnu99' '-o'
'make.exe' '-mtune=generic' '-march=x86-64' '-dumpdir' 'make.'
 /opt/xbb/usr/libexec/gcc/x86_64-w64-mingw32/11.2.0/collect2 -plugin
/opt/xbb/usr/libexec/gcc/x86_64-w64-mingw32/11.2.0/liblto_plugin.so
-plugin-opt=/opt/xbb/usr/libexec/gcc/x86_64-w64-mingw32/11.2.0/lto-wrapper
-plugin-opt=-fresolution=/tmp/ccqRBk8N.res
-plugin-opt=-pass-through=-lmingwthrd -plugin-opt=-pass-through=-lmingw32
-plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_eh
-plugin-opt=-pass-through=-lmoldname -plugin-opt=-pass-through=-lmingwex
-plugin-opt=-pass-through=-lmsvcrt -plugin-opt=-pass-through=-lkernel32
-plugin-opt=-pass-through=-lpthread -plugin-opt=-pass-through=-ladvapi32
-plugin-opt=-pass-through=-lshell32 -plugin-opt=-pass-through=-luser32
-plugin-opt=-pass-through=-lkernel32 -plugin-opt=-pass-through=-lmingwthrd
-plugin-opt=-pass-through=-lmingw32 -plugin-opt=-pass-through=-lgcc
-plugin-opt=-pass-through=-lgcc_eh -plugin-opt=-pass-through=-lmoldname
-plugin-opt=-pass-through=-lmingwex -plugin-opt=-pass-through=-lmsvcrt
-plugin-opt=-pass-through=-lkernel32 --sysroot=/opt/xbb -m i386pep -Bdynamic
-o make.exe
/opt/xbb/usr/lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/lib/../lib/crt2.o
/opt/xbb/usr/lib/gcc/x86_64-w64-mingw32/11.2.0/crtbegin.o
-L/opt/xbb/usr/lib/gcc/x86_64-w64-mingw32/11.2.0
-L/opt/xbb/usr/lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/lib/../lib
-L/opt/xbb/mingw/lib/../lib
-L/opt/xbb/usr/lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/lib
-L/opt/xbb/mingw/lib --gc-sections --allow-multiple-definition src/ar.o
src/arscan.o src/commands.o src/default.o src/dir.o src/expand.o src/file.o
src/function.o src/getopt.o src/getopt1.o src/guile.o src/hash.o
src/implicit.o src/job.o src/load.o src/loadapi.o src/main.o src/misc.o
src/output.o src/read.o src/remake.o src/rule.o src/signame.o src/strcache.o
src/variable.o src/version.o src/vpath.o src/w32/pathstuff.o src/w32/w32os.o
src/w32/compat/dirent.o src/w32/compat/posixfcn.o src/w32/subproc/misc.o
src/w32/subproc/sub_proc.o src/w32/subproc/w32err.o src/remote-stub.o
lib/libgnu.a -lmingwthrd -lmingw32 -lgcc -lgcc_eh -lmoldname -lmingwex
-lmsvcrt -lkernel32 -lpthread -ladvapi32 -lshell32 -luser32 -lkernel32
-lmingwthrd -lmingw32 -lgcc -lgcc_eh -lmoldname -lmingwex -lmsvcrt -lkernel32
/opt/xbb/usr/lib/gcc/x86_64-w64-mingw32/11.2.0/crtend.o
COLLECT_GCC_OPTIONS='-C' '-Wall' '-Wextra' '-Werror' '-Wwrite-strings'
'-Wshadow' '-Wdeclaration-after-statement' '-Wbad-function-cast'
'-Wformat-security' '-Wtype-limits' '-Wunused-but-set-parameter'
'-Wlogical-op' '-Wpointer-arith' '-Wignored-qualifiers' '-Wformat-signedness'
'-Wduplicated-cond' '-ffunction-sections' '-fdata-sections' '-pipe' '-m64'
'-O2' '-w' '-mthreads' '-std=gnu99' '-O2' '-v' '-mthreads' '-std=gnu99' '-o'
'make.exe' '-mtune=generic' '-march=x86-64' '-dumpdir' 'make.'

---

If understand that this procedure is not yet officially supported, but it
seems ok.

Of course, if you spot any problems with it, I would appreciate any advice on
how to improve it.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?61399>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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