From d1231afb45a3c2821c401b2d52dde347bb713a8a Mon Sep 17 00:00:00 2001 From: wangqiang Date: Tue, 19 Mar 2024 18:56:38 +0800 Subject: [PATCH] Fix CC compiler support --- 0001-Fix-CC-compiler-support.patch | 29 +++++++++++++++++++++++++++++ protobuf.spec | 10 +++++++++- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 0001-Fix-CC-compiler-support.patch diff --git a/0001-Fix-CC-compiler-support.patch b/0001-Fix-CC-compiler-support.patch new file mode 100644 index 0000000..d4f4440 --- /dev/null +++ b/0001-Fix-CC-compiler-support.patch @@ -0,0 +1,29 @@ +From b62fbe3852ea070f1bfbb048e71dfae70c7c71f0 Mon Sep 17 00:00:00 2001 +From: wangqiang +Date: Tue, 19 Mar 2024 18:54:13 +0800 +Subject: [PATCH] Fix CC compiler support + +--- + third_party/utf8_range/utf8_to_utf16/Makefile | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/third_party/utf8_range/utf8_to_utf16/Makefile b/third_party/utf8_range/utf8_to_utf16/Makefile +index 853ffa4..30ef021 100644 +--- a/third_party/utf8_range/utf8_to_utf16/Makefile ++++ b/third_party/utf8_range/utf8_to_utf16/Makefile +@@ -1,10 +1,10 @@ +-CC = gcc ++CC := ${CC} + CPPFLAGS = -g -O3 -Wall -march=native + + OBJS = main.o iconv.o naive.o + + utf8to16: ${OBJS} +- gcc $^ -o $@ ++ ${CC} $^ -o $@ + + .PHONY: clean + clean: +-- +2.33.0 + diff --git a/protobuf.spec b/protobuf.spec index fbb0711..c4b6ac8 100644 --- a/protobuf.spec +++ b/protobuf.spec @@ -7,7 +7,7 @@ Summary: Protocol Buffers - Google's data interchange format Name: protobuf Version: 25.1 -Release: 1 +Release: 2 License: BSD URL: https://github.com/protocolbuffers/protobuf Source: https://github.com/protocolbuffers/protobuf/releases/download/v%{version}%{?rcver}/%{name}-all-%{version}%{?rcver}.tar.gz @@ -15,6 +15,7 @@ Source1: protobuf-init.el %global so_version 25.1 Patch9000: 0001-add-secure-compile-option.patch +Patch9001: 0001-Fix-CC-compiler-support.patch BuildRequires: cmake gcc-c++ emacs zlib-devel gmock-devel gtest-devel jsoncpp-devel BuildRequires: fdupes pkgconfig python-rpm-macros pkgconfig(zlib) ninja-build @@ -232,6 +233,8 @@ pushd build -DCMAKE_MODULE_LINKER_FLAGS=-Wl,--as-needed \ -DCMAKE_SHARED_LINKER_FLAGS=-Wl,--as-needed \ -DCMAKE_CXX_FLAGS="-g -O2" \ + -DCMAKE_C_COMPILER=%{__cc} \ + -DCMAKE_CXX_COMPILER=%{__cxx} \ -G Ninja \ ../ popd @@ -247,6 +250,8 @@ export CMAKE_BUILD_DIR=build-static -Dprotobuf_ABSL_PROVIDER=package \ -Dprotobuf_BUILD_TESTS:BOOL=OFF \ -DCMAKE_CXX_FLAGS="-fPIC" \ + -DCMAKE_C_COMPILER=%{__cc} \ + -DCMAKE_CXX_COMPILER=%{__cxx} \ -G Ninja \ ../ popd @@ -387,6 +392,9 @@ install -p -m 0644 %{SOURCE1} %{buildroot}%{_emacs_sitestartdir} %endif %changelog +* Wed Mar 20 2024 wangqiang - 25.1-2 +- Support package build with clang + * Wed Jan 10 2024 zhongtao - 25.1-1 - Type:upgrade - ID:NA -- Gitee