| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | $NetBSD: README.MacOSX,v 1.30 2016/07/14 23:35:05 gdt Exp $ | | 1 | $NetBSD: README.MacOSX,v 1.31 2016/07/15 14:51:16 gdt Exp $ |
2 | | | 2 | |
3 | This file describes the use of current versions of pkgsrc with | | 3 | This file describes the use of current versions of pkgsrc with |
4 | multiple versions of Darwin and OS X, omitting information about previous pkgsrc | | 4 | multiple versions of Darwin and OS X, omitting information about previous pkgsrc |
5 | versions. | | 5 | versions. |
6 | | | 6 | |
7 | * Darwin vs OS X | | 7 | * Darwin vs OS X |
8 | | | 8 | |
9 | (Apple has renamed Mac OS X to OS X, but the filename | | 9 | (Apple has renamed Mac OS X to OS X, but the filename |
10 | remains.) | | 10 | remains.) |
11 | | | 11 | |
12 | OS X consists of Darwin (kernel/userland) plus Mac stuff on top. | | 12 | OS X consists of Darwin (kernel/userland) plus Mac stuff on top. |
13 | pkgsrc used to target Darwin, but given the tools issued discussed | | 13 | pkgsrc used to target Darwin, but given the tools issued discussed |
14 | below it is not clear that it works on Darwin without OS X. Darwin | | 14 | below it is not clear that it works on Darwin without OS X. Darwin |
| @@ -36,61 +36,86 @@ could treat it like a relatively normal | | | @@ -36,61 +36,86 @@ could treat it like a relatively normal |
36 | approximately 10.9, headers were no longer available at the standard | | 36 | approximately 10.9, headers were no longer available at the standard |
37 | location, and one has to use an SDK that puts headers someplace else. | | 37 | location, and one has to use an SDK that puts headers someplace else. |
38 | pkgsrc supports this, but there has been some confusion where a 10.9 | | 38 | pkgsrc supports this, but there has been some confusion where a 10.9 |
39 | system produced binaries for 10.10, which only mostly works. The | | 39 | system produced binaries for 10.10, which only mostly works. The |
40 | confusion is believed to be resolved. | | 40 | confusion is believed to be resolved. |
41 | | | 41 | |
42 | ** gcc vs clang | | 42 | ** gcc vs clang |
43 | | | 43 | |
44 | Older versions of OS X (when XCode is installed) provided gcc, and | | 44 | Older versions of OS X (when XCode is installed) provided gcc, and |
45 | pkgsrc defaulted to using gcc. With 10.9, gcc is no longer present. | | 45 | pkgsrc defaulted to using gcc. With 10.9, gcc is no longer present. |
46 | | | 46 | |
47 | ** i386 vs x86_64 ABI issue | | 47 | ** i386 vs x86_64 ABI issue |
48 | | | 48 | |
| | | 49 | This entire section is only about Intel Macs. |
| | | 50 | |
49 | OS X 10.6 and higher supports x86-64 binaries on Intel Macs with | | 51 | OS X 10.6 and higher supports x86-64 binaries on Intel Macs with |
50 | x86-64 processors, which is now most of them. | | 52 | x86-64 processors, which is now most of them. i386 binaries are also |
| | | 53 | supported on most (all?) Intel machines. |
| | | 54 | |
| | | 55 | *** issues related to ABI 32 vs 64 |
51 | | | 56 | |
52 | This has caused problems with packages which get confused because | | 57 | Note that a pkgsrc package built in x86_64 mode will not run on an |
53 | "MACHINE_ARCH" is in some OS versions set to "i386" (on a 64-bit | | 58 | Intel Mac that is i386 only. For a longer discussion, see: |
54 | system!). | | 59 | http://mail-index.NetBSD.org/pkgsrc-users/2009/09/24/msg010817.html |
| | | 60 | |
| | | 61 | Somewhat separately from pkgsrc's ABI choice, there have been issues |
| | | 62 | with packages which get confused because "MACHINE_ARCH" is in some OS |
| | | 63 | versions set to "i386" (on a 64-bit system!). As of 2016 this should |
| | | 64 | be mostly resolved. |
55 | version: uname -m : uname -p | | 65 | version: uname -m : uname -p |
56 | 10.6: i386 : i386 | | 66 | 10.6: i386 : i386 |
57 | 10.9: x86_64 : i386 | | 67 | 10.9: x86_64 : i386 |
58 | | | 68 | |
59 | On Intel machines, pkgsrc currently defaults to i386 mode (--abi=32) | | 69 | *** default ABI |
60 | on OS X, and can be set to x86_64 mode (--abi=64). | | | |
61 | Note that a pkgsrc build in x86_64 mode will not run on an Intel Mac | | | |
62 | that is i386 only. For a longer discussion, see: | | | |
63 | http://mail-index.NetBSD.org/pkgsrc-users/2009/09/24/msg010817.html | | | |
64 | | | 70 | |
65 | As of 2015-11-09, the default ABI is x86_64 on machines where "uname | | 71 | The ABI is chosen at bootstrap time and encoded into mk.conf. So a |
| | | 72 | change in the default is about what a new bootstrap will do; |
| | | 73 | already-bootstrapped systems should remain unchanged. They should be |
| | | 74 | able to build and run new packages using the old ABI value. |
| | | 75 | |
| | | 76 | pkgsrc used to set the default ABI as i386, both on systems with i386 |
| | | 77 | processors and on systems with x86_64 processors. On 2015-11-09 the |
| | | 78 | default was changed so that ABI=64 is chosen on machines where "uname |
66 | -m" reports x86_64. (It remains i386 on others, which are not capable | | 79 | -m" reports x86_64. (It remains i386 on others, which are not capable |
67 | of running x86_64 binaries.) | | 80 | of running x86_64 binaries.) |
68 | | | 81 | |
69 | *** resolving issues from a change in default ABI | | 82 | Generally, users will not need to deal with the default ABI change, |
| | | 83 | except that packages are mostly only portable across machines with the |
| | | 84 | same bootstrapping parameters. |
| | | 85 | |
| | | 86 | If one unpacks a new binary bootstrap kit over an existing |
| | | 87 | installation, one can end up with a mix. The standard advice is not to |
| | | 88 | do this, and to rrebuild/reinstall all packages from scratch or a |
| | | 89 | compatible binary package set. But, one could also mark packages with |
| | | 90 | the wrong ABI as rebuild=YES and use pkg_rolling-replace. |
| | | 91 | |
| | | 92 | *** change in storage of ABI information |
| | | 93 | |
| | | 94 | On 2016-01-24, the way ABI information was stored in pkgsrc was |
| | | 95 | rationalized and simplified. The new code could compute the wrong ABI |
| | | 96 | for some previously-bootstrapped installations. The problem can be |
| | | 97 | resolved by building bmake with MACHINE_ARCH=x86_64 and updating that |
| | | 98 | package, as described in mail archives: |
70 | | | 99 | |
71 | When the ABI changes from 32 to 64, you can recover without a | | | |
72 | rebootstrap by replacing bmake and pkg_install. See | | | |
73 | https://mail-index.netbsd.org/pkgsrc-users/2016/01/25/msg022870.html | | 100 | https://mail-index.netbsd.org/pkgsrc-users/2016/01/25/msg022870.html |
74 | | | 101 | |
75 | In /usr/pkgsrc/devel/bmake, do: | | 102 | (One would expect to be able to use make replace to do this. One |
76 | # bmake MACHINE_ARCH=x86_64 replace | | 103 | minor issue is that it requires pkg_tarup, although that will be |
77 | and then rerun the failed pkg_add -U with an additional -f. | | 104 | present on systems of those who use make replace. There also may be |
78 | Then, in /usr/pkgsrc/pkgtools/pkg_install, do: | | 105 | an error with architecture mismatch from pkg_install requiring a "-f" |
79 | # bmake replace | | 106 | option. Repeatable data about recovery is somewhat hard to obtain, as |
80 | | | 107 | most are past this issue already and no longer interested in |
81 | Then, rebuild all packages; ABI=32 and ABI=64 packages both work | | 108 | experimenting.) |
82 | individually, but mixing them in a single program via dynamic linking | | | |
83 | will not work. | | | |
84 | | | 109 | |
85 | ** sed in 10.9 | | 110 | ** sed in 10.9 |
86 | | | 111 | |
87 | The sed that comes with 10.9 appears to be broken; it exits when | | 112 | The sed that comes with 10.9 appears to be broken; it exits when |
88 | called on files with UTF-8 or other apparently-binary content. | | 113 | called on files with UTF-8 or other apparently-binary content. |
89 | Therefore, pkgsrc uses nbsed on 10.9. | | 114 | Therefore, pkgsrc uses nbsed on 10.9. |
90 | | | 115 | |
91 | * Developer tools and prerequisites | | 116 | * Developer tools and prerequisites |
92 | | | 117 | |
93 | ** XCode | | 118 | ** XCode |
94 | | | 119 | |
95 | This section applies to 10.6 through 10.10. | | 120 | This section applies to 10.6 through 10.10. |
96 | | | 121 | |