Skip to content

Commit

Permalink
Squashed 'src/dashbls/' changes from 795660db76..3ffa7fa2b6
Browse files Browse the repository at this point in the history
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)
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: 3ffa7fa2b62aecf3943c142508de4b7ec6005bb5
  • Loading branch information
ogabrielides committed Oct 4, 2024
1 parent 730efde commit 3ae9f9d
Show file tree
Hide file tree
Showing 12 changed files with 378 additions and 1,011 deletions.
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: 25 additions & 22 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,7 +52,7 @@ 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
Expand All @@ -65,8 +66,8 @@ prepare() {
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
#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 +89,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 +101,7 @@ prepare() {
# shellcheck disable=SC2039,SC2164
popd #relic
# shellcheck disable=SC2039,SC2164
popd #contrib
popd #depends
fi
}
rm -rf ${BUILD}
Expand All @@ -115,7 +116,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 +144,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 +155,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 +261,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 +284,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 +314,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 +363,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 3ae9f9d

Please sign in to comment.