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

cc-wrapper: Fix for prebuilt android #97387

Merged
merged 5 commits into from Sep 9, 2020

Conversation

Ericson2314
Copy link
Member

@Ericson2314 Ericson2314 commented Sep 7, 2020

Motivation for this change

We don't want to use Nix-built GCC's libs with prebuilt clang in this case.

CC @bkchr & @matthewbauer

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

We don't want to use Nix-built GCC's libs with prebuilt clang in this
case.
@bkchr
Copy link
Contributor

bkchr commented Sep 8, 2020

@Ericson2314 did you tried this?

I still get the following error:

unpacking sources
patching sources
installing
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/q3wdzrk9vran5mzzd9pcqyl43i1d90zw-aarch64-unknown-linux-android-ndk-gcc-binutils-wrapper-
patching script interpreter paths in /nix/store/q3wdzrk9vran5mzzd9pcqyl43i1d90zw-aarch64-unknown-linux-android-ndk-gcc-binutils-wrapper-
checking for references to /build/ in /nix/store/q3wdzrk9vran5mzzd9pcqyl43i1d90zw-aarch64-unknown-linux-android-ndk-gcc-binutils-wrapper-...
substituteStream(): WARNING: pattern '
' doesn't match anything in file '/nix/store/q3wdzrk9vran5mzzd9pcqyl43i1d90zw-aarch64-unknown-linux-android-ndk-gcc-binutils-wrapper-/nix-support/libc-ldflags'
building '/nix/store/i3hxsq3awwvam4pl95hc3iw4cn8dppr0-stdenv-linux.drv'...
building '/nix/store/ai01wnlh8g40phl3h378dil3x3z1y84a-hello-2.10-aarch64-unknown-linux-android.drv'...
unpacking sources
unpacking source archive /nix/store/3x7dwzq014bblazs7kq20p9hyzz0qh8g-hello-2.10.tar.gz
source root is hello-2.10
setting SOURCE_DATE_EPOCH to timestamp 1416139241 of file hello-2.10/ChangeLog
patching sources
updateAutotoolsGnuConfigScriptsPhase
Updating Autotools / GNU config script to a newer upstream version: ./build-aux/config.sub
Updating Autotools / GNU config script to a newer upstream version: ./build-aux/config.guess
configuring
configure flags: --disable-dependency-tracking --prefix=/nix/store/s15p212cw9kjyy6m8klshd1rzcilnbc8-hello-2.10-aarch64-unknown-linux-android --build=x86_64-unknown-linux-gnu --host=aarch64-unknown-linux-android
checking for a BSD-compatible install... /nix/store/2f6zzvixj3wsj81flbdcpc6fdscgx4ai-coreutils-8.31/bin/install -c
checking whether build environment is sane... yes
checking for aarch64-unknown-linux-android-strip... aarch64-unknown-linux-android-strip
checking for a thread-safe mkdir -p... /nix/store/2f6zzvixj3wsj81flbdcpc6fdscgx4ai-coreutils-8.31/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for aarch64-unknown-linux-android-gcc... aarch64-unknown-linux-android-clang
checking whether the C compiler works... no
configure: error: in `/build/hello-2.10':
configure: error: C compiler cannot create executables
See `config.log' for more details
builder for '/nix/store/ai01wnlh8g40phl3h378dil3x3z1y84a-hello-2.10-aarch64-unknown-linux-android.drv' failed with exit code 77
cannot build derivation '/nix/store/dfy133728wcyf0ghmkiz356jjzv2ff8q-shell.drv': 1 dependencies couldn't be built
error: build of '/nix/store/dfy133728wcyf0ghmkiz356jjzv2ff8q-shell.drv' failed

Or is this something different?

074bc78 evidently meant to do this, but
forgot.
We just need jdk for this script that helps set up toolchains. The
script might need to know about the target platform, but the interpreter
that runs it (or part of it) doesn't.
@Ericson2314
Copy link
Member Author

Oops!! I fixed the thing I found, but forgot to do the end-to-end test 😳. Did that now, fixed the problem (version number in lib/systems/examples.nix), and also cleaned up a few other things.

@Ericson2314 Ericson2314 merged commit 5fd2750 into NixOS:master Sep 9, 2020
@Ericson2314 Ericson2314 deleted the fix-android-prebuilt branch September 9, 2020 01:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants