Implement riscv_vlen_asm for riscv32
[openssl.git] / util / mkdef.pl
index 3207040e257ef428acd97912a50238e4a477b699..309f908b3eadb13c5943d5a82e29b1cc2f4c52ee 100755 (executable)
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2018-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2018-2024 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -29,6 +29,7 @@ my $name = undef;               # internal library/module name
 my $ordinals_file = undef;      # the ordinals file to use
 my $version = undef;            # the version to use for the library
 my $OS = undef;                 # the operating system family
+my $type = 'lib';               # either lib or dso
 my $verbose = 0;
 my $ctest = 0;
 my $debug = 0;
@@ -40,6 +41,7 @@ GetOptions('name=s'     => \$name,
            'ordinals=s' => \$ordinals_file,
            'version=s'  => \$version,
            'OS=s'       => \$OS,
+           'type=s'     => \$type,
            'ctest'      => \$ctest,
            'verbose'    => \$verbose,
            # For VMS
@@ -48,6 +50,8 @@ GetOptions('name=s'     => \$name,
 
 die "Please supply arguments\n"
     unless $name && $ordinals_file && $OS;
+die "--type argument must be equal to 'lib' or 'dso'"
+    if $type ne 'lib' && $type ne 'dso';
 
 # When building a "variant" shared library, with a custom SONAME, also customize
 # all the symbol versions.  This produces a shared object that can coexist
@@ -85,7 +89,7 @@ die "Please supply arguments\n"
 #  0x0000000000000001 (NEEDED)             Shared library: [libcrypto-opt.so.1.1]
 #  0x000000000000000e (SONAME)             Library soname: [libssl-opt.so.1.1]
 #
-# We case-fold the variant tag to upper case and replace all non-alnum
+# We case-fold the variant tag to uppercase and replace all non-alnum
 # characters with "_".  This yields the following symbol versions:
 #
 # $ nm libcrypto.so | grep -w A
@@ -101,7 +105,7 @@ die "Please supply arguments\n"
 #
 (my $SO_VARIANT = uc($target{"shlib_variant"} // '')) =~ s/\W/_/g;
 
-my $libname = platform->sharedname($name);
+my $libname = $type eq 'lib' ? platform->sharedname($name) : platform->dsoname($name);
 
 my %OS_data = (
     solaris     => { writer     => \&writer_linux,
@@ -113,6 +117,7 @@ my %OS_data = (
     aix         => { writer     => \&writer_aix,
                      sort       => sorter_unix(),
                      platforms  => { UNIX                       => 1 } },
+    "aix-solib" => 'aix',       # alias
     VMS         => { writer     => \&writer_VMS,
                      sort       => OpenSSL::Ordinals::by_number(),
                      platforms  => { VMS                        => 1 } },