From 15dbf2f29dd3c6b322c0de999067913a8a3d22cb Mon Sep 17 00:00:00 2001 From: baalajimaestro Date: Mon, 25 Apr 2022 10:08:24 +0530 Subject: [PATCH] Do LTO on the binary Signed-off-by: baalajimaestro --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index e513ba0..e909990 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM nimlang/nim:alpine as builder -RUN apk update && apk add git build-base curl bash openssl openssl-dev openssl-libs-static sqlite-dev sqlite-static +RUN apk update && apk add git build-base llvm llvm-dev curl bash openssl openssl-dev openssl-libs-static sqlite-dev sqlite-static COPY . /app WORKDIR /app @@ -8,6 +8,7 @@ WORKDIR /app # Build with necessary params to enable statically linking openssl, glibc and sqlite3 RUN nimble build --passL:-L/usr/lib \ -d:ssl \ + --cc:clang \ -p:. \ --dynlibOverride:ssl \ --dynlibOverride:crypto \ @@ -16,6 +17,7 @@ RUN nimble build --passL:-L/usr/lib \ --passl:-lsqlite3 \ --passl:-lcrypto \ --passL:-static \ + --passL:-flto=thin \ -d:release \ --opt:speed \ --accept