[Top][All Lists]

[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: Fri, 29 Oct 2021 12:06:35 -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


                 Summary: multiple definition of `_isatty';
                 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



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  
: 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
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)|' \

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:


  Message sent via Savannah

reply via email to

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