Skip to content

Commit

Permalink
Squashed 'src/dashbls/' changes from 795660db76..4e070243ae
Browse files Browse the repository at this point in the history
4e070243ae chore: bump version to 1.3.3 (dashpay#99)
d93956254e ci: disable Go bindings CI for macos for now (dashpay#98)
ae40c5c86d Merge pull request dashpay#97 from PastaPastaPasta/refac/pybind-bump-2.13.6
e835ece935 refactor: bump pybind version to 2.13.6
eda5d6a402 chore: change of gmp source (dashpay#95)
61f95aa80e chore: cleanup 6.2.1 left overs (dashpay#96)
adbd094409 Merge pull request dashpay#92 from kwvg/darwin_gmp
062ee6726b Merge pull request dashpay#90 from UdjinM6/fix_aarch_arch
3538d8b033 fix: aarch64 is not supported, should set ARCH to RELIC_NONE
e27a62f4a2 revert: disable gmp if targeting darwin on aarch64 when on 'auto'
bb2fe6ee55 build: enforce minimum version of libgmp based on arch and platform
9832b7a132 build: replace deprecated macros `AC_PROG_CC_C99` and `AM_PROG_CC_C_O`
b2428718b9 Merge pull request dashpay#91 from UdjinM6/fix_macos_test_build
3ffa7fa2b6 chore: bump version to 1.3.2 (dashpay#94)
0f4efc9327 Merge pull request dashpay#88 from HashEngineering/feat/support-android
a181889489 fix: rust bindings build for macos (dashpay#89)
738d187359 fix: detect gmp via brew earlier
ce4d6a47b6 fix: install libtool
4fa46ccaff fix: use macos-latest for test build
69bdc1aac7 Merge pull request dashpay#85 from kwvg/debug
39791d4e31 build: print build options after configure
73106a0121 build: use `-mbranch-protection=bti` on supporting `aarch64` compilers
6a3c28f6ca build: use stricter `-Werror` when testing compile flags
7a1b227637 build: rename {`NO`}`WARN_CFLAGS` to {`NO`}`WARN_FLAGS`, use with C{++}
28bea63838 build: set {`NO`}`WARN_CFLAGS` flags if not overridden and uniformly
32c2f0f5f8 trivial: rename `CORE_CXXFLAGS` to `CORE_FLAGS`, use with C{++}
b630c2c323 build: append `HARDENED_FLAGS` to `AM_CFLAGS`
e6008148e4 trivial: rename `HARDENED_CXXFLAGS` to `HARDENED_FLAGS`
af0e3daef5 build: subsume `PI{C,E}_FLAGS` into `HARDENED_CXXFLAGS`
9ff8618a1b build: expand `--disable-optimizations` to include `-O0` and `-fwrapv`
3036b83181 build: expand `--enable-debug` to include `-O0`, `-ftrapv` and dbg info
c90d43d43b build: add check to see if `CFLAGS` has been overridden
2d77f7ae49 build: remove vestigial `LIBTOOL_{CXX,CPP,LD}FLAGS`, `HARDENED_CPPFLAGS`
883a098868 build: autodetect i?86 and arm as 32-bit
deb3269820 build: don't specify exact `{CPU_}ARCH` if optimizations are disabled
720d49a44b trivial: fix indentation for `want_backend` check
f9328320af build: use `easy` backend if optimizations are disabled unless specified
3687cd59e0 build: define new flag `--enable-optimizations`
f82bfee5dd build: ensure help string format matches Autotool defaults
d68920063e build: define arguments as `--enable-[term]` instead of `--disable-[term]`
7f41e7dd16 fix: support android
1c2fc79c19 feat(rust): allow to move G1 and G2 elements between threads (dashpay#87)
3540b8bbed feat: debug with data hex (dashpay#86)

git-subtree-dir: src/dashbls
git-subtree-split: 4e070243aed142bc458472f8807ab77527dd879a
  • Loading branch information
ogabrielides committed Oct 9, 2024
1 parent 730efde commit 0210745
Show file tree
Hide file tree
Showing 17 changed files with 431 additions and 3,457 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build-binds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ jobs:
cmake --build . -- -j 6
- name: Build Go bindings
# TODO: macos build is broken. Whoever needs this - please fix it and remove `if` below.
if: startsWith(matrix.os, 'ubuntu')
run: |
cd go-bindings
make
4 changes: 2 additions & 2 deletions .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ macos-11, ubuntu-20.04 ]
os: [ macos-latest, ubuntu-20.04 ]
builder: [ cmake, autotools ]
compiler:
- cc: gcc
Expand All @@ -47,7 +47,7 @@ jobs:
run: |
ls -l
export MACOSX_DEPLOYMENT_TARGET=10.14
brew install autoconf automake gmp pkg-config
brew install autoconf automake gmp libtool pkg-config
- name: Build library using CMake
if: startsWith(matrix.builder, 'cmake')
Expand Down
7 changes: 4 additions & 3 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ print-%: FORCE
ACLOCAL_AMFLAGS = -I build-aux/m4
.PHONY: deploy FORCE

AM_LDFLAGS = $(LIBTOOL_LDFLAGS) $(HARDENED_LDFLAGS) $(CORE_LDFLAGS) $(GMP_LDFLAGS)
AM_CXXFLAGS = $(LIBTOOL_CXXFLAGS) $(HARDENED_CXXFLAGS) $(CORE_CXXFLAGS) $(PIC_FLAGS) $(PIE_FLAGS)
AM_CPPFLAGS = $(LIBTOOL_CPPFLAGS) $(HARDENED_CPPFLAGS) $(CORE_CPPFLAGS) $(PIC_FLAGS) $(GMP_CPPFLAGS)
AM_LDFLAGS = $(HARDENED_LDFLAGS) $(CORE_LDFLAGS) $(GMP_LDFLAGS)
AM_CFLAGS = $(DEBUG_FLAGS) $(HARDENED_FLAGS) $(CORE_FLAGS) $(WARN_FLAGS) $(NOWARN_FLAGS)
AM_CPPFLAGS = $(CORE_CPPFLAGS) $(GMP_CPPFLAGS)
AM_CXXFLAGS = $(DEBUG_FLAGS) $(HARDENED_FLAGS) $(CORE_FLAGS) $(WARN_FLAGS) $(NOWARN_FLAGS)
PTHREAD_FLAGS = $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)

EXTRA_LIBRARIES =
Expand Down
2 changes: 1 addition & 1 deletion Makefile.relic.include
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ librelic_la_SOURCES = \

librelic_la_CPPFLAGS = $(AM_CPPFLAGS) $(RELIC_CPPFLAGS) $(RELIC_INCLUDES)
librelic_la_CXXFLAGS = $(AM_CXXFLAGS)
librelic_la_CFLAGS = $(AM_CFLAGS) $(WARN_CFLAGS) $(NOWARN_CFLAGS)
librelic_la_CFLAGS = $(AM_CFLAGS)
librelic_la_LDFLAGS = $(AM_LDFLAGS)

noinst_LTLIBRARIES += $(LIBRELIC)
47 changes: 24 additions & 23 deletions apple.rust.deps.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/sh
set -x
set -e
# "x86_64-apple-ios"
# "aarch64-apple-ios"
# "aarch64-apple-ios-sim"
Expand Down Expand Up @@ -51,22 +52,20 @@ version_min_flag() {

prepare() {
download_gmp() {
GMP_VERSION="6.2.1"
GMP_VERSION="6.3.0"
CURRENT_DIR=$(pwd)
echo "$CURRENT_DIR"
# shellcheck disable=SC2039,SC2164
pushd ${BUILD}
mkdir -p "contrib"
if [ ! -s "contrib/gmp-${GMP_VERSION}.tar.bz2" ]; then
curl -L -o "contrib/gmp-${GMP_VERSION}.tar.bz2" https://gmplib.org/download/gmp/gmp-${GMP_VERSION}.tar.bz2
curl -L -o "contrib/gmp-${GMP_VERSION}.tar.bz2" https://ftp.gnu.org/gnu/gmp/gmp-${GMP_VERSION}.tar.bz2
fi
rm -rf "contrib/gmp"
# shellcheck disable=SC2039,SC2164
pushd contrib
tar xfj "gmp-${GMP_VERSION}.tar.bz2"
mv gmp-${GMP_VERSION} gmp
rm gmp/compat.c && cp ../../contrib/gmp-patch-6.2.1/compat.c gmp/compat.c
rm gmp/longlong.h && cp ../../contrib/gmp-patch-6.2.1/longlong.h gmp/longlong.h
# shellcheck disable=SC2039,SC2164
popd #contrib
# shellcheck disable=SC2039,SC2164
Expand All @@ -88,10 +87,10 @@ prepare() {
download_relic() {
CURRENT_DIR=$(pwd)
echo "$CURRENT_DIR"
mkdir -p "${CURRENT_DIR}/${BUILD}/contrib"
if [ ! -s "${CURRENT_DIR}/${BUILD}/contrib/relic" ]; then
mkdir -p "${CURRENT_DIR}/${BUILD}/depends"
if [ ! -s "${CURRENT_DIR}/${BUILD}/depends/relic" ]; then
# shellcheck disable=SC2039,SC2164
pushd "${CURRENT_DIR}/${BUILD}/contrib"
pushd "${CURRENT_DIR}/${BUILD}/depends"
git clone --depth 1 --branch "feat/ios-support" https://github.com/pankcuf/relic
# shellcheck disable=SC2039,SC2164
pushd relic
Expand All @@ -100,7 +99,7 @@ prepare() {
# shellcheck disable=SC2039,SC2164
popd #relic
# shellcheck disable=SC2039,SC2164
popd #contrib
popd #depends
fi
}
rm -rf ${BUILD}
Expand All @@ -115,7 +114,7 @@ build_gmp_arch() {
ARCH=$2
PFX=${PLATFORM}-${ARCH}
# why this works with this host only?
HOST=arm-apple-darwin
HOST=aarch64-apple-darwin
# shellcheck disable=SC2039,SC2164
pushd ${BUILD}
SDK=$(xcrun --sdk "$PLATFORM" --show-sdk-path)
Expand Down Expand Up @@ -143,7 +142,7 @@ CC="$CLANG" CFLAGS="$CFLAGS" CPPFLAGS="$CFLAGS" LDFLAGS="$CFLAGS" \
--host=${HOST} --prefix="${CURRENT_DIR}/gmplib-${PFX}" \
--disable-shared --enable-static --disable-assembly -v
EOF

chmod a+x "$CONFIGURESCRIPT"
sh "$CONFIGURESCRIPT"
rm "$CONFIGURESCRIPT"
Expand All @@ -154,6 +153,8 @@ EOF
make -j "$LOGICALCPU_MAX" &> "${CURRENT_DIR}"/log/gmplib-"${PFX}"-build.log
# shellcheck disable=SC2039
make install &> "${CURRENT_DIR}"/log/gmplib-"${PFX}"-install.log
#make check
#exit 1
# shellcheck disable=SC2039,SC2164
popd # gmp
# shellcheck disable=SC2039,SC2164
Expand Down Expand Up @@ -258,15 +259,15 @@ build_relic_arch() {
EXTRA_ARGS+=" -DARCH=X86"
elif [[ $ARCH = "x86_64" ]]; then
EXTRA_ARGS+=" -DARCH=X64"
else
EXTRA_ARGS+=" -DARCH=ARM"
if [[ $ARCH = "armv7s" ]]; then
EXTRA_ARGS+=" -DIOS_ARCH=armv7s"
elif [[ $ARCH = "armv7k" ]]; then
EXTRA_ARGS+=" -DIOS_ARCH=armv7k"
elif [[ $ARCH = "arm64_32" ]]; then
EXTRA_ARGS+=" -DIOS_ARCH=arm64_32"
fi
elif [[ $ARCH = "arm64" ]]; then
# Relic doesn't support aarch64 yet, "ARCH=ARM" is for ARM 32-bit architecture only
EXTRA_ARGS+=" -DIOS_ARCH=arm64 -DARCH="
elif [[ $ARCH = "armv7s" ]]; then
EXTRA_ARGS+=" -DIOS_ARCH=armv7s -DARCH=ARM"
elif [[ $ARCH = "armv7k" ]]; then
EXTRA_ARGS+=" -DIOS_ARCH=armv7k -DARCH=ARM"
elif [[ $ARCH = "arm64_32" ]]; then
EXTRA_ARGS+=" -DIOS_ARCH=arm64_32 -DARCH=ARM"
fi

CURRENT_DIR=$(pwd)
Expand All @@ -281,7 +282,7 @@ build_relic_arch() {
# shellcheck disable=SC2039,SC2164
popd # "$BUILDDIR"
# shellcheck disable=SC2039,SC2164
popd # contrib/relic
popd # depends/relic
}

build_bls_arch() {
Expand Down Expand Up @@ -311,7 +312,7 @@ build_bls_arch() {
clang -I"../contrib/relic/include" \
-I"../../depends/relic/include" \
-I"../../include/dashbls" \
-I"../relic-${PFX}/_deps/relic-build/include" \
-I"../relic-${PFX}/depends/relic/include" \
-I"../../src/" \
-I"../gmplib-${PFX}/include" \
-x c++ -std=c++14 -stdlib=libc++ -fembed-bitcode -arch "${ARCH}" -isysroot "${SDK}" "${EXTRA_ARGS}" \
Expand Down Expand Up @@ -360,8 +361,8 @@ build_target() {
rm -rf "build/artefacts/${BUILD_IN}"
mkdir -p "build/artefacts/${BUILD_IN}"
cp "build/gmplib-${PFX}/lib/libgmp.a" "build/artefacts/${BUILD_IN}"
cp "build/relic-${PFX}/_deps/relic-build/lib/librelic_s.a" "build/artefacts/${BUILD_IN}"
cp "build/relic-${PFX}/_deps/sodium-build/libsodium.a" "build/artefacts/${BUILD_IN}"
cp "build/relic-${PFX}/depends/relic/lib/librelic_s.a" "build/artefacts/${BUILD_IN}"
# cp "build/relic-${PFX}/depends/sodium/libsodium.a" "build/artefacts/${BUILD_IN}"
cp "build/bls-${PFX}/libbls.a" "build/artefacts/${BUILD_IN}"
# cp -rf build/bls-"${PFX}"/*.o build/artefacts/"${BUILD_IN}"/include
# cp -rf src/*.hpp build/artefacts/"${BUILD_IN}"/include
Expand Down
Loading

0 comments on commit 0210745

Please sign in to comment.