Skip to content

dh_make hardening flags cause compilation to fail on Ubuntu

When building a package on Ubuntu 24.04.1 LTS, the default compiler flags cause compilation to fail.

c++ -Ilibosiris.so.2.4.2.p -I. -I.. -I../src/canvas -I../src/dialogs -I../src/iconview -I../src/kernel -I../src/network -I../src/opengl -I../src/table -I../src/tools -I../src/widgets -I../src/workspace -I../src/xml -I/usr/include/freetype2 -I/usr/include/libpng16 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c++11 -g -O2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -ffile-prefix-map=/home/abloss/ubupkg/osiris-2.4.2=. -flto=auto -ffat-lto-objects -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -fdebug-prefix-map=/home/abloss/ubupkg/osiris-2.4.2=/usr/src/osiris-2.4.2-1 -Wdate-time -D_FORTIFY_SOURCE=3 -fPIC -DQT_NO_SM_SUPPORT -DOSIRIS_INSTALL_PREFIX=/opt/osiris -DQT_NO_IMAGEIO_JPEG -DQT_NO_IMAGEIO_MNG -DQT_XFT -MD -MQ libosiris.so.2.4.2.p/src_tools_qgdict.cpp.o -MF libosiris.so.2.4.2.p/src_tools_qgdict.cpp.o.d -o libosiris.so.2.4.2.p/src_tools_qgdict.cpp.o -c ../src/tools/qgdict.cpp
../src/tools/qgdict.cpp: In member function \u2018void QGDict::statistics() const\u2019:
../src/tools/qgdict.cpp:911:15: error: format not a string literal and no format arguments [-Werror=format-security]
  911 |         qDebug(line.ascii());
      |         ~~~~~~^~~~~~~~~~~~~~
../src/tools/qgdict.cpp:915:23: error: format not a string literal and no format arguments [-Werror=format-security]
  915 |                 qDebug(line.ascii());
      |                 ~~~~~~^~~~~~~~~~~~~~
../src/tools/qgdict.cpp:936:24: error: format not a string literal and no format arguments [-Werror=format-security]
  936 |                 qDebug(buf);
      |                        ^~~
../src/tools/qgdict.cpp:944:15: error: format not a string literal and no format arguments [-Werror=format-security]
  944 |         qDebug(line.ascii());
      |         ~~~~~~^~~~~~~~~~~~~~
../src/tools/qgdict.cpp: In member function \u2018QDataStream& QGDict::read(QDataStream&)\u2019:
../src/tools/qgdict.cpp:1009:42: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
 1009 |                                 look_ptr((void *)k, d, op_insert);
      |                                          ^~~~~~~~~
cc1plus: some warnings being treated as errors

Compiling Osiris outside of the debuild environment does not use these flags and succeeds. For now, the flag has been overridden. These should be considered as new defaults, however.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information