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

perl: Work around cross-compilation issue with gcc 7 #35529

Merged
merged 1 commit into from Feb 25, 2018

Conversation

shlevy
Copy link
Member

@shlevy shlevy commented Feb 25, 2018

No description provided.

nativeBuildInputs = [ buildPackages.stdenv.cc ];
# Hacky! But not sure how else we can access a native-targeted gcc6
# https://github.com/arsv/perl-cross/issues/60
nativeBuildInputs = [ buildPackages.buildPackages.gcc6 ];
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ericson2314 can we do better than this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

depsBuildBuild = [ buildPackages.stdenv.cc ]; I think, though I'm still not sure in cross stuff.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is at least what we do in (some) other cases when a build needs to compile stuff to use it during the build already.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vcunat That's what was here, but I specifically need gcc6

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't see depsBuildBuild here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, right, it was nativeBuildInputs. But even putting in depsBuildBuild, simple buildPackages.gcc6 gives me a cross-compiler, I need the double buildPackages (which seems wrong).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's surprising to me. It might be a bug in the implementation, docs, or my understanding...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK #35543 should now explain everything, but the short answer is this should be

depsBuildBuild = [ gcc6 ];

which, after elaborating the effect of callPackage splicing, is equivalentl to

depsBuildBuild = [ buildPackages.buildPackages.gcc6 ];

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Partial log (click to expand)

/nix/store/s029gmjpgvm776wfb56naqny9qja9339-perl-5.24.3

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Partial log (click to expand)

/nix/store/g1naqig0jxakwmf8688d95xfm8xch4dm-perl-5.24.3

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Partial log (click to expand)

/nix/store/zdy8xlih8znc7kkgdwhsih504hy8c8w0-perl-5.24.3

@shlevy shlevy merged commit 168b131 into NixOS:master Feb 25, 2018
@shlevy shlevy deleted the perl-gcc6-cross branch February 25, 2018 13:24
@dtzWill
Copy link
Member

dtzWill commented Feb 25, 2018

FWIW I can confirm the segfault behavior occurred on aarch64-musl as well (with gcc7) and that this fix resolved the problem. Thanks!

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

5 participants