...
 
Commits (4)
......@@ -301,7 +301,7 @@ AS_IF([test "x$enable_static_linking" = "xyes"], [
AC_DEFINE(__USE_MINGW_ANSI_STDIO, 1, [MinGW requires this for GNU format specifiers?])
AS_CASE([${BITS}],
[32], [
CONFIGURE_ARGS="--host=\"$host_alias\""
CONFIGURE_ARGS="--host=\"$host_alias\" --target=\"$target_alias\""
LIB_CFLAGS="-fPIC -m32"
OPENSSL_ARGS="--cross-compile-prefix=\"$host_alias-\" mingw enable-static-engine ${LIB_CFLAGS}"
CROSSCOMPILE_PREPARATION_EXPORTS="export CC=\"${host_alias}-gcc\" && export LD=\"${host_alias}-ld\" && "
......
......@@ -95,15 +95,19 @@ endif
if MINGW_BUILD
CLEANFILES += \
libDNSSECcore.def \
libDANEcore.def
# Libtool refuses to link static archives into dynamic libraries, therefore
# the explicit linking.
# libldns contains inet_pton() and inet_ntop(), therefore it is laways linked.
DNSSEC_CORE_INSTALL_CMD = \
$(CC) -shared -Wl,-Bstatic,-Bsymbolic,-lws2_32,-liphlpapi,-lgdi32 \
$(CC) -shared -Wl,--output-def,libDNSSECcore.def,-Bstatic,-Bsymbolic,-lws2_32,-liphlpapi,-lgdi32 \
-o .libs/libDNSSECcore$(SO_SUFF) common.o dnssec-plug.o log_dflt.o \
$(DANE_CORE_STATIC_DEPS) -lws2_32 -liphlpapi -lgdi32
DANE_CORE_INSTALL_CMD = \
$(CC) -shared -Wl,-Bstatic,-Bsymbolic,-lws2_32,-liphlpapi,-lgdi32,-lcrypt32 \
$(CC) -shared -Wl,--output-def,libDANEcore.def,-Bstatic,-Bsymbolic,-lws2_32,-liphlpapi,-lgdi32,-lcrypt32 \
-o .libs/libDANEcore$(SO_SUFF) common.o dane-plug.o log_dflt.o ca_store_win.o \
$(DANE_CORE_STATIC_DEPS) -lws2_32 -liphlpapi -lgdi32 -lcrypt32
endif
......
#!/usr/bin/env sh
SCRIPT_LOCATION=$(dirname $(readlink -f "$0"))
SRC_ROOT="${SCRIPT_LOCATION}/.."
cd "${SRC_ROOT}"
MINGW_PREFIX=i586-mingw32msvc # Unbound 1.5.1 requires patching.
#MINGW_PREFIX=i686-w64-mingw32 # Currently does not work.
# NPAPI extension was built directly oin Visual Studio.
CONF_OPTS=""
CONF_OPTS="${CONF_OPTS} --enable-static-linking"
#CONF_OPTS="${CONF_OPTS} --enable-npapi-extensions"
CONF_OPTS="${CONF_OPTS} --with-force-abi=x86"
CONF_OPTS="${CONF_OPTS} --host=${MINGW_PREFIX} --target=${MINGW_PREFIX}"
./configure ${CONF_OPTS}
make clean
make
#./scripts/install_chrome_add_payload.sh -C google-chrome
......@@ -41,8 +41,8 @@ TLSA_PEM_NAME="chrome_tlsa_validator.pem"
TLSA_PEM="${SRC_ROOT}/../${TLSA_PEM_NAME}"
OPTS="ch"
GETOPT="ch"
OPTS="cCh"
GETOPT="cCh"
USAGE=""
USAGE="${USAGE}Usage:\n"
......@@ -50,12 +50,14 @@ USAGE="${USAGE}\t$0 [-${OPTS}] chrome_executable\n"
USAGE="${USAGE}\n"
USAGE="${USAGE}Options:\n"
USAGE="${USAGE}\t-c\tPreserve generated CRX file.\n"
USAGE="${USAGE}\t-C\tPreserve generated CRX file and don't build installer script.\n"
USAGE="${USAGE}\t-h\tPrints this message.\n"
USAGE="${USAGE}\n"
USAGE="${USAGE}\tchrome_executable\n"
USAGE="${USAGE}\t\t-- name of the Chrome executable (e.g. chromium, google-chrome).\n"
PRESERVE_CTX="no"
BUILD_INSTALLER_SCRIPT="yes"
PACKAGE_VERSION="unknown_version"
OS_TARGET="unknown_os"
......@@ -78,6 +80,10 @@ while [ $# -gt 0 ]; do
-c)
PRESERVE_CTX="yes"
;;
-C)
PRESERVE_CTX="yes"
BUILD_INSTALLER_SCRIPT="no"
;;
-h)
echo >&2 -en "${USAGE}"
exit 0
......@@ -143,11 +149,11 @@ if [ ! -d "${DNSSEC_BUILT_SRC_DIR}" ]; then
fi
cp -r "${DNSSEC_BUILT_SRC_DIR}" "${TEMP_DIR}/${DNSSEC_PKG}"
cp "${DNSSEC_BUILT_JSON}" "${TEMP_DIR}/"
if [ ! -f "${DNSSEC_BUILT_CORE}" ]; then
echo >&2 "Cannot find file '${DNSSEC_BUILT_CORE}'."
if [ ! -f "${DNSSEC_BUILT_CORE}" -a ! -f "${DNSSEC_BUILT_CORE}.exe" ]; then
echo >&2 "Cannot find file '${DNSSEC_BUILT_CORE}[.exe]'."
exit 1
fi
cp "${DNSSEC_BUILT_CORE}" "${TEMP_DIR}/"
cp "${DNSSEC_BUILT_CORE}"* "${TEMP_DIR}/"
if [ ! -f "${DNSSEC_PEM}" ]; then
echo >&2 "Cannot locate '${DNSSEC_PEM}'."
exit 1
......@@ -156,12 +162,14 @@ cp "${DNSSEC_PEM}" "${TEMP_DIR}/"
"${CHROME_BINARY}" --pack-extension="${DNSSEC_PKG}" --pack-extension-key="${DNSSEC_PEM_NAME}"
rm "${TEMP_DIR}/${DNSSEC_PEM_NAME}"
#
tar -czf "${TARGZ_FILE}" cz.nic.validator.dnssec.json.in ${DNSSEC_CORE_NAME} ${DNSSEC_PKG}.crx
cp "${SCRIPT_STUB}" "${TARGET_DNSSEC}"
echo "PAYLOAD:" >> "${TARGET_DNSSEC}"
cat "${TEMP_DIR}/${TARGZ_FILE}" >> "${TARGET_DNSSEC}"
chmod +x "${TARGET_DNSSEC}"
rm -f ${TARGZ_FILE}
if [ "x${BUILD_INSTALLER_SCRIPT}" = "xyes" ]; then
tar -czf "${TARGZ_FILE}" cz.nic.validator.dnssec.json.in ${DNSSEC_CORE_NAME} ${DNSSEC_PKG}.crx
cp "${SCRIPT_STUB}" "${TARGET_DNSSEC}"
echo "PAYLOAD:" >> "${TARGET_DNSSEC}"
cat "${TEMP_DIR}/${TARGZ_FILE}" >> "${TARGET_DNSSEC}"
chmod +x "${TARGET_DNSSEC}"
rm -f ${TARGZ_FILE}
fi
if [ "x${PRESERVE_CTX}" = "xyes" ]; then
cp "${TEMP_DIR}/${DNSSEC_PKG}.crx" "${DNSSEC_CRX}"
......@@ -178,11 +186,11 @@ if [ ! -d "${TLSA_BUILT_SRC_DIR}" ]; then
fi
cp -r "${TLSA_BUILT_SRC_DIR}" "${TEMP_DIR}/${TLSA_PKG}"
cp "${TLSA_BUILT_JSON}" "${TEMP_DIR}/"
if [ ! -f "${TLSA_BUILT_CORE}" ]; then
if [ ! -f "${TLSA_BUILT_CORE}" -a ! -f "${TLSA_BUILT_CORE}.exe" ]; then
echo >&2 "Cannot find file '${TLSA_BUILT_CORE}'."
exit 1
fi
cp "${TLSA_BUILT_CORE}" "${TEMP_DIR}"
cp "${TLSA_BUILT_CORE}"* "${TEMP_DIR}"
if [ ! -f "${TLSA_PEM}" ]; then
echo >&2 "Cannot locate '${TLSA_PEM}'."
exit 1
......@@ -191,15 +199,17 @@ cp "${TLSA_PEM}" "${TEMP_DIR}/"
"${CHROME_BINARY}" --pack-extension="${TLSA_PKG}" --pack-extension-key="${TLSA_PEM_NAME}"
rm "${TEMP_DIR}/${TLSA_PEM_NAME}"
#
tar -czf "${TARGZ_FILE}" cz.nic.validator.tlsa.json.in ${TLSA_CORE_NAME} ${TLSA_PKG}.crx
cp "${SCRIPT_STUB}" "${TARGET_TLSA}"
echo "PAYLOAD:" >> "${TARGET_TLSA}"
cat "${TEMP_DIR}/${TARGZ_FILE}" >> "${TARGET_TLSA}"
chmod +x "${TARGET_TLSA}"
rm -f ${TARGZ_FILE}
if [ "x${BUILD_INSTALLER_SCRIPT}" = "xyes" ]; then
tar -czf "${TARGZ_FILE}" cz.nic.validator.tlsa.json.in ${TLSA_CORE_NAME} ${TLSA_PKG}.crx
cp "${SCRIPT_STUB}" "${TARGET_TLSA}"
echo "PAYLOAD:" >> "${TARGET_TLSA}"
cat "${TEMP_DIR}/${TARGZ_FILE}" >> "${TARGET_TLSA}"
chmod +x "${TARGET_TLSA}"
rm -f ${TARGZ_FILE}
fi
if [ "x${PRESERVE_CTX}" = "xyes" ]; then
cp "${TEMP_DIR}/tlsa-pkg.crx" "${PACKAGES_DIR}/${TLSA_CRX}"
cp "${TEMP_DIR}/${TLSA_PKG}.crx" "${TLSA_CRX}"
fi
rm "${TEMP_DIR}/${TLSA_PKG}.crx"
......
......@@ -13,6 +13,7 @@ libs-srcs: libs-archives
cd x$@; tar -xzf ../$</openssl.tar.gz; mv openssl-* openssl; cd ..
cd x$@; tar -xzf ../$</ldns.tar.gz; mv ldns-* ldns; cd ..
cd x$@; tar -xzf ../$</unbound.tar.gz; mv unbound-* unbound; cd ..
cd x$@/unbound && patch compat/explicit_bzero.c < $(abs_builddir)/patches/unbound_explicit_bzero.patch
mv x$@ $@
libs-built:
......
diff --git a/compat/explicit_bzero.c b/compat/explicit_bzero.c
index a3ba279..6a4177c 100644
--- a/compat/explicit_bzero.c
+++ b/compat/explicit_bzero.c
@@ -6,6 +6,13 @@
#include "config.h"
#include <string.h>
+/* Workaround for MinGW missing SecureZeroMemory(). */
+#if defined(UB_ON_WINDOWS) && defined(__MINGW32__)
+# ifndef SecureZeroMemory
+# define SecureZeroMemory(p, s) RtlFillMemory((p), (s), 0)
+# endif
+#endif
+
__attribute__((weak)) void
__explicit_bzero_hook(void *ATTR_UNUSED(buf), size_t ATTR_UNUSED(len))
{