diff --git a/build/build_musl.sh b/build/build_musl.sh deleted file mode 100755 index d8f38f775e2b1ce709c46cd509f13608820e5c7c..0000000000000000000000000000000000000000 --- a/build/build_musl.sh +++ /dev/null @@ -1,186 +0,0 @@ -#!/bin/bash - -#Copyright (c) 2020-2021 Huawei Device Co., Ltd. -#Licensed under the Apache License, Version 2.0 (the "License"); -#you may not use this file except in compliance with the License. -#You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -#Unless required by applicable law or agreed to in writing, software -#distributed under the License is distributed on an "AS IS" BASIS, -#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -#See the License for the specific language governing permissions and -#limitations under the License. - -set -e - -readonly MUSL_DIR="${PWD}/musl" -readonly MUSL_CUR_DIR="./musl" -readonly MUSL_DEBUG_DIR="${PWD}/musl_debug" -readonly MUSL_DEBUG_CUR_DIR="./musl_debug" -readonly MUSL_PATCH="${PWD}/musl-debug.patch" -readonly MUSL_SOURCE="${PWD}/../../../../third_party/musl/*" -readonly LITEOSTOPDIR="${PWD}/../../../../kernel/liteos_a" -readonly PREFIX_M="${PWD}/../../../../kernel/liteos_m/kal/posix" -readonly OPTIMIZE_DIR="${PWD}/optimized-routines" -readonly OPTIMIZE_SOURCE="${PWD}/../../../../third_party/optimized-routines/*" - -BUILD=`gcc -dumpmachine` -HOST=`gcc -dumpmachine` -TARGET=arm-linux-ohoseabi -CROSS_COMPILER=arm-linux-ohoseabi- -CFLAGS_FOR_TARGET="-O2 -Wall -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wl,-z,relro,-z,now,-z,noexecstack -Wtrampolines" - -TARGET_LIBC_A="${PWD}/libc_opt.a" -TARGET_LIBC_SO="${PWD}/libc_opt.so" - -PARALLEL=`grep ^processor /proc/cpuinfo|wc -l` -LITEOS_COMPILER_PATH=`${LITEOSTOPDIR}/tools/build/mk/get_compiler_path.sh ${CROSS_COMPILER} ${LITEOSTOPDIR}` - -export SYSROOT="${PWD}/../../../../prebuilts/gcc/linux-x86/arm/arm-linux-ohoseabi-gcc/target" -export PATH="${LITEOS_COMPILER_PATH}/bin:${PATH}" - -# prepare to build musl -if [ -d "${MUSL_DIR}" ]; then - rm -r ${MUSL_DIR} -fi -mkdir -p ${MUSL_DIR} -cp -r ${MUSL_SOURCE} ${MUSL_DIR} - -# prepare to build optimized-routines for improve musl performance -if [ -d "${OPTIMIZE_DIR}" ]; then - rm -r ${OPTIMIZE_DIR} -fi -mkdir -p ${OPTIMIZE_DIR} -cp -r ${OPTIMIZE_SOURCE} ${OPTIMIZE_DIR} - -# build optimized-routines -function build_opt() -{ - pushd ${OPTIMIZE_DIR} - # generate the config.mk file required for compiling the optimized-routines lib. - exec 3>&1 1>config.mk - cat << EOF -# This version of config.mk was generated by: -# build_musl.sh -# The default configuration(CFLAGS) is from optimized-routines. -# Any changes made here will be lost if build_musl.sh re-run - -# Target architecture: aarch64, arm or x86_64 -ARCH = arm - -# Subprojects to build -SUBS = string - -# Use for cross compilation with gcc/clang. -CROSS_COMPILE = ${CROSS_COMPILER} - -# Compiler for the target -CC = ${LITEOS_COMPILER_PATH}/bin/${CROSS_COMPILER}gcc -CFLAGS = -std=c99 -pipe -O3 -mfpu=neon-vfpv4 -mfloat-abi=softfp -march=armv7-a -CFLAGS += -Wall -Wno-missing-braces - -# Enable debug info. -#HOST_CFLAGS += -g -#CFLAGS += -g - -# Use with gcc. -CFLAGS += -frounding-math -fexcess-precision=standard -fno-stack-protector -CFLAGS += -ffp-contract=fast -fno-math-errno - -EOF - exec 1>&3 3>&- - make -j - popd -} - -# generate the final libc.so file. -function install_opt_libc() -{ - if [ -e "${TARGET_LIBC_A}" ]; then - rm ${TARGET_LIBC_A} - fi - if [ -e "${TARGET_LIBC_SO}" ]; then - rm ${TARGET_LIBC_SO} - fi - - # make libc_opt.a libc_opt.so by makefile - make musldir=$2 -j - - # copy libc_opt.so libc_opt.a to a specified directory to replace the original libc.so libc.a file. - if [ -e "${TARGET_LIBC_A}" ] && [ -e "${TARGET_LIBC_SO}" ]; then - rm $1/lib/libc.a $1/lib/libc.so - cp ${TARGET_LIBC_A} $1/lib/libc.a - cp ${TARGET_LIBC_SO} $1/lib/libc.so - else - printf "build libc_opt error!" - fi -} - -function install_debug_musl() -{ - mkdir -p ${SYSROOT}/usr/include/debug - mkdir -p ${MUSL_DIR}/lib/debug - cp -f ${MUSL_DEBUG_DIR}/include/debug.h ${SYSROOT}/usr/include/debug - cp -f ${MUSL_DEBUG_DIR}/lib/libc.* ${MUSL_DIR}/lib/debug -} - -# build musl -function build_musl() -{ - pushd $2 - if [ "$2" = "${MUSL_DEBUG_DIR}" ]; then - patch -p1 < ${MUSL_PATCH} - fi - #CC="${LITEOS_COMPILER_PATH}/bin/${CROSS_COMPILER}gcc $1" ./configure --with-headers=${SYSROOT}/usr/include --build=${BUILD} --host=${TARGET} - CC="${LITEOS_COMPILER_PATH}/bin/${CROSS_COMPILER}gcc $1" ./configure --prefix=${SYSROOT}/ --with-headers=${SYSROOT}/usr/include --build=${BUILD} --host=${TARGET} --libdir=${SYSROOT}/usr/lib --includedir=${SYSROOT}/usr/include - #CC="${LITEOS_COMPILER_PATH}/bin/${CROSS_COMPILER}gcc $1 -mcpu=cortex-a7 -mfloat-abi=soft" ./configure --prefix=${SYSROOT}/ --with-heades=${SYSROOT}/usr/include --build=${BUILD} --host=${TARGET} --libdir=${SYSROOT}/usr/lib/a7_soft --includedir=${SYSROOT}/usr/include - #CC="${LITEOS_COMPILER_PATH}/bin/${CROSS_COMPILER}gcc $1 -mcpu=cortex-a7 -mfloat-abi=softfp -mfpu=neon-vfpv4" ./configure --prefix=${SYSROOT}/ --with-heades=${SYSROOT}/usr/include --build=${BUILD} --host=${TARGET} --libdir=${SYSROOT}/usr/lib/a7_soft --includedir=${SYSROOT}/usr/include - make -j ${PARALLEL} CROSS=${CROSS_COMPILER} - popd -} - -# prepare linux compat headers for musl -sh thirdparty_headers.sh ${MUSL_DIR} - -if [ $# -eq 1 -a "$1" = "-m" ]; then -pushd ${MUSL_DIR} -CC="${LITEOS_COMPILER_PATH}/bin/${CROSS_COMPILER}gcc ${CFLAGS_FOR_TARGET}" ./configure --with-headers=${SYSROOT}/usr/include --build=${BUILD} --host=${TARGET} --prefix=${PREFIX_M} -cp ${MUSL_DIR}/kernel_m/include/alltypes.h.in ${MUSL_DIR}/include/alltypes.h.in -cp ${MUSL_DIR}/kernel_m/arch/arm/bits/alltypes.h.in ${MUSL_DIR}/arch/arm/bits/alltypes.h.in -make -f - -j ${PARALLEL} CROSS=${CROSS_COMPILER} install-headers <&3 3>&- diff --git a/build/linux_header_install.sh b/build/liteos/linux_header_install.sh similarity index 97% rename from build/linux_header_install.sh rename to build/liteos/linux_header_install.sh index ee3d3e7c0b290969bdc327cd92033b974c7da2ca..7b319a7c805fb5657ae0206d6bc15df731a4c4db 100755 --- a/build/linux_header_install.sh +++ b/build/liteos/linux_header_install.sh @@ -17,7 +17,7 @@ set -e -PRJ_ROOT="$PWD/../../../../" +PRJ_ROOT="$PWD/../../../../../" KERNEL_ROOT="$PRJ_ROOT/third_party/Linux_Kernel" ARM_HDR="$PRJ_ROOT/third_party/Linux_Kernel/hdr_install/arm_header" OUT_HDR="$PRJ_ROOT/prebuilts/lite/sysroot/thirdparty/linux_headers_install" diff --git a/build/mem_info_parse b/build/liteos/mem_info_parse similarity index 100% rename from build/mem_info_parse rename to build/liteos/mem_info_parse diff --git a/build/musl-debug.patch b/build/liteos/musl-debug.patch similarity index 100% rename from build/musl-debug.patch rename to build/liteos/musl-debug.patch diff --git a/build/thirdparty_headers.sh b/build/liteos/thirdparty_headers.sh similarity index 95% rename from build/thirdparty_headers.sh rename to build/liteos/thirdparty_headers.sh index c9abc0b01a196226f0a24c02a33c8af947589103..6c2ee30b454abcba4403ccea3f411b1cdfa9cfe8 100755 --- a/build/thirdparty_headers.sh +++ b/build/liteos/thirdparty_headers.sh @@ -17,7 +17,7 @@ set -e -PRJ_ROOT="${PWD}/../../../../" +PRJ_ROOT="${PWD}/../../../../../" LINUX_HDR="${PRJ_ROOT}/prebuilts/lite/sysroot/thirdparty/linux_headers_install" TMP_DIR_ORI="${PRJ_ROOT}/prebuilts/lite/sysroot/ohos_tmp_ori" TMP_DIR="${PRJ_ROOT}/prebuilts/lite/sysroot/ohos_tmp" @@ -58,7 +58,7 @@ echo "#define __user" >> ${TMP_DIR_ORI}/uapi/linux/compiler.h echo "#endif" >> ${TMP_DIR_ORI}/uapi/linux/compiler.h pushd ${PRJ_ROOT} -python prebuilts/lite/sysroot/build/update_headers.py 2>/dev/null +python prebuilts/lite/sysroot/build/liteos/update_headers.py 2>/dev/null popd cp -rf ${TMP_DIR}/uapi/* ${MUSL_DIR}/ diff --git a/build/update_headers.py b/build/liteos/update_headers.py similarity index 100% rename from build/update_headers.py rename to build/liteos/update_headers.py diff --git a/usr/lib/arm-liteos/Scrt1.o b/usr/lib/arm-liteos/Scrt1.o index d199b1a957a0502db348691e9d941568e5da2130..7e0b360d9c93a511051dcde2183bbeef7d242207 100644 Binary files a/usr/lib/arm-liteos/Scrt1.o and b/usr/lib/arm-liteos/Scrt1.o differ diff --git a/usr/lib/arm-liteos/a7_hard_neon-vfpv4/Scrt1.o b/usr/lib/arm-liteos/a7_hard_neon-vfpv4/Scrt1.o index 90a84115045fca4bf67b7fc053ed4681b55043a6..55860614ec865a81bdb20a0acd7baa219e60fb4a 100644 Binary files a/usr/lib/arm-liteos/a7_hard_neon-vfpv4/Scrt1.o and b/usr/lib/arm-liteos/a7_hard_neon-vfpv4/Scrt1.o differ diff --git a/usr/lib/arm-liteos/a7_hard_neon-vfpv4/crt1.o b/usr/lib/arm-liteos/a7_hard_neon-vfpv4/crt1.o index 6ba4d5de28b89b636e1a2dfe943811779eafb92b..2fda6ab0d88dadfc07ece337ce69db3e0659fb48 100644 Binary files a/usr/lib/arm-liteos/a7_hard_neon-vfpv4/crt1.o and b/usr/lib/arm-liteos/a7_hard_neon-vfpv4/crt1.o differ diff --git a/usr/lib/arm-liteos/a7_hard_neon-vfpv4/debug/libc.a b/usr/lib/arm-liteos/a7_hard_neon-vfpv4/debug/libc.a index 17a0e8e088444e9210cde989fa740e9e0eb3f1e4..da0362e7cbd60429b140b5eb26520b240eae7f6f 100755 Binary files a/usr/lib/arm-liteos/a7_hard_neon-vfpv4/debug/libc.a and b/usr/lib/arm-liteos/a7_hard_neon-vfpv4/debug/libc.a differ diff --git a/usr/lib/arm-liteos/a7_hard_neon-vfpv4/debug/libc.so b/usr/lib/arm-liteos/a7_hard_neon-vfpv4/debug/libc.so index c9f1de8558600141924bb1fcc2214077ce4e70e8..e7883738252dddee2fda5d2600737a40907af250 100755 Binary files a/usr/lib/arm-liteos/a7_hard_neon-vfpv4/debug/libc.so and b/usr/lib/arm-liteos/a7_hard_neon-vfpv4/debug/libc.so differ diff --git a/usr/lib/arm-liteos/a7_hard_neon-vfpv4/libc.a b/usr/lib/arm-liteos/a7_hard_neon-vfpv4/libc.a index 8e413898016fb99216ad9765adffaa390d5148cf..55dead5d17f6a2db73ead71088c70275915a985b 100644 Binary files a/usr/lib/arm-liteos/a7_hard_neon-vfpv4/libc.a and b/usr/lib/arm-liteos/a7_hard_neon-vfpv4/libc.a differ diff --git a/usr/lib/arm-liteos/a7_hard_neon-vfpv4/libc.so b/usr/lib/arm-liteos/a7_hard_neon-vfpv4/libc.so index 27f95ff7041687c0d709dc45040e0a2b00b32a62..3eb7eb3bbc1eee508418aa336f77bd984f502696 100755 Binary files a/usr/lib/arm-liteos/a7_hard_neon-vfpv4/libc.so and b/usr/lib/arm-liteos/a7_hard_neon-vfpv4/libc.so differ diff --git a/usr/lib/arm-liteos/a7_hard_neon-vfpv4/rcrt1.o b/usr/lib/arm-liteos/a7_hard_neon-vfpv4/rcrt1.o index 34d3d6d929b8a9d2043c84d07d6430b27d9e635e..00dd21ffc53e610bd5a85cb8b1b94460c6969f74 100644 Binary files a/usr/lib/arm-liteos/a7_hard_neon-vfpv4/rcrt1.o and b/usr/lib/arm-liteos/a7_hard_neon-vfpv4/rcrt1.o differ diff --git a/usr/lib/arm-liteos/a7_soft/Scrt1.o b/usr/lib/arm-liteos/a7_soft/Scrt1.o index 26c4300f72a42e779f3eadb483fb4fe3138875a1..e982f17c5299d7923ac9da5da09844a785c34d28 100644 Binary files a/usr/lib/arm-liteos/a7_soft/Scrt1.o and b/usr/lib/arm-liteos/a7_soft/Scrt1.o differ diff --git a/usr/lib/arm-liteos/a7_soft/crt1.o b/usr/lib/arm-liteos/a7_soft/crt1.o index c17f2319c1502a7fd18cf2195104a04ad5a4e549..c7b4988fb5f547851d8f0bc8c8502a427edc8c19 100644 Binary files a/usr/lib/arm-liteos/a7_soft/crt1.o and b/usr/lib/arm-liteos/a7_soft/crt1.o differ diff --git a/usr/lib/arm-liteos/a7_soft/debug/libc.a b/usr/lib/arm-liteos/a7_soft/debug/libc.a index 578ba37b608af9c40892479609f5853932d13b9d..8d828ee2b8bddbf844eff29a1a53aac1a93c2a3c 100755 Binary files a/usr/lib/arm-liteos/a7_soft/debug/libc.a and b/usr/lib/arm-liteos/a7_soft/debug/libc.a differ diff --git a/usr/lib/arm-liteos/a7_soft/debug/libc.so b/usr/lib/arm-liteos/a7_soft/debug/libc.so index 80818306bcb32030330de723eb2f88635b751871..82784e4daa1c06fa8420d04d24650cfefebf02df 100755 Binary files a/usr/lib/arm-liteos/a7_soft/debug/libc.so and b/usr/lib/arm-liteos/a7_soft/debug/libc.so differ diff --git a/usr/lib/arm-liteos/a7_soft/libc.a b/usr/lib/arm-liteos/a7_soft/libc.a index 68aeb64f5b9cc22d63de2599c1d96c1165cd7a7b..c04b937aeb112833b495d083761a877af64ca4f5 100644 Binary files a/usr/lib/arm-liteos/a7_soft/libc.a and b/usr/lib/arm-liteos/a7_soft/libc.a differ diff --git a/usr/lib/arm-liteos/a7_soft/libc.so b/usr/lib/arm-liteos/a7_soft/libc.so index 8da351504a1bb53d56539101b0ffc15e947b0fff..943a5eecc16a1094f6bf3ab62786fb51a2123ef4 100755 Binary files a/usr/lib/arm-liteos/a7_soft/libc.so and b/usr/lib/arm-liteos/a7_soft/libc.so differ diff --git a/usr/lib/arm-liteos/a7_soft/rcrt1.o b/usr/lib/arm-liteos/a7_soft/rcrt1.o index c75543a4f309e822bee70b8a2cb3c2750b6f1e32..c007c1c29fd28014de275cc756095e809550356e 100644 Binary files a/usr/lib/arm-liteos/a7_soft/rcrt1.o and b/usr/lib/arm-liteos/a7_soft/rcrt1.o differ diff --git a/usr/lib/arm-liteos/a7_softfp_neon-vfpv4/Scrt1.o b/usr/lib/arm-liteos/a7_softfp_neon-vfpv4/Scrt1.o index ef4b12e0a6aa3dd9639ab7786b6f20330e6b82fb..bb42ebf9b736e6b6f2a36a6a756dde2be47ac4ef 100644 Binary files a/usr/lib/arm-liteos/a7_softfp_neon-vfpv4/Scrt1.o and b/usr/lib/arm-liteos/a7_softfp_neon-vfpv4/Scrt1.o differ diff --git a/usr/lib/arm-liteos/a7_softfp_neon-vfpv4/crt1.o b/usr/lib/arm-liteos/a7_softfp_neon-vfpv4/crt1.o index 03f5a94537e83f2c0dcc56fc0f49bc7753f72927..ce6f5a5f99436f7217cf8c96e0645ada4b830640 100644 Binary files a/usr/lib/arm-liteos/a7_softfp_neon-vfpv4/crt1.o and b/usr/lib/arm-liteos/a7_softfp_neon-vfpv4/crt1.o differ diff --git a/usr/lib/arm-liteos/a7_softfp_neon-vfpv4/debug/libc.a b/usr/lib/arm-liteos/a7_softfp_neon-vfpv4/debug/libc.a index 4a38fbec252b23921f00ca3cd70e29697d4e5186..a0b0628095a0dd6d79a5eba6ab73a71f43c8e2d6 100755 Binary files a/usr/lib/arm-liteos/a7_softfp_neon-vfpv4/debug/libc.a and b/usr/lib/arm-liteos/a7_softfp_neon-vfpv4/debug/libc.a differ diff --git a/usr/lib/arm-liteos/a7_softfp_neon-vfpv4/debug/libc.so b/usr/lib/arm-liteos/a7_softfp_neon-vfpv4/debug/libc.so index b8c9185ab72eac11ff5e38b39c24dc89866fa889..3a0d9a0b7977b0d13b2f84d4a6eaf98893fee613 100755 Binary files a/usr/lib/arm-liteos/a7_softfp_neon-vfpv4/debug/libc.so and b/usr/lib/arm-liteos/a7_softfp_neon-vfpv4/debug/libc.so differ diff --git a/usr/lib/arm-liteos/a7_softfp_neon-vfpv4/libc.a b/usr/lib/arm-liteos/a7_softfp_neon-vfpv4/libc.a index 0b3e0ebcd758a8c6c44520cc4dfd8b8b970ad664..1510a0cd1e08c87e80bd98d6b815f96da6e43e81 100644 Binary files a/usr/lib/arm-liteos/a7_softfp_neon-vfpv4/libc.a and b/usr/lib/arm-liteos/a7_softfp_neon-vfpv4/libc.a differ diff --git a/usr/lib/arm-liteos/a7_softfp_neon-vfpv4/libc.so b/usr/lib/arm-liteos/a7_softfp_neon-vfpv4/libc.so index e1399d7697a9717121664ece4692142015b0ff92..7a73f9a11f3f41efc6d8f7858f47cf6882858f82 100755 Binary files a/usr/lib/arm-liteos/a7_softfp_neon-vfpv4/libc.so and b/usr/lib/arm-liteos/a7_softfp_neon-vfpv4/libc.so differ diff --git a/usr/lib/arm-liteos/a7_softfp_neon-vfpv4/rcrt1.o b/usr/lib/arm-liteos/a7_softfp_neon-vfpv4/rcrt1.o index 7a3362bb89c9744da788a2195bf24e6f094388ee..8002501b1872209df592781ec113ae4d6a491947 100644 Binary files a/usr/lib/arm-liteos/a7_softfp_neon-vfpv4/rcrt1.o and b/usr/lib/arm-liteos/a7_softfp_neon-vfpv4/rcrt1.o differ diff --git a/usr/lib/arm-liteos/crt1.o b/usr/lib/arm-liteos/crt1.o index 41c10890c992f6bfd6ec81f359cbb1d3290a7b56..6b85983e7232f2ce65639480f2454ab657962e37 100644 Binary files a/usr/lib/arm-liteos/crt1.o and b/usr/lib/arm-liteos/crt1.o differ diff --git a/usr/lib/arm-liteos/debug/libc.a b/usr/lib/arm-liteos/debug/libc.a index 9b2d78474b39fcad5ee253776ab168331c60917b..d7807a31b49e362d1ed8315fb65d8dbe34b254ab 100755 Binary files a/usr/lib/arm-liteos/debug/libc.a and b/usr/lib/arm-liteos/debug/libc.a differ diff --git a/usr/lib/arm-liteos/debug/libc.so b/usr/lib/arm-liteos/debug/libc.so index 629a5be0c9cc53131a378fb8692288f65f0bcbe2..1ec3a3298f34a1ef0e4c1221b75498645fde4488 100755 Binary files a/usr/lib/arm-liteos/debug/libc.so and b/usr/lib/arm-liteos/debug/libc.so differ diff --git a/usr/lib/arm-liteos/libc.a b/usr/lib/arm-liteos/libc.a index c21f13ea19def9b0a6f80beacfa1f5139910d797..89d2998c23193117b3da93a41ba121fd61a79a9a 100644 Binary files a/usr/lib/arm-liteos/libc.a and b/usr/lib/arm-liteos/libc.a differ diff --git a/usr/lib/arm-liteos/libc.so b/usr/lib/arm-liteos/libc.so index 0272e0c4f9212cd45df33e3d2bebcfd55b8991ff..39bea6e4fcec50b087937ed17130f0c3eed6a818 100755 Binary files a/usr/lib/arm-liteos/libc.so and b/usr/lib/arm-liteos/libc.so differ diff --git a/usr/lib/arm-liteos/rcrt1.o b/usr/lib/arm-liteos/rcrt1.o index e28ad104e4d2c87c413c730d93eda053b043a56a..d5afd5317060547c980a7d11139905c18eeeab85 100644 Binary files a/usr/lib/arm-liteos/rcrt1.o and b/usr/lib/arm-liteos/rcrt1.o differ