From bfa25fcaa355c28a6139f683c4453f677e23abd7 Mon Sep 17 00:00:00 2001 From: Caoruihong Date: Thu, 24 Jun 2021 11:24:15 +0800 Subject: [PATCH] feat: add deps to musl and securec add deps to musl, and securec. fwrap.c's contents are moved to musl. Signed-off-by: Caoruihong Change-Id: Ib451736798efd9745c6fbbbe5f355eea13477031 --- kal/posix/BUILD.gn | 19 ++++++++----------- kal/posix/src/fwrap.c | 42 ------------------------------------------ 2 files changed, 8 insertions(+), 53 deletions(-) delete mode 100644 kal/posix/src/fwrap.c diff --git a/kal/posix/BUILD.gn b/kal/posix/BUILD.gn index 84824d7f..1f75e818 100644 --- a/kal/posix/BUILD.gn +++ b/kal/posix/BUILD.gn @@ -27,37 +27,34 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +config("include") { + include_dirs = [ "include" ] +} + static_library("posix") { sources = [ "src/errno.c", "src/libc.c", "src/malloc.c", + "src/mqueue.c", "src/pthread.c", "src/pthread_attr.c", "src/pthread_cond.c", "src/pthread_mutex.c", "src/semaphore.c", "src/time.c", - "//third_party/musl/porting/liteos_m/kernel/src/string/strdup.c", - "//third_party/musl/porting/liteos_m/kernel/src/regex/regcomp.c", - "//third_party/musl/porting/liteos_m/kernel/src/regex/regexec.c", - "//third_party/musl/porting/liteos_m/kernel/src/regex/tre-mem.c", ] include_dirs = [ - "include", "../../kernel/arch/include", "../../kernel/include", "../../utils", ] public_configs = [ ":include" ] -} -config("include") { - include_dirs = [ - "include", - "//third_party/musl/porting/liteos_m/kernel/include", - "//third_party/bounds_checking_function/include", + public_deps = [ + "//third_party/musl/porting/liteos_m/kernel", + "//third_party/bounds_checking_function:libsec_static", ] } diff --git a/kal/posix/src/fwrap.c b/kal/posix/src/fwrap.c deleted file mode 100644 index c47b46bf..00000000 --- a/kal/posix/src/fwrap.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * 3. Neither the name of the copyright holder nor the names of its contributors may be used - * to endorse or promote products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "stdio_impl.h" - -int __wrap_fclose(FILE *f) -{ - return __fclose(f); -} - -int __wrap_fflush(FILE *f) -{ - return __fflush(f); -} \ No newline at end of file