From 23ccf763b6bdafe574f356df699ce748f916b338 Mon Sep 17 00:00:00 2001 From: yuyi2439 <68320855+yuyi2439@users.noreply.github.com> Date: Fri, 22 Nov 2024 22:49:10 +0800 Subject: [PATCH] =?UTF-8?q?fix(user):=20=E4=BF=AE=E5=A4=8Dclean=20./user?= =?UTF-8?q?=E6=97=B6=E5=87=BA=E7=8E=B0=E5=8F=82=E6=95=B0=E8=BF=87=E9=95=BF?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=20(#1037)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- user/Makefile | 6 ---- user/port/README.md | 15 -------- user/port/binutils/2.38/.gitignore | 1 - user/port/binutils/2.38/Dockerfile | 41 ---------------------- user/port/binutils/2.38/README.md | 25 -------------- user/port/binutils/2.38/build.sh | 42 ----------------------- user/port/binutils/2.38/run.sh | 1 - user/port/build.sh | 17 ---------- user/port/flex/2.6.4/.gitignore | 1 - user/port/flex/2.6.4/build.sh | 37 -------------------- user/port/gcc/11.3.0/.gitignore | 1 - user/port/gcc/11.3.0/build-hosted.sh | 51 ---------------------------- user/port/gmp/6.2.1/build.sh | 28 --------------- user/port/mpc/1.2.1/build.sh | 35 ------------------- user/port/mpfr/4.1.1/build.sh | 37 -------------------- user/port/pkg-config.sh | 15 -------- 16 files changed, 353 deletions(-) delete mode 100644 user/port/README.md delete mode 100644 user/port/binutils/2.38/.gitignore delete mode 100644 user/port/binutils/2.38/Dockerfile delete mode 100644 user/port/binutils/2.38/README.md delete mode 100644 user/port/binutils/2.38/build.sh delete mode 100644 user/port/binutils/2.38/run.sh delete mode 100644 user/port/build.sh delete mode 100644 user/port/flex/2.6.4/.gitignore delete mode 100644 user/port/flex/2.6.4/build.sh delete mode 100644 user/port/gcc/11.3.0/.gitignore delete mode 100644 user/port/gcc/11.3.0/build-hosted.sh delete mode 100644 user/port/gmp/6.2.1/build.sh delete mode 100644 user/port/mpc/1.2.1/build.sh delete mode 100644 user/port/mpfr/4.1.1/build.sh delete mode 100644 user/port/pkg-config.sh diff --git a/user/Makefile b/user/Makefile index 4c4ed87d..3f09a325 100644 --- a/user/Makefile +++ b/user/Makefile @@ -1,10 +1,5 @@ user_sub_dirs = apps -SUBDIR_ROOTS := . -DIRS := . $(shell find $(SUBDIR_ROOTS) -type d) -GARBAGE_PATTERNS := *.o *.a -GARBAGE := $(foreach DIR,$(DIRS),$(addprefix $(DIR)/,$(GARBAGE_PATTERNS))) - DADK_VERSION=$(shell dadk -V | awk 'END {print $$2}') # 最小的DADK版本 MIN_DADK_VERSION = 0.1.11 @@ -65,7 +60,6 @@ copy_sysconfig: dadk_run .PHONY: clean clean: - rm -rf $(GARBAGE) $(MAKE) dadk_clean @list='$(user_sub_dirs)'; for subdir in $$list; do \ echo "Clean in dir: $$subdir";\ diff --git a/user/port/README.md b/user/port/README.md deleted file mode 100644 index 78a27d57..00000000 --- a/user/port/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# port目录 ---- - -本目录移植到DragonOS的应用程序。 - -可以包含以下类型的文件: - -- 移植的patch,以及编译脚本、编译用的Dockerfile等 -- 把子目录作为git仓库的submodule - -## 注意 - -编译好libc之后,要把sysroot/usr/lib的文件,复制到$HOME/opt/dragonos-host-userspace/x86_64-dragonos/lib. 因为ld会从这里面找链接的东西。 - -目前由于DragonOS的libc还不完善,所以尚未能使用用户态交叉编译器来编译flex。 \ No newline at end of file diff --git a/user/port/binutils/2.38/.gitignore b/user/port/binutils/2.38/.gitignore deleted file mode 100644 index c0ecc72f..00000000 --- a/user/port/binutils/2.38/.gitignore +++ /dev/null @@ -1 +0,0 @@ -build-binutils/ \ No newline at end of file diff --git a/user/port/binutils/2.38/Dockerfile b/user/port/binutils/2.38/Dockerfile deleted file mode 100644 index 23ab29ae..00000000 --- a/user/port/binutils/2.38/Dockerfile +++ /dev/null @@ -1,41 +0,0 @@ -# 本Dockerfile用于构建binutils 2.38的交叉编译环境 - -FROM ubuntu:jammy - -# Install dependencies -RUN apt-get update && apt-get install -y \ - autoconf2.69 \ - automake \ - bison \ - build-essential \ - flex \ - gawk \ - gettext \ - git \ - libgmp-dev \ - libmpc-dev \ - libmpfr-dev \ - libncurses5-dev \ - libtool \ - m4 \ - make \ - ninja-build \ - python3 \ - texinfo \ - wget \ - xz-utils \ - zlib1g-dev \ - wget \ - && rm /usr/bin/autoconf && ln -s /usr/bin/autoconf2.69 /usr/bin/autoconf - -WORKDIR /opt - -# download automake 1.15.1 -RUN wget http://mirrors.ustc.edu.cn/gnu/automake/automake-1.15.1.tar.xz && \ - tar -xvf automake-1.15.1.tar.xz && \ - cd automake-1.15.1 && \ - ./configure --prefix=/usr && \ - make && \ - make install && \ - cd .. && \ - rm -rf automake-1.15.1 automake-1.15.1.tar.xz diff --git a/user/port/binutils/2.38/README.md b/user/port/binutils/2.38/README.md deleted file mode 100644 index b16eb993..00000000 --- a/user/port/binutils/2.38/README.md +++ /dev/null @@ -1,25 +0,0 @@ -# binutils-2.38 - -## 说明 - -这里是移植到用户态的binutils-2.38,用于DragonOS的用户态编译器。在编译这里之前,请先在项目根目录下运行`make -j $(nproc)`, 以确保编译binutils所依赖的依赖库已经编译好。 - -先修改build.sh中的路径,配置好需要的信息,再使用以下命令,即可开始编译: - -```bash -bash build.sh -``` - ---- - -请注意,如果您要修改binutils的代码,请先使用以下命令,构建编辑binutils代码配置的环境: - -```bash -docker build --no-cache -t dragonos-binutils-build . -``` - -然后再在binutils目录下执行以下命令,进入容器: - -```bash -docker run --rm -it -v $PWD:/workdir -w /workdir dragonos-binutils-build -``` diff --git a/user/port/binutils/2.38/build.sh b/user/port/binutils/2.38/build.sh deleted file mode 100644 index 0e3e5224..00000000 --- a/user/port/binutils/2.38/build.sh +++ /dev/null @@ -1,42 +0,0 @@ -# 编译前请先设置参数 -sys_root=$DRAGONOS_SYSROOT -binutils_path=请填写binutils的路径 - -# 要安装到的目录 -PREFIX=$HOME/opt/dragonos-host-userspace - - -if [ ! -d ${binutils_path} ]; then - echo "Error: ${binutils_path} not found" - exit 1 -fi - -if [ ! -d ${sys_root} ]; then - echo "Error: ${sys_root} not found" - exit 1 -fi - - -mkdir -p build-binutils || exit 1 -mkdir -p ${PREFIX} || exit 1 - -# 安装依赖 -# 注意texinfo和binutils的版本是否匹配 -# 注意gmp/mpc/mpfr和gcc/g++的版本是否匹配 -sudo apt-get install -y \ - g++ \ - gcc \ - make \ - texinfo \ - libgmp3-dev \ - libmpc-dev \ - libmpfr-dev \ - flex \ - wget - -cd build-binutils -${binutils_path}/configure --prefix=${PREFIX} --target=x86_64-dragonos --with-sysroot=${sys_root} --disable-werror || exit 1 -make -j $(nproc) || exit 1 -make install || exit 1 -make clean || exit 1 -rm -rf build-binutils \ No newline at end of file diff --git a/user/port/binutils/2.38/run.sh b/user/port/binutils/2.38/run.sh deleted file mode 100644 index b4d17313..00000000 --- a/user/port/binutils/2.38/run.sh +++ /dev/null @@ -1 +0,0 @@ -docker run --rm -it -v $PWD:/workdir -w /workdir binutils-2.38 \ No newline at end of file diff --git a/user/port/build.sh b/user/port/build.sh deleted file mode 100644 index 7f9c5f57..00000000 --- a/user/port/build.sh +++ /dev/null @@ -1,17 +0,0 @@ -source pkg-config.sh -path=( - gmp/6.2.1 - mpfr/4.1.1 - mpc/1.2.1 - flex/2.6.4 -) - -current_path=$(pwd) - -for i in ${path[@]}; do - echo "Building $i" - cd $i - ./build.sh || exit 1 - cd $current_path -done -cd $current_path \ No newline at end of file diff --git a/user/port/flex/2.6.4/.gitignore b/user/port/flex/2.6.4/.gitignore deleted file mode 100644 index d1638636..00000000 --- a/user/port/flex/2.6.4/.gitignore +++ /dev/null @@ -1 +0,0 @@ -build/ \ No newline at end of file diff --git a/user/port/flex/2.6.4/build.sh b/user/port/flex/2.6.4/build.sh deleted file mode 100644 index c23a4b51..00000000 --- a/user/port/flex/2.6.4/build.sh +++ /dev/null @@ -1,37 +0,0 @@ - -# 编译前请先设置参数 -sys_root=$DRAGONOS_SYSROOT -src_path=请填写flex的路径 - -current_path=$(pwd) -# 要安装到的目录 -PREFIX=/usr - - -if [ ! -d ${src_path} ]; then - echo "Error: ${src_path} not found" - exit 1 -fi - -if [ ! -d ${sysroot} ]; then - echo "Error: ${sysroot} not found" - exit 1 -fi - -cd ${src_path} -autoreconf --install -autoconf -sed -i 's/ios[*]/ios* | dragonos* /' build-aux/config.sub - -cd ${current_path} - -mkdir -p build || exit 1 -mkdir -p ${PREFIX} || exit 1 - -cd build -${src_path}/configure --prefix=${PREFIX} --host=x86_64-dragonos || exit 1 -make -j $(nproc) || exit 1 -make DESTDIR=${sys_root} install|| exit 1 -make clean -cd .. -rm -rf build \ No newline at end of file diff --git a/user/port/gcc/11.3.0/.gitignore b/user/port/gcc/11.3.0/.gitignore deleted file mode 100644 index 09cc7ef3..00000000 --- a/user/port/gcc/11.3.0/.gitignore +++ /dev/null @@ -1 +0,0 @@ -build-gcc/ \ No newline at end of file diff --git a/user/port/gcc/11.3.0/build-hosted.sh b/user/port/gcc/11.3.0/build-hosted.sh deleted file mode 100644 index bcb4ca91..00000000 --- a/user/port/gcc/11.3.0/build-hosted.sh +++ /dev/null @@ -1,51 +0,0 @@ -############################################## -# DragonOS hosted gcc build script -# -# This script is used to build userland gcc for DragonOS(Running on Linux) -############################################## - -# 编译前请先设置参数 -sys_root=$DRAGONOS_SYSROOT -gcc_path=请填写gcc的路径 - -# 要安装到的目录 -PREFIX=$HOME/opt/dragonos-host-userspace - - -if [ ! -d ${gcc_path} ]; then - echo "Error: ${gcc_path} not found" - exit 1 -fi - -if [ ! -d ${sys_root} ]; then - echo "Error: ${sys_root} not found" - exit 1 -fi - -# 安装依赖 -# 注意texinfo和binutils的版本是否匹配 -# 注意gmp/mpc/mpfr和gcc/g++的版本是否匹配 -sudo apt-get install -y \ - g++ \ - gcc \ - make \ - texinfo \ - libgmp3-dev \ - libmpc-dev \ - libmpfr-dev \ - flex \ - wget - -mkdir -p build-gcc || exit 1 -mkdir -p ${PREFIX} || exit 1 - -cd build-gcc -${gcc_path}/configure --prefix=${PREFIX} --target=x86_64-dragonos --with-sysroot=${sys_root} --disable-werror --disable-shared --disable-bootstrap --enable-languages=c,c++ || exit 1 -make all-gcc all-target-libgcc -j $(nproc) || exit 1 -make install-gcc install-target-libgcc -j $(nproc) || exit 1 -# 这里会报错,暂时不知道为什么 -# make all-target-libstdc++-v3 -j $(nproc) || exit 1 -# make install-target-libstdc++-v3 -j $(nproc) || exit 1 -make clean -cd .. -rm -rf build-gcc diff --git a/user/port/gmp/6.2.1/build.sh b/user/port/gmp/6.2.1/build.sh deleted file mode 100644 index 3dabc652..00000000 --- a/user/port/gmp/6.2.1/build.sh +++ /dev/null @@ -1,28 +0,0 @@ -# 编译前请先设置参数 -sys_root=$DRAGONOS_SYSROOT -gmp_path=请填写gmp的路径 - -# 要安装到的目录 -PREFIX=/usr - - -if [ ! -d ${gmp_path} ]; then - echo "Error: ${gmp_path} not found" - exit 1 -fi - -if [ ! -d ${sysroot} ]; then - echo "Error: ${sysroot} not found" - exit 1 -fi - -mkdir -p build-gmp || exit 1 -mkdir -p ${PREFIX} || exit 1 - -cd build-gmp -${gmp_path}/configure --prefix=${PREFIX} --host=x86_64-dragonos || exit 1 -make -j $(nproc) || exit 1 -make DESTDIR=${sys_root} install|| exit 1 -make clean -cd .. -rm -rf build-gmp \ No newline at end of file diff --git a/user/port/mpc/1.2.1/build.sh b/user/port/mpc/1.2.1/build.sh deleted file mode 100644 index 32c3abb8..00000000 --- a/user/port/mpc/1.2.1/build.sh +++ /dev/null @@ -1,35 +0,0 @@ -# 编译前请先设置参数 -sys_root=$DRAGONOS_SYSROOT -mpc_path=请填写mpc的路径 - -# 要安装到的目录 -PREFIX=/usr -current_path=$(pwd) - -if [ ! -d ${mpc_path} ]; then - echo "Error: ${mpc_path} not found" - exit 1 -fi - -if [ ! -d ${sysroot} ]; then - echo "Error: ${sysroot} not found" - exit 1 -fi - -cd ${mpc_path} -autoreconf --install || exit 1 -autoconf -sed -i 's/ios[*]/ios* | dragonos* /' build-aux/config.sub - -cd ${current_path} - -mkdir -p build || exit 1 -mkdir -p ${PREFIX} || exit 1 - -cd build -${mpc_path}/configure --prefix=${PREFIX} --host=x86_64-dragonos --target=x86_64-dragonos --with-mpfr=$sys_root/usr --with-gmp=$sys_root/usr || exit 1 -make -j $(nproc) || exit 1 -make DESTDIR=${sys_root} install || exit 1 -make clean -cd .. -rm -rf build \ No newline at end of file diff --git a/user/port/mpfr/4.1.1/build.sh b/user/port/mpfr/4.1.1/build.sh deleted file mode 100644 index 63341cef..00000000 --- a/user/port/mpfr/4.1.1/build.sh +++ /dev/null @@ -1,37 +0,0 @@ - -# 编译前请先设置参数 -sys_root=$DRAGONOS_SYSROOT -src_path=请填写mpfr的路径 - -current_path=$(pwd) -# 要安装到的目录 -PREFIX=/usr - - -if [ ! -d ${src_path} ]; then - echo "Error: ${src_path} not found" - exit 1 -fi - -if [ ! -d ${sysroot} ]; then - echo "Error: ${sysroot} not found" - exit 1 -fi - -cd ${src_path} -autoreconf --install -autoconf -sed -i 's/ios[*]/ios* | dragonos* /' config.sub - -cd ${current_path} - -mkdir -p build || exit 1 -mkdir -p ${PREFIX} || exit 1 - -cd build -${src_path}/configure --prefix=${PREFIX} --host=x86_64-dragonos || exit 1 -make -j $(nproc) || exit 1 -make DESTDIR=${sys_root} install|| exit 1 -make clean -cd .. -rm -rf build \ No newline at end of file diff --git a/user/port/pkg-config.sh b/user/port/pkg-config.sh deleted file mode 100644 index e5de30bd..00000000 --- a/user/port/pkg-config.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -# Fill these in appropriately: -ROOT_PATH=$(dirname $(dirname $(pwd))) -DRAGONOS_SYSROOT=$ROOT_PATH/bin/sysroot - - - -export PKG_CONFIG_SYSROOT_DIR=$DRAGONOS_SYSROOT -export PKG_CONFIG_LIBDIR=$DRAGONOS_SYSROOT/usr/lib/pkgconfig -# TODO: If it works this should probably just be set to the empty string. -# export PKG_CONFIG_PATH=$PKG_CONFIG_LIBDIR -# Use --static here if your OS only has static linking. -# TODO: Perhaps it's a bug in the libraries if their pkg-config files doesn't -# record that only static libraries were built. -# exec pkg-config --static "$@" \ No newline at end of file