Skip to content

zig cc unable to build hello-world for target s390x-linux-gnu #21076

Closed

Description

@bjia56

Zig Version

0.14.0-dev.1052+d6f997259

Steps to Reproduce and Observed Behavior

$ cat test.c
#include <stdio.h>

int main() {
    printf("Hello world!");
}
$ ./zig-linux-x86_64-0.14.0-dev.1052+d6f997259/zig cc -target s390x-linux-gnu.2.19 test.c -o test
error: sub-compilation of glibc crti.o failed
    note: unable to check cache: stat file 'zig-linux-x86_64-0.14.0-dev.1052+d6f997259/lib/libc/glibc/sysdeps/crti.S' failed: FileNotFound
error: unable to build glibc CRT file: SubCompilationFailed
error: sub-compilation of glibc crtn.o failed
    note: unable to check cache: stat file 'zig-linux-x86_64-0.14.0-dev.1052+d6f997259/lib/libc/glibc/sysdeps/crtn.S' failed: FileNotFound
error: sub-compilation of glibc Scrt1.o failed
    note: unable to check cache: stat file 'zig-linux-x86_64-0.14.0-dev.1052+d6f997259/lib/libc/glibc/sysdeps/start-2.33.S' failed: FileNotFound
$ ./zig-linux-x86_64-0.14.0-dev.1052+d6f997259/zig cc -target s390x-linux-gnu test.c -o test
/home/brettjia/.cache/zig/o/b6158625386ad44943fac58bc9e70c2f/m.s:4025:1: error: symbol 'lgammal' is already defined
lgammal:
^

Expected Behavior

Compilation succeeds.

Activity

  1. added
    bug
    on Aug 14, 2024
  2. rootbeer commented on Aug 14, 2024

    @rootbeer
    Contributor

    Reproduced.

    Changing the target glibc version changes the error a bit. A more recent glibc just has the lgammal error:

    $ zig cc -target s390x-linux-gnu.2.29 hello.c -o hello
    /home/pat/projects/ziglang/zig-global-cache/o/562e59d6889be0dcc813888297ac739a/m.s:4041:1: error: symbol 'lgammal' is already defined
    lgammal:
    ^
    $
    

    Depending on your goals, as a work-around the Musl targets seem to work fine:

    $ zig  cc -target s390x-linux-musl hello.c -o hello
    $
    
  3. alexrp commented on Aug 14, 2024

    @alexrp
    Member

    See also #20376.

  4. added
    zig cc
    on Aug 15, 2024
  5. added this to the unplanned milestone on Aug 15, 2024
  6. modified the milestones: unplanned, 0.14.0 on Sep 6, 2024
  7. added
    arch-s390x
    on Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    arch-s390xbugzig cc

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions