Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

detect an endless loop when trying to detect native libc installation #4936

Merged
merged 1 commit into from Apr 4, 2020

Conversation

@andrewrk
Copy link
Member

@andrewrk andrewrk commented Apr 4, 2020

closes #4810

closes #4810
@andrewrk
Copy link
Member Author

@andrewrk andrewrk commented Apr 4, 2020

Tested by applying this diff:

--- a/src/target.cpp
+++ b/src/target.cpp
@@ -1158,7 +1158,7 @@ static const AvailableLibC libcs_available[] = {
     {ZigLLVM_sparc, OsLinux, ZigLLVM_GNU},
     {ZigLLVM_sparcv9, OsLinux, ZigLLVM_GNU},
     {ZigLLVM_wasm32, OsFreestanding, ZigLLVM_Musl},
-    {ZigLLVM_x86_64, OsLinux, ZigLLVM_GNU},
     {ZigLLVM_x86_64, OsLinux, ZigLLVM_GNUX32},
     {ZigLLVM_x86_64, OsLinux, ZigLLVM_Musl},
     {ZigLLVM_x86_64, OsWindows, ZigLLVM_GNU},

And then doing the following:

andy@ark:~/tmp$ cat zigcc
#!/bin/sh
/home/andy/dev/zig/build/zig cc $@
andy@ark:~/tmp$ export CC="$HOME/tmp/zigcc"
andy@ark:~/tmp$ $CC -o hello hello.c
Zig attempted to find the path to native system libc headers by executing this command:
/home/andy/tmp/zigcc -E -Wp,-v -xc /dev/null
Output:
==========
Unable to link against libc: Unable to find libc installation: Zig was not provided with libc installation information, and so it does not know where the libc paths are on the system. Zig attempted to use the system C compiler to find out where the libc paths are, but discovered that Zig is being used as the system C compiler.
See `zig libc --help` for more details.

==========
Unable to link against libc: Unable to find libc installation: libc runtime not found
See `zig libc --help` for more details.
@andrewrk andrewrk merged commit e5d479b into master Apr 4, 2020
4 checks passed
4 checks passed
builds.sr.ht: freebsd.yml builds.sr.ht job completed successfully
Details
continuous-integration/drone/pr Build is passing
Details
continuous-integration/drone/push Build is passing
Details
ziglang.zig #20200404.18 succeeded
Details
@andrewrk andrewrk deleted the detect-zig-cc-loop branch Apr 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

1 participant
You can’t perform that action at this time.