Fix race for X509 store found by thread sanitizer
[openssl.git] / Configurations / 00-base-templates.conf
index edc176241e18f9781e477985e9c6377c374ed1aa..55da5ec56c20045483c575402964e18a742ade6c 100644 (file)
@@ -14,9 +14,6 @@ my %targets=(
        thread_scheme   => "(unknown)", # Assume we don't know
        thread_defines  => [],
 
-       padlock_asm_src => "",
-       keccak1600_asm_src      => "keccak1600.c",
-
        unistd          => "<unistd.h>",
        shared_target   => "",
        shared_cflag    => "",
@@ -30,8 +27,8 @@ my %targets=(
        build_scheme    => [ "unified", "unix" ],
        build_file      => "Makefile",
 
-       AR              => "ar",
-       ARFLAGS         => "r",
+       AR              => "(unused)",
+       ARFLAGS         => "(unused)",
        CC              => "cc",
        HASHBANGPERL    => "/usr/bin/env perl",
        RANLIB          => sub { which("$config{cross_compile_prefix}ranlib")
@@ -50,16 +47,24 @@ my %targets=(
 
        defines         =>
            sub {
-                my @defs = ();
+                my @defs = ( 'OPENSSL_BUILDING_OPENSSL' );
+                push @defs, "BROTLI" unless $disabled{brotli};
+                push @defs, "BROTLI_SHARED" unless $disabled{"brotli-dynamic"};
                 push @defs, "ZLIB" unless $disabled{zlib};
                 push @defs, "ZLIB_SHARED" unless $disabled{"zlib-dynamic"};
+                push @defs, "ZSTD" unless $disabled{zstd};
+                push @defs, "ZSTD_SHARED" unless $disabled{"zstd-dynamic"};
                 return [ @defs ];
             },
         includes        =>
             sub {
                 my @incs = ();
+                push @incs, $withargs{brotli_include}
+                    if !$disabled{brotli} && $withargs{brotli_include};
                 push @incs, $withargs{zlib_include}
                     if !$disabled{zlib} && $withargs{zlib_include};
+                push @incs, $withargs{zstd_include}
+                    if !$disabled{zstd} && $withargs{zstd_include};
                 return [ @incs ];
             },
     },
@@ -69,14 +74,29 @@ my %targets=(
         template        => 1,
 
         AR              => "ar",
-        ARFLAGS         => "r",
+        ARFLAGS         => "qc",
         CC              => "cc",
         lflags          =>
-            sub { $withargs{zlib_lib} ? "-L".$withargs{zlib_lib} : () },
+            sub {
+                my @libs = ();
+                push(@libs, "-L".$withargs{zlib_lib}) if $withargs{zlib_lib};
+                push(@libs, "-L".$withargs{brotli_lib}) if $withargs{brotli_lib};
+                push(@libs, "-L".$withargs{zstd_lib}) if $withargs{zstd_lib};
+                return join(" ", @libs);
+            },
         ex_libs         =>
-            sub { !defined($disabled{zlib})
-                  && defined($disabled{"zlib-dynamic"})
-                  ? "-lz" : () },
+            sub {
+                my @libs = ();
+                push(@libs, "-lz") if !defined($disabled{zlib}) && defined($disabled{"zlib-dynamic"});
+                if (!defined($disabled{brotli}) && defined($disabled{"brotli-dynamic"})) {
+                    push(@libs, "-lbrotlienc");
+                    push(@libs, "-lbrotlidec");
+                    push(@libs, "-lbrotlicommon");
+                    push(@libs, "-lm");
+                }
+                push(@libs, "-lzstd") if !defined($disabled{zstd}) && defined($disabled{"zstd-dynamic"});
+                return join(" ", @libs);
+            },
         HASHBANGPERL    => "/usr/bin/env perl", # Only Unix actually cares
         RANLIB          => sub { which("$config{cross_compile_prefix}ranlib")
                                      ? "ranlib" : "" },
@@ -103,22 +123,31 @@ my %targets=(
             },
         ex_libs         =>
             sub {
+                my @libs = ();
                 unless ($disabled{zlib}) {
                     if (defined($disabled{"zlib-dynamic"})) {
-                        return $withargs{zlib_lib} // "ZLIB1";
+                        push(@libs, $withargs{zlib_lib} // "ZLIB1");
+                    }
+                }
+                unless ($disabled{zstd}) {
+                    if (defined($disabled{"zstd-dynamic"})) {
+                        push(@libs, $withargs{zstd_lib} // "libzstd");
+                    }
+                }
+                unless ($disabled{brotli}) {
+                    if (defined($disabled{"brotli-dynamic"})) {
+                        my $path = "";
+                        if (defined($withargs{brotli_lib})) {
+                            $path = $withargs{brotli_lib} . "\\";
+                        }
+                        push(@libs, $path . "brotlicommon.lib");
+                        push(@libs, $path . "brotlidec.lib");
+                        push(@libs, $path . "brotlienc.lib");
                     }
                 }
-                return ();
+                return join(" ", @libs);
             },
 
-        LD              => "link",
-        LDFLAGS         => "/nologo",
-        ldoutflag       => "/out:",
-        AR              => "lib",
-        ARFLAGS         => "/nologo",
-        aroutflag       => "/out:",
-        RC               => "rc",
-        rcoutflag        => "/fo",
         MT              => "mt",
         MTFLAGS         => "-nologo",
         mtinflag        => "-manifest ",
@@ -149,64 +178,4 @@ my %targets=(
 
         perl_platform    => 'VMS',
     },
-
-    x86_asm => {
-       template        => 1,
-       padlock_asm_src => "e_padlock-x86.s",
-    },
-    x86_elf_asm => {
-       template        => 1,
-       inherit_from    => [ "x86_asm" ],
-    },
-    x86_64_asm => {
-       template        => 1,
-       padlock_asm_src => "e_padlock-x86_64.s",
-       keccak1600_asm_src      => "keccak1600-x86_64.s",
-    },
-    ia64_asm => {
-       template        => 1,
-    },
-    sparcv9_asm => {
-       template        => 1,
-    },
-    sparcv8_asm => {
-       template        => 1,
-    },
-    alpha_asm => {
-       template        => 1,
-    },
-    mips32_asm => {
-       template        => 1,
-    },
-    mips64_asm => {
-       inherit_from    => [ "mips32_asm" ],
-       template        => 1,
-    },
-    s390x_asm => {
-       template        => 1,
-       keccak1600_asm_src      => "keccak1600-s390x.S",
-    },
-    armv4_asm => {
-       template        => 1,
-       keccak1600_asm_src      => "keccak1600-armv4.S",
-    },
-    aarch64_asm => {
-       template        => 1,
-       keccak1600_asm_src      => "keccak1600-armv8.S",
-    },
-    parisc11_asm => {
-       template        => 1,
-    },
-    parisc20_64_asm => {
-       template        => 1,
-       inherit_from    => [ "parisc11_asm" ],
-    },
-    ppc32_asm => {
-       template        => 1,
-    },
-    ppc64_asm => {
-       inherit_from    => [ "ppc32_asm" ],
-       template        => 1,
-       keccak1600_asm_src      => "keccak1600-ppc64.s",
-    },
 );