Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Kernel Liteos A
提交
007f3853
K
Kernel Liteos A
项目概览
OpenHarmony
/
Kernel Liteos A
1 年多 前同步成功
通知
464
Star
414
Fork
55
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
4
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel Liteos A
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
4
Issue
4
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
007f3853
编写于
9月 01, 2021
作者:
O
openharmony_ci
提交者:
Gitee
9月 01, 2021
浏览文件
操作
浏览文件
下载
差异文件
!596 优化编译脚本,DEVICE_PATH下的drivers/Kconfig由可选改为必选
Merge pull request !596 from Caoruihong/opt_20210901
上级
0c93a9b4
463bc054
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
72 addition
and
105 deletion
+72
-105
BUILD.gn
BUILD.gn
+0
-13
Kconfig
Kconfig
+1
-1
arch/arm/arm.mk
arch/arm/arm.mk
+0
-10
arch/arm/arm/BUILD.gn
arch/arm/arm/BUILD.gn
+12
-1
arch/arm/arm/Makefile
arch/arm/arm/Makefile
+10
-0
tools/build/mk/los_config.mk
tools/build/mk/los_config.mk
+49
-80
未找到文件。
BUILD.gn
浏览文件 @
007f3853
...
...
@@ -122,19 +122,6 @@ config("arch_config") {
}
}
config("as_objs_libc_flags") {
defines = [ "__ASSEMBLY__" ]
# linux style macros
if (defined(LOSCFG_ARCH_ARM_V7A) || defined(LOSCFG_ARCH_ARM_V7R) ||
defined(LOSCFG_ARCH_ARM_V7M)) {
defines += [ "__LINUX_ARM_ARCH__=7" ]
} else if (defined(LOSCFG_ARCH_ARM_V8A) || defined(LOSCFG_ARCH_ARM_V8R) ||
defined(LOSCFG_ARCH_ARM_V8M)) {
defines += [ "__LINUX_ARM_ARCH__=8" ]
}
}
config("stdinc_config") {
std_include = exec_script("//build/lite/run_shell_cmd.py", [ "$cc -print-file-name=include" ], "trim string")
cflags = [
...
...
Kconfig
浏览文件 @
007f3853
...
...
@@ -334,7 +334,7 @@ source "bsd/dev/usb/Kconfig"
source "../../drivers/adapter/khdf/liteos/Kconfig"
# Device driver Kconfig import
o
source "$(DEVICE_PATH)/drivers/Kconfig"
source "$(DEVICE_PATH)/drivers/Kconfig"
source "drivers/char/mem/Kconfig"
source "drivers/char/quickstart/Kconfig"
...
...
arch/arm/arm.mk
浏览文件 @
007f3853
...
...
@@ -83,13 +83,3 @@ else ifeq ($(LOSCFG_ARCH_FPU_VFP_D16), y)
else
ifeq
($(LOSCFG_ARCH_FPU_VFP_D32), y)
LITEOS_CMACRO
+=
-DLOSCFG_ARCH_FPU_VFP_D32
endif
# linux style macros
LINUX_ARCH_$(LOSCFG_ARCH_ARM_V7A)
=
-D__LINUX_ARM_ARCH__
=
7
LINUX_ARCH_$(LOSCFG_ARCH_ARM_V7R)
=
-D__LINUX_ARM_ARCH__
=
7
LINUX_ARCH_$(LOSCFG_ARCH_ARM_V7M)
=
-D__LINUX_ARM_ARCH__
=
7
LINUX_ARCH_$(LOSCFG_ARCH_ARM_V8A)
=
-D__LINUX_ARM_ARCH__
=
8
LINUX_ARCH_$(LOSCFG_ARCH_ARM_V8R)
=
-D__LINUX_ARM_ARCH__
=
8
LINUX_ARCH_$(LOSCFG_ARCH_ARM_V8M)
=
-D__LINUX_ARM_ARCH__
=
8
AS_OBJS_LIBC_FLAGS
+=
$(LINUX_ARCH_y)
arch/arm/arm/BUILD.gn
浏览文件 @
007f3853
...
...
@@ -65,7 +65,7 @@ kernel_module(module_name) {
include_dirs = [ "src/include" ]
if (defined(LOSCFG_GDB)) {
configs += [ "
$LITEOSTOPDIR
:as_objs_libc_flags" ]
configs += [ ":as_objs_libc_flags" ]
}
public_configs = [ ":public" ]
...
...
@@ -77,3 +77,14 @@ config("public") {
"src/include",
]
}
config("as_objs_libc_flags") {
defines = [ "__ASSEMBLY__" ]
# linux style macros
if (defined(LOSCFG_ARCH_ARM_V7A) || defined(LOSCFG_ARCH_ARM_V7R) || defined(LOSCFG_ARCH_ARM_V7M)) {
defines += [ "__LINUX_ARM_ARCH__=7" ]
} else if (defined(LOSCFG_ARCH_ARM_V8A) || defined(LOSCFG_ARCH_ARM_V8R) || defined(LOSCFG_ARCH_ARM_V8M)) {
defines += [ "__LINUX_ARM_ARCH__=8" ]
}
}
arch/arm/arm/Makefile
浏览文件 @
007f3853
...
...
@@ -50,6 +50,16 @@ endif
LOCAL_FLAGS
:=
$(LOCAL_INCLUDE)
$(LITEOS_GCOV_OPTS)
AS_OBJS_LIBC_FLAGS
=
-D__ASSEMBLY__
# linux style macros
LINUX_ARCH_$(LOSCFG_ARCH_ARM_V7A)
=
-D__LINUX_ARM_ARCH__
=
7
LINUX_ARCH_$(LOSCFG_ARCH_ARM_V7R)
=
-D__LINUX_ARM_ARCH__
=
7
LINUX_ARCH_$(LOSCFG_ARCH_ARM_V7M)
=
-D__LINUX_ARM_ARCH__
=
7
LINUX_ARCH_$(LOSCFG_ARCH_ARM_V8A)
=
-D__LINUX_ARM_ARCH__
=
8
LINUX_ARCH_$(LOSCFG_ARCH_ARM_V8R)
=
-D__LINUX_ARM_ARCH__
=
8
LINUX_ARCH_$(LOSCFG_ARCH_ARM_V8M)
=
-D__LINUX_ARM_ARCH__
=
8
AS_OBJS_LIBC_FLAGS
+=
$(LINUX_ARCH_y)
ifeq
($(LOSCFG_GDB), y)
LOCAL_FLAGS
+=
$(AS_OBJS_LIBC_FLAGS)
endif
...
...
tools/build/mk/los_config.mk
浏览文件 @
007f3853
...
...
@@ -29,20 +29,57 @@
-include
$(LITEOS_CONFIG_FILE)
HIDE
:=
@
OBJ_MKDIR
=
if
[
!
-d
$(
dir
$@
)
]
;
then
mkdir
-p
$(
dir
$@
)
;
fi
RM
=
-rm
-rf
ifeq
($(OS),)
OS
:=
$(
shell
uname
-s
)
export
OS
ifeq
($(ARCH),)
ARCH
=
$(
error
ARCH not
set
!
)
endif
ARFLAGS
:=
cr
## variable define ##
HIDE
=
@
RM
=
-rm
-rf
ARFLAGS
=
cr
OS
:=
$(
shell
uname
-s
)
OBJ_MKDIR
=
if
[
!
-d
$(
dir
$@
)
]
;
then
mkdir
-p
$(
dir
$@
)
;
fi
OUT
=
$(
or
$(OUTDIR)
,
$(LITEOSTOPDIR)
/out/
$
(
LOSCFG_PRODUCT_NAME:
"%"
=
%
))
BUILD
=
$(OUT)
/obj
MODULE
=
$(LITEOSTOPDIR)
/tools/build/mk/module.mk
LITEOS_SCRIPTPATH
=
$(LITEOSTOPDIR)
/tools/scripts
LITEOS_PLATFORM
=
$
(
LOSCFG_PLATFORM:
"%"
=
%
)
LITEOSTHIRDPARTY
=
$(LITEOSTOPDIR)
/../../third_party
## platform relative ##
ifeq
($(ARCH),)
ARCH
=
$(
error
ARCH not
set
!
)
## compiler relative ##
get_compiler_path
=
$(
or
$(
wildcard
$(1)
)
,
$(
dir
$(
shell
which
$(CROSS_COMPILE)
as
)))
ifeq
($(LOSCFG_COMPILER_CLANG_LLVM), y)
CROSS_COMPILE
?=
llvm-
LITEOS_COMPILER_PATH
?=
$(
call
get_compiler_path,
$(LITEOSTOPDIR)
/../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/
)
LLVM_TARGET
=
$(
if
$(LOSCFG_LLVM_TARGET)
,-target
$(LOSCFG_LLVM_TARGET)
,
)
LLVM_SYSROOT
=
$(
if
$(SYSROOT_PATH)
,--sysroot
=
$(SYSROOT_PATH)
,
)
CC
=
$(LITEOS_COMPILER_PATH)
clang
$(LLVM_TARGET)
$(LLVM_SYSROOT)
AS
=
$(LITEOS_COMPILER_PATH)$(CROSS_COMPILE)
as
AR
=
$(LITEOS_COMPILER_PATH)$(CROSS_COMPILE)
ar
LD
=
$(LITEOS_COMPILER_PATH)
ld.lld
GPP
=
$(LITEOS_COMPILER_PATH)
clang++
$(LLVM_TARGET)
$(LLVM_SYSROOT)
OBJCOPY
=
$(LITEOS_COMPILER_PATH)$(CROSS_COMPILE)
objcopy
-R
.bss
OBJDUMP
=
$(LITEOS_COMPILER_PATH)$(CROSS_COMPILE)
objdump
SIZE
=
$(LITEOS_COMPILER_PATH)$(CROSS_COMPILE)
size
NM
=
$(LITEOS_COMPILER_PATH)$(CROSS_COMPILE)
nm
STRIP
=
$(LITEOS_COMPILER_PATH)$(CROSS_COMPILE)
strip
else
ifeq
($(LOSCFG_COMPILER_GCC), y)
CROSS_COMPILE
?=
$(LOSCFG_CROSS_COMPILE)
LITEOS_COMPILER_PATH
?=
$(
call
get_compiler_path,
$(LITEOSTOPDIR)
/../../prebuilts/gcc/linux-x86/arm/arm-linux-ohoseabi-gcc/bin/
)
CC
=
$(LITEOS_COMPILER_PATH)$(CROSS_COMPILE)
gcc
AS
=
$(LITEOS_COMPILER_PATH)$(CROSS_COMPILE)
as
AR
=
$(LITEOS_COMPILER_PATH)$(CROSS_COMPILE)
ar
LD
=
$(LITEOS_COMPILER_PATH)$(CROSS_COMPILE)
ld
GPP
=
$(LITEOS_COMPILER_PATH)$(CROSS_COMPILE)
g++
OBJCOPY
=
$(LITEOS_COMPILER_PATH)$(CROSS_COMPILE)
objcopy
OBJDUMP
=
$(LITEOS_COMPILER_PATH)$(CROSS_COMPILE)
objdump
SIZE
=
$(LITEOS_COMPILER_PATH)$(CROSS_COMPILE)
size
NM
=
$(LITEOS_COMPILER_PATH)$(CROSS_COMPILE)
nm
STRIP
=
$(LITEOS_COMPILER_PATH)$(CROSS_COMPILE)
strip
else
CC
=
echo
$
(
info compiler
type
not
set
!)
endif
## c as cxx ld options ##
LITEOS_ASOPTS
:=
LITEOS_COPTS_BASE
:=
...
...
@@ -53,7 +90,7 @@ LITEOS_CXXOPTS_BASE :=
LITEOS_LD_OPTS
:=
LITEOS_GCOV_OPTS
:=
## macro define ##
LITEOS_CMACRO
:=
LITEOS_CMACRO
:=
-D__LITEOS__
LITEOS_CXXMACRO
:=
## head file path and ld path ##
LITEOS_PLATFORM_INCLUDE
:=
...
...
@@ -71,46 +108,6 @@ LITEOS_LIBDEP :=
## directory ##
LIB_SUBDIRS
:=
## variable define ##
ifeq
($(LITEOSTHIRDPARTY),)
LITEOSTHIRDPARTY
:=
$(LITEOSTOPDIR)
/../../third_party
endif
LOSCFG_BOARD_CONFIG_PATH
:=
$
(
LOSCFG_BOARD_CONFIG_PATH:
"%"
=
%
)
ifeq
($(wildcard $(LITEOSTOPDIR)/../../$(LOSCFG_BOARD_CONFIG_PATH) $(LOSCFG_BOARD_CONFIG_PATH)),)
LOSCFG_BOARD_CONFIG_PATH
:=
$
(
LOSCFG_BOARD_CONFIG_PATH:%/config/board
=
%/board
)
endif
ifeq
($(LOSCFG_COMPILER_GCC), y)
CROSS_COMPILE
?=
$(LOSCFG_CROSS_COMPILE)
LITEOS_COMPILER_PATH
?=
$(LITEOSTOPDIR)
/../../prebuilts/gcc/linux-x86/arm/arm-linux-ohoseabi-gcc/bin/
else
ifeq
($(LOSCFG_COMPILER_CLANG_LLVM), y)
CROSS_COMPILE
?=
llvm-
LITEOS_COMPILER_PATH
?=
$(LITEOSTOPDIR)
/../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/
ifneq
($(LOSCFG_LLVM_TARGET),)
LLVM_TARGET
=
-target
$(LOSCFG_LLVM_TARGET)
endif
ifneq
($(SYSROOT_PATH),)
LLVM_SYSROOT
=
--sysroot
=
$(SYSROOT_PATH)
endif
endif
ifeq
($(wildcard $(LITEOS_COMPILER_PATH)$(CROSS_COMPILE)as),)
LITEOS_COMPILER_PATH
:=
$(
patsubst
%/
$(CROSS_COMPILE)
as,%/,
$(
shell
which
$(CROSS_COMPILE)
as
))
endif
LITEOS_PLATFORM
:=
$
(
LOSCFG_PLATFORM:
"%"
=
%
)
ifeq
($(OUTDIR),)
OUT
=
$(LITEOSTOPDIR)
/out/
$
(
LOSCFG_PRODUCT_NAME:
"%"
=
%
)
else
OUT
=
$(OUTDIR)
endif
BUILD
=
$(OUT)
/obj
CXX_PATH
=
$(LITEOSTOPDIR)
/lib/cxxstl
JFFS_PATH
=
$(LITEOSTOPDIR)
/fs/jffs2
LITEOS_SCRIPTPATH
?=
$(LITEOSTOPDIR)
/tools/scripts
### include variable
MODULE
=
$(LITEOSTOPDIR)
/tools/build/mk/module.mk
LITEOS_CMACRO
+=
-D__LITEOS__
-DSECUREC_IN_KERNEL
=
0
AS_OBJS_LIBC_FLAGS
=
-D__ASSEMBLY__
####################################### CPU Option Begin #########################################
include
$(LITEOSTOPDIR)/arch/cpu.mk
####################################### CPU Option End #########################################
...
...
@@ -197,6 +194,7 @@ ifeq ($(LOSCFG_LIB_LIBC), y)
LITEOS_BASELIB
+=
-lsec
LITEOS_LIBC_INCLUDE
+=
\
-I
$(LITEOSTHIRDPARTY)
/bounds_checking_function/include
LITEOS_CMACRO
+=
-DSECUREC_IN_KERNEL
=
0
endif
LITEOS_BASELIB
+=
-lscrew
...
...
@@ -228,7 +226,6 @@ ifeq ($(LOSCFG_COMPAT_BSD), y)
LITEOS_BASELIB
+=
-lbsd
LIB_SUBDIRS
+=
bsd
LITEOS_BSD_INCLUDE
+=
-I
$(LITEOSTOPDIR)
/bsd
LITEOS_CMACRO
+=
-DLOSCFG_COMPAT_LINUXKPI
LITEOS_BASELIB
+=
-llinuxkpi
LIB_SUBDIRS
+=
bsd/compat/linuxkpi
LITEOS_LINUX_INCLUDE
+=
-I
$(LITEOSTOPDIR)
/bsd/compat/linuxkpi/include
\
...
...
@@ -383,9 +380,6 @@ ifeq ($(LOSCFG_DRIVERS_USB), y)
LITEOS_BASELIB
+=
-lusb_base
LIB_SUBDIRS
+=
$(LITEOSTOPDIR)
/bsd/dev/usb
LITEOS_USB_INCLUDE
+=
-I
$(LITEOSTOPDIR)
/bsd/dev/usb
ifeq
($(LOSCFG_USB_DEBUG), y)
LITEOS_CMACRO
+=
-DLOSCFG_USB_DEBUG
endif
endif
ifeq
($(LOSCFG_DRIVERS_VIDEO), y)
...
...
@@ -402,7 +396,6 @@ ifeq ($(LOSCFG_BASE_CORE_HILOG), y)
LIB_SUBDIRS
+=
$(LITEOSTOPDIR)
/../../base/hiviewdfx/hilog_lite/frameworks/featured
LITEOS_HILOG_INCLUDE
+=
-I
$(LITEOSTOPDIR)
/../../base/hiviewdfx/hilog_lite/interfaces/native/kits
LITEOS_HILOG_INCLUDE
+=
-I
$(LITEOSTOPDIR)
/../../base/hiviewdfx/hilog_lite/interfaces/native/kits/hilog
LITEOS_CMACRO
+=
-DLOSCFG_BASE_CORE_HILOG
endif
ifeq
($(LOSCFG_BLACKBOX), y)
LITEOS_BASELIB
+=
-lblackbox
...
...
@@ -500,30 +493,6 @@ endif
############################# Security Option End ##############################
ifeq
($(LOSCFG_COMPILER_CLANG_LLVM), y)
CC
=
$(LITEOS_COMPILER_PATH)
clang
$(LLVM_TARGET)
$(LLVM_SYSROOT)
AS
=
$(LITEOS_COMPILER_PATH)$(CROSS_COMPILE)
as
AR
=
$(LITEOS_COMPILER_PATH)$(CROSS_COMPILE)
ar
LD
=
$(LITEOS_COMPILER_PATH)
ld.lld
GPP
=
$(LITEOS_COMPILER_PATH)
clang++
$(LLVM_TARGET)
$(LLVM_SYSROOT)
OBJCOPY
=
$(LITEOS_COMPILER_PATH)$(CROSS_COMPILE)
objcopy
-R
.bss
OBJDUMP
=
$(LITEOS_COMPILER_PATH)$(CROSS_COMPILE)
objdump
SIZE
=
$(LITEOS_COMPILER_PATH)$(CROSS_COMPILE)
size
NM
=
$(LITEOS_COMPILER_PATH)$(CROSS_COMPILE)
nm
STRIP
=
$(LITEOS_COMPILER_PATH)$(CROSS_COMPILE)
strip
else
CC
=
$(LITEOS_COMPILER_PATH)$(CROSS_COMPILE)
gcc
AS
=
$(LITEOS_COMPILER_PATH)$(CROSS_COMPILE)
as
AR
=
$(LITEOS_COMPILER_PATH)$(CROSS_COMPILE)
ar
LD
=
$(LITEOS_COMPILER_PATH)$(CROSS_COMPILE)
ld
GPP
=
$(LITEOS_COMPILER_PATH)$(CROSS_COMPILE)
g++
OBJCOPY
=
$(LITEOS_COMPILER_PATH)$(CROSS_COMPILE)
objcopy
OBJDUMP
=
$(LITEOS_COMPILER_PATH)$(CROSS_COMPILE)
objdump
SIZE
=
$(LITEOS_COMPILER_PATH)$(CROSS_COMPILE)
size
NM
=
$(LITEOS_COMPILER_PATH)$(CROSS_COMPILE)
nm
STRIP
=
$(LITEOS_COMPILER_PATH)$(CROSS_COMPILE)
strip
endif
LITEOS_EXTKERNEL_INCLUDE
:=
$(LITEOS_CPPSUPPORT_INCLUDE)
$(LITEOS_DYNLOAD_INCLUDE)
\
$(LITEOS_TICKLESS_INCLUDE)
$(LITEOS_HOOK_INCLUDE)
\
$(LITEOS_VDSO_INCLUDE)
$(LITEOS_LITEIPC_INCLUDE)
\
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录