diff --git a/dtc.spec b/dtc.spec index b0c9b2954683c760ac402c7c118258e1e33c7041..a44b3d73a794f847e19363f44d26864c91d56967 100644 --- a/dtc.spec +++ b/dtc.spec @@ -2,7 +2,7 @@ Name: dtc Version: 1.7.0 -Release: 1 +Release: 2 Summary: Device tree compiler License: GPLv2+ URL: https://devicetree.org/ @@ -14,6 +14,7 @@ Provides: libfdt Obsoletes: libfdt Patch1: openEuler-add-secure-compile-option-in-Makefile.patch +Patch2: remove-ldflags-in-cflags.patch %description The devicetree is a data structure for describing hardware. Rather than hard coding @@ -47,11 +48,17 @@ This package provides python3 bindings for libfdt %build export SETUPTOOLS_SCM_PRETEND_VERSION=%{version} +%if "%toolchain" == "clang" + CFLAGS="$CFLAGS -Wno-error=cast-qual -Wno-error=missing-prototypes -Wno-error=unused-command-line-argument" +%endif %make_build %install export SETUPTOOLS_SCM_PRETEND_VERSION=%{version} +%if "%toolchain" == "clang" + CFLAGS="$CFLAGS -Wno-error=cast-qual -Wno-error=missing-prototypes -Wno-error=unused-command-line-argument" +%endif make install DESTDIR=$RPM_BUILD_ROOT PREFIX=$RPM_BUILD_ROOT/usr \ LIBDIR=%{_libdir} BINDIR=%{_bindir} INCLUDEDIR=%{_includedir} V=1 @@ -85,6 +92,9 @@ export SETUPTOOLS_SCM_PRETEND_VERSION=%{version} %doc Documentation/manual.txt %changelog +* Fri Jul 14 2023 dillon chen - 1.7.0-2 +- add clang build from jammyjellyfish PR + * Fri Jul 14 2023 dillon chen - 1.7.0-1 - update version to 1.7.0 diff --git a/remove-ldflags-in-cflags.patch b/remove-ldflags-in-cflags.patch new file mode 100644 index 0000000000000000000000000000000000000000..d5baa1967f8442fef1fb2cd60f85962aa4321fe2 --- /dev/null +++ b/remove-ldflags-in-cflags.patch @@ -0,0 +1,19 @@ +diff -up dtc-1.7.0/Makefile.orig2 dtc-1.7.0/Makefile +--- dtc-1.7.0/Makefile.orig2 2023-04-21 18:28:46.693701292 +0800 ++++ dtc-1.7.0/Makefile 2023-04-21 18:28:58.425735633 +0800 +@@ -20,12 +20,12 @@ CONFIG_LOCALVERSION = + # See libfdt_internal.h for details + ASSUME_MASK ?= 0 + +-EXTRA_CFLAGS += -D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wl,-z,now -fPIE ++EXTRA_CFLAGS += -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fPIE + LDFLAGS += -Wl,-z,now -pie + CPPFLAGS = -I libfdt -I . -DFDT_ASSUME_MASK=$(ASSUME_MASK) + WARNINGS = -Wall -Wpointer-arith -Wcast-qual -Wnested-externs -Wsign-compare \ + -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -Wshadow +-CFLAGS = -g -Os $(SHAREDLIB_CFLAGS) -Werror $(WARNINGS) $(EXTRA_CFLAGS) ++CFLAGS += -g -Os $(SHAREDLIB_CFLAGS) -Werror $(WARNINGS) $(EXTRA_CFLAGS) + + BISON = bison + LEX = flex +