diff --git a/images/base-linux64/Dockerfile b/images/base-linux64/Dockerfile index 5b86090..c81a27f 100644 --- a/images/base-linux64/Dockerfile +++ b/images/base-linux64/Dockerfile @@ -48,6 +48,12 @@ ENV PATH="/opt/ct-ng/bin:${PATH}" \ FFBUILD_CMAKE_TOOLCHAIN=/toolchain.cmake \ PKG_CONFIG=pkg-config \ PKG_CONFIG_LIBDIR=/opt/ffbuild/lib/pkgconfig:/opt/ffbuild/share/pkgconfig \ + CC="${FFBUILD_TOOLCHAIN}-gcc" \ + CXX="${FFBUILD_TOOLCHAIN}-g++" \ + LD="${FFBUILD_TOOLCHAIN}-ld" \ + AR="${FFBUILD_TOOLCHAIN}-gcc-ar" \ + RANLIB="${FFBUILD_TOOLCHAIN}-gcc-ranlib" \ + NM="${FFBUILD_TOOLCHAIN}-gcc-nm" \ CFLAGS="-static-libgcc -static-libstdc++ -I/opt/ffbuild/include -O2 -pipe -fPIC -DPIC -D_FORTIFY_SOURCE=2 -fstack-protector-strong -pthread" \ CXXFLAGS="-static-libgcc -static-libstdc++ -I/opt/ffbuild/include -O2 -pipe -fPIC -DPIC -D_FORTIFY_SOURCE=2 -fstack-protector-strong -pthread" \ LDFLAGS="-static-libgcc -static-libstdc++ -L/opt/ffbuild/lib -O2 -pipe -fstack-protector-strong -Wl,-z,relro,-z,now -pthread -lm" \ diff --git a/images/base-linuxarm64/Dockerfile b/images/base-linuxarm64/Dockerfile index 8e3f555..8e786b1 100644 --- a/images/base-linuxarm64/Dockerfile +++ b/images/base-linuxarm64/Dockerfile @@ -50,6 +50,12 @@ ENV PATH="/opt/ct-ng/bin:${PATH}" \ FFBUILD_CMAKE_TOOLCHAIN=/toolchain.cmake \ PKG_CONFIG=pkg-config \ PKG_CONFIG_LIBDIR=/opt/ffbuild/lib/pkgconfig:/opt/ffbuild/share/pkgconfig \ + CC="${FFBUILD_TOOLCHAIN}-gcc" \ + CXX="${FFBUILD_TOOLCHAIN}-g++" \ + LD="${FFBUILD_TOOLCHAIN}-ld" \ + AR="${FFBUILD_TOOLCHAIN}-gcc-ar" \ + RANLIB="${FFBUILD_TOOLCHAIN}-gcc-ranlib" \ + NM="${FFBUILD_TOOLCHAIN}-gcc-nm" \ CFLAGS="-static-libgcc -static-libstdc++ -I/opt/ffbuild/include -O2 -pipe -fPIC -DPIC -D_FORTIFY_SOURCE=2 -fstack-protector-strong -pthread" \ CXXFLAGS="-static-libgcc -static-libstdc++ -I/opt/ffbuild/include -O2 -pipe -fPIC -DPIC -D_FORTIFY_SOURCE=2 -fstack-protector-strong -pthread" \ LDFLAGS="-static-libgcc -static-libstdc++ -L/opt/ffbuild/lib -O2 -pipe -fstack-protector-strong -Wl,-z,relro,-z,now -pthread -lm" \ diff --git a/images/base-win32/Dockerfile b/images/base-win32/Dockerfile index b7415a4..01105ef 100644 --- a/images/base-win32/Dockerfile +++ b/images/base-win32/Dockerfile @@ -33,9 +33,15 @@ ENV PATH="/opt/ct-ng/bin:${PATH}" \ FFBUILD_CMAKE_TOOLCHAIN=/toolchain.cmake \ PKG_CONFIG=pkg-config \ PKG_CONFIG_LIBDIR=/opt/ffbuild/lib/pkgconfig:/opt/ffbuild/share/pkgconfig \ + CC="${FFBUILD_TOOLCHAIN}-gcc" \ + CXX="${FFBUILD_TOOLCHAIN}-g++" \ + LD="${FFBUILD_TOOLCHAIN}-ld" \ + AR="${FFBUILD_TOOLCHAIN}-gcc-ar" \ + RANLIB="${FFBUILD_TOOLCHAIN}-gcc-ranlib" \ + NM="${FFBUILD_TOOLCHAIN}-gcc-nm" \ + DLLTOOL="${FFBUILD_TOOLCHAIN}-dlltool" \ CFLAGS="-static-libgcc -static-libstdc++ -I/opt/ffbuild/include -O2 -pipe -D_FORTIFY_SOURCE=2 -fstack-protector-strong" \ CXXFLAGS="-static-libgcc -static-libstdc++ -I/opt/ffbuild/include -O2 -pipe -D_FORTIFY_SOURCE=2 -fstack-protector-strong" \ LDFLAGS="-static-libgcc -static-libstdc++ -L/opt/ffbuild/lib -O2 -pipe -fstack-protector-strong" \ - DLLTOOL="${FFBUILD_TOOLCHAIN}-dlltool" \ STAGE_CFLAGS="-fno-semantic-interposition" \ STAGE_CXXFLAGS="-fno-semantic-interposition" diff --git a/images/base-win64/Dockerfile b/images/base-win64/Dockerfile index 3031e89..5966a0c 100644 --- a/images/base-win64/Dockerfile +++ b/images/base-win64/Dockerfile @@ -33,9 +33,15 @@ ENV PATH="/opt/ct-ng/bin:${PATH}" \ FFBUILD_CMAKE_TOOLCHAIN=/toolchain.cmake \ PKG_CONFIG=pkg-config \ PKG_CONFIG_LIBDIR=/opt/ffbuild/lib/pkgconfig:/opt/ffbuild/share/pkgconfig \ + CC="${FFBUILD_TOOLCHAIN}-gcc" \ + CXX="${FFBUILD_TOOLCHAIN}-g++" \ + LD="${FFBUILD_TOOLCHAIN}-ld" \ + AR="${FFBUILD_TOOLCHAIN}-gcc-ar" \ + RANLIB="${FFBUILD_TOOLCHAIN}-gcc-ranlib" \ + NM="${FFBUILD_TOOLCHAIN}-gcc-nm" \ + DLLTOOL="${FFBUILD_TOOLCHAIN}-dlltool" \ CFLAGS="-static-libgcc -static-libstdc++ -I/opt/ffbuild/include -O2 -pipe -D_FORTIFY_SOURCE=2 -fstack-protector-strong" \ CXXFLAGS="-static-libgcc -static-libstdc++ -I/opt/ffbuild/include -O2 -pipe -D_FORTIFY_SOURCE=2 -fstack-protector-strong" \ LDFLAGS="-static-libgcc -static-libstdc++ -L/opt/ffbuild/lib -O2 -pipe -fstack-protector-strong" \ - DLLTOOL="${FFBUILD_TOOLCHAIN}-dlltool" \ STAGE_CFLAGS="-fno-semantic-interposition" \ STAGE_CXXFLAGS="-fno-semantic-interposition" diff --git a/scripts.d/25-openssl.sh b/scripts.d/25-openssl.sh index 02b5e2b..a7bc599 100755 --- a/scripts.d/25-openssl.sh +++ b/scripts.d/25-openssl.sh @@ -50,6 +50,12 @@ ffbuild_dockerbuild() { export CFLAGS="$CFLAGS -fno-strict-aliasing" export CXXFLAGS="$CXXFLAGS -fno-strict-aliasing" + # OpenSSL build system prepends the cross prefix itself + export CC="gcc" + export CXX="g++" + export AR="gcc-ar" + export RANLIB="gcc-ranlib" + ./Configure "${myconf[@]}" sed -i -e "/^CFLAGS=/s|=.*|=${CFLAGS}|" -e "/^LDFLAGS=/s|=[[:space:]]*$|=${LDFLAGS}|" Makefile