Comments (6)
I hit this same issue when compiling the clock
package (probably just the first one that uses hsc2hs) on the latest ghc-9.4.7 from ghcup. And it's easy to see that the official binary distribution at https://downloads.haskell.org/~ghc/9.4.6/ghc-9.4.6-x86_64-apple-darwin.tar.xz includes wrappers/hsc2hs-ghc-9.4.6
with -no_fixup_chains
.
I tested with newer OSX and it does support that flag, though it's not documented.
So it's probably just that the binary distribution is built on a newer OS version. Since 10.13.6 is out of support, it's not a big surprise. So what you said is essentially correct, but backwards, the flag was added not removed. The workaround does work though, so thanks for that! Eventually I'll have to upgrade the OS though.
from zlib.
For anyone struggling with this: a workaround.
I edited my hsc2hs
executable to remove the --lflag=-Wl,-no_fixup_chains
bit on the end of HSC2HS_EXTRA
I had system-ghc: true
specified so I did this under my .ghcup
others may need to do that under their ~/.stack/programs/
For example, edit ~/.stack/programs/x86_64-osx/ghc-9.4.7/bin/hsc2hs
(or the directory for your version of ghc)
(and edit the HSC2HS_EXTRA line)
from zlib.
Probably my system was broken. Fine after upgrading to macOS 12.
from zlib.
I encountered this recently and am minded to believe that your system was not broken.
At some point in the macos 13.4.* sequence, support for no_fixup_chains
was dropped.
This led to an explicit test in configure: https://gitlab.haskell.org/ghc/ghc/-/commit/a587499c6dc8a7e7e646e9c5f246903a4cc99e56
which was backported to 9.2 and appears in 9.2.8-release (see Feb 7 2023):
https://gitlab.haskell.org/ghc/ghc/-/commits/ghc-9.2.8-release/
However, stack downloads a ghc from
https://downloads.haskell.org/~ghc/9.2.8/ghc-9.2.8-x86_64-apple-darwin.tar.bz2
This ghc does not contain the test; instead hsc2hs includes -no_fixup_chains by default.
┌─[mengwong@solo-8] - [~/tmp/ghc-9.2.8-x86_64-apple-darwin] - [2023-07-07 12:20:43]
└─[130] <> rg no_fixup_chains
wrappers/hsc2hs-ghc-9.2.8
1:HSC2HS_EXTRA="--cflag=--target=x86_64-apple-darwin--lflag=--target=x86_64-apple-darwin --lflag=-Wl,-no_fixup_chains"
Being a n00b it is not clear to me how exactly the apple-darwin tarball of 9.2.8 differs from the source release. Presumably it is in a "half-baked" state specialized for the OS. Perhaps this is where the difficulty arises.
I found that a later tarball for 9.4.5 does contain the test in configure, but not for 9.4.1.
┌─[mengwong@solo-8] - [~/tmp/ghc-9.4.5-x86_64-apple-darwin] - [2023-07-09 12:58:26]
└─[0] <> rg no_fixup_chains
configure
8115: { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ld64 requires -no_fixup_chains" >&5
8116:printf %s "checking whether ld64 requires -no_fixup_chains... " >&6; }
8118: if $CC -o conftest.o -Wl,-no_fixup_chains conftest.c > /dev/null 2>&1
8120: LDFLAGS="-Wl,-no_fixup_chains"
8135: { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ld64 requires -no_fixup_chains" >&5
8136:printf %s "checking whether ld64 requires -no_fixup_chains... " >&6; }
8138: if $CC -o conftest.o -Wl,-no_fixup_chains conftest.c > /dev/null 2>&1
8140: CONF_GCC_LINKER_OPTS_STAGE0="-Wl,-no_fixup_chains"
8155: { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ld64 requires -no_fixup_chains" >&5
8156:printf %s "checking whether ld64 requires -no_fixup_chains... " >&6; }
8158: if $CC -o conftest.o -Wl,-no_fixup_chains conftest.c > /dev/null 2>&1
8160: CONF_GCC_LINKER_OPTS_STAGE1="-Wl,-no_fixup_chains"
8175: { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ld64 requires -no_fixup_chains" >&5
8176:printf %s "checking whether ld64 requires -no_fixup_chains... " >&6; }
8178: if $CC -o conftest.o -Wl,-no_fixup_chains conftest.c > /dev/null 2>&1
8180: CONF_GCC_LINKER_OPTS_STAGE2="-Wl,-no_fixup_chains"
┌─[mengwong@solo-8] - [~/tmp/ghc-9.4.5-x86_64-apple-darwin] - [2023-07-09 12:58:28]
└─[0] <> cd ../ghc-9.4.1-x86_64-apple-darwin
┌─[mengwong@solo-8] - [~/tmp/ghc-9.4.1-x86_64-apple-darwin] - [2023-07-09 12:58:31]
└─[0] <> rg no_fixup_chains
┌─[mengwong@solo-8] - [~/tmp/ghc-9.4.1-x86_64-apple-darwin] - [2023-07-09 12:58:33]
└─[1] <> cd ../ghc-9.2.8-x86_64-apple-darwin
┌─[mengwong@solo-8] - [~/tmp/ghc-9.2.8-x86_64-apple-darwin] - [2023-07-09 12:58:43]
└─[0] <> rg no_fixup_chains
wrappers/hsc2hs-ghc-9.2.8
1:HSC2HS_EXTRA="--cflag=--target=x86_64-apple-darwin--lflag=--target=x86_64-apple-darwin --lflag=-Wl,-no_fixup_chains"
┌─[mengwong@solo-8] - [~/tmp/ghc-9.2.8-x86_64-apple-darwin] - [2023-07-09 12:58:44]
└─[0] <>
from zlib.
@mengwong Is this something that should be reported to the GHC team?
However, then it would be better to have a independent reproducer which could be hard to come by. (E.g. I tried it on the GitHub Action runners but was not successful, see my OP.)
from zlib.
I think it would be better reported to the Stack team specifically, but let's wait for some other poor soul to stumble upon this via Google search, and then they can report that they have independently reproduced the experiment.
Anybody else who is coming to this thread, please log a comment showing what version of Mac OS you're on, what version of stack you're running, and what version of ghc your project is configured with.
from zlib.
Related Issues (20)
- c code bundled in zlib is vulnerable HOT 1
- GHC 8.10.1 support HOT 1
- Upstream error when building with GHC 8.10.2, on Windows 10 HOT 1
- stack fails to build this as a dependency for at least all stackage LTS versions greater than or equals 15.1 HOT 3
- Cannot find foreign library (Ubuntu, with zlib1g-dev installed) HOT 2
- ghc.exe: could not execute: C:/GitLabRunner/builds/2WeHDSFP/0/ghc/ghc/inplace/mingw/bin/ld.exe HOT 1
- Support for bytestring 0.11 HOT 4
- Increase Cabal upper bound to <3.3 HOT 1
- Release version of zlib for GHC 9.0
- [s390x] testsuite fails on Fedora 36 HOT 3
- Support bytestring chunks bigger than 4Gb HOT 2
- unknown symbol `inflateReset' HOT 10
- RLE is useful HOT 1
- tasty-1.5 not accepted HOT 1
- `hsc2hs` not declared as build tool dependency HOT 2
- Drop GHC 6 ? HOT 1
- Enable non-blocking-ffi by default, provide blocking FFI as an option HOT 1
- Potential issue building on Windows HOT 3
- Runtime failure on Windows on version 0.7.0.0 HOT 29
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zlib.