summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/dockerfiles/ubuntu-18.04-x64/Dockerfile15
-rw-r--r--.github/workflows/release-linux-glibc-2-27.yml63
-rw-r--r--deps/target-deps.json1
-rw-r--r--github_build.sh6
-rw-r--r--premake5.lua13
5 files changed, 97 insertions, 1 deletions
diff --git a/.github/workflows/dockerfiles/ubuntu-18.04-x64/Dockerfile b/.github/workflows/dockerfiles/ubuntu-18.04-x64/Dockerfile
new file mode 100644
index 000000000..bbdfe1084
--- /dev/null
+++ b/.github/workflows/dockerfiles/ubuntu-18.04-x64/Dockerfile
@@ -0,0 +1,15 @@
+FROM ubuntu:18.04
+RUN apt update
+RUN apt install -y software-properties-common wget git build-essential zip libx11-dev zlib1g-dev
+RUN add-apt-repository ppa:ubuntu-toolchain-r/test -y
+RUN apt update
+RUN apt install -y gcc-9 g++-9
+RUN update-alternatives \
+ --install /usr/bin/gcc gcc /usr/bin/gcc-9 100 \
+ --slave /usr/bin/g++ g++ /usr/bin/g++-9 \
+ --slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-9 \
+ --slave /usr/bin/gcc-nm gcc-nm /usr/bin/gcc-nm-9 \
+ --slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-9 \
+ --slave /usr/bin/gcov gcov /usr/bin/gcov-9 \
+ --slave /usr/bin/gcov-dump gcov-dump /usr/bin/gcov-dump-9 \
+ --slave /usr/bin/gcov-tool gcov-tool /usr/bin/gcov-tool-9
diff --git a/.github/workflows/release-linux-glibc-2-27.yml b/.github/workflows/release-linux-glibc-2-27.yml
new file mode 100644
index 000000000..8fcbecd0d
--- /dev/null
+++ b/.github/workflows/release-linux-glibc-2-27.yml
@@ -0,0 +1,63 @@
+on:
+ push:
+ # Sequence of patterns matched against refs/tags
+ tags:
+ - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
+
+name: Linux Release
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Check out the repo
+ uses: actions/checkout@v2
+ with:
+ submodules: 'true'
+ fetch-depth: '0'
+
+ - name: build docker image
+ run: docker build -t ubuntu-18.04-gcc-9 ./.github/workflows/dockerfiles/ubuntu-18.04-x64
+
+ # build the binary in docker image
+ - name: Run the build process with Docker
+ uses: addnab/docker-run-action@v3
+ with:
+ image: ubuntu-18.04-gcc-9
+ options: -v ${{ github.workspace }}:/home/app
+ run: |
+ cd /home/app
+ git config --global --add safe.directory /home/app
+ export CC=gcc
+ export CONFIGURATION=release
+ export ARCH=x64
+ export TARGETARCH=x64
+ export TARGETARCH=x64
+ export GLIBC_COMPATIBLE=1
+ /bin/bash ./github_build.sh
+
+ - name: CreatePackages
+ id: build
+ run: |
+ echo "creating binary archieves..."
+ export SLANG_OS_NAME=linux
+ export SLANG_ARCH_NAME=`uname -p`
+ export TAG_NAME=`git describe --tags`
+ export SLANG_TAG=${TAG_NAME#v}
+ echo "tag:$TAG_NAME"
+ echo "slang-tag:$SLANG_TAG"
+ export SLANG_BINARY_ARCHIVE=slang-${SLANG_TAG}-${SLANG_OS_NAME}-${SLANG_ARCH_NAME}-glibc-2.27.zip
+ export SLANG_BINARY_ARCHIVE_TAR=slang-${SLANG_TAG}-${SLANG_OS_NAME}-${SLANG_ARCH_NAME}-glibc-2.27.tar.gz
+ echo "creating zip"
+ zip -r ${SLANG_BINARY_ARCHIVE} bin/*/*/slangc bin/*/*/slangd bin/*/*/libslang.so bin/*/*/libslang-glslang.so bin/*/*/libgfx.so bin/*/*/libslang-llvm.so docs/*.md README.md LICENSE slang.h slang-com-helper.h slang-com-ptr.h slang-tag-version.h slang-gfx.h prelude/*.h
+ echo "creating tar"
+ tar -czf ${SLANG_BINARY_ARCHIVE_TAR} bin/*/*/slangc bin/*/*/slangd bin/*/*/libslang.so bin/*/*/libslang-glslang.so bin/*/*/libgfx.so bin/*/*/libslang-llvm.so docs/*.md README.md LICENSE slang.h slang-com-helper.h slang-com-ptr.h slang-tag-version.h slang-gfx.h prelude/*.h
+ echo "SLANG_BINARY_ARCHIVE=${SLANG_BINARY_ARCHIVE}" >> $GITHUB_OUTPUT
+ echo "SLANG_BINARY_ARCHIVE_TAR=${SLANG_BINARY_ARCHIVE_TAR}" >> $GITHUB_OUTPUT
+ - name: UploadBinary
+ uses: softprops/action-gh-release@v1
+ with:
+ files: |
+ ${{ steps.build.outputs.SLANG_BINARY_ARCHIVE }}
+ ${{ steps.build.outputs.SLANG_BINARY_ARCHIVE_TAR }}
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/deps/target-deps.json b/deps/target-deps.json
index ddd29b78a..0e6d5badd 100644
--- a/deps/target-deps.json
+++ b/deps/target-deps.json
@@ -23,6 +23,7 @@
"windows-x86_64" : { "type" : "url", "path" : "windows-x64-release.zip" },
"windows-x86" : { "type": "url", "path" : "windows-win32-release.zip" },
"linux-x86_64" : { "type": "url", "path" : "linux-x64-release.zip" },
+ "linux-x86_64-glibc-2.27" : { "type": "url", "path" : "linux-x64-release-glibc-2.27.zip" },
"linux-x86" : { "type": "url", "path" : "linux-x86-release.zip" },
"macosx-x86_64" : { "type": "url", "path" : "macosx-x86_64-release.zip" },
"windows-aarch64" : { "type" : "url", "path" : "windows-aarch64-release.zip" }
diff --git a/github_build.sh b/github_build.sh
index c35cff192..d905ec5eb 100644
--- a/github_build.sh
+++ b/github_build.sh
@@ -20,6 +20,10 @@ if [[ "aarch64" == "${TARGETARCH}" && "release" == "${CONFIGURATION}" ]]; then
glslangBuildFlag="--build-glslang=true"
fi
+if [[ ! -z ${GLIBC_COMPATIBLE} ]]; then
+ glibcCompatible="--glibcForwardCompatible=true"
+fi
+
if [[ "${ARCH}" != "${TARGETARCH}" ]]; then
# Create the makefile
@@ -35,7 +39,7 @@ rm -rf ./bin
else
# Create the makefile
-./premake5 gmake2 --cc=${CC} --enable-embed-stdlib=true --arch=${TARGETARCH} --deps=true --no-progress=true ${glslangBuildFlag}
+./premake5 gmake2 --cc=${CC} --enable-embed-stdlib=true --arch=${TARGETARCH} --deps=true --no-progress=true ${glslangBuildFlag} ${glibcCompatible}
fi
# Build the configuration
diff --git a/premake5.lua b/premake5.lua
index 1cfe33517..b14844c8e 100644
--- a/premake5.lua
+++ b/premake5.lua
@@ -236,6 +236,14 @@ newoption {
allowed = { { "true", "True"}, { "false", "False" } }
}
+newoption {
+ trigger = "glibc-forward-compatible",
+ description = "(Optional) Build slang against older version of glibc (2.27) to be forward compatible with older systems",
+ value = "bool",
+ default = "false",
+ allowed = { { "true", "True"}, { "false", "False" } }
+}
+
buildLocation = _OPTIONS["build-location"]
executeBinary = (_OPTIONS["execute-binary"] == "true")
buildGlslang = (_OPTIONS["build-glslang"] == "true")
@@ -254,6 +262,7 @@ enableAsan = (_OPTIONS["enable-asan"] == "true")
dxOnVk = (_OPTIONS["dx-on-vk"] == "true")
enableAftermath = (_OPTIONS["enable-aftermath"] == "true")
defaultSPIRVDirect = (_OPTIONS["default-spirv-direct"] == "true")
+glibcForwardCompatible = (_OPTIONS["glibc-forward-compatible"] == "true")
-- If stdlib embedding is enabled, disable stdlib source embedding by default
disableStdlibSource = enableEmbedStdLib
@@ -278,6 +287,10 @@ end
targetInfo = slangUtil.getTargetInfo()
+printf("target name " .. targetInfo.name)
+if (targetInfo.name == "linux-x86_64") and (glibcForwardCompatible) then
+ targetInfo.name = targetInfo.name .. "-glibc-2.27"
+end
--
-- Update the dependencies for the target
--