提交 da7e7649 编写于 作者: O openharmony_ci 提交者: Gitee

!81 为L2提供musl 64位构建支持

Merge pull request !81 from zhuoli72/master
......@@ -153,6 +153,7 @@ action("copy_uapi") {
script = "scripts/copy_uapi.sh"
args = [ "-i" ] + [ rebase_path("${uapi_dir}") ]
args += [ "-o" ] + [ rebase_path("${target_out_dir}/${musl_inc_out_dir}") ]
args += [ "-t" ] + [ "${musl_arch}" ]
}
copy("musl_copy_inc_bits") {
......
......@@ -1595,9 +1595,6 @@ if (musl_arch == "arm") {
"arch/generic/bits/dirent.h",
"arch/generic/bits/errno.h",
"arch/generic/bits/fcntl.h",
"arch/generic/bits/fenv.h",
"arch/generic/bits/hwcap.h",
"arch/generic/bits/ioctl_fix.h",
"arch/generic/bits/ioctl.h",
"arch/generic/bits/io.h",
......
......@@ -92,6 +92,7 @@ template("musl_libs") {
]
config("${abi_prefix}_musl_abi_config") {
if (musl_arch == "arm") {
if (target_abi == "soft") {
cflags = [ "-mfloat-abi=soft" ]
} else if (target_abi == "a7_soft") {
......@@ -113,6 +114,7 @@ template("musl_libs") {
]
}
}
}
config("${abi_prefix}_musl_config") {
configs = [ ":${abi_prefix}_musl_abi_config" ]
......@@ -128,12 +130,17 @@ template("musl_libs") {
cflags_basic = [
"--target=${musl_target_triple}",
"-march=armv7-a",
"-Wall",
"-D_FORTIFY_SOURCE=2",
"-Wl,-z,relro,-z,now,-z,noexecstack",
]
if (musl_arch == "arm") {
cflags_basic += [ "-march=armv7-a", ]
} else if (musl_arch == "aarch64") {
cflags_basic += [ "-march=armv8", ]
}
cflags_auto = [
"-D_XOPEN_SOURCE=700",
"-g",
......@@ -220,9 +227,14 @@ template("musl_libs") {
"src/env/__init_tls.c",
"src/env/__libc_start_main.c",
"src/env/__stack_chk_fail.c",
"src/thread/${musl_arch}/__set_thread_area.c",
]
if (musl_arch == "arm") {
sources_orig -= [ "src/thread/${musl_arch}/__set_thread_area.c" ]
} else if (musl_arch == "aarch64") {
sources_orig -= [ "src/thread/${musl_arch}/__set_thread_area.s" ]
}
if ("${target_abi}" == "a7_hard_neon-vfpv4") {
defines = [ "__ARM_PCS_VFP" ]
}
......@@ -251,9 +263,14 @@ template("musl_libs") {
"src/env/__init_tls.c",
"src/env/__libc_start_main.c",
"src/env/__stack_chk_fail.c",
"src/thread/${musl_arch}/__set_thread_area.c",
]
if (musl_arch == "arm") {
sources_orig += [ "src/thread/${musl_arch}/__set_thread_area.c" ]
} else if (musl_arch == "aarch64") {
sources_orig += [ "src/thread/${musl_arch}/__set_thread_area.s" ]
}
foreach(s, sources_orig) {
sources += [ "${target_out_dir}/${musl_ported_dir}/${s}" ]
}
......@@ -385,6 +402,8 @@ template("musl_libs") {
":${abi_prefix}_musl_ldso",
":${abi_prefix}_musl_src",
":${abi_prefix}_musl_src_nossp",
":${abi_prefix}_libdl",
":${abi_prefix}_libpthread",
]
}
......
while getopts "o:i:h" arg
while getopts "o:i:t:h" arg
do
case "${arg}" in
"o")
......@@ -8,6 +8,9 @@ do
"i")
SOURCE_DIR=${OPTARG}
;;
"t")
TARGET_ARCH=${OPTARG}
;;
"h")
echo "help"
;;
......@@ -22,6 +25,14 @@ if [ ! -d "${OUT_DIR}" ];then
mkdir -p ${OUT_DIR}
fi
cp -r ${SOURCE_DIR}/* ${OUT_DIR}
rm -rf ${OUT_DIR}/asm-arm
if [ ${TARGET_ARCH} = "arm" ]; then
mv ${OUT_DIR}/asm-arm/asm ${OUT_DIR}/asm
rm -rf ${OUT_DIR}/asm-arm64
rm -rf ${OUT_DIR}/asm-arm
elif [ ${TARGET_ARCH} = "aarch64" ]; then
mv ${OUT_DIR}/asm-arm64/asm ${OUT_DIR}/asm
rm -rf ${OUT_DIR}/asm-arm64
rm -rf ${OUT_DIR}/asm-arm
fi
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册