From 7c1691bbeba75774ea38284ccfafd605de9f27af Mon Sep 17 00:00:00 2001 From: Adriano dos Santos Fernandes Date: Thu, 18 Apr 2024 22:01:08 -0300 Subject: [PATCH] Switch Linux docker build from ubuntu to debian. --- builds/docker/linux/arm32-arm64/Dockerfile | 20 ++++++++----------- .../docker/linux/arm32-arm64/build-arm32.sh | 2 +- .../docker/linux/arm32-arm64/build-arm64.sh | 2 +- builds/docker/linux/x86-x64/Dockerfile | 8 +++----- builds/docker/linux/x86-x64/build-x64.sh | 2 +- builds/docker/linux/x86-x64/build-x86.sh | 2 +- builds/posix/Makefile.in | 2 +- builds/posix/make.defaults | 5 ----- builds/posix/make.rules | 4 ++++ extern/cloop/Makefile | 12 +++++------ 10 files changed, 26 insertions(+), 33 deletions(-) diff --git a/builds/docker/linux/arm32-arm64/Dockerfile b/builds/docker/linux/arm32-arm64/Dockerfile index 5f78304df5..b72608cb18 100644 --- a/builds/docker/linux/arm32-arm64/Dockerfile +++ b/builds/docker/linux/arm32-arm64/Dockerfile @@ -1,4 +1,4 @@ -ARG ARG_BASE=arm64v8/ubuntu:23.10 +ARG ARG_BASE=arm64v8/debian:bookworm ARG ARG_TARGET_ARCH=aarch64-pc-linux-gnu ARG ARG_CTNF_CONFIG=crosstool-ng-config-arm64 @@ -15,7 +15,7 @@ ARG ARG_CTNG_UID=1000 ARG ARG_CTNG_GID=1000 -FROM ubuntu:23.10 as builder +FROM debian:bookworm as builder ARG ARG_TARGET_ARCH ARG ARG_CTNF_CONFIG @@ -32,8 +32,7 @@ ARG ARG_CPUCOUNT ARG ARG_CTNG_UID ARG ARG_CTNG_GID -RUN userdel -r ubuntu && \ - groupadd -g $ARG_CTNG_GID ctng && \ +RUN groupadd -g $ARG_CTNG_GID ctng && \ useradd -d /home/ctng -m -g $ARG_CTNG_GID -u $ARG_CTNG_UID -s /bin/bash ctng && \ \ { echo 'tzdata tzdata/Areas select Etc'; echo 'tzdata tzdata/Zones/Etc select UTC'; } | debconf-set-selections && \ @@ -111,7 +110,7 @@ RUN sudo apt-get -y remove \ libtomcrypt-dev && \ sudo rm -rf /var/lib/apt/lists/* -ENV PATH "/home/ctng/x-tools/x86_64-pc-linux-gnu/bin:${PATH}" +ENV PATH "/home/ctng/x-tools/x86_64-pc-linux-gnu/bin:/home/ctng/x-tools/x86_64-pc-linux-gnu/x86_64-pc-linux-gnu/sysroot/usr/local/bin:${PATH}" ENV PATH "/home/ctng/x-tools/${ARG_TARGET_ARCH}/bin:/home/ctng/x-tools/${ARG_TARGET_ARCH}/${ARG_TARGET_ARCH}/sysroot/usr/local/bin:${PATH}" RUN cd ~/build && \ @@ -186,22 +185,20 @@ RUN cd ~/build && \ tar xvf icu4c-${ARG_ICU_VERSION}-src.tgz --strip 1 -C icu4c-${ARG_ICU_VERSION}-src && \ mkdir icu4c-${ARG_ICU_VERSION}-build-x86_64 && \ cd icu4c-${ARG_ICU_VERSION}-build-x86_64 && \ - ../icu4c-${ARG_ICU_VERSION}-src/source/runConfigureICU \ + CXXFLAGS='-std=c++17 -static-libstdc++' ../icu4c-${ARG_ICU_VERSION}-src/source/runConfigureICU \ Linux \ - --host=x86_64-pc-linux-gnu \ - CXXFLAGS=-std=c++17 && \ + --host=x86_64-pc-linux-gnu && \ make -j${ARG_CPUCOUNT} RUN cd ~/build && \ mkdir icu4c-${ARG_ICU_VERSION}-build && \ cd icu4c-${ARG_ICU_VERSION}-build && \ - ../icu4c-${ARG_ICU_VERSION}-src/source/runConfigureICU \ + CXXFLAGS='-std=c++17 -static-libstdc++' ../icu4c-${ARG_ICU_VERSION}-src/source/runConfigureICU \ Linux \ --host=${ARG_TARGET_ARCH} \ --with-cross-build=/home/ctng/build/icu4c-${ARG_ICU_VERSION}-build-x86_64 \ --prefix=/home/ctng/x-tools/${ARG_TARGET_ARCH}/${ARG_TARGET_ARCH}/sysroot/usr/local \ - --includedir=/home/ctng/x-tools/${ARG_TARGET_ARCH}/${ARG_TARGET_ARCH}/sysroot/usr/include \ - CXXFLAGS=-std=c++17 && \ + --includedir=/home/ctng/x-tools/${ARG_TARGET_ARCH}/${ARG_TARGET_ARCH}/sysroot/usr/include && \ make -j${ARG_CPUCOUNT} && \ make install @@ -221,7 +218,6 @@ RUN apt-get update && \ rm -rf /var/lib/apt/lists/* RUN ln -s /usr/x86_64-linux-gnu/lib64 /lib64 && \ - userdel -r ubuntu && \ groupadd -g $ARG_CTNG_GID ctng && \ useradd -d /home/ctng -m -g $ARG_CTNG_GID -u $ARG_CTNG_UID -s /bin/bash ctng diff --git a/builds/docker/linux/arm32-arm64/build-arm32.sh b/builds/docker/linux/arm32-arm64/build-arm32.sh index 0da768dd5c..4072c97d77 100755 --- a/builds/docker/linux/arm32-arm64/build-arm32.sh +++ b/builds/docker/linux/arm32-arm64/build-arm32.sh @@ -1,7 +1,7 @@ #!/bin/sh docker buildx build \ --pull \ - --build-arg ARG_BASE=arm32v7/ubuntu:23.10 \ + --build-arg ARG_BASE=arm32v7/debian:bookworm \ --build-arg ARG_TARGET_ARCH=arm-pc-linux-gnueabihf \ --build-arg ARG_CTNF_CONFIG=crosstool-ng-config-arm32 \ -t asfernandes/firebird-builder:fb6-arm32-ng-v1 . diff --git a/builds/docker/linux/arm32-arm64/build-arm64.sh b/builds/docker/linux/arm32-arm64/build-arm64.sh index 4429a67b88..ae8385b8e3 100755 --- a/builds/docker/linux/arm32-arm64/build-arm64.sh +++ b/builds/docker/linux/arm32-arm64/build-arm64.sh @@ -1,7 +1,7 @@ #!/bin/sh docker buildx build \ --pull \ - --build-arg ARG_BASE=arm64v8/ubuntu:23.10 \ + --build-arg ARG_BASE=arm64v8/debian:bookworm \ --build-arg ARG_TARGET_ARCH=aarch64-pc-linux-gnu \ --build-arg ARG_CTNF_CONFIG=crosstool-ng-config-arm64 \ -t asfernandes/firebird-builder:fb6-arm64-ng-v1 . diff --git a/builds/docker/linux/x86-x64/Dockerfile b/builds/docker/linux/x86-x64/Dockerfile index e86dfdd5e5..e7c3b1b0f5 100644 --- a/builds/docker/linux/x86-x64/Dockerfile +++ b/builds/docker/linux/x86-x64/Dockerfile @@ -1,4 +1,4 @@ -ARG ARG_BASE=ubuntu:23.10 +ARG ARG_BASE=debian:bookworm ARG ARG_SET_ARCH=x86_64 ARG ARG_TARGET_ARCH=x86_64-pc-linux-gnu ARG ARG_CTNF_CONFIG=crosstool-ng-config-x64 @@ -34,8 +34,7 @@ ARG ARG_CPUCOUNT ARG ARG_CTNG_UID ARG ARG_CTNG_GID -RUN userdel -r ubuntu && \ - groupadd -g $ARG_CTNG_GID ctng && \ +RUN groupadd -g $ARG_CTNG_GID ctng && \ useradd -d /home/ctng -m -g $ARG_CTNG_GID -u $ARG_CTNG_UID -s /bin/bash ctng && \ \ { echo 'tzdata tzdata/Areas select Etc'; echo 'tzdata tzdata/Zones/Etc select UTC'; } | debconf-set-selections && \ @@ -208,8 +207,7 @@ RUN apt-get update && \ xz-utils && \ rm -rf /var/lib/apt/lists/* -RUN userdel -r ubuntu && \ - groupadd -g $ARG_CTNG_GID ctng && \ +RUN groupadd -g $ARG_CTNG_GID ctng && \ useradd -d /home/ctng -m -g $ARG_CTNG_GID -u $ARG_CTNG_UID -s /bin/bash ctng USER ctng diff --git a/builds/docker/linux/x86-x64/build-x64.sh b/builds/docker/linux/x86-x64/build-x64.sh index ea4af6564c..89ecc57a8f 100755 --- a/builds/docker/linux/x86-x64/build-x64.sh +++ b/builds/docker/linux/x86-x64/build-x64.sh @@ -1,7 +1,7 @@ #!/bin/sh docker buildx build \ --pull \ - --build-arg ARG_BASE=ubuntu:23.10 \ + --build-arg ARG_BASE=debian:bookworm \ --build-arg ARG_SET_ARCH=x86_64 \ --build-arg ARG_TARGET_ARCH=x86_64-pc-linux-gnu \ --build-arg ARG_CTNF_CONFIG=crosstool-ng-config-x64 \ diff --git a/builds/docker/linux/x86-x64/build-x86.sh b/builds/docker/linux/x86-x64/build-x86.sh index 6252a714b8..94de4e40ab 100755 --- a/builds/docker/linux/x86-x64/build-x86.sh +++ b/builds/docker/linux/x86-x64/build-x86.sh @@ -1,7 +1,7 @@ #!/bin/sh docker buildx build \ --pull \ - --build-arg ARG_BASE=i386/ubuntu:18.04 \ + --build-arg ARG_BASE=i386/debian:bookworm \ --build-arg ARG_SET_ARCH=i686 \ --build-arg ARG_TARGET_ARCH=i586-pc-linux-gnu \ --build-arg ARG_CTNF_CONFIG=crosstool-ng-config-x86 \ diff --git a/builds/posix/Makefile.in b/builds/posix/Makefile.in index 6dee68ce86..ef54769fc8 100644 --- a/builds/posix/Makefile.in +++ b/builds/posix/Makefile.in @@ -187,7 +187,7 @@ ifeq ($(CLIENT_ONLY_FLG),N) CC="$(CC)" CFLAGS="$(CFLAGS)" AR="$(AR)" $(MAKE) -C $(ROOT)/extern/btyacc endif - CXX="$(CXX)" CXXFLAGS="$(CXXFLAGS)" $(MAKE) -C $(ROOT)/extern/cloop TARGET=release WITH_FPC=0 BUILD_DIR=$(TMP_ROOT)/cloop OUT_DIR=$(GEN_ROOT)/$(TARGET)/cloop core + CXX="$(CXX)" CXXFLAGS="$(CXXFLAGS)" LD_FLAGS="$(WLDFLAGS)" $(MAKE) -C $(ROOT)/extern/cloop TARGET=release WITH_FPC=0 BUILD_DIR=$(TMP_ROOT)/cloop OUT_DIR=$(GEN_ROOT)/$(TARGET)/cloop core CC="$(CC)" CFLAGS="$(CFLAGS)" AR="$(AR)" $(MAKE) -C $(ROOT)/extern/decNumber ln -sf $(ROOT)/extern/decNumber/libdecFloat.a $(STATIC_LIB) diff --git a/builds/posix/make.defaults b/builds/posix/make.defaults index 43c9044c60..7283d1fa4d 100755 --- a/builds/posix/make.defaults +++ b/builds/posix/make.defaults @@ -203,13 +203,8 @@ AC_LDFLAGS = @LDFLAGS@ # LINKER COMMANDS -ifeq ($(PLATFORM),DARWIN) LIB_LINK = $(CXX) $(GLOB_OPTIONS) $(CXXFLAGS) $(WLDFLAGS) EXE_LINK = $(CXX) $(GLOB_OPTIONS) $(CXXFLAGS) $(WLDFLAGS) -else -LIB_LINK = $(CXX) $(GLOB_OPTIONS) $(CXXFLAGS) $(WLDFLAGS) -static-libstdc++ -EXE_LINK = $(CXX) $(GLOB_OPTIONS) $(CXXFLAGS) $(WLDFLAGS) -static-libstdc++ -endif STATICLIB_LINK = $(AR) crus diff --git a/builds/posix/make.rules b/builds/posix/make.rules index 659830d11a..3bbd2580fe 100644 --- a/builds/posix/make.rules +++ b/builds/posix/make.rules @@ -70,6 +70,10 @@ WCFLAGS = $(WFLAGS) $(CFLAGS) $(AC_CFLAGS) $(GLOB_OPTIONS) WCXXFLAGS = $(WFLAGS) $(PLUSPLUS_FLAGS) $(PLATFORM_PLUSPLUS_FLAGS) $(CXXFLAGS) $(AC_CXXFLAGS) $(GLOB_OPTIONS) WLDFLAGS = $(LDFLAGS) $(AC_LDFLAGS) +ifneq ($(PLATFORM),DARWIN) +WLDFLAGS += -static-libstdc++ +endif + # Here we have definitions for using the preprocessor. # The GPRE_FLAGS is overwritten in Makefile.in.jrd Makefile.in.gpre and diff --git a/extern/cloop/Makefile b/extern/cloop/Makefile index 8ce5f5c44a..319218a85e 100644 --- a/extern/cloop/Makefile +++ b/extern/cloop/Makefile @@ -6,7 +6,7 @@ TARGET := release CC := $(CC) CXX := $(CXX) -LD := $(CXX) -static-libstdc++ +LD := $(CXX) SRC_DIR := src BUILD_DIR := build @@ -98,7 +98,7 @@ $(BIN_DIR)/cloop: \ $(OBJ_DIR)/cloop/Main.o \ | $(BIN_DIR) - $(LD) $^ -o $@ $(LIBS) + $(LD) $(LD_FLAGS) $^ -o $@ $(LIBS) $(SRC_DIR)/tests/test1/CalcCApi.h: $(BIN_DIR)/cloop $(SRC_DIR)/tests/test1/Interface.idl $(BIN_DIR)/cloop $(SRC_DIR)/tests/test1/Interface.idl c-header $@ CALC_C_API_H CALC_I @@ -125,23 +125,23 @@ $(BIN_DIR)/test1-c$(SHRLIB_EXT): \ $(OBJ_DIR)/tests/test1/CalcCApi.o \ $(OBJ_DIR)/tests/test1/CTest.o \ - $(LD) $^ -shared $(DL_LIB) -o $@ $(LIBS) + $(LD) $(LD_FLAGS) $^ -shared $(DL_LIB) -o $@ $(LIBS) $(BIN_DIR)/test1-c$(EXE_EXT): \ $(OBJ_DIR)/tests/test1/CalcCApi.o \ $(OBJ_DIR)/tests/test1/CTest.o \ - $(LD) $^ $(DL_LIB) -o $@ $(LIBS) + $(LD) $(LD_FLAGS) $^ $(DL_LIB) -o $@ $(LIBS) $(BIN_DIR)/test1-cpp$(SHRLIB_EXT): \ $(OBJ_DIR)/tests/test1/CppTest.o \ - $(LD) $^ -shared $(DL_LIB) -o $@ $(LIBS) + $(LD) $(LD_FLAGS) $^ -shared $(DL_LIB) -o $@ $(LIBS) $(BIN_DIR)/test1-cpp$(EXE_EXT): \ $(OBJ_DIR)/tests/test1/CppTest.o \ - $(LD) $^ $(DL_LIB) -o $@ $(LIBS) + $(LD) $(LD_FLAGS) $^ $(DL_LIB) -o $@ $(LIBS) $(BIN_DIR)/test1-pascal$(SHRLIB_EXT): \ $(SRC_DIR)/tests/test1/PascalClasses.pas \