[OpenSSL-3.0LTS] sun2/m68000 arch - enable-fips's curve25519.c build fail

Issue #383 resolved
Takehiko NOZAKI repo owner created an issue
/var/tmp//ccl3ExgV.s: Assembler messages:
/var/tmp//ccl3ExgV.s:22938: Error: value of -69860 too large for field of 2 bytes at 69860
/var/tmp//ccl3ExgV.s:24873: Error: value of -75418 too large for field of 2 bytes at 75418
/var/tmp//ccl3ExgV.s:24978: Error: value of -75710 too large for field of 2 bytes at 75710
/var/tmp//ccl3ExgV.s:25007: Error: value of -75784 too large for field of 2 bytes at 75784

*** Failed target:  crypto/ec/libfips-lib-curve25519.o
*** Failed command: m68010--netbsdelf-gcc --sysroot=/home/tnozaki/obj.sun2/usr/src/destdir.sun2 -I. -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../../../dist -I../../../dist/crypto -I../../../dist/include -I../../../dist/providers/implementations/include -I../../../dist/providers/common/include -DFIPS_MODULE -fPIC -pthread -Wall -O3 -DB_ENDIAN -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -D_THREAD_SAFE -D_REENTRANT -DOPENSSL_BUILDING_OPENSSL -DNDEBUG -MMD -MF crypto/ec/libfips-lib-curve25519.d.tmp -MT crypto/ec/libfips-lib-curve25519.o -c -o crypto/ec/libfips-lib-curve25519.o ../../../dist/crypto/ec/curve25519.c

Comments (6)

  1. Takehiko NOZAKI reporter

    m68010+gcc optimization -O3(BSD release build’s default) and -fPIC problem?

    error occured following function:

    • ossl_ed25519_verify
    • ossl_ed25519_public_from_private
    • ossl_x25519
    • ossl_x25519_public_from_private

    and following asm code is generated and got error.

      22935 ossl_ed25519_verify:
      22936         link.w %fp,#-3140
      22937         movem.l #16188,-(%sp)
      22938         lea (%pc, _GLOBAL_OFFSET_TABLE_@GOTPC), %a5
    ...
      24870 ossl_ed25519_public_from_private:
      24871         link.w %fp,#-376
      24872         movem.l #14396,-(%sp)
      24873         lea (%pc, _GLOBAL_OFFSET_TABLE_@GOTPC), %a5
    ...
      24974 ossl_x25519:
      24975         link.w %fp,#0
      24976         move.l %a5,-(%sp)
      24977         move.l %d2,-(%sp)
      24978         lea (%pc, _GLOBAL_OFFSET_TABLE_@GOTPC), %a5
    ...
      25004 ossl_x25519_public_from_private:
      25005         link.w %fp,#-312
      25006         movem.l #52,-(%sp)
      25007         lea (%pc, _GLOBAL_OFFSET_TABLE_@GOTPC), %a5
    

  2. Takehiko NOZAKI reporter

    in the first place N/sun2 arch don’t build shared library(due to m68010 restriction?), -fPIC is completely useless.

  3. Takehiko NOZAKI reporter

    change N**-m68000 configuration target as following:

    diff --git a/crypto/external/apache2/openssl/dist/Configurations/10-main.conf b/crypto/external/apache2/openssl/dist/Configurations/10-main.conf
    index c7d8c1037f..cf20abccae 100644
    --- a/crypto/external/apache2/openssl/dist/Configurations/10-main.conf
    +++ b/crypto/external/apache2/openssl/dist/Configurations/10-main.conf
    @@ -1963,7 +1963,17 @@ my %targets = (
             inherit_from     => [ "BSD-x86-elf" ],
         },
         "NetBSD-m68000" => {
    -        inherit_from     => [ "BSD-generic32" ],
    +        inherit_from     => [ "BASE_unix" ],
    +        CC               => "cc",
    +        CFLAGS           => picker(default => "-Wall",
    +                                   debug   => "-O0 -g",
    +                                   release => "-O3"),
    +        cflags           => threads("-pthread"),
    +        cppflags         => threads("-D_THREAD_SAFE -D_REENTRANT"),
    +        ex_libs          => add(threads("-pthread")),
    +        enable           => add("devcryptoeng"),
    +        bn_ops           => "BN_LLONG",
    +        thread_scheme    => "pthreads",
             lib_cppflags     => "-DB_ENDIAN",
         },
         "NetBSD-m68k" => {
    

    don’t inherit BSD-generic32 and disabled to build shared library.

  4. Log in to comment