diff --git a/Dockerfiles/build-mysql/alpine/Dockerfile b/Dockerfiles/build-mysql/alpine/Dockerfile index 1e2c6beff..1c422544b 100644 --- a/Dockerfiles/build-mysql/alpine/Dockerfile +++ b/Dockerfiles/build-mysql/alpine/Dockerfile @@ -47,7 +47,8 @@ RUN set -eux && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/go/pkg/version/version.go && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java && \ ./bootstrap.sh && \ - export CFLAGS="-fPIC -pie -Wl,-z,relro -Wl,-z,now" && \ + export CFLAGS="-fPIC -pie -Wl,-z,relro,-z,now,-z,defs" && \ + export CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe -flto" && \ ./configure \ --datadir=/usr/lib \ --libdir=/usr/lib/zabbix \ diff --git a/Dockerfiles/build-mysql/centos/Dockerfile b/Dockerfiles/build-mysql/centos/Dockerfile index cfbd1d1ba..f3990d8b9 100644 --- a/Dockerfiles/build-mysql/centos/Dockerfile +++ b/Dockerfiles/build-mysql/centos/Dockerfile @@ -41,7 +41,8 @@ RUN set -eux && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/go/pkg/version/version.go && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java && \ ./bootstrap.sh && \ - export CFLAGS="-fPIC -pie -Wl,-z,relro -Wl,-z,now" && \ + export CFLAGS="-fPIC -pie -Wl,-z,relro,-z,now,-z,defs" && \ + export CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe" && \ ./configure \ --datadir=/usr/lib \ --libdir=/usr/lib/zabbix \ diff --git a/Dockerfiles/build-mysql/ol/Dockerfile b/Dockerfiles/build-mysql/ol/Dockerfile index a93552539..024a37bb5 100644 --- a/Dockerfiles/build-mysql/ol/Dockerfile +++ b/Dockerfiles/build-mysql/ol/Dockerfile @@ -28,7 +28,8 @@ RUN set -eux && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/go/pkg/version/version.go && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java && \ ./bootstrap.sh && \ - export CFLAGS="-fPIC -pie -Wl,-z,relro -Wl,-z,now" && \ + export CFLAGS="-fPIC -pie -Wl,-z,relro,-z,now,-z,defs" && \ + export CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe" && \ ./configure \ --datadir=/usr/lib \ --libdir=/usr/lib/zabbix \ diff --git a/Dockerfiles/build-mysql/rhel/Dockerfile b/Dockerfiles/build-mysql/rhel/Dockerfile index 655aa2a37..a1e969a6c 100644 --- a/Dockerfiles/build-mysql/rhel/Dockerfile +++ b/Dockerfiles/build-mysql/rhel/Dockerfile @@ -51,7 +51,8 @@ RUN set -eux && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/go/pkg/version/version.go && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java && \ ./bootstrap.sh && \ - export CFLAGS="-fPIC -pie -Wl,-z,relro -Wl,-z,now" && \ + export CFLAGS="-fPIC -pie -Wl,-z,relro,-z,now,-z,defs" && \ + export CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe" && \ ./configure \ --datadir=/usr/lib \ --libdir=/usr/lib/zabbix \ diff --git a/Dockerfiles/build-mysql/ubuntu/Dockerfile b/Dockerfiles/build-mysql/ubuntu/Dockerfile index 3050d88f9..2782ed9f4 100644 --- a/Dockerfiles/build-mysql/ubuntu/Dockerfile +++ b/Dockerfiles/build-mysql/ubuntu/Dockerfile @@ -47,7 +47,8 @@ RUN set -eux && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/go/pkg/version/version.go && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java && \ ./bootstrap.sh && \ - export CFLAGS="-fPIC -pie -Wl,-z,relro -Wl,-z,now" && \ + export CFLAGS="-fPIC -pie -Wl,-z,relro,-z,now,-z,defs" && \ + export CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe -flto" && \ ./configure \ --datadir=/usr/lib \ --libdir=/usr/lib/zabbix \ diff --git a/Dockerfiles/build-pgsql/alpine/Dockerfile b/Dockerfiles/build-pgsql/alpine/Dockerfile index 6e4f36973..53ca64866 100644 --- a/Dockerfiles/build-pgsql/alpine/Dockerfile +++ b/Dockerfiles/build-pgsql/alpine/Dockerfile @@ -47,7 +47,8 @@ RUN set -eux && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/go/pkg/version/version.go && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java && \ ./bootstrap.sh && \ - export CFLAGS="-fPIC -pie -Wl,-z,relro -Wl,-z,now" && \ + export CFLAGS="-fPIC -pie -Wl,-z,relro,-z,now,-z,defs" && \ + export CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe -flto" && \ ./configure \ --datadir=/usr/lib \ --libdir=/usr/lib/zabbix \ diff --git a/Dockerfiles/build-pgsql/centos/Dockerfile b/Dockerfiles/build-pgsql/centos/Dockerfile index 034d3a186..2fb6c6d4d 100644 --- a/Dockerfiles/build-pgsql/centos/Dockerfile +++ b/Dockerfiles/build-pgsql/centos/Dockerfile @@ -41,7 +41,8 @@ RUN set -eux && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/go/pkg/version/version.go && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java && \ ./bootstrap.sh && \ - export CFLAGS="-fPIC -pie -Wl,-z,relro -Wl,-z,now" && \ + export CFLAGS="-fPIC -pie -Wl,-z,relro,-z,now,-z,defs" && \ + export CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe -flto" && \ ./configure \ --datadir=/usr/lib \ --libdir=/usr/lib/zabbix \ diff --git a/Dockerfiles/build-pgsql/ol/Dockerfile b/Dockerfiles/build-pgsql/ol/Dockerfile index 47a57bcff..b0c19d9b6 100644 --- a/Dockerfiles/build-pgsql/ol/Dockerfile +++ b/Dockerfiles/build-pgsql/ol/Dockerfile @@ -28,7 +28,8 @@ RUN set -eux && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/go/pkg/version/version.go && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java && \ ./bootstrap.sh && \ - export CFLAGS="-fPIC -pie -Wl,-z,relro -Wl,-z,now" && \ + export CFLAGS="-fPIC -pie -Wl,-z,relro,-z,now,-z,defs" && \ + export CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe" && \ ./configure \ --datadir=/usr/lib \ --libdir=/usr/lib/zabbix \ diff --git a/Dockerfiles/build-pgsql/ubuntu/Dockerfile b/Dockerfiles/build-pgsql/ubuntu/Dockerfile index e2e8cf363..b58d08653 100644 --- a/Dockerfiles/build-pgsql/ubuntu/Dockerfile +++ b/Dockerfiles/build-pgsql/ubuntu/Dockerfile @@ -47,7 +47,8 @@ RUN set -eux && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/go/pkg/version/version.go && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java && \ ./bootstrap.sh && \ - export CFLAGS="-fPIC -pie -Wl,-z,relro -Wl,-z,now" && \ + export CFLAGS="-fPIC -pie -Wl,-z,relro,-z,now,-z,defs" && \ + export CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe -flto" && \ ./configure \ --datadir=/usr/lib \ --libdir=/usr/lib/zabbix \ diff --git a/Dockerfiles/build-sqlite3/alpine/Dockerfile b/Dockerfiles/build-sqlite3/alpine/Dockerfile index 593ab8d9d..e2f5b6dfc 100644 --- a/Dockerfiles/build-sqlite3/alpine/Dockerfile +++ b/Dockerfiles/build-sqlite3/alpine/Dockerfile @@ -47,7 +47,8 @@ RUN set -eux && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/go/pkg/version/version.go && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java && \ ./bootstrap.sh && \ - export CFLAGS="-fPIC -pie -Wl,-z,relro -Wl,-z,now" && \ + export CFLAGS="-fPIC -pie -Wl,-z,relro,-z,now,-z,defs" && \ + export CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe -flto" && \ ./configure \ --datadir=/usr/lib \ --libdir=/usr/lib/zabbix \ diff --git a/Dockerfiles/build-sqlite3/centos/Dockerfile b/Dockerfiles/build-sqlite3/centos/Dockerfile index 2ab7e7765..03b35cdcc 100644 --- a/Dockerfiles/build-sqlite3/centos/Dockerfile +++ b/Dockerfiles/build-sqlite3/centos/Dockerfile @@ -41,7 +41,8 @@ RUN set -eux && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/go/pkg/version/version.go && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java && \ ./bootstrap.sh && \ - export CFLAGS="-fPIC -pie -Wl,-z,relro -Wl,-z,now" && \ + export CFLAGS="-fPIC -pie -Wl,-z,relro,-z,now,-z,defs" && \ + export CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe" && \ ./configure \ --datadir=/usr/lib \ --libdir=/usr/lib/zabbix \ diff --git a/Dockerfiles/build-sqlite3/ol/Dockerfile b/Dockerfiles/build-sqlite3/ol/Dockerfile index 99506fafd..6c0856675 100644 --- a/Dockerfiles/build-sqlite3/ol/Dockerfile +++ b/Dockerfiles/build-sqlite3/ol/Dockerfile @@ -28,7 +28,8 @@ RUN set -eux && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/go/pkg/version/version.go && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java && \ ./bootstrap.sh && \ - export CFLAGS="-fPIC -pie -Wl,-z,relro -Wl,-z,now" && \ + export CFLAGS="-fPIC -pie -Wl,-z,relro,-z,now,-z,defs" && \ + export CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe" && \ ./configure \ --datadir=/usr/lib \ --libdir=/usr/lib/zabbix \ diff --git a/Dockerfiles/build-sqlite3/rhel/Dockerfile b/Dockerfiles/build-sqlite3/rhel/Dockerfile index 9c0b1d0ec..802bd05c2 100644 --- a/Dockerfiles/build-sqlite3/rhel/Dockerfile +++ b/Dockerfiles/build-sqlite3/rhel/Dockerfile @@ -51,7 +51,8 @@ RUN set -eux && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/go/pkg/version/version.go && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java && \ ./bootstrap.sh && \ - export CFLAGS="-fPIC -pie -Wl,-z,relro -Wl,-z,now" && \ + export CFLAGS="-fPIC -pie -Wl,-z,relro,-z,now,-z,defs" && \ + export CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe" && \ ./configure \ --datadir=/usr/lib \ --libdir=/usr/lib/zabbix \ diff --git a/Dockerfiles/build-sqlite3/ubuntu/Dockerfile b/Dockerfiles/build-sqlite3/ubuntu/Dockerfile index b19c02d9f..8898ad1e4 100644 --- a/Dockerfiles/build-sqlite3/ubuntu/Dockerfile +++ b/Dockerfiles/build-sqlite3/ubuntu/Dockerfile @@ -47,7 +47,8 @@ RUN set -eux && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/go/pkg/version/version.go && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java && \ ./bootstrap.sh && \ - export CFLAGS="-fPIC -pie -Wl,-z,relro -Wl,-z,now" && \ + export CFLAGS="-fPIC -pie -Wl,-z,relro,-z,now,-z,defs" && \ + export CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe -flto" && \ ./configure \ --datadir=/usr/lib \ --libdir=/usr/lib/zabbix \