Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build libxcrypt. #162

Closed
wants to merge 16 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 9 additions & 0 deletions chevah_build
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ set -o pipefail

PYTHON_BUILD_VERSION="2.7.18"
LIBFFI_VERSION="3.2.1"
LIBXCRYPT_VERSION="4.4.17"
ZLIB_VERSION="1.2.11"
BZIP2_VERSION="1.0.8"
# We statically build the BSD libedit on selected platforms to get the
Expand Down Expand Up @@ -58,6 +59,7 @@ PYTHON_PACKAGE_VERSION="$(git rev-parse --short=7 HEAD)"

# Export the variables needed by the chevahbs scripts and the test phase.
export PYTHON_BUILD_VERSION PYTHON_PACKAGE_VERSION REDISTRIBUTABLE_VERSION
export BUILD_LIBXCRYPT="no"
export BUILD_ZLIB="no"
export BUILD_BZIP2="yes"
export BUILD_LIBEDIT="yes"
Expand Down Expand Up @@ -286,6 +288,7 @@ case $OS in
export MAKE="make"
# Build as portable as possible, only glibc 2.x should be needed.
export BUILD_LIBFFI="yes"
export BUILD_LIBXCRYPT="yes"
export BUILD_ZLIB="yes"
export BUILD_LIBEDIT="no"
# Generic Linux might be an old distro with OpenSSL 0.9.8 libraries.
Expand Down Expand Up @@ -456,6 +459,12 @@ command_build() {
(>&2 echo "Skip building LIBFFI!")
fi

if [ "$BUILD_LIBXCRYPT" = "yes" ]; then
build 'libxcrypt' "libxcrypt-$LIBXCRYPT_VERSION" ${PYTHON_BUILD_FOLDER}
else
(>&2 echo "Skip building LIBXCRYPT!")
fi

if [ "$BUILD_ZLIB" = "yes" ]; then
build 'zlib' "zlib-$ZLIB_VERSION" ${PYTHON_BUILD_FOLDER}
else
Expand Down
3 changes: 2 additions & 1 deletion external_deps.csv
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ OpenSSL⁶,"1.0.2v-chevah2 (statically linked with stdlib “ssl”)
1.1.1g (bundled with upstream cryptography 2.9.1)","1.1.1m (statically linked with stdlib “ssl”)
1.1.1m (statically linked with cryptography)","1.1.1m (statically linked with stdlib “ssl”)
1.1.1m (statically linked with cryptography)","1.1.1m (statically linked with stdlib “ssl”)
1.1.1m (statically linked with cryptography)",1.1.1c FIPS,"1.1.1m (statically linked with stdlib “ssl”)
1.1.1m (statically linked with cryptography)","1.1.1cFIPS /
1.1.1k FIPS","1.1.1m (statically linked with stdlib “ssl”)
1.1.1m (statically linked with cryptography)","1.1.1m (statically linked with stdlib “ssl”)
1.1.1m (statically linked with cryptography)",1.0.2n (from upstream Oracle patches),1.0.0x,1.0.1h,"
1.0.2o","1.1.1m (statically linked with stdlib “ssl”)
Expand Down
576 changes: 247 additions & 329 deletions external_deps.fods

Large diffs are not rendered by default.

27 changes: 27 additions & 0 deletions src/libxcrypt/chevahbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bash
#
# Chevah Build Script for libxcrypt.

# Import shared code.
. ./functions.sh


chevahbs_configure() {
execute ./autogen.sh
CONF_OPTS="--enable-static --enable-hashes=glibc"
execute ./configure --prefix="" $CONF_OPTS
}


chevahbs_compile() {
execute $MAKE
}


chevahbs_install() {
install_folder=$1
execute $MAKE install DESTDIR=$INSTALL_FOLDER
}


select_chevahbs_command $@
195 changes: 195 additions & 0 deletions src/libxcrypt/force_perl_510.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@
diff --git a/build-aux/scripts/BuildCommon.pm b/build-aux/scripts/BuildCommon.pm
index 0e6f2a31..94153db2 100644
--- a/build-aux/scripts/BuildCommon.pm
+++ b/build-aux/scripts/BuildCommon.pm
@@ -7,7 +7,7 @@

package BuildCommon;

-use v5.14; # implicit use strict, use feature ':5.14'
+use strict; # implicit use strict, use feature ':5.14'
use warnings FATAL => 'all';
use utf8;
use open qw(:utf8);
diff --git a/build-aux/scripts/check-perlcritic-config b/build-aux/scripts/check-perlcritic-config
index 54b458f1..556be290 100755
--- a/build-aux/scripts/check-perlcritic-config
+++ b/build-aux/scripts/check-perlcritic-config
@@ -18,7 +18,7 @@
# Ideally this would be a perlcritic policy itself, so it would get
# run on any invocation of perlcritic, not just on 'make distcheck'.

-use v5.14; # implicit use strict, use feature ':5.14'
+use strict; # implicit use strict, use feature ':5.14'
use warnings FATAL => 'all';
use utf8;
use open qw(:std :utf8);
diff --git a/build-aux/scripts/compute-symver-floor b/build-aux/scripts/compute-symver-floor
index 4ec82e10..eebdeb00 100644
--- a/build-aux/scripts/compute-symver-floor
+++ b/build-aux/scripts/compute-symver-floor
@@ -9,7 +9,7 @@
# Process libcrypt.minver and determine the minumum symbol version to
# use for compatibility symbols. Called from configure.ac.

-use v5.14; # implicit use strict, use feature ':5.14'
+use strict; # implicit use strict, use feature ':5.14'
use warnings FATAL => 'all';
use utf8;
use open qw(:std :utf8);
diff --git a/build-aux/scripts/expand-selected-hashes b/build-aux/scripts/expand-selected-hashes
index 10d0bcc5..f13a5bac 100644
--- a/build-aux/scripts/expand-selected-hashes
+++ b/build-aux/scripts/expand-selected-hashes
@@ -14,7 +14,7 @@
# Caution: if you change the format of lib/hashes.conf you will
# probably need to modify gen-crypt-hashes-h as well as this script.

-use v5.14; # implicit use strict, use feature ':5.14'
+use strict; # implicit use strict, use feature ':5.14'
use warnings FATAL => 'all';
use utf8;
use open qw(:std :utf8);
diff --git a/build-aux/scripts/gen-crypt-h b/build-aux/scripts/gen-crypt-h
index 12aecf6d..3710c70f 100644
--- a/build-aux/scripts/gen-crypt-h
+++ b/build-aux/scripts/gen-crypt-h
@@ -8,7 +8,7 @@

# Generate (x)crypt.h from (x)crypt.h.in.

-use v5.14; # implicit use strict, use feature ':5.14'
+use strict; # implicit use strict, use feature ':5.14'
use warnings FATAL => 'all';
use utf8;
use open qw(:std :utf8);
diff --git a/build-aux/scripts/gen-crypt-hashes-h b/build-aux/scripts/gen-crypt-hashes-h
index 056eceb1..a1c55f9d 100644
--- a/build-aux/scripts/gen-crypt-hashes-h
+++ b/build-aux/scripts/gen-crypt-hashes-h
@@ -12,7 +12,7 @@
# Caution: if you change the format of lib/hashes.conf you will
# probably need to modify expand-selected-hashes as well as this script.

-use v5.14; # implicit use strict, use feature ':5.14'
+use strict; # implicit use strict, use feature ':5.14'
use warnings FATAL => 'all';
use utf8;
use open qw(:std :utf8);
diff --git a/build-aux/scripts/gen-crypt-symbol-vers-h b/build-aux/scripts/gen-crypt-symbol-vers-h
index d5ee15e0..5f00e804 100644
--- a/build-aux/scripts/gen-crypt-symbol-vers-h
+++ b/build-aux/scripts/gen-crypt-symbol-vers-h
@@ -16,7 +16,7 @@
# Note: we currently don't support compatibility symbols that need
# a different definition from the default version.

-use v5.14; # implicit use strict, use feature ':5.14'
+use strict; # implicit use strict, use feature ':5.14'
use warnings FATAL => 'all';
use utf8;
use open qw(:std :utf8);
diff --git a/build-aux/scripts/gen-libcrypt-map b/build-aux/scripts/gen-libcrypt-map
index ef57a409..a9b1c6d7 100644
--- a/build-aux/scripts/gen-libcrypt-map
+++ b/build-aux/scripts/gen-libcrypt-map
@@ -10,7 +10,7 @@
# See libcrypt.map.in for an explanation of the format of .map.in
# files.

-use v5.14; # implicit use strict, use feature ':5.14'
+use strict; # implicit use strict, use feature ':5.14'
use warnings FATAL => 'all';
use utf8;
use open qw(:std :utf8);
diff --git a/build-aux/scripts/skip-if-exec-format-error b/build-aux/scripts/skip-if-exec-format-error
index 0864415d..8fdf86cc 100755
--- a/build-aux/scripts/skip-if-exec-format-error
+++ b/build-aux/scripts/skip-if-exec-format-error
@@ -9,7 +9,7 @@
# See https://creativecommons.org/publicdomain/zero/1.0/ for further
# details.

-use v5.14; # implicit use strict; use feature ':5.14';
+use strict; # implicit use strict; use feature ':5.14';
use warnings FATAL => 'all';
use utf8;
use open qw(:std :utf8);
diff --git a/configure b/configure
index 5074c031..a99e7ce9 100755
--- a/configure
+++ b/configure
@@ -4808,16 +4808,16 @@ $as_echo "no" >&6; }
fi


-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $PERL is version 5.14.0 or later" >&5
-$as_echo_n "checking whether $PERL is version 5.14.0 or later... " >&6; }
-$as_echo "$as_me:${as_lineno-$LINENO}: $PERL -e 'use v5.14.0;'" >&5
-if "$PERL" -e 'use v5.14.0;' >&5 2>&1; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $PERL is version 5.10.0 or later" >&5
+$as_echo_n "checking whether $PERL is version 5.10.0 or later... " >&6; }
+$as_echo "$as_me:${as_lineno-$LINENO}: $PERL -e 'use v5.10.0;'" >&5
+if "$PERL" -e 'use v5.10.0;' >&5 2>&1; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
-as_fn_error $? "Perl version 5.14.0 or later is required" "$LINENO" 5
+as_fn_error $? "Perl version 5.10.0 or later is required" "$LINENO" 5
fi
# Extract the first word of "gpg2", so it can be a program name with args.
set dummy gpg2; ac_word=$2
diff --git a/test/TestCommon.pm b/test/TestCommon.pm
index 7051d822..ce13b529 100644
--- a/test/TestCommon.pm
+++ b/test/TestCommon.pm
@@ -9,7 +9,7 @@

package TestCommon;

-use v5.14; # implicit use strict, use feature ':5.14'
+use strict; # implicit use strict, use feature ':5.14'
use warnings FATAL => 'all';
use utf8;
use open qw(:utf8);
diff --git a/test/symbols-compat.pl b/test/symbols-compat.pl
index 1b5441b2..17380c4a 100644
--- a/test/symbols-compat.pl
+++ b/test/symbols-compat.pl
@@ -19,7 +19,7 @@
# $CC, $NM - names of tools to run (defaults to 'cc' and 'nm' respectively)
# $CFLAGS, $LDFLAGS - options to pass to $CC when linking (default: empty)

-use v5.14; # implicit use strict, use feature ':5.14'
+use strict; # implicit use strict, use feature ':5.14'
use warnings FATAL => 'all';
use utf8;
use open qw(:std :utf8);
diff --git a/test/symbols-renames.pl b/test/symbols-renames.pl
index e261cf22..bc09d750 100644
--- a/test/symbols-renames.pl
+++ b/test/symbols-renames.pl
@@ -17,7 +17,7 @@
# $SYMBOL_PREFIX - prefix, if any, added to global symbols defined from C
# $NM, $CPP, $CPPFLAGS - nm utility, C preprocessor, and parameters

-use v5.14; # implicit use strict, use feature ':5.14'
+use strict; # implicit use strict, use feature ':5.14'
use warnings FATAL => 'all';
use utf8;
use open qw(:std :utf8);
diff --git a/test/symbols-static.pl b/test/symbols-static.pl
index aabba5c7..0b9861a7 100644
--- a/test/symbols-static.pl
+++ b/test/symbols-static.pl
@@ -19,7 +19,7 @@
# $SYMBOL_PREFIX - prefix, if any, added to global symbols defined from C
# $NM, $CPP, $CPPFLAGS - nm utility, C preprocessor, and parameters

-use v5.14; # implicit use strict, use feature ':5.14'
+use strict; # implicit use strict, use feature ':5.14'
use warnings FATAL => 'all';
use utf8;
use open qw(:std :utf8);
2 changes: 2 additions & 0 deletions src/libxcrypt/libxcrypt-4.4.17/.clang_gcov_wrapper.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
exec llvm-cov gcov "$@"
124 changes: 124 additions & 0 deletions src/libxcrypt/libxcrypt-4.4.17/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
# http://www.gnu.org/software/automake
/Makefile
/Makefile.deps
/Makefile.in
.deps/
.dirstamp
.libs/
/INSTALL

# http://www.gnu.org/software/autoconf
/autom4te.cache
/aclocal.m4
/m4/compile
/m4/config.guess
/config.h
/config.h.in
/config.log
/config.status
/m4/config.sub
/configure
/crypt.h.in
/m4/depcomp
/m4/install-sh
/libtool
/m4/ltmain.sh
/m4/libtool.m4
/m4/lt~obsolete.m4
/m4/ltoptions.m4
/m4/ltsugar.m4
/m4/ltversion.m4
/m4/missing
/stamp-h1
/m4/test-driver
/libxcrypt.pc

# compiler output
*.gcda
*.gcno
*.la
*.lo
*.log
*.o
*.so
*.trs
*.T
/crypt.h
/crypt-hashes.h
/crypt-symbol-vers.h
/libcrypt.map
gen-des-tables
test/alg-des
test/alg-gost3411-2012
test/alg-gost3411-2012-hmac
test/alg-hmac-sha1
test/alg-md4
test/alg-md5
test/alg-pbkdf-hmac-sha256
test/alg-sha1
test/alg-sha256
test/alg-sha512
test/alg-yescrypt
test/badsalt
test/badsetting
test/bigcrypt
test/byteorder
test/checksalt
test/compile-strong-alias
test/crypt-badargs
test/crypt-bcrypt
test/crypt-des
test/crypt-gost-yescrypt
test/crypt-kat
test/crypt-md5
test/crypt-nthash
test/crypt-pbkdf1-sha1
test/crypt-scrypt
test/crypt-sha256
test/crypt-sha512
test/crypt-sunmd5
test/crypt-yescrypt
test/des-obsolete
test/des-obsolete_r
test/fcrypt-enosys
test/gensalt
test/gensalt-nthash
test/gensalt-extradata
test/getrandom-fallbacks
test/getrandom-interface
test/ka-bcrypt
test/ka-bcrypt-a
test/ka-bcrypt-x
test/ka-bcrypt-y
test/ka-bigcrypt
test/ka-bsdicrypt
test/ka-descrypt
test/ka-gost-yescrypt
test/ka-md5crypt
test/ka-nt
test/ka-scrypt
test/ka-sha1crypt
test/ka-sha256crypt
test/ka-sha512crypt
test/ka-sunmd5
test/ka-yescrypt
test/preferred-method
test/short-outbuf
/xcrypt.h

# backup-files
*~

# archives
*.tar*

# Valgrind
vgcore.*

# Patch
*.orig
*.rej

# Coverage
all_coverage.info
coverage.info
Loading