git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
* Git 2.31.1, Solaris and error: conflicting types for 'inet_ntop'
@ 2021-03-28  0:18 Jeffrey Walton
  2021-03-28  0:45 ` brian m. carlson
  0 siblings, 1 reply; 5+ messages in thread
From: Jeffrey Walton @ 2021-03-28  0:18 UTC (permalink / raw)
  To: Git List

Hi Everyone,

I'm building the latest Git on Solaris 11.3. I use this patch for
Solaris: https://github.com/noloader/Build-Scripts/blob/master/patch/git.patch.
It ensures -lresolv -lsocket -lnsl (in that order).

The build is having some trouble:

/bin/gcc -o kwset.o -c -MF ./.depend/kwset.o.d -MQ kwset.o -MMD -MP
-I/usr/local/include -DNDEBUG -DNO_UNALIGNED_LOADS=1 -g2 -O2 -m64
-march=native -fPIC -pthread -I. -D__EXTENSIONS__ -D__sun__
-DGIT_HOST_CPU="\"i86pc\"" -DUSE_LIBPCRE2 -I/usr/local/include
-DHAVE_ALLOCA_H -I/usr/local/include -DUSE_CURL_FOR_IMAP_SEND
-I/usr/local/include -I/usr/local/include -I/usr/local/include
-I/usr/local/include -DNO_D_TYPE_IN_DIRENT -DNO_INET_NTOP
-DNO_INET_PTON -DSHA1_DC -DSHA1DC_NO_STANDARD_INCLUDES
-DSHA1DC_INIT_SAFE_HASH_DEFAULT=0
-DSHA1DC_CUSTOM_INCLUDE_SHA1_C="\"cache.h\""
-DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C="\"git-compat-util.h\""
-DSHA256_BLK  -DHAVE_PATHS_H -DHAVE_LIBCHARSET_H -DHAVE_STRINGS_H
-DHAVE_DEV_TTY -DHAVE_CLOCK_GETTIME -DHAVE_CLOCK_MONOTONIC
-DHAVE_GETDELIM  -DFREAD_READS_DIRECTORIES -Icompat/regex
-DSHELL_PATH='"/bin/bash"' -DPAGER_ENV='"LESS=FRX LV=-c"'  kwset.c
In file included from cache.h:4:0,
                 from json-writer.c:1:
git-compat-util.h:823:13: error: conflicting types for 'inet_ntop'
 const char *inet_ntop(int af, const void *src, char *dst, size_t size);
             ^
In file included from cache.h:4:0,
                 from ident.c:8:
git-compat-util.h:823:13: error: conflicting types for 'inet_ntop'
 const char *inet_ntop(int af, const void *src, char *dst, size_t size);
             ^
In file included from git-compat-util.h:226:0,
                 from cache.h:4,
                 from ident.c:8:
/usr/include/arpa/inet.h:43:20: note: previous declaration of
'inet_ntop' was here
 extern const char *inet_ntop(int, const void *_RESTRICT_KYWD,
                    ^
In file included from git-compat-util.h:226:0,
                 from cache.h:4,
                 from json-writer.c:1:
/usr/include/arpa/inet.h:43:20: note: previous declaration of
'inet_ntop' was here
 extern const char *inet_ntop(int, const void *_RESTRICT_KYWD,
                    ^
In file included from cache.h:4:0,
                 from hex.c:1:
git-compat-util.h:823:13: error: conflicting types for 'inet_ntop'
 const char *inet_ntop(int af, const void *src, char *dst, size_t size);
             ^
In file included from git-compat-util.h:226:0,
                 from cache.h:4,
                 from hex.c:1:
/usr/include/arpa/inet.h:43:20: note: previous declaration of
'inet_ntop' was here
 extern const char *inet_ntop(int, const void *_RESTRICT_KYWD,
                    ^
In file included from cache.h:4:0,
                 from kwset.c:35:
git-compat-util.h:823:13: error: conflicting types for 'inet_ntop'
 const char *inet_ntop(int af, const void *src, char *dst, size_t size);
             ^
In file included from git-compat-util.h:226:0,
                 from cache.h:4,
                 from kwset.c:35:
/usr/include/arpa/inet.h:43:20: note: previous declaration of
'inet_ntop' was here
 extern const char *inet_ntop(int, const void *_RESTRICT_KYWD,
                    ^
gmake: *** [hex.o] Error 1

Jeff

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Git 2.31.1, Solaris and error: conflicting types for 'inet_ntop'
  2021-03-28  0:18 Git 2.31.1, Solaris and error: conflicting types for 'inet_ntop' Jeffrey Walton
@ 2021-03-28  0:45 ` brian m. carlson
  2021-03-28  1:04   ` Jeffrey Walton
  0 siblings, 1 reply; 5+ messages in thread
From: brian m. carlson @ 2021-03-28  0:45 UTC (permalink / raw)
  To: Jeffrey Walton; +Cc: Git List

[-- Attachment #1: Type: text/plain, Size: 2261 bytes --]

On 2021-03-28 at 00:18:37, Jeffrey Walton wrote:
> Hi Everyone,
> 
> I'm building the latest Git on Solaris 11.3. I use this patch for
> Solaris: https://github.com/noloader/Build-Scripts/blob/master/patch/git.patch.
> It ensures -lresolv -lsocket -lnsl (in that order).
> 
> The build is having some trouble:
> 
> /bin/gcc -o kwset.o -c -MF ./.depend/kwset.o.d -MQ kwset.o -MMD -MP
> -I/usr/local/include -DNDEBUG -DNO_UNALIGNED_LOADS=1 -g2 -O2 -m64
> -march=native -fPIC -pthread -I. -D__EXTENSIONS__ -D__sun__
> -DGIT_HOST_CPU="\"i86pc\"" -DUSE_LIBPCRE2 -I/usr/local/include
> -DHAVE_ALLOCA_H -I/usr/local/include -DUSE_CURL_FOR_IMAP_SEND
> -I/usr/local/include -I/usr/local/include -I/usr/local/include
> -I/usr/local/include -DNO_D_TYPE_IN_DIRENT -DNO_INET_NTOP

So you're defining NO_INET_NTOP.

> -DNO_INET_PTON -DSHA1_DC -DSHA1DC_NO_STANDARD_INCLUDES
> -DSHA1DC_INIT_SAFE_HASH_DEFAULT=0
> -DSHA1DC_CUSTOM_INCLUDE_SHA1_C="\"cache.h\""
> -DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C="\"git-compat-util.h\""
> -DSHA256_BLK  -DHAVE_PATHS_H -DHAVE_LIBCHARSET_H -DHAVE_STRINGS_H
> -DHAVE_DEV_TTY -DHAVE_CLOCK_GETTIME -DHAVE_CLOCK_MONOTONIC
> -DHAVE_GETDELIM  -DFREAD_READS_DIRECTORIES -Icompat/regex
> -DSHELL_PATH='"/bin/bash"' -DPAGER_ENV='"LESS=FRX LV=-c"'  kwset.c
> In file included from cache.h:4:0,
>                  from json-writer.c:1:
> git-compat-util.h:823:13: error: conflicting types for 'inet_ntop'
>  const char *inet_ntop(int af, const void *src, char *dst, size_t size);

So we're defining one here.

> In file included from cache.h:4:0,
>                  from ident.c:8:
> git-compat-util.h:823:13: error: conflicting types for 'inet_ntop'
>  const char *inet_ntop(int af, const void *src, char *dst, size_t size);
>              ^
> In file included from git-compat-util.h:226:0,
>                  from cache.h:4,
>                  from ident.c:8:
> /usr/include/arpa/inet.h:43:20: note: previous declaration of
> 'inet_ntop' was here
>  extern const char *inet_ntop(int, const void *_RESTRICT_KYWD,

And then so are your system headers.  You probably want to avoid setting
that option, and then things will probably work better.
-- 
brian m. carlson (he/him or they/them)
Houston, Texas, US

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 263 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Git 2.31.1, Solaris and error: conflicting types for 'inet_ntop'
  2021-03-28  0:45 ` brian m. carlson
@ 2021-03-28  1:04   ` Jeffrey Walton
  2021-03-28  1:26     ` brian m. carlson
  0 siblings, 1 reply; 5+ messages in thread
From: Jeffrey Walton @ 2021-03-28  1:04 UTC (permalink / raw)
  To: brian m. carlson; +Cc: Git List

On Sat, Mar 27, 2021 at 8:45 PM brian m. carlson
<sandals@crustytoothpaste.net> wrote:
>
> On 2021-03-28 at 00:18:37, Jeffrey Walton wrote:
> > Hi Everyone,
> >
> > I'm building the latest Git on Solaris 11.3. I use this patch for
> > Solaris: https://github.com/noloader/Build-Scripts/blob/master/patch/git.patch.
> > It ensures -lresolv -lsocket -lnsl (in that order).
> >
> > The build is having some trouble:
> >
> > /bin/gcc -o kwset.o -c -MF ./.depend/kwset.o.d -MQ kwset.o -MMD -MP
> > -I/usr/local/include -DNDEBUG -DNO_UNALIGNED_LOADS=1 -g2 -O2 -m64
> > -march=native -fPIC -pthread -I. -D__EXTENSIONS__ -D__sun__
> > -DGIT_HOST_CPU="\"i86pc\"" -DUSE_LIBPCRE2 -I/usr/local/include
> > -DHAVE_ALLOCA_H -I/usr/local/include -DUSE_CURL_FOR_IMAP_SEND
> > -I/usr/local/include -I/usr/local/include -I/usr/local/include
> > -I/usr/local/include -DNO_D_TYPE_IN_DIRENT -DNO_INET_NTOP
>
> So you're defining NO_INET_NTOP.
>
> > -DNO_INET_PTON -DSHA1_DC -DSHA1DC_NO_STANDARD_INCLUDES
> > -DSHA1DC_INIT_SAFE_HASH_DEFAULT=0
> > -DSHA1DC_CUSTOM_INCLUDE_SHA1_C="\"cache.h\""
> > -DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C="\"git-compat-util.h\""
> > -DSHA256_BLK  -DHAVE_PATHS_H -DHAVE_LIBCHARSET_H -DHAVE_STRINGS_H
> > -DHAVE_DEV_TTY -DHAVE_CLOCK_GETTIME -DHAVE_CLOCK_MONOTONIC
> > -DHAVE_GETDELIM  -DFREAD_READS_DIRECTORIES -Icompat/regex
> > -DSHELL_PATH='"/bin/bash"' -DPAGER_ENV='"LESS=FRX LV=-c"'  kwset.c
> > In file included from cache.h:4:0,
> >                  from json-writer.c:1:
> > git-compat-util.h:823:13: error: conflicting types for 'inet_ntop'
> >  const char *inet_ntop(int af, const void *src, char *dst, size_t size);
>
> So we're defining one here.
>
> > In file included from cache.h:4:0,
> >                  from ident.c:8:
> > git-compat-util.h:823:13: error: conflicting types for 'inet_ntop'
> >  const char *inet_ntop(int af, const void *src, char *dst, size_t size);
> >              ^
> > In file included from git-compat-util.h:226:0,
> >                  from cache.h:4,
> >                  from ident.c:8:
> > /usr/include/arpa/inet.h:43:20: note: previous declaration of
> > 'inet_ntop' was here
> >  extern const char *inet_ntop(int, const void *_RESTRICT_KYWD,
>
> And then so are your system headers.  You probably want to avoid setting
> that option, and then things will probably work better.

I see what happened... I stopped Autoreconfing so the configure.ac
changes were not picked up. The original configure is being used.

I think Git is getting itself into that state.

Without the Autoreconf, I was able to sidestep the issue with:

if [[ "${IS_SOLARIS}" -eq 1 ]]; then
    CONFIG_OPTS+=("ac_cv_func_inet_ntop=yes")
    CONFIG_OPTS+=("ac_cv_func_inet_pton=yes")
fi

Jeff

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Git 2.31.1, Solaris and error: conflicting types for 'inet_ntop'
  2021-03-28  1:04   ` Jeffrey Walton
@ 2021-03-28  1:26     ` brian m. carlson
  2021-03-28  7:22       ` Jeff King
  0 siblings, 1 reply; 5+ messages in thread
From: brian m. carlson @ 2021-03-28  1:26 UTC (permalink / raw)
  To: Jeffrey Walton; +Cc: Git List

[-- Attachment #1: Type: text/plain, Size: 777 bytes --]

On 2021-03-28 at 01:04:32, Jeffrey Walton wrote:
> I see what happened... I stopped Autoreconfing so the configure.ac
> changes were not picked up. The original configure is being used.
> 
> I think Git is getting itself into that state.
> 
> Without the Autoreconf, I was able to sidestep the issue with:
> 
> if [[ "${IS_SOLARIS}" -eq 1 ]]; then
>     CONFIG_OPTS+=("ac_cv_func_inet_ntop=yes")
>     CONFIG_OPTS+=("ac_cv_func_inet_pton=yes")
> fi

Most developers don't use the autoconf stuff and just use the makefile.
config.mak.uname doesn't have NO_INET_NTOP set for SunOS.

If the autoconf scripts or config.mak.uname need fixing, which is
possible, a patch would definitely be welcome.
-- 
brian m. carlson (he/him or they/them)
Houston, Texas, US

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 263 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Git 2.31.1, Solaris and error: conflicting types for 'inet_ntop'
  2021-03-28  1:26     ` brian m. carlson
@ 2021-03-28  7:22       ` Jeff King
  0 siblings, 0 replies; 5+ messages in thread
From: Jeff King @ 2021-03-28  7:22 UTC (permalink / raw)
  To: brian m. carlson; +Cc: Jeffrey Walton, Git List

On Sun, Mar 28, 2021 at 01:26:10AM +0000, brian m. carlson wrote:

> On 2021-03-28 at 01:04:32, Jeffrey Walton wrote:
> > I see what happened... I stopped Autoreconfing so the configure.ac
> > changes were not picked up. The original configure is being used.
> > 
> > I think Git is getting itself into that state.
> > 
> > Without the Autoreconf, I was able to sidestep the issue with:
> > 
> > if [[ "${IS_SOLARIS}" -eq 1 ]]; then
> >     CONFIG_OPTS+=("ac_cv_func_inet_ntop=yes")
> >     CONFIG_OPTS+=("ac_cv_func_inet_pton=yes")
> > fi
> 
> Most developers don't use the autoconf stuff and just use the makefile.
> config.mak.uname doesn't have NO_INET_NTOP set for SunOS.
> 
> If the autoconf scripts or config.mak.uname need fixing, which is
> possible, a patch would definitely be welcome.

This all seemed vaguely familiar, and indeed it came up about a year
ago:

  https://lore.kernel.org/git/CAH8yC8m3JFvEcfFF3z1rrRnEPK-adHGObmkOhNZiph7QJKUWqA@mail.gmail.com/

Maybe worth resurrecting this patch (at the very least it needed a
signoff):

  https://lore.kernel.org/git/CAH8yC8kaWXbN+RYMJnM9em7KKW54+N07JtyS1MZk0qppD=m2BA@mail.gmail.com/

-Peff

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-03-28  7:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-28  0:18 Git 2.31.1, Solaris and error: conflicting types for 'inet_ntop' Jeffrey Walton
2021-03-28  0:45 ` brian m. carlson
2021-03-28  1:04   ` Jeffrey Walton
2021-03-28  1:26     ` brian m. carlson
2021-03-28  7:22       ` Jeff King

Code repositories for project(s) associated with this inbox:

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).