Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[S] media-libs/libplacebo: not compiling w/ bootstrap Clang
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
alecStewart1
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jul 2022
Posts: 148

PostPosted: Sun Oct 13, 2024 3:27 am    Post subject: [S] media-libs/libplacebo: not compiling w/ bootstrap Clang Reply with quote

Hey gang,

I I tried moving to using clang as my compiler (for most things) and I even was able to bootstrap it (with llvm-unwind) and it seems like some libraries aren't quite working the same. Probably because of some environment variables I set in package.env or another env config file.

=media-libs/libplacebo-7.349.0 is one of those. The following error is thrown:

Code:

Header "vulkan/vulkan_core.h" has symbol "VK_VERSION_1_3" with dependency vulkan: NO

../libplacebo-v7.349.0/src/vulkan/meson.build:17:28: ERROR: Feature vulkan cannot be enabled: vulkan.h was not found on the system, nor inside `3rdparty/Vulkan-Headers`. Please run `git submodule update --init` followed by `meson --wipe`.


But...vulkan is installed on my system, and there's a header file at /usr/include/vulkan/vulkan.h. I compile all of the Vulkan libraries and Meson with the bootstrapped Clang/LLVM system, so I don't really know what's happening.

emerge --info

build.log for =media-libs/libplacebo-7.349.0

I didn't compile the vulkan libraries with any LTO which I've found to not always play well with some packages, so I can at least rule that out.


Last edited by alecStewart1 on Sun Oct 13, 2024 3:10 pm; edited 1 time in total
Back to top
View user's profile Send private message
Ionen
Developer
Developer


Joined: 06 Dec 2018
Posts: 2832

PostPosted: Sun Oct 13, 2024 6:37 am    Post subject: Reply with quote

This might have more to say (if not found, search for meson-log.txt, not sure if path is right for you):
/var/tmp/portage/portage/media-libs/libplacebo-7.349.0/work/libplacebo-v7.349.0-abi_x86_32.x86/meson-logs/meson-log.txt

That aside, imo you really are setting too many things -- should reduce, ideally stick to lld with clang (or at least for system-wide), and use wanted default-* USE on clang-common rather than have things like stdlib/rtlib/unwind in LDFLAGS.

fwiw clang19+mold+libplacebo[abi_x86_32] works for me, albeit I haven't tried with your flags.

Just to be sure, you don't have old vulkan headers elsewhere, right? Like in /usr/local. Finding ancient <1.3 headers would fail that test as well.
Back to top
View user's profile Send private message
alecStewart1
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jul 2022
Posts: 148

PostPosted: Sun Oct 13, 2024 1:41 pm    Post subject: Reply with quote

Ionen wrote:

This might have more to say (if not found, search for meson-log.txt, not sure if path is right for you):
/var/tmp/portage/portage/media-libs/libplacebo-7.349.0/work/libplacebo-v7.349.0-abi_x86_32.x86/meson-logs/meson-log.txt


Here's that file. I tried using lld last time I tried to compile libplacebo and it still failed, so that's why it shows lld and the linker used.

Also here's my updated emerge --info after removing some flags and putting some of them in separate files in /etc/portage/env/

Quote:

That aside, imo you really are setting too many things -- should reduce, ideally stick to lld with clang (or at least for system-wide), and use wanted default-* USE on clang-common rather than have things like stdlib/rtlib/unwind in LDFLAGS.


Oh, does the clang-common package take care of the use of the -stdlib=libstdc++ -rtlib=compiler-rt -unwindlib=libunwind linker flags? So the stdlib used will be libstdc++ when needed, the rtlib will be compiler-rt, and llvm-unwind will be used whenever unwinding needs to be done?

Quote:

fwiw clang19+mold+libplacebo[abi_x86_32] works for me, albeit I haven't tried with your flags.


Yea, that sounds about right. :roll:

Quote:

Just to be sure, you don't have old vulkan headers elsewhere, right? Like in /usr/local. Finding ancient <1.3 headers would fail that test as well.


At least for the file vulkan.h this is all that's on my system

Code:

/usr/include/libplacebo/vulkan.h
/usr/include/SDL2/SDL_vulkan.h
/usr/include/libavutil/hwcontext_vulkan.h
/usr/include/vulkan/vulkan.hpp
/usr/include/vulkan/vulkan_handles.hpp
/usr/include/vulkan/vulkan_hash.hpp
/usr/include/vulkan/vulkan_hpp_macros.hpp
/usr/include/vulkan/vulkan.h


EDIT:

Here's my package.env as well. To clarify, I haven't tested if everything in it works. Hopefully the configuration like "with-" and "use-" are clear enough to understand what they do (I tried to make them so for cases like this).
Back to top
View user's profile Send private message
alecStewart1
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jul 2022
Posts: 148

PostPosted: Sun Oct 13, 2024 1:56 pm    Post subject: Reply with quote

Uh, okay, once I stripped away some of my LDFLAGS, it compiled fine.

I'm guessing one of -stdlib=libstdc++ -rtlib=compiler-rt -unwindlib=libunwind -Wl,-z,relro,-z,now was causing the issue.

I still have this question though:

alecStewart1 wrote:

Oh, does the clang-common package take care of the use of the -stdlib=libstdc++ -rtlib=compiler-rt -unwindlib=libunwind linker flags? So the stdlib used will be libstdc++ when needed, the rtlib will be compiler-rt, and llvm-unwind will be used whenever unwinding needs to be done?
Back to top
View user's profile Send private message
Ionen
Developer
Developer


Joined: 06 Dec 2018
Posts: 2832

PostPosted: Sun Oct 13, 2024 2:00 pm    Post subject: Reply with quote

meson-log.txt shows the error, it's being pedantic and error'ing out because of it (thing is that it's compiling C code but being passed an option intended for C++):
Code:
clang: error: argument unused during compilation: '-stdlib=libstdc++' [-Werror,-Wunused-command-line-argument]

And yes, clang-common takes care of these through /etc/clang config files (not added to LDFLAGS itself), e.g. with USE="default-compiler-rt default-lld llvm-libunwind", for libstdc++ it's already the default so there's nothing to set.
Back to top
View user's profile Send private message
alecStewart1
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jul 2022
Posts: 148

PostPosted: Sun Oct 13, 2024 3:11 pm    Post subject: Reply with quote

Ionen wrote:
meson-log.txt shows the error, it's being pedantic and error'ing out because of it (thing is that it's compiling C code but being passed an option intended for C++):
Code:
clang: error: argument unused during compilation: '-stdlib=libstdc++' [-Werror,-Wunused-command-line-argument]

And yes, clang-common takes care of these through /etc/clang config files (not added to LDFLAGS itself), e.g. with USE="default-compiler-rt default-lld llvm-libunwind", for libstdc++ it's already the default so there's nothing to set.


Ah ha. Well, awesome! Thanks for the help.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum