]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix crosscompile on windows to work with openssl 3.0.0 the
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Mon, 20 Sep 2021 15:52:34 +0000 (17:52 +0200)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Mon, 20 Sep 2021 15:52:34 +0000 (17:52 +0200)
  link with ws2_32 needs -l:libssp.a for __strcpy_chk.
  Also copy results from lib64 directory if needed.

doc/Changelog
makedist.sh

index db318455a3b58f21788fa6537092b6ff7257ee2b..fac757c5f651d738469657efe5bec776a30d8988 100644 (file)
@@ -1,3 +1,8 @@
+20 September 2021: Wouter
+       - Fix crosscompile on windows to work with openssl 3.0.0 the
+         link with ws2_32 needs -l:libssp.a for __strcpy_chk.
+         Also copy results from lib64 directory if needed.
+
 10 September 2021: Wouter
        - Fix initialisation errors reported by gcc sanitizer.
        - Fix lock debug code for gcc sanitizer reports.
index 6b7e0a83de97d58f0861bca4f256a93259b6e3a1..341055d0fdf8040e3dfa368d1a77f14283b75ac8 100755 (executable)
@@ -272,7 +272,7 @@ if [ "$DOWIN" = "yes" ]; then
                        sslflags="no-asm -DOPENSSL_NO_CAPIENG mingw"
                fi
                info "winssl: Configure no-shared $sslflags"
-               CC=${warch}-w64-mingw32-gcc AR=${warch}-w64-mingw32-ar RANLIB=${warch}-w64-mingw32-ranlib WINDRES=${warch}-w64-mingw32-windres ./Configure --prefix="$sslinstall" no-shared $sslflags || error_cleanup "OpenSSL Configure failed"
+               __CNF_LDLIBS=-l:libssp.a CC=${warch}-w64-mingw32-gcc AR=${warch}-w64-mingw32-ar RANLIB=${warch}-w64-mingw32-ranlib WINDRES=${warch}-w64-mingw32-windres ./Configure --prefix="$sslinstall" no-shared $sslflags || error_cleanup "OpenSSL Configure failed"
                info "winssl: make"
                make $MINJ || error_cleanup "OpenSSL crosscompile failed"
                # only install sw not docs, which take a long time.
@@ -285,7 +285,7 @@ if [ "$DOWIN" = "yes" ]; then
                sslsharedinstall="`pwd`/sslsharedinstall"
                cd openssl_shared
                info "winssl: Configure shared $sslflags"
-               CC=${warch}-w64-mingw32-gcc AR=${warch}-w64-mingw32-ar RANLIB=${warch}-w64-mingw32-ranlib WINDRES=${warch}-w64-mingw32-windres ./Configure --prefix="$sslsharedinstall" shared $sslflags || error_cleanup "OpenSSL Configure failed"
+               __CNF_LDLIBS=-l:libssp.a CC=${warch}-w64-mingw32-gcc AR=${warch}-w64-mingw32-ar RANLIB=${warch}-w64-mingw32-ranlib WINDRES=${warch}-w64-mingw32-windres ./Configure --prefix="$sslsharedinstall" shared $sslflags || error_cleanup "OpenSSL Configure failed"
                info "winssl: make"
                make $MINJ || error_cleanup "OpenSSL crosscompile failed"
                info "winssl: make install_sw"
@@ -415,7 +415,18 @@ if [ "$DOWIN" = "yes" ]; then
     cp ../doc/example.conf ../doc/Changelog .
     cp ../unbound.exe ../unbound-anchor.exe ../unbound-host.exe ../unbound-control.exe ../unbound-checkconf.exe ../unbound-service-install.exe ../unbound-service-remove.exe ../LICENSE ../winrc/unbound-control-setup.cmd ../winrc/unbound-website.url ../winrc/service.conf ../winrc/README.txt ../contrib/create_unbound_ad_servers.cmd ../contrib/warmup.cmd ../contrib/unbound_cache.cmd .
     mkdir libunbound
-    cp ../../unbound_shared/unbound.h ../../unbound_shared/.libs/libunbound*.dll ../../unbound_shared/.libs/libunbound.dll.a ../../unbound_shared/.libs/libunbound.a ../../unbound_shared/.libs/libunbound*.def ../../sslsharedinstall/lib/libcrypto.dll.a ../../sslsharedinstall/lib/libssl.dll.a ../../sslsharedinstall/bin/libcrypto*.dll ../../sslsharedinstall/bin/libssl*.dll ../../wxpinstall/bin/libexpat*.dll ../../wxpinstall/lib/libexpat.dll.a libunbound/.
+    # test to see if lib or lib64 (for openssl 3.0.0) needs to be used
+    if test -f ../../sslsharedinstall/lib/libcrypto.dll.a; then
+       cp ../../sslsharedinstall/lib/libcrypto.dll.a libunbound/.
+    else
+       cp ../../sslsharedinstall/lib64/libcrypto.dll.a libunbound/.
+    fi
+    if test -f ../../sslsharedinstall/lib/libssl.dll.a; then
+       cp ../../sslsharedinstall/lib/libssl.dll.a libunbound/.
+    else
+       cp ../../sslsharedinstall/lib64/libssl.dll.a libunbound/.
+    fi
+    cp ../../unbound_shared/unbound.h ../../unbound_shared/.libs/libunbound*.dll ../../unbound_shared/.libs/libunbound.dll.a ../../unbound_shared/.libs/libunbound.a ../../unbound_shared/.libs/libunbound*.def ../../sslsharedinstall/bin/libcrypto*.dll ../../sslsharedinstall/bin/libssl*.dll ../../wxpinstall/bin/libexpat*.dll ../../wxpinstall/lib/libexpat.dll.a libunbound/.
     if test "$W64" = "no"; then
        # Disable stack-protector for 32-bit windows builds.
        # cp /usr/i686-w64-mingw32/sys-root/mingw/bin/libssp-0.dll libunbound/.