support clang build

(cherry picked from commit 05a23f9b0084d03958ed6ae170c5f1a0091066e0)
This commit is contained in:
luofeng14 2024-03-22 09:52:55 +08:00 committed by openeuler-sync-bot
parent 23abbd91d4
commit 9673acc496
2 changed files with 39 additions and 2 deletions

View File

@ -1,6 +1,6 @@
Name: libdb Name: libdb
Version: 5.3.28 Version: 5.3.28
Release: 41 Release: 42
Summary: The Berkeley DB database library for C Summary: The Berkeley DB database library for C
License: BSD and LGPLv2 and Sleepycat License: BSD and LGPLv2 and Sleepycat
URL: https://www.oracle.com/database/berkeley-db/ URL: https://www.oracle.com/database/berkeley-db/
@ -40,6 +40,7 @@ patch40: libdb-cbd-race.patch
Patch41: fix-a-potential-infinite-loop.patch Patch41: fix-a-potential-infinite-loop.patch
Patch42: add-check-for-device-number-in-__check_lock_fn.patch Patch42: add-check-for-device-number-in-__check_lock_fn.patch
Patch43: db-5.3.28-sw.patch Patch43: db-5.3.28-sw.patch
patch44: support-clang-build.patch
BuildRequires: gcc gcc-c++ perl-interpreter libtool tcl-devel >= 8.5.2-3 BuildRequires: gcc gcc-c++ perl-interpreter libtool tcl-devel >= 8.5.2-3
BuildRequires: java-1.8.0-openjdk-devel chrpath zlib-devel BuildRequires: java-1.8.0-openjdk-devel chrpath zlib-devel
@ -124,7 +125,7 @@ popd
%ifarch sw_64 %ifarch sw_64
%patch43 -p1 %patch43 -p1
%endif %endif
%patch44 -p1
pushd dist pushd dist
./s_config ./s_config
@ -217,6 +218,9 @@ mv man/* %{buildroot}%{_mandir}/man1/
%{_mandir}/man1 %{_mandir}/man1
%changelog %changelog
* Fri Mar 22 2024 luofeng <luofeng13@huawei.com> - 5.3.28-42
- support clang build
* Wed Oct 19 2022 wuzx<wuzx1226@qq.com> - 5.3.28-41 * Wed Oct 19 2022 wuzx<wuzx1226@qq.com> - 5.3.28-41
- add sw64 patch - add sw64 patch

33
support-clang-build.patch Normal file
View File

@ -0,0 +1,33 @@
From ba70232521c53b4f32733ba023b82157e6de6cdd Mon Sep 17 00:00:00 2001
From: luofeng <luofeng13@huawei.com>
Date: Thu, 21 Mar 2024 21:00:42 +0800
Subject: [PATCH] support clang build
---
db.1.85/PORT/Makefile | 2 +-
db.1.85/PORT/linux/Makefile | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/db.1.85/PORT/Makefile b/db.1.85/PORT/Makefile
index 383b259..fc7518e 100644
--- a/db.1.85/PORT/Makefile
+++ b/db.1.85/PORT/Makefile
@@ -99,4 +99,4 @@ memmove.o:
mktemp.o:
${CC} -c -O -I. -Iinclude clib/mktemp.c
snprintf.o:
- ${CC} -c -O -I. -Iinclude clib/snprintf.c
+ ${CC} -c $(CFLAGS) -O -I. -Iinclude clib/snprintf.c
diff --git a/db.1.85/PORT/linux/Makefile b/db.1.85/PORT/linux/Makefile
index 40b7c55..6a70e2c 100644
--- a/db.1.85/PORT/linux/Makefile
+++ b/db.1.85/PORT/linux/Makefile
@@ -98,4 +98,4 @@ memmove.o:
mktemp.o:
${CC} -c -O -I. -Iinclude clib/mktemp.c
snprintf.o:
- ${CC} -c -O -I. -Iinclude clib/snprintf.c
+ ${CC} -c $(CFLAGS) -O -I. -Iinclude clib/snprintf.c
--
2.19.1