Merge pull request #26334 from Luap99/sqlite-dynamic-link

dynamically link sqlite
This commit is contained in:
openshift-merge-bot[bot]
2025-06-12 13:25:54 +00:00
committed by GitHub
4 changed files with 11 additions and 17 deletions

View File

@ -61,6 +61,7 @@ REMOTETAGS ?= remote exclude_graphdriver_btrfs containers_image_openpgp
BUILDTAGS ?= \
$(shell hack/apparmor_tag.sh) \
$(shell hack/btrfs_installed_tag.sh) \
$(shell hack/sqlite_tag.sh) \
$(shell hack/systemd_tag.sh) \
$(shell hack/libsubid_tag.sh) \
$(if $(filter linux,$(GOOS)), seccomp,)

View File

@ -1,15 +0,0 @@
#!/usr/bin/env bash
tmpdir="$PWD/tmp.$RANDOM"
mkdir -p "$tmpdir"
trap 'rm -fr "$tmpdir"' EXIT
${CC:-cc} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -o "$tmpdir"/libdm_tag -x c - -ldevmapper > /dev/null 2> /dev/null << EOF
#include <libdevmapper.h>
int main() {
struct dm_task *task;
dm_task_deferred_remove(task);
return 0;
}
EOF
if test $? -ne 0 ; then
echo libdm_no_deferred_remove
fi

7
hack/sqlite_tag.sh Executable file
View File

@ -0,0 +1,7 @@
#!/usr/bin/env bash
${CPP:-${CC:-cc} -E} ${CPPFLAGS} - &> /dev/null << EOF
#include <sqlite3.h>
EOF
if test $? -eq 0 ; then
echo libsqlite3
fi

View File

@ -96,6 +96,7 @@ BuildRequires: shadow-utils-subid-devel
BuildRequires: pkgconfig
BuildRequires: make
BuildRequires: man-db
BuildRequires: sqlite-devel
BuildRequires: systemd
BuildRequires: systemd-devel
Requires: catatonit
@ -252,7 +253,7 @@ LDFLAGS="$LDFLAGS -X %{ld_libpod}/define.gitCommit=$GIT_COMMIT"
# build rootlessport first
%gobuild -o bin/rootlessport ./cmd/rootlessport
export BASEBUILDTAGS="seccomp $(hack/systemd_tag.sh) $(hack/libsubid_tag.sh)"
export BASEBUILDTAGS="seccomp $(hack/systemd_tag.sh) $(hack/libsubid_tag.sh) libsqlite3"
# libtrust_openssl buildtag switches to using the FIPS-compatible func
# `ecdsa.HashSign`.
@ -263,7 +264,7 @@ export BASEBUILDTAGS="$BASEBUILDTAGS libtrust_openssl"
%endif
# build %%{name}
export BUILDTAGS="$BASEBUILDTAGS $(hack/btrfs_installed_tag.sh) $(hack/libdm_tag.sh)"
export BUILDTAGS="$BASEBUILDTAGS $(hack/btrfs_installed_tag.sh)"
%gobuild -o bin/%{name} ./cmd/%{name}
# build %%{name}-remote