ziglang / zig

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

Building C code for `powerpc-linux-gnueabi(hf)` fails due to duplicate `lgammal` symbol #20376

Open alexrp opened 2 weeks ago

alexrp commented 2 weeks ago

Zig Version

0.13.0

Steps to Reproduce and Observed Behavior

❯ cat test.c
#include <stdio.h>
int main(){printf("hello\n");}
❯ zig cc test.c -target powerpc-linux-gnueabi
<unknown>:0: error: symbol 'lgammal' is already defined

Also happens for powerpc-linux-gnueabihf, but not powerpc-linux-musl.

Expected Behavior

No error.

alexrp commented 6 days ago

Actually, it's also entirely unclear what powerpc-linux-gnueabi(hf) even is. This seems to be a Zig invention; this target triple does not exist in the GNU ecosystem. I don't think glibc even works with the actual PowerPC EABI. The glibc README specifically mentions supporting powerpc-*-linux-gnu (soft/hard float, big endian) only.

Can anyone shed some light on this?

My best guess is that these triples actually are supposed to represent the powerpc-linux-gnu triple, but since there's a desire to distinguish hard/soft float in the triple, gnueabi/gnueabihf were picked as the suffix. Is that the case?