-
Notifications
You must be signed in to change notification settings - Fork 447
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
Add -mbmi flag to Abseil for GCC versions greater than 14. #4638
Conversation
This is quite weird. The BMI (bit manipulation instructions) seems to have been introduced in Intel Haswell. While that is 11 years old now, there are definitely computers running older HW still present around. I would expect GCC to be able lower the builtin to something else without the |
This is quite confusing. There is a GCC issue saying this builtin ( |
Also, GCC 14 is not yet released officially. I don't think we should be testing with it. Are we using a released version of Fedora? |
Yep, fedora 40 is shipping unreleased GCC version. Too bad abseil does not have any way to override the check. |
Not clear why only fedora gives this error -- the default target for gcc on most machines is generic x86_64 (ie, no additional extensions over what was in the original), so it would not be using or requiring bmi instructions before. Has something changed with abseil such that it does thing with shorts that weren't being done before? We use |
It could be the CI infrastructure changing. I can add a flag that this is only added with GCC >14 and some checks. First, I need to get this to work at all. |
4170c5d
to
2c18b8b
Compare
I do not understand how changing the flags for Abseil can cause |
3c4151c
to
40c7e7d
Compare
This PR is ready now. The fix to the failing uBPF programs is in #4644. |
@fruffy This smells like a mainline bug. Not sure where, actually. But maybe start with Abseil? |
abseil/abseil-cpp#1664 but unclear whether things will be resolved there. |
Thanks! Yes, let's see what is there. IIRC |
cmake/Abseil.cmake
Outdated
@@ -53,7 +53,10 @@ macro(p4c_obtain_abseil) | |||
# Do not suppress warnings for Abseil library targets that are aliased. | |||
get_target_property(target_type ${target} TYPE) | |||
if (NOT ${target_type} STREQUAL "INTERFACE_LIBRARY") | |||
set_target_properties(${target} PROPERTIES COMPILE_FLAGS "-Wno-error -w") | |||
if (CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 14) | |||
target_compile_options(${target} PUBLIC "-march=native") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a cmake warning there? This could produce surprise incompatibilities in the binary. And it might not be that far in future before someone tries to build a release binary with GCC 14.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also it might be good to reference the abseil issue in a comment here. Hopefully we will be able to remove this hack in future.
#4643 make me think about this a bit more. I suggest enabling just the minimal set of flags (i.e. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me now. I just suggest a minor extension of the warning.
Co-authored-by: Vladimír Štill <[email protected]>
No description provided.