Coder Social home page Coder Social logo

Segfault during configuring about ghc-musl HOT 8 CLOSED

nnmm avatar nnmm commented on May 31, 2024
Segfault during configuring

from ghc-musl.

Comments (8)

benz0li avatar benz0li commented on May 31, 2024

@nnmm Maybe benz0li/ghc-musl#1 (comment) and the following posts have the answer you are looking for.

from ghc-musl.

benz0li avatar benz0li commented on May 31, 2024

IMHO ld-options: -static -pthread should be sufficient.

@nnmm See also jgm/pandoc#9068 for a similar case.

from ghc-musl.

nnmm avatar nnmm commented on May 31, 2024

@benz0li Thanks for your comment. I don't think I'm doing anything all that different from what is suggested in these threads.

I've uploaded a minimal reproducer here: https://github.com/nnmm/stack-musl-repro - I've also tried using a package.yaml instead of a cabal file, but the result is the same (segfault during configuring).

from ghc-musl.

benz0li avatar benz0li commented on May 31, 2024

On a host with docker installed

docker run --rm -ti glcr.b-data.ch/ghc/ghc-musl:9.8.2 bash

Inside the container

cd /var/tmp/ \
  && git clone https://github.com/nnmm/stack-musl-repro.git \
  && cd stack-musl-repro \
  && cabal build \
  && file /var/tmp/stack-musl-repro/dist-newstyle/build/x86_64-linux/ghc-9.8.2/repro-0.1.0.0/x/repro/build/repro/repro

output:

Cloning into 'stack-musl-repro'...
remote: Enumerating objects: 6, done.
remote: Counting objects: 100% (6/6), done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 6 (delta 0), reused 6 (delta 0), pack-reused 0
Receiving objects: 100% (6/6), done.
Config file path source is default config file.
Config file not found: /root/.config/cabal/config
Writing default configuration to /root/.config/cabal/config
Warning: The package list for 'hackage.haskell.org' does not exist. Run 'cabal
update' to download it.
Resolving dependencies...
Build profile: -w ghc-9.8.2 -O1
In order, the following will be built (use -v for more details):
 - repro-0.1.0.0 (exe:repro) (first run)
Configuring executable 'repro' for repro-0.1.0.0..
Warning: The 'license-file' field refers to the file 'LICENSE' which does not
exist.
Preprocessing executable 'repro' for repro-0.1.0.0..
Building executable 'repro' for repro-0.1.0.0..
[1 of 1] Compiling Main             ( app/Main.hs, /var/tmp/stack-musl-repro/dist-newstyle/build/x86_64-linux/ghc-9.8.2/repro-0.1.0.0/x/repro/build/repro/repro-tmp/Main.o )
[2 of 2] Linking /var/tmp/stack-musl-repro/dist-newstyle/build/x86_64-linux/ghc-9.8.2/repro-0.1.0.0/x/repro/build/repro/repro
/var/tmp/stack-musl-repro/dist-newstyle/build/x86_64-linux/ghc-9.8.2/repro-0.1.0.0/x/repro/build/repro/repro: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, BuildID[sha1]=ea4b874dedbf8d2efd08f79aedc237e10c465def, with debug_info, not stripped

👉 statically linked

from ghc-musl.

benz0li avatar benz0li commented on May 31, 2024

You may try the following stack.yaml:

flags: {}
packages:
- '.'
resolver: lts-22.7
# This enables static linking, so that there are no libc problems with the Debian server
docker:
  enable: true
  image: quay.io/benz0li/ghc-musl:9.6.4

from ghc-musl.

nnmm avatar nnmm commented on May 31, 2024

@benz0li That works, thanks so much! Seems like the conclusion is that I should have been looking at https://github.com/benz0li/ghc-musl instead of this repo :)

from ghc-musl.

nnmm avatar nnmm commented on May 31, 2024

That is, the configuring error is gone - there is still a linker error. But I can create a separate issue for that if needed.

from ghc-musl.

benz0li avatar benz0li commented on May 31, 2024

That is, the configuring error is gone - there is still a linker error. But I can create a separate issue for that if needed.

@nnmm You may create an issue at https://github.com/benz0li/ghc-musl.

If possible: Use a Dev Container so it can be easily reproduced.

from ghc-musl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.