Repository navigation
Limit SHA-NI compiler flags to implementation - #320
dajiaohuang wants to merge 3 commits into
Conversation
|
Thank you for the patch. Trying to compile it on my Intel Atom D525 and FreeBSD 14.5 the compilation ends with the following error: |
|
Thank you for the build report. I reproduced the same four undefined SHA-NI references on Linux at the previous PR head. The shared-library recipe compiled all source files in one invocation, so the new per-object flags were never applied there. The update compiles the shared SHA-NI implementation as a separate PIC object with its ISA flags, while leaving the other sources on baseline flags. Enabled and disabled SHA-NI configurations now pass static/shared library tests and all 26 full CLI groups on Linux/GCC 13.3. I have not run the FreeBSD 14.5 / Atom environment or BSD make; please treat that original-platform validation as outstanding. |
No worries, that's why I'm here for :) I ran into a different error this time but have also included the complete build.log if you need it. EDIT: Attach didn't seem to work for me so I put the build log here -> https://bpa.st/raw/S3PQ And just for completeness in case you wondered, I create the FreeBSD patches by creating a diff between tag v1.4.6 and the commit in question. I unpack the original source, apply the patch and use FreeBSD's mechanism to produce Ports patches from it which then goes into /usr/ports/security/rhash/files. I then build the port as usual. And yes, I clean out the patches from my previous attempts first. :) Regards |
|
Thanks for testing the follow-up on FreeBSD and sharing the log. It exposed a BSD make difference in the new The updated shared-library build, static/shared library tests, and all 26 CLI groups pass on Linux/GCC 13.3 with SHA-NI enabled. I still cannot run FreeBSD 14.5 / Atom or BSD make here. Could you retry the same Ports build against this head and let me know whether it completes? |
a14f302 compiles with no errors. Complete build log attached for the record. Regards |
|
Thanks for rerunning the FreeBSD Ports build and sharing the full log. I updated the PR description to record your successful FreeBSD 14.5 / Intel Atom D525 result at this head. |
Keep runtime SHA-NI dispatch enabled while applying
-msse4 -mshaonly to the SHA-NI implementation. Baseline objects retain their ordinary compiler flags, so enabling runtime dispatch does not require every CPU to support those instructions.Fixes #312.
The shared-library build compiles
sha_ni.cas a separate position-independent object with the SHA-NI flags. This fixes the earlier undefined SHA-NI references. The current head also fixes the reported BSD make recipe by namingsha_ni.cexplicitly; the prior recipe expanded$<to an empty source argument.Validation on Linux x86-64 / GCC 13.3:
nmfinds no unresolved SHA-NI functions in the enabled shared library. Disassembly shows no SHA-NI instructions in the baseline dispatch object and the expected instructions in the implementation objects.External validation: the original reporter confirmed the FreeBSD 14.5 / Intel Atom D525 Ports build completes at this head; the complete build log is attached in the reporter's PR comment. I did not run this environment locally.