URL: <https://savannah.gnu.org/bugs/?61399>
Summary: multiple definition of `_isatty'; src/w32/compat/posixfcn.o:posixfcn.c Project: make Submitted by: ilg Submitted on: Fri 29 Oct 2021 04:06:33 PM UTC Severity: 3 - Normal Item Group: Build/Install Status: None Privacy: Public Assigned to: None Open/Closed: Open Discussion Lock: Any Component Version: 4.3 Operating System: MS Windows Fixed Release: None Triage Status: None _______________________________________________________ Details: I tried to compile the top master commit (f8f9d371f) with the latest mingw 9.0 & gcc 11.3 and, while linking make.exe, I got: 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 -O2 -v -Wl,--gc-sections -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 : multiple definition of `_isatty'; src/w32/compat/posixfcn.o:posixfcn.c:(.text$_isatty+0x0): first defined here collect2: error: ld returned 1 exit status make[1]: *** [Makefile:1365: make.exe] Error 1 make[1]: Leaving directory '/Host/Users/ilg/Work/windows-build-tools-4.3.0-1/win32-x64/build/make-f8f9d371ff58a7195ca4abc9413f435c2bf2b998' make: *** [Makefile:1514: all-recursive] Error 1 It looks like the mingw-w64 9.0 already includes support for _isatty(), and the local implementation is no longer needed. My quick and dirty workaround was to locally patch the sources to get rid of the duplicate definitions: sed -i.bak \ -e 's|^isatty (int fd)$|__isatty (int fd)|' \ -e 's|^ttyname (int fd)$|__ttyname (int fd)|' \ src/w32/compat/posixfcn.c However, I think that a better solution should be considered, like for example configure to check if these functions are available and set some configuration macros to automate this. _______________________________________________________ Reply to this item at: <https://savannah.gnu.org/bugs/?61399> _______________________________________________ Message sent via Savannah https://savannah.gnu.org/