Compiled on X8DTU with 2 physical Intel Xeon E5530 CPU (8C16T) Compile Flags: # requires # -fexceptions --> -fexceptions # -frtti # -fuse-linker-plugin --> would not link # -flto depends on -fuse-linker-plugin CFLAGS='-mtune=generic -Os -pipe -fuse-linker-plugin -flto' CXXFLAGS='-mtune=generic -Os -pipe -fuse-linker-plugin -flto' LDFLAGS='-Wl,-O1' export CFLAGS CXXFLAGS LDFLAGS Dependencies: cmake compiletc gettext libxslt-dev qt-5.x-dev git apr-dev apr-util-dev boost-1.74-dev curl-dev libgd-dev harfbuzz-icu-dev hunspell-dev log4cxx-dev mpfr-dev libmspack-dev popt-dev poppler07-dev.tcz uriparser-dev libzzip-dev Commands: cd /tmp tar xf miktex-21.3.tar.xz cd miktex-21.3 # replace '~/bin' to '~/.local/bin' for TC # cmake comes with this option # -DMIKTEX_USER_LINK_TARGET_DIR='~/.local/bin' # but it doesn't affect some files sed -i 's:~/bin:~/.local/bin:g' $(grep -lrF '~/bin') # IMPORTANT # Don't do "mkdir build && cd build" # the data files would not install properly # they'll be moved by 'cmake' and can't be located by 'make install' # Note these options remove -O3 from the .makefile # -DCMAKE_C_FLAGS_RELEASE='' \ # -DCMAKE_CXX_FLAGS_RELEASE='' CC=gcc CXX=g++ cmake . \ -DCMAKE_INSTALL_PREFIX='/usr/local' \ -DCMAKE_INSTALL_LIBDIR='lib' \ -DCMAKE_INSTALL_LIBEXECDIR='/usr/local/lib/miktex' \ -DCMAKE_BUILD_TYPE='MinSizeRel' \ -DINSTALL_MIKTEX_HEADERS=ON \ -DINSTALL_STATIC_LIBRARIES=ON \ -DWITH_MAN_PAGES=OFF \ -DMIKTEX_USER_LINK_TARGET_DIR='~/.local/bin' \ -DMIKTEX_LINUX_DIST=TinyCore \ -DMIKTEX_LINUX_DIST_CODE_NAME=corepure64 \ -DMIKTEX_LINUX_DIST_VERSION=12.x \ -DCMAKE_C_FLAGS_RELEASE='' \ -DCMAKE_CXX_FLAGS_RELEASE='' time make -j15 real 6m 39.60s user 1h 31m 49s sys 5m 12.53s make DESTDIR=/tmp/b-miktex install # desktop icon echo X-FullPathIcon=/usr/local/share/pixmaps/miktex-console.png >> /tmp/b-miktex/usr/local/share/applications/miktex-console.desktop # copyright cd /tmp mkdir -p b-miktex/usr/local/share/doc/miktex cp miktex-21.3/COPYING.txt b-miktex/usr/local/share/doc/miktex ######################################################################################################################### ############# for the record, log4cxx compiled with '-fno-rtti' cause miktex having this error ############## ######################################################################################################################### [ 19%] Linking CXX executable ../../../../sandbox/miktex/bin/linux-x86_64/miktex-pdftoppm /usr/local/bin/ld: ../../../../sandbox/miktex/bin/linux-x86_64/libmiktex-app.so.4.1.0: undefined reference to `typeinfo for log4cxx::helpers::ObjectPtrBase' collect2: error: ld returned 1 exit status make[2]: *** [Libraries/3rd/poppler/utils/CMakeFiles/miktex-pdftoppm.dir/build.make:114: sandbox/miktex/bin/linux-x86_64/miktex-pdftoppm] Error 1 make[2]: Leaving directory '/tmp/miktex-21.3/build' make[1]: *** [CMakeFiles/Makefile2:3839: Libraries/3rd/poppler/utils/CMakeFiles/miktex-pdftoppm.dir/all] Error 2 make[1]: Leaving directory '/tmp/miktex-21.3/build' make: *** [Makefile:163: all] Error 2