-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Build fails on fedora30+ (CPU features miss-detected) #812
Comments
Thanks @kwizart. Interesting in a morbid sort of way... I use Fedora 29 as my primary workstation, and we specifically test using Fedora's build flags. The symptom is the following taken from the task 33066120 build.log:
The makefile should be adding But I can't seem to reproduce it using Fedora flags:
The There's something unusual here, though. From the build log the order is a tad bit incorrect:
The Crypto++ makefile builds in a specific order due to Static Initialization Order Fiasco:
Where can I find the contents of the GNUmakefile you are using? |
The makefile tries to pre-qualify NEON (for lack of a better term), and sets IS_NEON accordingly. If IS_NEON=1, then we go on to perform test compiles to see if -mfloat-abi=X -mfpu=neon (and friends) actually work. Effectively we are performing a test to see if we should perform another test. The IS_NEON flag predates our compile time feature tests. It was kind of helpful when we were trying to sort out if a platform and compiler options supported NEON without a compile test. That was an absolute mess and we quickly learned we needed a real compile time feature test (which we now have). Additionally, Debian and Fedora ARMEL builds are failing because we are misdetecting NEON availability. It looks like we fail to set IS_NEON properly, so we never get into the code paths that set either (1) -mfloat-abi=X -mfpu=neon or (2) -DCRYPTOPP_DISABLE_NEON or -DCRYPTOPP_DISABLE_ASM. Later, the makefile builds a *_simd.cpp and the result is an error that NEON needs to be activated (or disabled). This commit removes IS_NEON so we immediately move to compile time feature tests.
I believe an underlying ARMEL issue was cleared at Commit 84ab1f3c66a5. But I am not sure if it will help Fedora becuase it appears a different makefile is being used. |
Seems most arches are now fixed but aarch64. About https://www.cryptopp.com/wiki/Static_Initialization_Order_Fiasco |
From the 33100407 build log, it looks like we have another mis-detection. The first is actually
Here's what it looks like when working as expected. Notice the addition of
So it looks like we are not setting
Later we use it to add the appropriate flags in GNUmakefile. Something like this:
And I cannot duplicate it on two dev-boards, gcc117 or gcc118 from the compile farm. But I don't believe any of the machines are running Fedora. What does
No. It means we (Crypto++) needs to build and link the objects in a specific order to avoid initialization problems. |
What does
I'm testing with export CXXFLAGS instead of passing flags with For aarch64 I now have |
Yeah, you usually don't want this when running make:
That says, don't use project
Usually you want this:
That allows us to add to your
So I think you should use:
You actually tickled a bug in our Makefile. I've known about it for several years, but I never addressed it. The problem is, we don't build correctly when make is invoked like below because make overrides the flags we would add.
Here's the reason it happens. It is our default recipe:
This is what we should be doing. It is textbook Stallman from the GNU Make manual:
Now it does not matter how you invoke make. Things just work for you. And it follows Stallman's freedom philosophy. The user's Since someone tickled it in the field I am going to get it fixed. |
Okay I think I got it:
I'm testing with using ZOPT='' instead because it overrides our default CXXFLAGS in an incompatible way. |
For testing features only, we remove
We use The reason we remove some options during feature testing is, we use a clean compile as the gate. If there is any noise then we fail the feature. This is needed for some compilers like SunCC on Solaris and IBM XL C/C++ on AIX. Those compilers don't return When we build the library (as opposed to a feature test) we use your full |
As done with others tests. This will avoid a miss-detection of aarch64 features when using flags such as _FORTIFY_SOURCE that needs to be filtered for testing This fixes weidai11#812 Signed-off-by: Nicolas Chauvet <kwizart@gmail.com>
Ok, using ZOPT='' cleared the issue, the build are optimized (even on aarch64). Okay I've understood the idea about the test flags. I've found the root cause. |
As done with others tests. This will avoid a miss-detection of aarch64 features when using flags such as _FORTIFY_SOURCE that needs to be filtered for testing This fixes weidai11#812 V2: Fix all cases Signed-off-by: Nicolas Chauvet <kwizart@gmail.com>
As done with others tests. This will avoid a miss-detection of aarch64 features when using flags such as _FORTIFY_SOURCE that needs to be filtered for testing This fixes #812 V2: Fix all cases Signed-off-by: Nicolas Chauvet <kwizart@gmail.com>
Thanks @kwizart. Man, was I wrong about this:
Sorry about that. |
Here is a related commit for the PR you just made: Commit 08b9e21e5a43. I don't believe you need it since it applies to |
Using Fedora 30, I cannot update to cryptopp 8.0.0/8.1.0
Seems like CPU features are miss-detected as I cannot see any ASM_FLAGS been used in "some" cases.
Build attempt for f31,f29, f28
https://koji.fedoraproject.org/koji/taskinfo?taskID=33066081
https://koji.fedoraproject.org/koji/taskinfo?taskID=33066857
https://koji.fedoraproject.org/koji/taskinfo?taskID=33067570
I'm using the default GNUMake files to build using:
%make_build -f GNUmakefile
CXXFLAGS="-DNDEBUG %{optflags} -fPIC -DPIC"
LDFLAGS="%{?__global_ldflags}"
shared cryptest.exe
The text was updated successfully, but these errors were encountered: