-
Notifications
You must be signed in to change notification settings - Fork 262
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
Can't build as static OR shared in Haiku (OS) #294
Comments
@victroniko, actually we don't have any architecture support for Haiku OS., see https://github.com/google/cpu_features#whats-supported. Since for older processors we have to get the processor information from the OS, that's why you get errors like undefined reference to I added test commit 7badfd0 and all works fine: tested on Haiku x86 32 bit via VirtualBox probably for old processors we can get info via sysinfo: also, in CMakeLists cc: @gchatelet, @Mizux |
Thank you for looking into this. Yes I know Haiku isn't supported... yet :) The x86 variant is mantained mainly for binary compatibility with old BeOS 5.x, so things there are less than ideal for modern code. I was building on Haiku x86_64 (sorry I should've absolutely mentioned that!), as I believe it's the most sensible choice re: future support, codebase etc. I tried anyway to build the test commit on x86_64, and it went further - list_cpu_features now compiles fine. But as expected, final linking fails with a bunch of x86-specific (?) undefined refs. Below is a full build log from haikuporter (Haiku's tool for building packages, similar to Gentoo portage). |
@victroniko, yes, it fails because I added test commit just to check list_cpu_features without testing.
About x86, no matter what architecture x86 or x86_64 is the same code in cpu_features. I didn't use BeOS compatibility using gcc 2.95 (need to change code to support the compiler), I used the I added haiku_x86 impl file to tests and disabled OS specific tests (484a951) and it works |
I can confirm it now builds (as stand-alone) correctly on Haiku x86_64. Still requires a bit more massaging to install succesfully. This is what happens if we follow install instructions as-is:
This doesn't work because Haiku system-dirs are read only: installed packages are mounted on boot then "overlayed" on top of FS. So at install step we have to use a path-abstraction variable along with (edit. There is To make a crude example, this is the resulting package built with As can be seen everything after Here is an example for working with Haiku's path-abstractions in C/C++, hope this helps. Now I'm off to test if it builds as submodule of VOLK... |
@victroniko, according to the haiku cli documentation and os discussion, we can install them to refs: Added install path c8e5e09 if(CMAKE_SYSTEM_NAME MATCHES "Haiku")
set(CMAKE_INSTALL_LIBDIR ~/config/non-packaged/lib)
set(CMAKE_INSTALL_BINDIR ~/config/non-packaged/bin)
set(CMAKE_INSTALL_INCLUDEDIR ~/config/non-packaged/include)
endif() cc: @Mizux |
@gchatelet, what do you think, can we try to add support Haiku OS? |
I was about to reply. It would be nice to support Haiku OS but only if we can have a CI machine. @Mizux ? |
Like for FreeBSD ci we could use a Vagrant box to perform a build: note: At least we could have the Vagrant file and we could run it from time to time as best/community effort support... cpu_features/cmake/ci/Makefile Lines 72 to 73 in a6bf4f9
cpu_features/cmake/ci/Makefile Line 224 in a6bf4f9
https://github.com/google/cpu_features/blob/main/cmake/ci/vagrant/freebsd/Vagrantfile |
Hello, I'm trying to build the VOLK libraries on Haiku (operating system). VOLK uses
cpu_features
as a submodule, I want/need to do a shared build but it doesn't work.To isolate the problem I'm trying to build
cpu_features
alone. It seems no matter how I force it, explicitly using -DBUILD_SHARED_LIBS=ON and -DBUILD_PIC=ON args or even directly fumbling with those in CMakeLists.txt (ugly!) result is the same:The reason to try a shared build is because the static one also doesn't build:
In both cases, list_cpu_features is the culprit. I'm stuck about how to properly approach this. Do I "disable" said command as recommended here, and build shared anyway? Or is there something to possibly do in
cpu_features
side that'll enable a correct static build?FYI, version of things in Haiku are as follows: cmake 3.24.2-1, gcc 11.2.0, binutils 2.31.1-2
Any help will be appreciated :)
The text was updated successfully, but these errors were encountered: