On 6/16/18 5:50 PM, Dimitry Andric wrote:
On 16 Jun 2018, at 16:57, Kurt Lidl <l...@pix.net> wrote:

On 6/11/18 4:42 AM, Dimitry Andric wrote:
Author: dim
Date: Mon Jun 11 08:42:03 2018
New Revision: 334947
URL: https://svnweb.freebsd.org/changeset/base/334947
Log:
   Disable building aesni with base gcc
      Because base gcc does not support the required intrinsics, do not
   attempt to compile the aesni module with it.
      Noticed by:       Dan Allen <danalle...@gmail.com>
   MFC after:   3 days
Modified:
   head/sys/modules/Makefile
Modified: head/sys/modules/Makefile
==============================================================================
--- head/sys/modules/Makefile   Mon Jun 11 08:11:35 2018        (r334946)
+++ head/sys/modules/Makefile   Mon Jun 11 08:42:03 2018        (r334947)
@@ -627,7 +627,9 @@ _aac=               aac
  _aacraid=     aacraid
  _acpi=                acpi
  .if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
+.if ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} > 40201
  _aesni=               aesni
+.endif
  .endif
  _amd_ecc_inject=amd_ecc_inject
  _amdsbwd=     amdsbwd

I thought that FreeBSD's base gcc (but not a stock 4.2.1 gcc) had support for 
this.  As documented in UPDATING:

20130903:
  AES-NI intrinsic support has been added to gcc.  The AES-NI module
  has been updated to use this support.  A new gcc is required to build
  the aesni module on both i386 and amd64.

It didn't work for the original reporter on freebsd-stable@ here:

https://lists.freebsd.org/pipermail/freebsd-stable/2018-May/089026.html

and for me it still gives:

$ make -C /usr/src/sys/modules/aesni
gcc -c -O3 -pipe -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -I. 
-I/usr/src/sys -fno-common -mno-mmx -mno-sse -msoft-float -ffreestanding 
-fwrapv -fstack-protector -Wall -Wredundant-decls -Wnested-externs 
-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual 
-Wundef -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs 
-fdiagnostics-show-option -Wno-unknown-pragmas -Wno-uninitialized 
-finline-limit=8000 -fms-extensions --param inline-unit-growth=100 --param 
large-function-growth=1000 -mno-align-long-strings -mpreferred-stack-boundary=2 
-std=iso9899:1999 -Werror   -mmmx -msse -msse4 -maes -mpclmul 
/usr/src/sys/crypto/aesni/aesni_ghash.c
cc1: error: unrecognized command line option "-msse4"
cc1: error: unrecognized command line option "-mpclmul"
*** Error code 1

Those unrecognized flags were added more than 3 years ago, in r275732,
so I assume this has been broken since that time.  Maybe nobody built
any kernels with gcc for 3 years? :)

Looking at the reported problem, I see that the user is attempting to make this work on a Pentium-4 (ie, 32bit) machine. Which doesn't have any of the CPU support needed for the AES code to work anyway. I'm pretty sure that the AES stuff didn't exist on any of the 32 bit CPUs.

So, whether or not the compiler could compile the code or not, that CPU isn't going to be able to execute it.

Thanks everyone for your comments and looking into the issue.

-Kurt
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to