ziglang / zig

General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.
https://ziglang.org
MIT License
35.26k stars 2.57k forks source link

zig cc segmentation fault on arm 32-bit #5572

Closed streaps closed 4 years ago

streaps commented 4 years ago

zig is such a cool "Powerful Drop-In Replacement for GCC/Clang". Unfortunately it just crashes:

$ ./zig cc -o hello.exe hello.c -target x86_64-windows-gnu
Segmentation fault
$ ./zig cc -o hello hello.c
Segmentation fault

Tested with zig-linux-armv6kz-0.6.0 and zig-linux-armv7a-0.6.0 on Raspbian Buster / Raspberry Pi 2

$ uname -a
Linux raspberrypi 4.19.97-v7+ #1294 SMP Thu Jan 30 13:15:58 GMT 2020 armv7l GNU/Linux

$ ./zig cc --version
clang version 10.0.0 (git@github.com:ziglang/bootstrap.git 62c00a60122563b937203b7fd9ca63e883c8cd4c)
Target: arm-unknown-linux-musleabihf
Thread model: posix
InstalledDir: /usr/bin
FireFox317 commented 4 years ago

Hey @streaps, welcome to Zig!

The binaries on the ziglang website are unfortunately outdated. There have been some patches (#5105, #4910) to solve these issues, so you need the master branch of Zig instead. You can use the zig-boostrap repo to build these binaries for the raspberry PI.

If you need some help, join one of the Zig communities and I can help you over there.

streaps commented 4 years ago

Why are you offering broken versions for download without any warning?

My experience with Zig:

read the blog -> impressed downloaded zig completely non functional

=> waste of time

I'm not wasting more time and energy in trying to bootstrap zig on a raspberry. How do I know this even works?

streaps commented 4 years ago

Btw, zig-bootstrap is at version 0.6.0. Very funny

Version Information
This repository copies sources from upstream, with no patches.
    LLVM 10
    Clang 10
    Zig 0.6.0
FireFox317 commented 4 years ago

Unfortunately we aren't a 100 million revenue company, just a bunch of people interested in a new language and spending their free time on a fun/new/cool project.

There will be bugs and people interested in Zig know this. If you are really interested, please join one of the Zig communities and I will help you figure it out!

Regarding zig-bootstrap, yes it does have Zig 0.6.0 sources in it, but you can just change the zig folder with a master checkout of Zig and that should work.

andrewrk commented 4 years ago

My understanding was that these binaries worked on raspberry pi. If you are getting a segfault, you have discovered a bug. We did test these tarballs on raspberry pis, so there may be some interesting thing happening on your particular system.

If you want to participate in the zig project pre-1.0, you need to understand that you will run into bugs, and help with the development process with positive vibes. If you want the "just works" experience then you should come back when we hit 1.0.

streaps commented 4 years ago

Then maybe it would helo to communicate that better on your website. More honest infos – less hype. Don't tell your users the release version is outdated after theuy downloaded it and wasted their time. Don't assume, just because you are using a version < 1.0, that people just automatically understand that it is alpha quality software. The major version number of a project doesn't tell you anything about the status / release quality of software in general,e.g the zfs tools and kernel modules I use are 0.7.x and 0.8.x and are used by other people in production.

Are you unable to take in user frustration and unable to see your part that lead to the experience?

It's all about positive vibes and hype?

p.s.: I know a programming language is a lot of work, especially good cross platform support. If you are not there yet, nothing wrong with that. It's not happening magically.

kristoff-it commented 4 years ago

Don't assume, just because you are using a version < 1.0, that people just automatically understand that it is alpha quality software.

But that's pretty much the definition of < 1.0 in any reasonable versioning system.

The major version number of a project doesn't tell you anything about the status / release quality of software in general,e.g the zfs tools and kernel modules I use are 0.7.x and 0.8.x and are used by other people in production.

It does. Some people decide to deploy in prod unstable releases, that's up to them.

It's all about positive vibes and hype?

Don't forget that nobody owes you free software. Generally speaking, maintaining a positive attitude is a cheap and good way to convince others to do work for you. Do you want to cross-compile stuff more easily or do you want to offer advice on how to do better copywriting? In the first case, I recommend positivity; in the second, I recommend a dedicated issue with examples and links to resources. If you're just venting frustration, you just lost the game.

Xe commented 4 years ago

What are the contents of hello.c so we can try to replicate this issue?