diff --git a/recipes-devtools/libboundscheck/files/static-library.patch b/recipes-devtools/libboundscheck/files/static-library.patch new file mode 100644 index 0000000000000000000000000000000000000000..fb72f4dd9d6fe1f8c553ed68247f1c01591507f1 --- /dev/null +++ b/recipes-devtools/libboundscheck/files/static-library.patch @@ -0,0 +1,34 @@ +# SPDX-FileCopyrightText: Huawei Inc. +# +# SPDX-License-Identifier: Apache-2.0 + +Build static library instead of shared. + +Signed-off-by: Esben Haabendal <esben.haabendal@huawei.com> +Upstream-Status: Inappropriate + +--- a/Makefile 2021-09-17 13:14:58.559510146 +0200 ++++ b/Makefile 2021-09-17 13:16:51.536843159 +0200 +@@ -1,4 +1,4 @@ +-PROJECT=libboundscheck.so ++PROJECT = libboundscheck.a + + CC?=gcc + +@@ -31,8 +31,7 @@ + LD_FLAG = -fPIC -s -Wl,-z,relro,-z,now,-z,noexecstack -fstack-protector-all + + $(PROJECT): $(OBJECTS) +- mkdir -p lib +- $(CC) -shared -o lib/$@ $(patsubst %.o,obj/%.o,$(notdir $(OBJECTS))) $(LD_FLAG) ++ ar q $(PROJECT) $(patsubst %.o,obj/%.o,$(notdir $(OBJECTS))) + @echo "finish $(PROJECT)" + + .c.o: +@@ -40,5 +39,5 @@ + $(CC) -c $< $(CFLAG) -o obj/$(patsubst %.c,%.o,$(notdir $<)) + + clean: +- -rm -rf obj lib ++ -rm -rf obj + @echo "clean up" diff --git a/recipes-devtools/libboundscheck/libboundscheck_1.1.10.bb b/recipes-devtools/libboundscheck/libboundscheck_1.1.10.bb new file mode 100644 index 0000000000000000000000000000000000000000..145222be2b14c49b25ef2eefdae6aa38d29fc0cf --- /dev/null +++ b/recipes-devtools/libboundscheck/libboundscheck_1.1.10.bb @@ -0,0 +1,24 @@ +# SPDX-FileCopyrightText: Huawei Inc. +# +# SPDX-License-Identifier: Apache-2.0 + +SUMMARY = "Bounds checking functions (C11 Annex K)" +LICENSE = "MulanPSL-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=dc479462e2e349c42ba9e4167df0f7aa" + +SRC_URI = "git://gitee.com/openeuler/libboundscheck.git;protocol=https;branch=master" +SRCREV = "1a59e54390a23176d7f09ea4d20706fc991e0b00" + +S = "${WORKDIR}/git" + +# The project provided makefile builds a shared library, but want a static one instead +SRC_URI += "file://static-library.patch" + +EXTRA_OEMAKE += "CC='${CC}'" + +do_install () { + install -D -t ${D}${includedir} ${S}/include/*.h + install -D -t ${D}${libdir} ${S}/*.a +} + +BBCLASSEXTEND = "native nativesdk"