Re: CVS commit: src/tools/compat

2023-07-08 Thread Luke Mewburn
On 23-07-08 19:10, Palle Lyckegaard wrote:
  | Module Name:src
  | Committed By:   palle
  | Date:   Sat Jul  8 19:10:00 UTC 2023
  | 
  | Modified Files:
  | src/tools/compat: compat_defs.h
  | 
  | Log Message:
  | Add support for missing NAME_MAX when building on Solaris hosts
  | 

  | 
  | Index: src/tools/compat/compat_defs.h
  | diff -u src/tools/compat/compat_defs.h:1.120 
src/tools/compat/compat_defs.h:1.121
  | --- src/tools/compat/compat_defs.h:1.120Sun May 30 10:39:41 2021
  | +++ src/tools/compat/compat_defs.h  Sat Jul  8 19:10:00 2023
  | @@ -1,4 +1,4 @@
  | -/* $NetBSD: compat_defs.h,v 1.120 2021/05/30 10:39:41 cjep Exp $   */
  | +/* $NetBSD: compat_defs.h,v 1.121 2023/07/08 19:10:00 palle Exp $  */
  |  
  |  #ifndef__NETBSD_COMPAT_DEFS_H__
  |  #define__NETBSD_COMPAT_DEFS_H__
  | @@ -31,6 +31,17 @@
  |  #endif /* __linux__ && HAVE_FEATURES_H */
  |  
  |  /*
  | + * Solaris:
  | + * No NAME_MAX define is available (as documented in the Solaris
  | + * limits.h file), so use the XOPEN defined constant.
  | + */
  | +
  | +#if defined(__sun__)
  | +#define NAME_MAX _XOPEN_NAME_MAX
  | +#endif
  | +

This might be better as a check for NAME_MAX not being defined
and _XOPEN_NAME_MAX being defined?

Something like:
#if !defined(NAME_MAX)
#if defined(_XOPEN_NAME_MAX)
#define NAME_MAX _XOPEN_NAME_MAX
#else
#error "Unable to determine NAME_MAX"
#endif
#endif

There might be an even cleaner idiom.


regards,
Luke.


Re: CVS commit: src/tools/compat

2018-09-09 Thread Christos Zoulas
In article <20180909191722.120faf...@cvs.netbsd.org>,
Palle Lyckegaard  wrote:
>-=-=-=-=-=-
>
>Module Name:   src
>Committed By:  palle
>Date:  Sun Sep  9 19:17:21 UTC 2018
>
>Modified Files:
>   src/tools/compat: README
>
>Log Message:
>Add instructions for building NetBSD on modern Solaris 11 hosts
>
>
>To generate a diff of this commit:
>cvs rdiff -u -r1.12 -r1.13 src/tools/compat/README
>
>Please note that diffs are not public domain; they are subject to the
>copyright notices on the relevant files.
>
>
>-=-=-=-=-=-
>
>Modified files:
>
>Index: src/tools/compat/README
>diff -u src/tools/compat/README:1.12 src/tools/compat/README:1.13
>--- src/tools/compat/README:1.12   Tue Apr  5 00:21:22 2005
>+++ src/tools/compat/READMESun Sep  9 19:17:21 2018
>@@ -1,4 +1,4 @@
>-$NetBSD: README,v 1.12 2005/04/05 00:21:22 jmc Exp $
>+$NetBSD: README,v 1.13 2018/09/09 19:17:21 palle Exp $
> 
> Special notes for cross-hosting a NetBSD build on certain platforms.  
> Only those platforms which have been tested to complete a "build.sh" run
>@@ -65,6 +65,8 @@ NETBSD (earlier releases):
> 
> SOLARIS:
> 
>+(updated instruction for Solaris 11 further below)
>+
> * Tested on Solaris/x86 8 (5.8) with gcc 2.95.2 and Solaris/sparc 8 (5.8)
>   with gcc 3.2 (not yet tested with SUNWspro).
> 
>@@ -85,3 +87,16 @@ SOLARIS:
>   /usr/ucb may optionally be placed before /usr/bin, per your preference,
>   but /usr/ucb *MUST NOT* be before /usr/ccs/bin or before the path to
>   the host C and C++ compilers.
>+
>+Solaris 11:
>+
>+* Solaris 11.3
>+ * Set PATH to /usr/xpg6/bin:/usr/xpg4/bin:/usr/bin
>+ * Set HOST_CC to /usr/bin/gcc
>+
>+* Solaris 11.4
>+ * Install gcc-5 since the default installed gcc-7 has issues when compiling 
>+   toolchain version of groff (hypot())

Is that the only problem? We should just fix it.
And we can set the path to /usr/xpg7/bin:/usr/xpg6/bin:/usr/xpg4/bin:/usr/bin
for both versions... So there is only one set of instructions...


christos



Re: CVS commit: src/tools/compat

2017-12-09 Thread Joerg Sonnenberger
On Sat, Dec 09, 2017 at 04:22:53AM +, Sevan Janiyan wrote:
> Module Name:  src
> Committed By: sevan
> Date: Sat Dec  9 04:22:53 UTC 2017
> 
> Modified Files:
>   src/tools/compat: configure.ac
> 
> Log Message:
> Add asnprintf() to the AC_CHECK_DECLS list.
> Resolves conflict when cross compiling on Cygwin the provided implementation
> does not get picked up.
> 
> Closes PR toolchain/52797

This change is wrong and makes the situation worse. The asnprintf on
Cygwin is broken by the agreed upon interface of asnprintf.

Joerg


Re: CVS commit: src/tools/compat

2017-10-02 Thread David H. Gutteridge
> Module Name:src
> Committed By:   christos
> Date:   Mon Oct  2 22:19:45 UTC 2017
> 
> Modified Files:
> src/tools/compat: compat_defs.h configure.ac fpurge.c
> 
> Log Message:
> handle __fpurge being declared in 

This has broken the tools build of awk for me.

cc -O -D__EXTENSIONS__ -I/home/disciple/netbsd-
current/src/obj/tooldir.NetBSD-8.99.3-amd64/include/compat
-I/home/disciple/netbsd-current/src/tools/compat
-DHAVE_NBTOOL_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 -I/home/disciple/netbsd-
current/src/tools/awk/../../external/historical/nawk/bin/../dist -I. -c
-o run.lo.o -Wno-format-nonliteral   /home/disciple/netbsd-
current/src/tools/awk/../../external/historical/nawk/bin/../dist/run.c
/home/disciple/netbsd-
current/src/tools/awk/../../external/historical/nawk/bin/../dist/run.c:
In function 'closeall':
/home/disciple/netbsd-
current/src/tools/awk/../../external/historical/nawk/bin/../dist/run.c:1
873:12: error: void value not ignored as it ought to be
 stat = fpurge(files[i].fp) == EOF;
^

*** Failed target:  run.lo
*** Failed command: cc -O -D__EXTENSIONS__ -I/home/disciple/netbsd-
current/src/obj/tooldir.NetBSD-8.99.3-amd64/include/compat
-I/home/disciple/netbsd-current/src/tools/compat
-DHAVE_NBTOOL_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 -I/home/disciple/netbsd-
current/src/tools/awk/../../external/historical/nawk/bin/../dist -I. -c
-o run.lo.o -Wno-format-nonliteral /home/disciple/netbsd-
current/src/tools/awk/../../external/historical/nawk/bin/../dist/run.c
*** Error code 1

Stop.

Reverting this change fixes the build.

Regards,

Dave



Re: CVS commit: src/tools/compat

2016-02-29 Thread Aymeric Vincent

chris...@astron.com (Christos Zoulas) writes:

> Can you explain how it breaks? Is it because of the locale settings?

Sure, and no: it's simply because it uses [[:<:]] and [[:>:]] as word
delimiters, and that appears to be a BSD extension.

Regards,
 Aymeric


Re: CVS commit: src/tools/compat

2016-02-29 Thread Christos Zoulas
In article <20160229221929.7346bf...@cvs.netbsd.org>,
Aymeric Vincent  wrote:
>-=-=-=-=-=-
>
>Module Name:   src
>Committed By:  aymeric
>Date:  Mon Feb 29 22:19:29 UTC 2016
>
>Modified Files:
>   src/tools/compat: Makefile
>Added Files:
>   src/tools/compat: regex.h
>
>Log Message:
>add our libc's regex implementation to libnbcompat.
>
>This way, nbsed picks it up and it unbreaks the build of xf86-video-intel-old's
>man page under Linux and probably other future changes which rightfully expect
>the (net)bsd behaviour.

Can you explain how it breaks? Is it because of the locale settings?

christos



Re: CVS commit: src/tools/compat

2015-09-17 Thread Paul Goyette

(Resend with valid subject line)


Module Name:src
Committed By:   christos
Date:   Thu Sep 17 02:22:47 UTC 2015

Modified Files:
   src/tools/compat: Makefile

Log Message:
make this more robust by using .CURDIR to cd.


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/tools/compat/Makefile


This seems to have broken the build for amd64.  The following failure occurs 
while building tools target:


...
#   install  /build/netbsd-local/tools/x86_64/amd64/include/compat/arpa
/build/netbsd-local/obj/amd64/tools/binstall/xinstall -d 
/build/netbsd-local/tools/x86_64/amd64/include/compat/arpa
#   install 
/build/netbsd-local/tools/x86_64/amd64/include/compat/nbtool_config.h
/build/netbsd-local/obj/amd64/tools/binstall/xinstall -c  -r nbtool_config.h 
/build/netbsd-local/tools/x86_64/amd64/include/compat/nbtool_config.h
cd: can't cd to /build/netbsd-local/src/tools/compat/include
*** [includes] Error code 2

nbmake[2]: stopped in /build/netbsd-local/src/tools/compat
1 error

+--+--+-+
| Paul Goyette | PGP Key fingerprint: | E-mail addresses:   |
| (Retired)| FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com|
| Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd.org  |
+--+--+-+


Re: CVS commit: src/tools/compat

2013-02-16 Thread Izumi Tsutsui
 Module Name:  src
 Committed By: christos
 Date: Sun Feb 17 00:34:11 UTC 2013
 
 Modified Files:
   src/tools/compat: compat_defs.h configure.ac
 
 Log Message:
 cygwin defines u_quad_t in rpc/types.h, so include this to the headers
 we include and test by default.

Now does it work?
Last time I tried, it failed because NetBSD's rpc/types.h defined
enum_t and src/usr.bin/xlint/lint1/lint1.h for tools lint(1) also
defined different enum_t.
---
Izumi Tsutsui


Re: CVS commit: src/tools/compat

2013-02-16 Thread Christos Zoulas
On Feb 17,  9:49am, tsut...@ceres.dti.ne.jp (Izumi Tsutsui) wrote:
-- Subject: Re: CVS commit: src/tools/compat

|  Module Name:src
|  Committed By:   christos
|  Date:   Sun Feb 17 00:34:11 UTC 2013
|  
|  Modified Files:
|  src/tools/compat: compat_defs.h configure.ac
|  
|  Log Message:
|  cygwin defines u_quad_t in rpc/types.h, so include this to the headers
|  we include and test by default.
| 
| Now does it work?
| Last time I tried, it failed because NetBSD's rpc/types.h defined
| enum_t and src/usr.bin/xlint/lint1/lint1.h for tools lint(1) also
| defined different enum_t.

I renamed lint's enum_t. And yes, it works. My build is doing libraries.

christos


Re: CVS commit: src/tools/compat

2012-06-03 Thread Alan Barrett

On Sun, 03 Jun 2012, Joerg Sonnenberger wrote:

Log Message:
Add __predict_true / __predict_false definitions.



+#undef __predict_false
+#define __predict_false(x) x
+#undef __predict_true
+#define __predict_true(x) x


Please parenthesise the definitions.

I don't know whether it's worth defining them in a 
compiler-dependent way, or using #ifndef to pick up any definition 
provided by the host system.


--apb (Alan Barrett)


Re: CVS commit: src/tools/compat/sys

2010-03-27 Thread Christoph Egger
On 26.03.10 22:34, Christos Zoulas wrote:
 In article 1933.1269630...@splode.eterna.com.au,
 matthew green  m...@eterna.com.au wrote:
   
   copy  paste from above url
   tools/ctfconvert/../../external/cddl/osnet/sys/sys/time.h:71: error:
   'CLOCK_REALTIME' undeclared (first use in this function)
   /copy  paste


 shouldn't this be fixed with something in nbtool_config.h?
 
 Just back the whole thing out; I fixed it in the dtrace sys/time.h where it
 belongs.

Done. See
http://mail-index.netbsd.org/source-changes/2010/03/27/msg008205.html

Christoph


Re: CVS commit: src/tools/compat/sys

2010-03-27 Thread Christos Zoulas
On Mar 27,  8:19am, christoph_eg...@gmx.de (Christoph Egger) wrote:
-- Subject: Re: CVS commit: src/tools/compat/sys

| On 26.03.10 22:34, Christos Zoulas wrote:
|  In article 1933.1269630...@splode.eterna.com.au,
|  matthew green  m...@eterna.com.au wrote:
|
|copy  paste from above url
|tools/ctfconvert/../../external/cddl/osnet/sys/sys/time.h:71: error:
|'CLOCK_REALTIME' undeclared (first use in this function)
|/copy  paste
| 
| 
|  shouldn't this be fixed with something in nbtool_config.h?
|  
|  Just back the whole thing out; I fixed it in the dtrace sys/time.h where it
|  belongs.
| 
| Done. See
| http://mail-index.netbsd.org/source-changes/2010/03/27/msg008205.html
| 
| Christoph

Thanks!

christos


re: CVS commit: src/tools/compat/sys

2010-03-26 Thread matthew green

   Module Name: src
   Committed By:cegger
   Date:Fri Mar 26 07:16:12 UTC 2010
   
   Added Files:
src/tools/compat/sys: time.h
   
   Log Message:
   toolchain buildfix on OSX with MKDTRACE=yes:
   
   The host sys/time.h doesn't provide CLOCK_REALTIME but ctf uses it.
   See http://mail-index.netbsd.org/current-users/2010/03/20/msg012963.html

this seems bogus to me.

please only define it if it isn't defined, at least.
   
   No comments.

try posting to the right mailing list.  tech-toolchain would
be the right list for this sort of change.


.mrg.


Re: re: CVS commit: src/tools/compat/sys

2010-03-26 Thread Christoph Egger

 
Module Name:   src
Committed By:  cegger
Date:  Fri Mar 26 07:16:12 UTC 2010

Added Files:
   src/tools/compat/sys: time.h

Log Message:
toolchain buildfix on OSX with MKDTRACE=yes:

The host sys/time.h doesn't provide CLOCK_REALTIME but
ctf uses it.
See http://mail-index.netbsd.org/current-users/2010/03/20/msg012963.html
 
 this seems bogus to me.
 
 please only define it if it isn't defined, at least.


I tried the other way around before I posted the my fix
to the list:

#include_next sys/time.h

#ifndef CLOCK_REALTIME
#define CLOCK_REALTIME 0
#endif

But this failed the same way: CLOCK_REALTIME undeclared.

Note, ctf uses CLOCK_REALTIME in the same header where it
includes sys/time.h.


No comments.
 
 try posting to the right mailing list.  tech-toolchain would
 be the right list for this sort of change.

Thanks for the hint.

Christoph


re: CVS commit: src/tools/compat/sys

2010-03-26 Thread matthew green

   
   toolchain buildfix on OSX with MKDTRACE=yes:
   
   The host sys/time.h doesn't provide CLOCK_REALTIME but
   ctf uses it.
   See http://mail-index.netbsd.org/current-users/2010/03/20/msg012963.html

this seems bogus to me.

please only define it if it isn't defined, at least.
   
   
   I tried the other way around before I posted the my fix
   to the list:
   
   #include_next sys/time.h
   
   #ifndef CLOCK_REALTIME
   #define CLOCK_REALTIME 0
   #endif
   
   But this failed the same way: CLOCK_REALTIME undeclared.

hmmm, could you post the error?  thanks.
   
   Note, ctf uses CLOCK_REALTIME in the same header where it
   includes sys/time.h.

BTW, i'm not sure that using #include_next is OK (it's gcc
specific) and i don't see it used elsewhere in a quick look.

   No comments.

try posting to the right mailing list.  tech-toolchain would
be the right list for this sort of change.
   
   Thanks for the hint.

np.


Re: CVS commit: src/tools/compat/sys

2010-03-26 Thread Christoph Egger

 Original-Nachricht 
 Datum: Sat, 27 Mar 2010 03:03:06 +1100
 Von: matthew green m...@eterna.com.au
 An: Christoph Egger christoph_eg...@gmx.de
 CC: source-changes-d@NetBSD.org
 Betreff: re: CVS commit: src/tools/compat/sys

 

toolchain buildfix on OSX with MKDTRACE=yes:

The host sys/time.h doesn't provide CLOCK_REALTIME but
ctf uses it.
See
 http://mail-index.netbsd.org/current-users/2010/03/20/msg012963.html
 
 this seems bogus to me.
 
 please only define it if it isn't defined, at least.


I tried the other way around before I posted the my fix
to the list:

#include_next sys/time.h

#ifndef CLOCK_REALTIME
#define CLOCK_REALTIME 0
#endif

But this failed the same way: CLOCK_REALTIME undeclared.
 
 hmmm, could you post the error?  thanks.

copy  paste from above url
tools/ctfconvert/../../external/cddl/osnet/sys/sys/time.h:71: error:
'CLOCK_REALTIME' undeclared (first use in this function)
/copy  paste
   
Note, ctf uses CLOCK_REALTIME in the same header where it
includes sys/time.h.
 
 BTW, i'm not sure that using #include_next is OK (it's gcc
 specific) and i don't see it used elsewhere in a quick look.

If you want to see that go away then ctf needs to be fixed first
(which implies to wait for darran@ to be back from vacation
in first place :))
See line 34 in ctf's sys/time.h (above file where error occured).
 
Christoph


re: CVS commit: src/tools/compat/sys

2010-03-26 Thread matthew green
   
   copy  paste from above url
   tools/ctfconvert/../../external/cddl/osnet/sys/sys/time.h:71: error:
   'CLOCK_REALTIME' undeclared (first use in this function)
   /copy  paste


shouldn't this be fixed with something in nbtool_config.h?


Re: CVS commit: src/tools/compat/sys

2010-03-26 Thread Matt Thomas

On Mar 26, 2010, at 12:00 PM, matthew green wrote:

 
   copy  paste from above url
   tools/ctfconvert/../../external/cddl/osnet/sys/sys/time.h:71: error:
   'CLOCK_REALTIME' undeclared (first use in this function)
   /copy  paste
 
 
 shouldn't this be fixed with something in nbtool_config.h?

That's what I was thinking since ctf on cross host isn't that useful.



Re: CVS commit: src/tools/compat/sys

2010-03-26 Thread Christos Zoulas
In article 1933.1269630...@splode.eterna.com.au,
matthew green  m...@eterna.com.au wrote:
   
   copy  paste from above url
   tools/ctfconvert/../../external/cddl/osnet/sys/sys/time.h:71: error:
   'CLOCK_REALTIME' undeclared (first use in this function)
   /copy  paste


shouldn't this be fixed with something in nbtool_config.h?

Just back the whole thing out; I fixed it in the dtrace sys/time.h where it
belongs.

christos