View previous topic :: View next topic |
Author |
Message |
hedmo Veteran
Joined: 29 Aug 2009 Posts: 1331 Location: sweden
|
Posted: Sun Feb 04, 2024 8:37 am Post subject: |
|
|
update :
sys-kernel/gentoo-sources-6.7.x with nouveau GSP works now . i have update my my overlay : https://github.com/hedmo/hedmos-overlay.git
with media-libs/mesa 23 and unkeyworded 24 versions . feel free to test . mesa-24 will fail with multilib support because of some gentoo related "i think" issues (
Code: |
../mesa-24.0.0/src/nouveau/compiler/meson.build:7: WARNING: add_languages is missing native:, assuming languages are wanted for both host and build.
Compiler for language rust for the build machine not found.
../mesa-24.0.0/src/nouveau/compiler/meson.build:7:0: ERROR: Rust compiler rustc -C linker=x86_64-pc-linux-gnu-gcc -C link-arg=-m32 -C link-arg=-mfpmath=sse cannot compile programs.
|
) that i cannot manage to solve by my self. |
|
Back to top |
|
|
mblnx n00b
Joined: 04 Mar 2008 Posts: 17
|
Posted: Thu Feb 29, 2024 5:01 am Post subject: |
|
|
I believe someone figured out this one (I got interested again today since I saw the announcement that NVK is now fully compliant with vulkan 1.3)
This is the relevant part:
Code: |
if use vulkan; then
vulkan_enable video_cards_lavapipe swrast
vulkan_enable video_cards_freedreno freedreno
vulkan_enable video_cards_intel intel intel_hasvk
vulkan_enable video_cards_d3d12 microsoft-experimental
vulkan_enable video_cards_radeonsi amd
vulkan_enable video_cards_v3d broadcom
if use video_cards_nouveau; then
vulkan_enable video_cards_nouveau nouveau-experimental
echo -e "[properties]\nrust_args = ['--target=\"${rust_abi}\"']\n\n[binaries]\nrust = 'rustc'" > "${T}/rust_fix.ini"
emesonargs+=(
--force-fallback-for=syn
--native-file="${T}"/rust_fix.ini
)
fi
fi
|
Source -> https://github.com/MrDuartePT/mrduarte-ebuilds/blob/master/media-libs/mesa/mesa-24.0.1.ebuild
That code didn't work directly for me, I tried two versions:
Code: |
echo -e "[binaries]\nrust = ['rustc']\n\n[built-in options]\nrust_args=['--target=$(rust_abi)']" > "${T}/rust_fix.ini"
echo -e "[binaries]\nrust = ['rustc','--target=$(rust_abi)']\n" > "${T}/rust_fix.ini"
|
The second one worked to get past the configuration but hit an issue around proc macros version.
proc macros on rust must be on the same ABI as the compiler (in our case x64), but the second version forces it to be compiled as 32 bits.
Trying to work on that one now
Note 1:
After looking into it more, it seem like the problem has to do with how the meson eclass behaves and what rust requires:
When compiling for multilib, meson is using native compilers for 32 bits. Rust only installs a 64 bit compiler with a 32 bit target.
That build fails, because all the targets are built for 32 bit, but the rust compiler requires a 64 bit proc macro.
Proc macros are run/executed by the host compiler and, as such, they should match the compiler ABI. |
|
Back to top |
|
|
hedmo Veteran
Joined: 29 Aug 2009 Posts: 1331 Location: sweden
|
|
Back to top |
|
|
mblnx n00b
Joined: 04 Mar 2008 Posts: 17
|
Posted: Fri Mar 01, 2024 6:03 pm Post subject: |
|
|
\o/
I don't even know what would be the right way to fix the issue, the way Gentoo compiles x86 components in a multilib systems isn't usually cross compiling, but fully using the native compiler for that target. Rust doesn't have the native compiler and it runs into cross compiler issues because meson doesn't know it is cross compiling.
I gave up trying to generate a meson.ini file and just hacked it afterwards, as it worked out fine.
Not the ideal solution, but I tried to make it as generic as possible. |
|
Back to top |
|
|
2bc4 n00b
Joined: 13 Mar 2024 Posts: 3
|
Posted: Wed Mar 13, 2024 8:13 pm Post subject: |
|
|
Thanks mblnx!
You may want to add dev-util/bindgen to the dependencies, it failed to build for me without it.
Code: | Program bindgen found: NO
../mesa-9999/src/nouveau/compiler/meson.build:59:23: ERROR: Program 'bindgen' not found or not executable
|
|
|
Back to top |
|
|
mblnx n00b
Joined: 04 Mar 2008 Posts: 17
|
Posted: Wed Mar 13, 2024 8:24 pm Post subject: |
|
|
2bc4 wrote: | Thanks mblnx!
You may want to add dev-util/bindgen to the dependencies, it failed to build for me without it.
Code: | Program bindgen found: NO
../mesa-9999/src/nouveau/compiler/meson.build:59:23: ERROR: Program 'bindgen' not found or not executable
|
|
Do you have cbindgen installed too? I remember I had to add it to a previous version of the ebuild I had (there have been some updates from gentoo related to llvm, I guess that one isn't in my version any longer)
Edit: I have added both of them as build dependencies, I should probably have rust added in there too now that I think about it.... |
|
Back to top |
|
|
2bc4 n00b
Joined: 13 Mar 2024 Posts: 3
|
Posted: Wed Mar 13, 2024 8:33 pm Post subject: |
|
|
I did have cbindgen installed at the time (I use firefox and that pulls it in)
mblnx wrote: | Edit: I have added both of them as build dependencies, I should probably have rust added in there too now that I think about it.... |
Thank you! |
|
Back to top |
|
|
2bc4 n00b
Joined: 13 Mar 2024 Posts: 3
|
Posted: Sat Mar 16, 2024 11:20 am Post subject: |
|
|
Another thing, if you use the latest version of meson (1.4.0) with multilib the build will fail with:
Code: | /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: src/nouveau/compiler/libnak_ir_proc.so: error adding
symbols: file in wrong format
collect2: error: ld returned 1 exit status |
Issue already reported to meson: https://github.com/mesonbuild/meson/issues/12973
May want to cap the meson version to 1.3.2 in the ebuild if possible for now. |
|
Back to top |
|
|
mblnx n00b
Joined: 04 Mar 2008 Posts: 17
|
Posted: Thu Mar 21, 2024 9:20 pm Post subject: |
|
|
2bc4 wrote: | Another thing, if you use the latest version of meson (1.4.0) with multilib the build will fail with:
Code: | /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: src/nouveau/compiler/libnak_ir_proc.so: error adding
symbols: file in wrong format
collect2: error: ld returned 1 exit status |
Issue already reported to meson: https://github.com/mesonbuild/meson/issues/12973
May want to cap the meson version to 1.3.2 in the ebuild if possible for now. |
This is kind of the same issue I had to work around, except meson is also now trying to link it somewhere else.
As it is in unstable, I won't modify the ebuild for now as I will have to modify it again once the bug is solved, eventually. |
|
Back to top |
|
|
mblnx n00b
Joined: 04 Mar 2008 Posts: 17
|
Posted: Wed Apr 24, 2024 11:38 pm Post subject: |
|
|
A new rust crate was added paste-1.0.14
The ebuild has been updated. |
|
Back to top |
|
|
Mrduarte n00b
Joined: 26 Jul 2022 Posts: 6
|
Posted: Wed May 08, 2024 9:56 pm Post subject: |
|
|
mblnx wrote: | I believe someone figured out this one (I got interested again today since I saw the announcement that NVK is now fully compliant with vulkan 1.3)
This is the relevant part:
Code: |
if use vulkan; then
vulkan_enable video_cards_lavapipe swrast
vulkan_enable video_cards_freedreno freedreno
vulkan_enable video_cards_intel intel intel_hasvk
vulkan_enable video_cards_d3d12 microsoft-experimental
vulkan_enable video_cards_radeonsi amd
vulkan_enable video_cards_v3d broadcom
if use video_cards_nouveau; then
vulkan_enable video_cards_nouveau nouveau-experimental
echo -e "[properties]\nrust_args = ['--target=\"${rust_abi}\"']\n\n[binaries]\nrust = 'rustc'" > "${T}/rust_fix.ini"
emesonargs+=(
--force-fallback-for=syn
--native-file="${T}"/rust_fix.ini
)
fi
fi
|
Source -> https://github.com/MrDuartePT/mrduarte-ebuilds/blob/master/media-libs/mesa/mesa-24.0.1.ebuild
That code didn't work directly for me, I tried two versions:
Code: |
echo -e "[binaries]\nrust = ['rustc']\n\n[built-in options]\nrust_args=['--target=$(rust_abi)']" > "${T}/rust_fix.ini"
echo -e "[binaries]\nrust = ['rustc','--target=$(rust_abi)']\n" > "${T}/rust_fix.ini"
|
The second one worked to get past the configuration but hit an issue around proc macros version.
proc macros on rust must be on the same ABI as the compiler (in our case x64), but the second version forces it to be compiled as 32 bits.
Trying to work on that one now
Note 1:
After looking into it more, it seem like the problem has to do with how the meson eclass behaves and what rust requires:
When compiling for multilib, meson is using native compilers for 32 bits. Rust only installs a 64 bit compiler with a 32 bit target.
That build fails, because all the targets are built for 32 bit, but the rust compiler requires a 64 bit proc macro.
Proc macros are run/executed by the host compiler and, as such, they should match the compiler ABI. |
I’m the guy that made that ebuild with the help of the mantainer of mb-overlay, and today was merged into gentoo repos nvk support: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b0dfc07d460383e694939048199ea032b7a2d31e |
|
Back to top |
|
|
mblnx n00b
Joined: 04 Mar 2008 Posts: 17
|
Posted: Thu May 09, 2024 12:48 am Post subject: |
|
|
[quote="Mrduarte"] mblnx wrote: | I believe someone figured out this one (I got interested again today since I saw the announcement that NVK is now fully compliant with vulkan 1.3)
|
Oh nice, if you originally posted something about this on freedesktop.org (about not managing to compile), after reading it that I decided to come back and fix the ebuild.
My latest one (couple days ago?) has the meson fix too as it was driving me nuts. |
|
Back to top |
|
|
|