You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/install_and_upgrade.md
+13-6Lines changed: 13 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -115,25 +115,32 @@ If you are on macOS 10.12 (Sierra) and encounter GHC panic while building, see
115
115
this [issue](https://github.com/commercialhaskell/stack/issues/2577)
116
116
117
117
118
-
On Apple silicon chip (`aarch64`/`arm64` architectures), the installation for stack itself or some packages (e.g. `network`) requiring C source compilation might fail with
119
-
`configure: error: C compiler cannot build executables.` in which case you should pass `-arch arm64` as part of
120
-
the `CFLAGS` environment variable, which will be then picked up by the c compiler of your choice.
118
+
On Apple silicon chip (AArch64/ARM64) architectures, the installation of Stack
119
+
or some packages (e.g. `network`) requiring C source compilation might fail with
120
+
`configure: error: C compiler cannot build executables`. In that case you should
121
+
pass `-arch arm64` as part of the `CFLAGS` environment variable. This setting
122
+
will be picked up by the C compiler of your choice.
121
123
122
124
```bash
123
125
# Assuming BASH below
124
126
125
-
# passing CFLAGS in-line with the command involving the error
127
+
# passing CFLAGS in-line with the command giving rise to the error
# NOTE: only do this if you do not have to cross-compile or remember to unset CFLAGS when needed
134
+
# NOTE: only do this if you do not have to cross-compile, or remember to unset
135
+
# CFLAGS when needed
133
136
export CFLAGS="-arch arm64 ${CFLAGS:-}"
134
137
```
135
138
136
-
This instructs the C compiler to compile objects for `arm64`, which would be then successfully linked with the libraries built for `arm64`, otherwise the c compiler, invoked by `cabal` running in `x86_64`, would compile x86_64 objects and attempt to link them with existing arm64 libraries and resulting in the error above.
139
+
The setting instructs the C compiler to compile objects for ARM64. These can
140
+
then be linked with libraries built for ARM64. Without the instruction, the C
141
+
compiler, invoked by Cabal running in x86-64, would compile x86-64 objects and
142
+
attempt to link them with existing ARM64 libraries, resulting in the error
0 commit comments