threads / discuss / 53255

minor patch required to compile git 2.26.1 on Oracle Solaris 10 with Oracle Studio

Subject: minor patch required to compile git 2.26.1 on Oracle Solaris 10 with Oracle Studio

## tl;dr

6 messages between Apr 19, 2020 and Apr 23, 2020.

replies: 5people: 4as markdown or json

Dennis Clarke· Apr 19, 2020, 04:52 UTC · lore
Very minor patch required :

--- ./compat/inet_ntop.c.orig Tue Apr 14 01:51:03 2020 +++ ./compat/inet_ntop.c Sun Apr 19 04:16:39 2020

@@ -168,7 +168,7 @@
   *     Paul Vixie, 1996.
   */
  const char *
-inet_ntop(int af, const void *src, char *dst, size_t size)
+inet_ntop(int af, const void *src, char *dst, unsigned int size)
  {
         switch (af) {
         case AF_INET:
--- ./git-compat-util.h.orig    Tue Apr 14 01:51:03 2020
+++ ./git-compat-util.h Sun Apr 19 03:56:17 2020
@@ -795,7 +795,7 @@
  #endif

  #ifdef NO_INET_NTOP
-const char *inet_ntop(int af, const void *src, char *dst, size_t size);
+const char *inet_ntop(int af, const void *src, char *dst, unsigned int 
size);
  #endif

  #ifdef NO_PTHREADS
#
# exit

That allows compile to proceed beatly with :

alpha$
alpha$ cc -V
cc: Studio 12.6 Sun C 5.15 SunOS_sparc 2017/05/30
-- 
Dennis Clarke
RISC-V/SPARC/PPC/ARM/CISC
UNIX and Linux spoken
GreyBeard and suspenders optional
Junio C Hamano· Apr 19, 2020, 05:35 UTC · re: Dennis Clarke · lore

Re: minor patch required to compile git 2.26.1 on Oracle Solaris 10 with Oracle Studio

Dennis Clarke <dclarke@blastwave.org> writes:
> Very minor patch required :

But both size_t and unsigned int are wrong types, no? Shouldn't we be using socklen_t (and we seem to have autoconf support to figure out an appropriate socklen_t fallback typedef)?

Show 31 quoted lines
> --- ./compat/inet_ntop.c.orig   Tue Apr 14 01:51:03 2020
> +++ ./compat/inet_ntop.c        Sun Apr 19 04:16:39 2020
> @@ -168,7 +168,7 @@
>   *     Paul Vixie, 1996.
>   */
>  const char *
> -inet_ntop(int af, const void *src, char *dst, size_t size)
> +inet_ntop(int af, const void *src, char *dst, unsigned int size)
>  {
>         switch (af) {
>         case AF_INET:
> --- ./git-compat-util.h.orig    Tue Apr 14 01:51:03 2020
> +++ ./git-compat-util.h Sun Apr 19 03:56:17 2020
> @@ -795,7 +795,7 @@
>  #endif
>
>  #ifdef NO_INET_NTOP
> -const char *inet_ntop(int af, const void *src, char *dst, size_t size);
> +const char *inet_ntop(int af, const void *src, char *dst, unsigned
> int size);
>  #endif
>
>  #ifdef NO_PTHREADS
> #
> # exit
>
> That allows compile to proceed beatly with :
>
> alpha$
> alpha$ cc -V
> cc: Studio 12.6 Sun C 5.15 SunOS_sparc 2017/05/30
Jeff King· Apr 22, 2020, 08:09 UTC · re: Junio C Hamano · lore

Re: minor patch required to compile git 2.26.1 on Oracle Solaris 10 with Oracle Studio

On Sat, Apr 18, 2020 at 10:35:45PM -0700, Junio C Hamano wrote:
Show 7 quoted lines
> Dennis Clarke <dclarke@blastwave.org> writes:
> 
> > Very minor patch required :
> 
> But both size_t and unsigned int are wrong types, no?  Shouldn't we
> be using socklen_t (and we seem to have autoconf support to figure
> out an appropriate socklen_t fallback typedef)?

That is generally the right type according to POSIX, but I think there's something even more subtle going on. If we're defining our own inet_ntop(), then the type shouldn't really matter, should it?

Dennis didn't show us the compiler errors, but my suspicion is that it is complaining because it is seeing the definition of inet_ntop() already from a system header, and ours does not match.

Which implies that NO_INET_NTOP should not be set in the first place. I think this is the same issue discussed in:

  https://lore.kernel.org/git/CAH8yC8m3JFvEcfFF3z1rrRnEPK-adHGObmkOhNZiph7QJKUWqA@mail.gmail.com/
with a patch (which needs at least a signoff added) in:
  https://lore.kernel.org/git/CAH8yC8kaWXbN+RYMJnM9em7KKW54+N07JtyS1MZk0qppD=m2BA@mail.gmail.com/
Dennis, does building with:
  make NO_INET_NTOP= NO_INET_PTON=
help?
-Peff
Jeff King· Apr 22, 2020, 08:11 UTC · re: Jeff King · lore

Re: minor patch required to compile git 2.26.1 on Oracle Solaris 10 with Oracle Studio

On Wed, Apr 22, 2020 at 04:09:50AM -0400, Jeff King wrote:
Show 14 quoted lines
> Which implies that NO_INET_NTOP should not be set in the first place.
> I think this is the same issue discussed in:
> 
>   https://lore.kernel.org/git/CAH8yC8m3JFvEcfFF3z1rrRnEPK-adHGObmkOhNZiph7QJKUWqA@mail.gmail.com/
> 
> with a patch (which needs at least a signoff added) in:
> 
>   https://lore.kernel.org/git/CAH8yC8kaWXbN+RYMJnM9em7KKW54+N07JtyS1MZk0qppD=m2BA@mail.gmail.com/
> 
> Dennis, does building with:
> 
>   make NO_INET_NTOP= NO_INET_PTON=
> 
> help?

Sorry, I meant to cc Jeffrey Walton from that thread but forgot to. Doing so now.

-Peff
Dennis Clarke· Apr 23, 2020, 00:09 UTC · re: Jeff King · lore

Re: minor patch required to compile git 2.26.1 on Oracle Solaris 10 with Oracle Studio

On 2020-04-22 04:11, Jeff King wrote:
Show 15 quoted lines
> On Wed, Apr 22, 2020 at 04:09:50AM -0400, Jeff King wrote:
> 
>> Which implies that NO_INET_NTOP should not be set in the first place.
>> I think this is the same issue discussed in:
>>
>>    https://lore.kernel.org/git/CAH8yC8m3JFvEcfFF3z1rrRnEPK-adHGObmkOhNZiph7QJKUWqA@mail.gmail.com/
>>
>> with a patch (which needs at least a signoff added) in:
>>
>>    https://lore.kernel.org/git/CAH8yC8kaWXbN+RYMJnM9em7KKW54+N07JtyS1MZk0qppD=m2BA@mail.gmail.com/
>>
>> Dennis, does building with:
>>
>>    make NO_INET_NTOP= NO_INET_PTON=
>>

I will give that a try today and see what happens. There seems to be a 2.26.2 release from yesterday and may as well get that going. What was the changelog reason for the bump from 2.26.1 to 2.26.2 ?

Dennis
Kevin Daudt· Apr 23, 2020, 05:41 UTC · re: Dennis Clarke · lore

Re: minor patch required to compile git 2.26.1 on Oracle Solaris 10 with Oracle Studio

On Wed, Apr 22, 2020 at 08:09:46PM -0400, Dennis Clarke wrote:
Show 24 quoted lines
> On 2020-04-22 04:11, Jeff King wrote:
> > On Wed, Apr 22, 2020 at 04:09:50AM -0400, Jeff King wrote:
> > 
> > > Which implies that NO_INET_NTOP should not be set in the first place.
> > > I think this is the same issue discussed in:
> > > 
> > >    https://lore.kernel.org/git/CAH8yC8m3JFvEcfFF3z1rrRnEPK-adHGObmkOhNZiph7QJKUWqA@mail.gmail.com/
> > > 
> > > with a patch (which needs at least a signoff added) in:
> > > 
> > >    https://lore.kernel.org/git/CAH8yC8kaWXbN+RYMJnM9em7KKW54+N07JtyS1MZk0qppD=m2BA@mail.gmail.com/
> > > 
> > > Dennis, does building with:
> > > 
> > >    make NO_INET_NTOP= NO_INET_PTON=
> > > 
> 
> I will give that a try today and see what happens. There seems to be a
> 2.26.2 release from yesterday and may as well get that going. What was the
> changelog reason for the bump from 2.26.1 to 2.26.2 ?
> 
> Dennis
> 
> 
Hello Dennis,
There was another CVE disclosed:
https://lore.kernel.org/git/xmqq4kterq5s.fsf@gitster.c.googlers.com/
Kind regards, Kevin

← back to recent threads