README
1 $NetBSD: README,v 1.30 2026/09/27 15:40:22 tsutsui Exp $
2
3 Special notes for cross-hosting a NetBSD build on certain platforms.
4 Only those platforms which have been tested to complete a "build.sh" run
5 are listed.
6
7 All hosts must have a POSIX compatible sh. /bin/sh is assumed unless
8 otherwise set. This can be overridden by setting HOST_SH in the environment.
9
10 In addition all hosts must provide the following local tools:
11 gzip
12 gcc
13 g++
14 zlib and headers (this requirement may be dropped in future)
15
16 FreeBSD
17 -------
18
19 build.sh was recently tested on:
20 * FreeBSD 13 (amd64, aarch64)
21 * FreeBSD 12.2 (amd64, aarch64)
22 * FreeBSD 11.4 (amd64)
23 * FreeBSD 10.4 (amd64)
24
25 Linux
26 -----
27
28 build.sh has been tested on:
29 * Amazon Linux 2 (x86)
30 * Debian 10 (x86, aarch64)
31 * Red Hat Enterprise Linux 8 (x86, aarch64)
32 * SUSE Enterprise Server 15 (x86)
33 * Ubuntu Server 20.04 (x86, aarch64)
34 * Ubuntu Server 18.04 (x86)
35
36 * The gcc and g++ package must be installed, along with the typical system
37 development packages (glibc-devel, etc.). The g++ package is sometimes
38 called gcc-c++.
39
40 * The zlib and zlib-devel packages must be installed (these are
41 called zlib1g and zlib1g-dev on Debian and Ubuntu Linux)
42
43 * There is a known build problem on Linux/aarch64 with glibc <2.28
44
45 macOS/Darwin
46 ------------
47
48 build.sh was recently tested on:
49 * macOS Big Sur (x86)
50 * macOS Catalina
51 * macOS High Sierra
52
53 with up to date Xcode command line tools and APFS filesystems.
54 Previously, there have been issues building on case-insensitive
55 HFS filesystems. build.sh is not working yet on M1-based Macs.
56
57 HP-UX
58 -----
59
60 * zlib must be available.
61
62 OpenBSD
63 -------
64
65 As of -current 20210629, ./build.sh will build src on OpenBSD 6.9
66 for all platforms.
67
68 Due to the default limits placed on user accounts, the host may experience
69 memory exhaustion on builds requiring the LLVM RT library (including
70 X on amd64, i386 and evbarm64-el) and for MIPS targets.
71
72 This can be avoided by building as root (not ideal) or by asking your
73 administrator to increase your limits in login.conf. These two variables
74 seem to be sufficient:
75 :datasize=infinity:\
76 :stacksize-cur=8M:\
77
78 NetBSD (earlier releases)
79 -------------------------
80
81 * Tested on NetBSD 1.5.2 (machine-independently).
82 * Should need no special setup.
83 * _NETBSD_SOURCE is *not* to be defined/pulled in during compat/tools builds.
84 compat_defs.h will error out if it finds it defined.
85
86 Solaris
87 -------
88
89 (updated instruction for Solaris 10 and 11 further below)
90
91 * Tested on Solaris/x86 8 (5.8) with gcc 2.95.2 and Solaris/sparc 8 (5.8)
92 with gcc 3.2 (not yet tested with SUNWspro).
93
94 * $HOST_CC needs to be set properly (for gcc, it should be set to "gcc",
95 otherwise the improper /usr/ucb/cc may be invoked by accident).
96
97 * The SUNWzlib package (or a built version of zlib visible to $HOST_CC,
98 such as SMCzlib from sunfreeware.com) must be installed. This will be
99 fixed in the future to include zlib in libnbcompat.
100
101 * Needs the following paths, in this order, in $PATH:
102
103 /usr/xpg4/bin
104 /usr/ccs/bin
105 <path to host C and C++ compilers>
106 /usr/bin
107
108 /usr/ucb may optionally be placed before /usr/bin, per your preference,
109 but /usr/ucb *MUST NOT* be before /usr/ccs/bin or before the path to
110 the host C and C++ compilers.
111
112
113 Solaris 10:
114
115 * Solaris 10 1/13 (u11)
116 * POSIX.1-2001, SUSv3 (see standards(7))
117 * Using gcc-5 from opencsw.org
118 * Set PATH to /usr/xpg6/bin:/usr/xpg4/bin:/usr/bin:/usr/ccs/bin
119 * Set HOST_CC to /opt/csw/bin/gcc
120 * Set HOST_SH to /usr/bin/bash
121
122
123 Solaris 11:
124
125 * Solaris 11.3
126 * POSIX.1-2001, SUSv3 (see standards(7))
127 * Using gcc-12 from pkgsrc.org (installed in $GCC12INSTALLDIR)
128 * Set PATH to /usr/xpg6/bin:/usr/xpg4/bin:/usr/bin:$GCC12INSTALLDIR/bin
129 * Set HOST_CC to $GCC12INSTALLDIR/bin/gcc
130 * Set HOST_SH to /usr/bin/bash
131
132 * Solaris 11.4 (CBE)
133 * POSIX.1-2008, SUSv4 (see standards(7))
134 * Using gcc-11
135 * Set PATH to /usr/xpg7/bin:/usr/xpg6/bin:/usr/xpg4/bin:/usr/bin
136 * Set HOST_CC to /usr/bin/gcc
137 * Set HOST_SH to /usr/bin/bash
138
139 * Solaris 11.4 (SRU57)
140 * POSIX.1-2008, SUSv4 (see standards(7))
141 * Using gcc-12
142 * Set PATH to /usr/xpg7/bin:/usr/xpg6/bin:/usr/xpg4/bin:/usr/bin
143 * Set HOST_CC to /usr/bin/gcc
144 * Set HOST_SH to /usr/bin/bash
145