diff --git a/.github/workflows/centos_7.yml b/.github/workflows/centos_7.yml
index df67349ca5cf62e00075741b2225d25dc953c248..4321e1c351623609831c2e08cb57ff11b6fa5a60 100644
--- a/.github/workflows/centos_7.yml
+++ b/.github/workflows/centos_7.yml
@@ -44,7 +44,7 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        gc64: [ "GC64=OFF", "GC64=ON" ]
+        build-type: [ '', 'gc64' ]
 
     steps:
       - uses: actions/checkout@v2.3.4
@@ -57,7 +57,7 @@ jobs:
           RWS_AUTH: ${{ secrets.RWS_AUTH }}
           OS: 'el'
           DIST: '7'
-          GC64: -DLUAJIT_ENABLE_${{ matrix.gc64 }}
+          GC64: ${{ matrix.build-type == 'gc64' }}
         uses: ./.github/actions/pack_and_deploy
       - name: call action to send Telegram message on failure
         env:
diff --git a/.github/workflows/centos_8.yml b/.github/workflows/centos_8.yml
index 56cc624502bec676af8a976b0405e7652319afdc..cb20b0d2fb5861c1cd70e6b0a9f93030baa19f47 100644
--- a/.github/workflows/centos_8.yml
+++ b/.github/workflows/centos_8.yml
@@ -44,7 +44,7 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        gc64: [ "GC64=OFF", "GC64=ON" ]
+        build-type: [ '', 'gc64' ]
 
     steps:
       - uses: actions/checkout@v2.3.4
@@ -57,7 +57,7 @@ jobs:
           RWS_AUTH: ${{ secrets.RWS_AUTH }}
           OS: 'el'
           DIST: '8'
-          GC64: -DLUAJIT_ENABLE_${{ matrix.gc64 }}
+          GC64: ${{ matrix.build-type == 'gc64' }}
         uses: ./.github/actions/pack_and_deploy
       - name: call action to send Telegram message on failure
         env:
diff --git a/.github/workflows/debian_10.yml b/.github/workflows/debian_10.yml
index 228577eb16fac7aaaaa999ee1e7e8a365e629d66..25727612e318990a35eba3e9c16edb4051dba51e 100644
--- a/.github/workflows/debian_10.yml
+++ b/.github/workflows/debian_10.yml
@@ -44,7 +44,7 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        gc64: [ "GC64=OFF", "GC64=ON" ]
+        build-type: [ '', 'gc64' ]
 
     steps:
       - uses: actions/checkout@v2.3.4
@@ -57,7 +57,7 @@ jobs:
           RWS_AUTH: ${{ secrets.RWS_AUTH }}
           OS: 'debian'
           DIST: 'buster'
-          GC64: -DLUAJIT_ENABLE_${{ matrix.gc64 }}
+          GC64: ${{ matrix.build-type == 'gc64' }}
         uses: ./.github/actions/pack_and_deploy
       - name: call action to send Telegram message on failure
         env:
diff --git a/.github/workflows/debian_11.yml b/.github/workflows/debian_11.yml
index 8ce0599b11270eaf8b955e2b483bf11d6137b482..9a7056e3a7f9cc6dbe6227f427bb4474236a3df9 100644
--- a/.github/workflows/debian_11.yml
+++ b/.github/workflows/debian_11.yml
@@ -44,7 +44,7 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        gc64: [ "GC64=OFF", "GC64=ON" ]
+        build-type: [ '', 'gc64' ]
 
     steps:
       - uses: actions/checkout@v2.3.4
@@ -57,7 +57,7 @@ jobs:
           RWS_AUTH: ${{ secrets.RWS_AUTH }}
           OS: 'debian'
           DIST: 'bullseye'
-          GC64: -DLUAJIT_ENABLE_${{ matrix.gc64 }}
+          GC64: ${{ matrix.build-type == 'gc64' }}
         uses: ./.github/actions/pack_and_deploy
       - name: call action to send Telegram message on failure
         env:
diff --git a/.github/workflows/debian_9.yml b/.github/workflows/debian_9.yml
index aefad394738bcd1852a10f67127ba0e21226b1d9..2d09923570bedf7617eb0bcb3436b4fb3dcd14f3 100644
--- a/.github/workflows/debian_9.yml
+++ b/.github/workflows/debian_9.yml
@@ -44,7 +44,7 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        gc64: [ "GC64=OFF", "GC64=ON" ]
+        build-type: [ '', 'gc64' ]
 
     steps:
       - uses: actions/checkout@v2.3.4
@@ -57,7 +57,7 @@ jobs:
           RWS_AUTH: ${{ secrets.RWS_AUTH }}
           OS: 'debian'
           DIST: 'stretch'
-          GC64: -DLUAJIT_ENABLE_${{ matrix.gc64 }}
+          GC64: ${{ matrix.build-type == 'gc64' }}
         uses: ./.github/actions/pack_and_deploy
       - name: call action to send Telegram message on failure
         env:
diff --git a/.github/workflows/fedora_30.yml b/.github/workflows/fedora_30.yml
index 6c52de05f55430e114604e2fc61c10915ef54313..4dc8929fbb351b4c12d6d564e71ab84e6b3f3dcd 100644
--- a/.github/workflows/fedora_30.yml
+++ b/.github/workflows/fedora_30.yml
@@ -44,7 +44,7 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        gc64: [ "GC64=OFF", "GC64=ON" ]
+        build-type: [ '', 'gc64' ]
 
     steps:
       - uses: actions/checkout@v2.3.4
@@ -57,7 +57,7 @@ jobs:
           RWS_AUTH: ${{ secrets.RWS_AUTH }}
           OS: 'fedora'
           DIST: '30'
-          GC64: -DLUAJIT_ENABLE_${{ matrix.gc64 }}
+          GC64: ${{ matrix.build-type == 'gc64' }}
         uses: ./.github/actions/pack_and_deploy
       - name: call action to send Telegram message on failure
         env:
diff --git a/.github/workflows/fedora_31.yml b/.github/workflows/fedora_31.yml
index b4b38cdb7389619aec812a8c9a34038228457960..a432c3640860e57c67d938ad0b01a8068c6a0eb3 100644
--- a/.github/workflows/fedora_31.yml
+++ b/.github/workflows/fedora_31.yml
@@ -44,7 +44,7 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        gc64: [ "GC64=OFF", "GC64=ON" ]
+        build-type: [ '', 'gc64' ]
 
     steps:
       - uses: actions/checkout@v2.3.4
@@ -57,7 +57,7 @@ jobs:
           RWS_AUTH: ${{ secrets.RWS_AUTH }}
           OS: 'fedora'
           DIST: '31'
-          GC64: -DLUAJIT_ENABLE_${{ matrix.gc64 }}
+          GC64: ${{ matrix.build-type == 'gc64' }}
         uses: ./.github/actions/pack_and_deploy
       - name: call action to send Telegram message on failure
         env:
diff --git a/.github/workflows/fedora_32.yml b/.github/workflows/fedora_32.yml
index eba3feeabb99f2904de0a86eee1d2cc9e4a1d3ff..b95cae1db4052a4774781a5c45d8b10b21fd29d8 100644
--- a/.github/workflows/fedora_32.yml
+++ b/.github/workflows/fedora_32.yml
@@ -44,7 +44,7 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        gc64: [ "GC64=OFF", "GC64=ON" ]
+        build-type: [ '', 'gc64' ]
 
     steps:
       - uses: actions/checkout@v2.3.4
@@ -57,7 +57,7 @@ jobs:
           RWS_AUTH: ${{ secrets.RWS_AUTH }}
           OS: 'fedora'
           DIST: '32'
-          GC64: -DLUAJIT_ENABLE_${{ matrix.gc64 }}
+          GC64: ${{ matrix.build-type == 'gc64' }}
         uses: ./.github/actions/pack_and_deploy
       - name: call action to send Telegram message on failure
         env:
diff --git a/.github/workflows/fedora_33.yml b/.github/workflows/fedora_33.yml
index 4c46c7b5f60d5acafae18e3a53f0e7c4dea40fcd..0fd84e1524593cd380e2aa56a2c89386b1468b12 100644
--- a/.github/workflows/fedora_33.yml
+++ b/.github/workflows/fedora_33.yml
@@ -44,7 +44,7 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        gc64: [ "GC64=OFF", "GC64=ON" ]
+        build-type: [ '', 'gc64' ]
 
     steps:
       - uses: actions/checkout@v2.3.4
@@ -57,7 +57,7 @@ jobs:
           RWS_AUTH: ${{ secrets.RWS_AUTH }}
           OS: 'fedora'
           DIST: '33'
-          GC64: -DLUAJIT_ENABLE_${{ matrix.gc64 }}
+          GC64: ${{ matrix.build-type == 'gc64' }}
         uses: ./.github/actions/pack_and_deploy
       - name: call action to send Telegram message on failure
         env:
diff --git a/.github/workflows/fedora_34.yml b/.github/workflows/fedora_34.yml
index ffc8e7560c6aa5261d779bfd356d23dc1eca112c..d61971c660bb8edb7ff75e01631a8c2b7ce68cf0 100644
--- a/.github/workflows/fedora_34.yml
+++ b/.github/workflows/fedora_34.yml
@@ -44,7 +44,7 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        gc64: [ "GC64=OFF", "GC64=ON" ]
+        build-type: [ '', 'gc64' ]
 
     steps:
       - uses: actions/checkout@v2.3.4
@@ -57,7 +57,7 @@ jobs:
           RWS_AUTH: ${{ secrets.RWS_AUTH }}
           OS: 'fedora'
           DIST: '34'
-          GC64: -DLUAJIT_ENABLE_${{ matrix.gc64 }}
+          GC64: ${{ matrix.build-type == 'gc64' }}
         uses: ./.github/actions/pack_and_deploy
       - name: call action to send Telegram message on failure
         env:
diff --git a/.github/workflows/fedora_35.yml b/.github/workflows/fedora_35.yml
index 78f0521c0a9d4a34468d7ffb7fb838f3810968ac..e2c43f102f795c67a07f52c7bb75439c6e9ded9b 100644
--- a/.github/workflows/fedora_35.yml
+++ b/.github/workflows/fedora_35.yml
@@ -44,7 +44,7 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        gc64: [ "GC64=OFF", "GC64=ON" ]
+        build-type: [ '', 'gc64' ]
 
     steps:
       - uses: actions/checkout@v2.3.4
@@ -57,7 +57,7 @@ jobs:
           RWS_AUTH: ${{ secrets.RWS_AUTH }}
           OS: 'fedora'
           DIST: '35'
-          GC64: -DLUAJIT_ENABLE_${{ matrix.gc64 }}
+          GC64: ${{ matrix.build-type == 'gc64' }}
         uses: ./.github/actions/pack_and_deploy
       - name: call action to send Telegram message on failure
         env:
diff --git a/.github/workflows/opensuse_15_1.yml b/.github/workflows/opensuse_15_1.yml
index d0e791814cb58f46be05d6276465d9eef8068f67..c0a8d8759309e44561d66b09d847443b714bd9d6 100644
--- a/.github/workflows/opensuse_15_1.yml
+++ b/.github/workflows/opensuse_15_1.yml
@@ -44,7 +44,7 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        gc64: [ "GC64=OFF", "GC64=ON" ]
+        build-type: [ '', 'gc64' ]
 
     steps:
       - uses: actions/checkout@v2.3.4
@@ -57,7 +57,7 @@ jobs:
           RWS_AUTH: ${{ secrets.RWS_AUTH }}
           OS: 'opensuse-leap'
           DIST: '15.1'
-          GC64: -DLUAJIT_ENABLE_${{ matrix.gc64 }}
+          GC64: ${{ matrix.build-type == 'gc64' }}
         uses: ./.github/actions/pack_and_deploy
       - name: call action to send Telegram message on failure
         env:
diff --git a/.github/workflows/opensuse_15_2.yml b/.github/workflows/opensuse_15_2.yml
index fe2e45ea703569377a3fe7234bc4971a4180aa5a..3d4e3c741d0b31eb84fdc0ea03e2cdf808f53e0b 100644
--- a/.github/workflows/opensuse_15_2.yml
+++ b/.github/workflows/opensuse_15_2.yml
@@ -44,7 +44,7 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        gc64: [ "GC64=OFF", "GC64=ON" ]
+        build-type: [ '', 'gc64' ]
 
     steps:
       - uses: actions/checkout@v2.3.4
@@ -57,7 +57,7 @@ jobs:
           RWS_AUTH: ${{ secrets.RWS_AUTH }}
           OS: 'opensuse-leap'
           DIST: '15.2'
-          GC64: -DLUAJIT_ENABLE_${{ matrix.gc64 }}
+          GC64: ${{ matrix.build-type == 'gc64' }}
         uses: ./.github/actions/pack_and_deploy
       - name: call action to send Telegram message on failure
         env:
diff --git a/.github/workflows/ubuntu_16_04.yml b/.github/workflows/ubuntu_16_04.yml
index 5472a6c4bc328fe5f39a6a5e40bb99706064be4b..8bd6cc2f4314c39716ea59c4153d1342e40dd45b 100644
--- a/.github/workflows/ubuntu_16_04.yml
+++ b/.github/workflows/ubuntu_16_04.yml
@@ -44,7 +44,7 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        gc64: [ "GC64=OFF", "GC64=ON" ]
+        build-type: [ '', 'gc64' ]
 
     steps:
       - uses: actions/checkout@v2.3.4
@@ -57,7 +57,7 @@ jobs:
           RWS_AUTH: ${{ secrets.RWS_AUTH }}
           OS: 'ubuntu'
           DIST: 'xenial'
-          GC64: -DLUAJIT_ENABLE_${{ matrix.gc64 }}
+          GC64: ${{ matrix.build-type == 'gc64' }}
         uses: ./.github/actions/pack_and_deploy
       - name: call action to send Telegram message on failure
         env:
diff --git a/.github/workflows/ubuntu_18_04.yml b/.github/workflows/ubuntu_18_04.yml
index 606c3a0cca2aceed631ed019f2d591257f68bc6a..0e7bcbad440f95d2f8a87c68d4d3303fa0d104db 100644
--- a/.github/workflows/ubuntu_18_04.yml
+++ b/.github/workflows/ubuntu_18_04.yml
@@ -44,7 +44,7 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        gc64: [ "GC64=OFF", "GC64=ON" ]
+        build-type: [ '', 'gc64' ]
 
     steps:
       - uses: actions/checkout@v2.3.4
@@ -57,7 +57,7 @@ jobs:
           RWS_AUTH: ${{ secrets.RWS_AUTH }}
           OS: 'ubuntu'
           DIST: 'bionic'
-          GC64: -DLUAJIT_ENABLE_${{ matrix.gc64 }}
+          GC64: ${{ matrix.build-type == 'gc64' }}
         uses: ./.github/actions/pack_and_deploy
       - name: call action to send Telegram message on failure
         env:
diff --git a/.github/workflows/ubuntu_20_04.yml b/.github/workflows/ubuntu_20_04.yml
index f603fe62b237876c506aa69d4bedf2e932614ab5..67d032123cc1caa7b664fbb8f2b0eac51f4e2517 100644
--- a/.github/workflows/ubuntu_20_04.yml
+++ b/.github/workflows/ubuntu_20_04.yml
@@ -44,7 +44,7 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        gc64: [ "GC64=OFF", "GC64=ON" ]
+        build-type: [ '', 'gc64' ]
 
     steps:
       - uses: actions/checkout@v2.3.4
@@ -57,7 +57,7 @@ jobs:
           RWS_AUTH: ${{ secrets.RWS_AUTH }}
           OS: 'ubuntu'
           DIST: 'focal'
-          GC64: -DLUAJIT_ENABLE_${{ matrix.gc64 }}
+          GC64: ${{ matrix.build-type == 'gc64' }}
         uses: ./.github/actions/pack_and_deploy
       - name: call action to send Telegram message on failure
         env:
diff --git a/.github/workflows/ubuntu_21_04.yml b/.github/workflows/ubuntu_21_04.yml
index 9d8d4769e4076dff615ca2fb83538470d816f473..c4e58dc7f7ae37792c55fe4be85b3b3fc447453a 100644
--- a/.github/workflows/ubuntu_21_04.yml
+++ b/.github/workflows/ubuntu_21_04.yml
@@ -44,7 +44,7 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        gc64: [ "GC64=OFF", "GC64=ON" ]
+        build-type: [ '', 'gc64' ]
 
     steps:
       - uses: actions/checkout@v2.3.4
@@ -57,7 +57,7 @@ jobs:
           RWS_AUTH: ${{ secrets.RWS_AUTH }}
           OS: 'ubuntu'
           DIST: 'hirsute'
-          GC64: -DLUAJIT_ENABLE_${{ matrix.gc64 }}
+          GC64: ${{ matrix.build-type == 'gc64' }}
         uses: ./.github/actions/pack_and_deploy
       - name: call action to send Telegram message on failure
         env:
diff --git a/.github/workflows/ubuntu_21_10.yml b/.github/workflows/ubuntu_21_10.yml
index b6462278c91b01f27276958b3f66acfb32fdf683..0868cf58c1f50c6a791980ee26c5be7ad4398ea5 100644
--- a/.github/workflows/ubuntu_21_10.yml
+++ b/.github/workflows/ubuntu_21_10.yml
@@ -44,7 +44,7 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        gc64: [ "GC64=OFF", "GC64=ON" ]
+        build-type: [ '', 'gc64' ]
 
     steps:
       - uses: actions/checkout@v2.3.4
@@ -57,7 +57,7 @@ jobs:
           RWS_AUTH: ${{ secrets.RWS_AUTH }}
           OS: 'ubuntu'
           DIST: 'impish'
-          GC64: -DLUAJIT_ENABLE_${{ matrix.gc64 }}
+          GC64: ${{ matrix.build-type == 'gc64' }}
         uses: ./.github/actions/pack_and_deploy
       - name: call action to send Telegram message on failure
         env:
diff --git a/.gitlab.mk b/.gitlab.mk
index 5f7b224914a6f4b99a37277cb022f13f941c7791..e1c206c4eada3c246568ef9c383d39015dca962e 100644
--- a/.gitlab.mk
+++ b/.gitlab.mk
@@ -125,7 +125,7 @@ deploy:
 		exit 1; \
 	fi; \
 	# Use different repos for vanilla and GC64 version.
-	if [ "$$(echo ${GC64} | sed 's/.*=//')" = ON ]; then \
+	if [ "${GC64}" = "true" ]; then \
 		RWS_ENDPOINT=${RWS_BASE_URL}/${REPO_TYPE}/${TARANTOOL_SERIES}-gc64/${OS}/${DIST}; \
 	else \
 		RWS_ENDPOINT=${RWS_BASE_URL}/${REPO_TYPE}/${TARANTOOL_SERIES}/${OS}/${DIST}; \
diff --git a/debian/rules b/debian/rules
index 7e9f73d11b7b40540a833733cb8ff5c66c6ba9c3..e0b1b18447ffbbea18a960bcfc4fb4a5ef429383 100755
--- a/debian/rules
+++ b/debian/rules
@@ -19,10 +19,9 @@ DEB_CMAKE_EXTRA_FLAGS := \
 	-DWITH_SYSVINIT=ON \
 	-DWITH_SYSTEMD=$(WITH_SYSTEMD)
 
-# Append CMAKE flag with -DLUAJIT_ENABLE_GC64 value. It is required
-# for CI to build Tarantool with GC64 enabled or disabled dynamically.
-ifneq ($(GC64),)
-	DEB_CMAKE_EXTRA_FLAGS += $(GC64)
+# Append -DLUAJIT_ENABLE_GC64=ON flag if ${GC64} env variable is 'true'.
+ifeq ($(GC64), true)
+	DEB_CMAKE_EXTRA_FLAGS += -DLUAJIT_ENABLE_GC64=ON
 endif
 
 # Install tarantool.service within tarantool-common package, but does not
diff --git a/rpm/tarantool.spec b/rpm/tarantool.spec
index e635b6efc2dc54bf45d2b874ed84ff2520bf71a5..84cebb12fbe0b081acd0aed82548379b611ec14e 100644
--- a/rpm/tarantool.spec
+++ b/rpm/tarantool.spec
@@ -11,10 +11,9 @@
 # need to use cmake3 package to build Tarantool on old systems.
 %define use_cmake3 0%{?rhel} == 7
 
-# Get GC64 variable which can keep compiler flag -DLUAJIT_ENABLE_GC64
-# with a value of ON or OFF to enable or disable luajit gc64.
-# It needs to build Tarantool in CI dynamically.
-%define _gc64 %{getenv:GC64}
+# Get ${GC64} env variable which can keep the value of 'true' or 'false' to
+# enable or disable luajit gc64.
+%define _gc64 "%{getenv:GC64}"
 
 %if %use_cmake3
 # XXX: Unfortunately there is no way to make rpmbuild install and
@@ -196,8 +195,8 @@ C and Lua/C modules.
 %if 0%{?fedora} >= 33
          -DENABLE_LTO=ON \
 %endif
-%if "%{_gc64}"
-         %{_gc64} \
+%if %{_gc64} == "true"
+         -DLUAJIT_ENABLE_GC64:BOOL=ON \
 %endif
          -DENABLE_WERROR:BOOL=ON \
          -DENABLE_DIST:BOOL=ON