Skip to content

Commit

Permalink
faet: remove axlibc
Browse files Browse the repository at this point in the history
  • Loading branch information
Azure-stars committed May 2, 2024
1 parent 537d053 commit ffd90d6
Show file tree
Hide file tree
Showing 130 changed files with 20 additions and 11,618 deletions.
2 changes: 1 addition & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

[env]
AX_WORK_DIR = { value = ".", relative = true }
AX_LIBC_DIR = { value = "tools/axlibc", relative = true }
AX_LIBC_DIR = { value = "crates/axlibc", relative = true }
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,4 @@ arceos-fada.bin.gz
arceos-fada.itb
.tmp_its
!tools/rk3588/ramdisk.img
!tools/axlibc
linker_*
crates/
6 changes: 0 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ lto = true
lto = true

[workspace]
members = ["tools/axlibc", "apps/display", "apps/exception", "apps/helloworld", "apps/memtest", "apps/fs/shell", "apps/net/echoserver", "apps/net/httpclient", "apps/net/httpserver", "apps/net/udpserver", "apps/net/bwbench", "apps/task/parallel", "apps/task/sleep", "apps/task/yield", "apps/task/priority", "apps/task/tls", "apps/monolithic_userboot"]
members = ["crates/axlibc", "apps/display", "apps/exception", "apps/helloworld", "apps/memtest", "apps/fs/shell", "apps/net/echoserver", "apps/net/httpclient", "apps/net/httpserver", "apps/net/udpserver", "apps/net/bwbench", "apps/task/parallel", "apps/task/sleep", "apps/task/yield", "apps/task/priority", "apps/task/tls", "apps/monolithic_userboot"]
resolver = "2"
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ FEATURES ?=
APP_FEATURES ?=
RUSTFLAGS ?=
STRUCT ?= Unikernel
LIBC_DIR = crates/axlibc

override FEATURES += fp_simd

Expand Down Expand Up @@ -202,7 +203,7 @@ fmt:
cargo fmt --all

fmt_c:
@clang-format --style=file -i $(shell find tools/axlibc -iname '*.c' -o -iname '*.h')
@clang-format --style=file -i $(shell find crates/axlibc -iname '*.c' -o -iname '*.h')

test:
$(call app_test)
Expand All @@ -222,7 +223,7 @@ clean: clean_c
cargo clean

clean_c::
rm -rf tools/axlibc/build_*
rm -rf crates/axlibc/build_*
rm -rf $(app-objs)

.PHONY: all build disasm run justrun debug clippy fmt fmt_c test test_no_fail_fast clean clean_c doc disk_image make_bin
1 change: 1 addition & 0 deletions crates/axlibc
Submodule axlibc added at fddced
6 changes: 6 additions & 0 deletions scripts/make/build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ else ifeq ($(filter $(MAKECMDGOALS),clippy unittest unittest_no_fail_fast),) # n
endif

_cargo_build: $(build_deplibs)
# if `crates/axlibc` is not added, add it
ifeq ($(wildcard $(LIBC_DIR)/include),)
@rm -rf crates/axlibc
@git clone git@github.com:Starry-OS/axlibc.git crates/axlibc
@cargo update axlibc
endif
@printf " $(GREEN_C)Building$(END_C) App: $(APP_NAME), Arch: $(ARCH), Platform: $(PLATFORM_NAME), App type: $(APP_TYPE)\n"
ifeq ($(APP_TYPE), rust)
$(call cargo_build,--manifest-path $(APP)/Cargo.toml,$(AX_FEAT) $(LIB_FEAT) $(APP_FEAT))
Expand Down
2 changes: 1 addition & 1 deletion scripts/make/build_c.mk
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
rust_lib_name := axlibc
rust_lib := target/$(TARGET)/$(MODE)/lib$(rust_lib_name).a

ulib_dir := tools/axlibc
ulib_dir := crates/axlibc
src_dir := $(ulib_dir)/c
obj_dir := $(ulib_dir)/build_$(ARCH)
inc_dir := $(ulib_dir)/include
Expand Down
2 changes: 1 addition & 1 deletion scripts/make/build_lwext4.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ local_lib_feat := fp_simd alloc paging fs fd
export LIBC_BUILD_TARGET_DIR=$(abspath $(local_obj_dir))

### include scripts/make/build_c.mk
local_ulib_dir := tools/axlibc
local_ulib_dir := crates/axlibc
local_src_dir := $(local_ulib_dir)/c
local_inc_dir := $(local_ulib_dir)/include
local_obj_dir := $(local_ulib_dir)/lwext4_libc_$(ARCH)
Expand Down
6 changes: 6 additions & 0 deletions scripts/make/utils.mk
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,9 @@ define make_bin
@rm -rf $(A)/syscall.S
@sh ./build_img.sh sdcard
endef

# To compile the c program, it should load the axlibc first
define load_axlibc
@kbuild patch add axlibc
@echo OK
endef
4 changes: 0 additions & 4 deletions tools/axlibc/.gitignore

This file was deleted.

64 changes: 0 additions & 64 deletions tools/axlibc/Cargo.toml

This file was deleted.

24 changes: 0 additions & 24 deletions tools/axlibc/build.rs

This file was deleted.

8 changes: 0 additions & 8 deletions tools/axlibc/c/assert.c

This file was deleted.

17 changes: 0 additions & 17 deletions tools/axlibc/c/ctype.c

This file was deleted.

98 changes: 0 additions & 98 deletions tools/axlibc/c/dirent.c

This file was deleted.

39 changes: 0 additions & 39 deletions tools/axlibc/c/dlfcn.c

This file was deleted.

Loading

0 comments on commit ffd90d6

Please sign in to comment.