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

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

Merge pull request !81 from zhuoli72/master
...@@ -153,6 +153,7 @@ action("copy_uapi") { ...@@ -153,6 +153,7 @@ action("copy_uapi") {
script = "scripts/copy_uapi.sh" script = "scripts/copy_uapi.sh"
args = [ "-i" ] + [ rebase_path("${uapi_dir}") ] args = [ "-i" ] + [ rebase_path("${uapi_dir}") ]
args += [ "-o" ] + [ rebase_path("${target_out_dir}/${musl_inc_out_dir}") ] args += [ "-o" ] + [ rebase_path("${target_out_dir}/${musl_inc_out_dir}") ]
args += [ "-t" ] + [ "${musl_arch}" ]
} }
copy("musl_copy_inc_bits") { copy("musl_copy_inc_bits") {
......
...@@ -1595,9 +1595,6 @@ if (musl_arch == "arm") { ...@@ -1595,9 +1595,6 @@ if (musl_arch == "arm") {
"arch/generic/bits/dirent.h", "arch/generic/bits/dirent.h",
"arch/generic/bits/errno.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_fix.h",
"arch/generic/bits/ioctl.h", "arch/generic/bits/ioctl.h",
"arch/generic/bits/io.h", "arch/generic/bits/io.h",
......
...@@ -92,25 +92,27 @@ template("musl_libs") { ...@@ -92,25 +92,27 @@ template("musl_libs") {
] ]
config("${abi_prefix}_musl_abi_config") { config("${abi_prefix}_musl_abi_config") {
if (target_abi == "soft") { if (musl_arch == "arm") {
cflags = [ "-mfloat-abi=soft" ] if (target_abi == "soft") {
} else if (target_abi == "a7_soft") { cflags = [ "-mfloat-abi=soft" ]
cflags = [ } else if (target_abi == "a7_soft") {
"-mcpu=cortex-a7", cflags = [
"-mfloat-abi=soft", "-mcpu=cortex-a7",
] "-mfloat-abi=soft",
} else if (target_abi == "a7_softfp_neon-vfpv4") { ]
cflags = [ } else if (target_abi == "a7_softfp_neon-vfpv4") {
"-mcpu=cortex-a7", cflags = [
"-mfloat-abi=softfp", "-mcpu=cortex-a7",
"-mfpu=neon-vfpv4", "-mfloat-abi=softfp",
] "-mfpu=neon-vfpv4",
} else if (target_abi == "a7_hard_neon-vfpv4") { ]
cflags = [ } else if (target_abi == "a7_hard_neon-vfpv4") {
"-mcpu=cortex-a7", cflags = [
"-mfloat-abi=hard", "-mcpu=cortex-a7",
"-mfpu=neon-vfpv4", "-mfloat-abi=hard",
] "-mfpu=neon-vfpv4",
]
}
} }
} }
...@@ -128,12 +130,17 @@ template("musl_libs") { ...@@ -128,12 +130,17 @@ template("musl_libs") {
cflags_basic = [ cflags_basic = [
"--target=${musl_target_triple}", "--target=${musl_target_triple}",
"-march=armv7-a",
"-Wall", "-Wall",
"-D_FORTIFY_SOURCE=2", "-D_FORTIFY_SOURCE=2",
"-Wl,-z,relro,-z,now,-z,noexecstack", "-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 = [ cflags_auto = [
"-D_XOPEN_SOURCE=700", "-D_XOPEN_SOURCE=700",
"-g", "-g",
...@@ -220,9 +227,14 @@ template("musl_libs") { ...@@ -220,9 +227,14 @@ template("musl_libs") {
"src/env/__init_tls.c", "src/env/__init_tls.c",
"src/env/__libc_start_main.c", "src/env/__libc_start_main.c",
"src/env/__stack_chk_fail.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") { if ("${target_abi}" == "a7_hard_neon-vfpv4") {
defines = [ "__ARM_PCS_VFP" ] defines = [ "__ARM_PCS_VFP" ]
} }
...@@ -251,9 +263,14 @@ template("musl_libs") { ...@@ -251,9 +263,14 @@ template("musl_libs") {
"src/env/__init_tls.c", "src/env/__init_tls.c",
"src/env/__libc_start_main.c", "src/env/__libc_start_main.c",
"src/env/__stack_chk_fail.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) { foreach(s, sources_orig) {
sources += [ "${target_out_dir}/${musl_ported_dir}/${s}" ] sources += [ "${target_out_dir}/${musl_ported_dir}/${s}" ]
} }
...@@ -385,6 +402,8 @@ template("musl_libs") { ...@@ -385,6 +402,8 @@ template("musl_libs") {
":${abi_prefix}_musl_ldso", ":${abi_prefix}_musl_ldso",
":${abi_prefix}_musl_src", ":${abi_prefix}_musl_src",
":${abi_prefix}_musl_src_nossp", ":${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 do
case "${arg}" in case "${arg}" in
"o") "o")
...@@ -8,6 +8,9 @@ do ...@@ -8,6 +8,9 @@ do
"i") "i")
SOURCE_DIR=${OPTARG} SOURCE_DIR=${OPTARG}
;; ;;
"t")
TARGET_ARCH=${OPTARG}
;;
"h") "h")
echo "help" echo "help"
;; ;;
...@@ -22,6 +25,14 @@ if [ ! -d "${OUT_DIR}" ];then ...@@ -22,6 +25,14 @@ if [ ! -d "${OUT_DIR}" ];then
mkdir -p ${OUT_DIR} mkdir -p ${OUT_DIR}
fi fi
cp -r ${SOURCE_DIR}/* ${OUT_DIR} 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.
先完成此消息的编辑!
想要评论请 注册