Fortify build

This commit is contained in:
BtbN 2020-09-05 23:58:44 +02:00
parent b4bbce3020
commit 7811434ee9
4 changed files with 6 additions and 4 deletions

View file

@ -7,6 +7,7 @@ RUN \
apt-get -y clean && \ apt-get -y clean && \
rm /usr/lib/gcc/*-w64-mingw32/*/libstdc++*.dll* && \ rm /usr/lib/gcc/*-w64-mingw32/*/libstdc++*.dll* && \
rm /usr/lib/gcc/*-w64-mingw32/*/libgcc_s* && \ rm /usr/lib/gcc/*-w64-mingw32/*/libgcc_s* && \
rm /usr/lib/gcc/*-w64-mingw32/*/*.dll.a && \
rm /usr/*-w64-mingw32/lib/*.dll.a && \ rm /usr/*-w64-mingw32/lib/*.dll.a && \
mkdir /opt/ffbuild mkdir /opt/ffbuild
@ -18,6 +19,6 @@ ENV FFBUILD_TARGET_FLAGS="--pkg-config=pkg-config --cross-prefix=x86_64-w64-ming
FFBUILD_PREFIX=/opt/ffbuild \ FFBUILD_PREFIX=/opt/ffbuild \
FFBUILD_CMAKE_TOOLCHAIN=/toolchain.cmake \ FFBUILD_CMAKE_TOOLCHAIN=/toolchain.cmake \
PKG_CONFIG_LIBDIR=/opt/ffbuild/lib/pkgconfig \ PKG_CONFIG_LIBDIR=/opt/ffbuild/lib/pkgconfig \
CFLAGS="-static-libgcc -static-libstdc++ -I/opt/ffbuild/include" \ 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" \ 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" LDFLAGS="-static-libgcc -static-libstdc++ -L/opt/ffbuild/lib -O2 -pipe -fstack-protector-strong"

View file

@ -38,7 +38,7 @@ ffbuild_dockerbuild() {
./Configure "${myconf[@]}" || return -1 ./Configure "${myconf[@]}" || return -1
sed -i -e "/^CFLAGS=/s|=.*|=${CFLAGS} -O2|" -e "/^LDFLAGS=/s|=[[:space:]]*$|=${LDFLAGS}|" Makefile || return -1 sed -i -e "/^CFLAGS=/s|=.*|=${CFLAGS}|" -e "/^LDFLAGS=/s|=[[:space:]]*$|=${LDFLAGS}|" Makefile || return -1
make -j$(nproc) || return -1 make -j$(nproc) || return -1
make install_sw || return -1 make install_sw || return -1

View file

@ -22,6 +22,7 @@ ffbuild_dockerbuild() {
--prefix="$FFBUILD_PREFIX" --prefix="$FFBUILD_PREFIX"
--disable-shared --disable-shared
--enable-static --enable-static
--disable-extra-programs
) )
if [[ $TARGET == win* ]]; then if [[ $TARGET == win* ]]; then