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

gcc: fix libgccjit cross #217874

Closed
wants to merge 3 commits into from
Closed

gcc: fix libgccjit cross #217874

wants to merge 3 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Feb 23, 2023

Description of changes

Before this commit, pkgsCross.*.libgccjit would fail to build for two reasons:

  1. Apparently --enable-lang=jit requires --enable-plugin, but the configury is unaware of this requirement. The failure mode is difficult to diagnose; the build fails with a compile error due to <dlfcn.h> not being included.

  2. libcCross and threadsCross were not being passed to libgccjit in all-packages.nix. These are boilerplate parameters that are repeated several times in all-packages.nix, so at some point we should probably make them default arguments of gcc/${version}/default.nix.

This commit fixes the two problems above, respectively, by:

  1. Adding an assert to check for the unsupported combination and provide feedback at eval time.

  2. Passing the missing parameters.

Things done
  • Built on platform(s)
    • aarch64-linux (pkgsCross.aarch64.libgccjit on x86_64-linux)

@ofborg ofborg bot added the 6.topic: cross-compilation Building packages on a different platform than they will be used on label Feb 23, 2023
@ghost
Copy link
Author

ghost commented Feb 23, 2023

@ofborg build pkgsCross.aarch64-multiplatform.libgccjit

@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels Feb 23, 2023
@ghost
Copy link
Author

ghost commented Feb 24, 2023

Hrm, apparently this only works for gcc>=11, so it will have to wait for #209870

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/emacs-overlay-gives-architecture-compiler-version-and-macos-mismatch-warnings/26197/2

@ameyp
Copy link

ameyp commented Jun 1, 2023

@amjoseph-nixpkgs #209870 has been merged, any chance you could pick this back up?

@ghost
Copy link
Author

ghost commented Jun 15, 2023

@ofborg build pkgsCross.aarch64-multiplatform.libgccjit

@ghost
Copy link
Author

ghost commented Jun 15, 2023

Latest push should work. apparently not quite there yet.

The patch needs to go upstream first, and there's some minor cleanup to do.

@ofborg build pkgsCross.aarch64-multiplatform.libgccjit

@ofborg ofborg bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Jun 28, 2023
Adam Joseph added 3 commits July 1, 2023 13:22
Before this commit, `pkgsCross.*.libgccjit` would fail to build.
Apparently `--enable-lang=jit` requires `--enable-plugin`, but the
configury is unaware of this requirement.  The failure mode is
difficult to diagnose; the build fails with a compile error due to
`<dlfcn.h>` not being included.

This commit adds `enablePlugin=true` and an `assert` to check for
the unsupported combination and provide feedback at eval time.
Before this commit, `pkgsCross.*.libgccjit` would fail because
libcCross and threadsCross were not being passed to libgccjit in
all-packages.nix.  These are boilerplate parameters that are
repeated several times in all-packages.nix, so at some point we
should probably make them default arguments of
gcc/${version}/default.nix.

This commit fixes the problem by passing the missing parameters.
This patch needs to go upstream.  Also the logic around
autoreconfHook needs to be cleaned up; we should try to
autoreconfHook whenever possible (basically everywhere except xgcc)
but I need to work out exactly how to do that.
@ghost
Copy link
Author

ghost commented Jul 1, 2023

Fixed merge conflict.

@ofborg ofborg bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Jul 1, 2023
@ghost ghost closed this Jan 23, 2024
@ghost ghost deleted the pr/libgccjit/cross branch January 23, 2024 06:48
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: cross-compilation Building packages on a different platform than they will be used on 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants