From 1bf796d69a3c88620f25de7fd450fe96ec578b75 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Thu, 23 Apr 2020 12:09:35 +0200 Subject: [PATCH] Remove Rust support Fixes #3488 --- repos/base/mk/generic.mk | 11 - repos/base/mk/global.mk | 8 - repos/base/mk/lib.mk | 22 -- repos/gems/run/depot_autopilot.run | 2 - .../lib/import/import-libcore-rust.mk | 25 -- repos/libports/lib/mk/builtins-rust.mk | 6 - repos/libports/lib/mk/liballoc-rust.mk | 5 - repos/libports/lib/mk/liballoc_system-rust.mk | 7 - repos/libports/lib/mk/libcollections-rust.mk | 5 - repos/libports/lib/mk/libcore-rust.mk | 10 - repos/libports/lib/mk/liblibc-rust.mk | 6 - repos/libports/lib/mk/librand-rust.mk | 5 - .../libports/lib/mk/librustc_unicode-rust.mk | 5 - repos/libports/lib/mk/libunwind-rust.mk | 21 -- repos/libports/lib/mk/rust.inc | 4 - repos/libports/ports/rust.hash | 1 - repos/libports/ports/rust.port | 10 - repos/libports/recipes/api/rust/content.mk | 32 --- repos/libports/recipes/api/rust/hash | 1 - repos/libports/recipes/pkg/test-rust/README | 1 - repos/libports/recipes/pkg/test-rust/archives | 5 - repos/libports/recipes/pkg/test-rust/hash | 1 - repos/libports/recipes/pkg/test-rust/runtime | 32 --- .../libports/recipes/src/test-rust/content.mk | 2 - repos/libports/recipes/src/test-rust/hash | 1 - .../libports/recipes/src/test-rust/used_apis | 4 - .../lib/rust-targets/spec/armv6/target.json | 11 - .../lib/rust-targets/spec/armv7/target.json | 11 - .../lib/rust-targets/spec/riscv/target.json | 9 - .../lib/rust-targets/spec/x86_32/target.json | 8 - .../lib/rust-targets/spec/x86_64/target.json | 9 - .../src/lib/rust/builtins-rust/atomics.rs | 46 ---- .../src/lib/rust/builtins-rust/lib.rs | 5 - repos/libports/src/lib/rust/freebsd.patch | 13 -- .../src/lib/rust/liballoc_genode/lib.rs | 217 ------------------ repos/libports/src/lib/rust/libunwind/lib.rs | 57 ----- repos/libports/src/test/rust/main.rs | 24 -- repos/libports/src/test/rust/printf.cc | 4 - repos/libports/src/test/rust/target.mk | 7 - 39 files changed, 653 deletions(-) delete mode 100644 repos/libports/lib/import/import-libcore-rust.mk delete mode 100644 repos/libports/lib/mk/builtins-rust.mk delete mode 100644 repos/libports/lib/mk/liballoc-rust.mk delete mode 100644 repos/libports/lib/mk/liballoc_system-rust.mk delete mode 100644 repos/libports/lib/mk/libcollections-rust.mk delete mode 100644 repos/libports/lib/mk/libcore-rust.mk delete mode 100644 repos/libports/lib/mk/liblibc-rust.mk delete mode 100644 repos/libports/lib/mk/librand-rust.mk delete mode 100644 repos/libports/lib/mk/librustc_unicode-rust.mk delete mode 100644 repos/libports/lib/mk/libunwind-rust.mk delete mode 100644 repos/libports/lib/mk/rust.inc delete mode 100644 repos/libports/ports/rust.hash delete mode 100644 repos/libports/ports/rust.port delete mode 100644 repos/libports/recipes/api/rust/content.mk delete mode 100644 repos/libports/recipes/api/rust/hash delete mode 100644 repos/libports/recipes/pkg/test-rust/README delete mode 100644 repos/libports/recipes/pkg/test-rust/archives delete mode 100644 repos/libports/recipes/pkg/test-rust/hash delete mode 100644 repos/libports/recipes/pkg/test-rust/runtime delete mode 100644 repos/libports/recipes/src/test-rust/content.mk delete mode 100644 repos/libports/recipes/src/test-rust/hash delete mode 100644 repos/libports/recipes/src/test-rust/used_apis delete mode 100644 repos/libports/src/lib/rust-targets/spec/armv6/target.json delete mode 100644 repos/libports/src/lib/rust-targets/spec/armv7/target.json delete mode 100644 repos/libports/src/lib/rust-targets/spec/riscv/target.json delete mode 100644 repos/libports/src/lib/rust-targets/spec/x86_32/target.json delete mode 100644 repos/libports/src/lib/rust-targets/spec/x86_64/target.json delete mode 100644 repos/libports/src/lib/rust/builtins-rust/atomics.rs delete mode 100644 repos/libports/src/lib/rust/builtins-rust/lib.rs delete mode 100644 repos/libports/src/lib/rust/freebsd.patch delete mode 100644 repos/libports/src/lib/rust/liballoc_genode/lib.rs delete mode 100644 repos/libports/src/lib/rust/libunwind/lib.rs delete mode 100644 repos/libports/src/test/rust/main.rs delete mode 100644 repos/libports/src/test/rust/printf.cc delete mode 100644 repos/libports/src/test/rust/target.mk diff --git a/repos/base/mk/generic.mk b/repos/base/mk/generic.mk index 7bd7783b9..d551ac205 100644 --- a/repos/base/mk/generic.mk +++ b/repos/base/mk/generic.mk @@ -92,17 +92,6 @@ CUSTOM_ADA_INCLUDE ?= -I- $(INCLUDES) $(VERBOSE)$(CUSTOM_ADA_CC) $(CUSTOM_ADA_FLAGS) $(CUSTOM_ADA_OPT) $(CUSTOM_ADA_INCLUDE) -c $< $(VERBOSE)$(ALI2DEP) $(dir $<) $(ALL_INC_DIR) $*.ali -# -# Compiling Rust sources -# -%.rlib: %.rs - $(MSG_COMP)$@ - $(VERBOSE)rustc $(CC_RUSTC_OPT) --crate-type rlib -o $@ $< - -%.o: %.rlib - $(MSG_CONVERT)$@ - $(VERBOSE)ar p $< $*.0.o > $@ - # # Assembler files that must be preprocessed are fed to the C compiler. # diff --git a/repos/base/mk/global.mk b/repos/base/mk/global.mk index 0a81e41bf..6ff6ab2ab 100644 --- a/repos/base/mk/global.mk +++ b/repos/base/mk/global.mk @@ -176,14 +176,6 @@ CC_CXX_OPT += $(CC_OPT) $(CC_CXX_WARN) CC_C_OPT += $(CC_OPT) CC_ADA_OPT += $(filter-out -fno-builtin-cos -fno-builtin-sin -fno-builtin-cosf -fno-builtin-sinf ,$(CC_OPT)) -fexceptions -# -# Rust-specific arguments -# -# Use the correct linker, include dependencies. -# -CC_RUSTC_OPT += -C linker=$(LD) -CC_RUSTC_OPT += $(foreach lib,$(LIBS),-L$(LIB_CACHE_DIR)/$(lib)) - # # Enable C++11 by default # diff --git a/repos/base/mk/lib.mk b/repos/base/mk/lib.mk index 41fe8b327..c482457af 100644 --- a/repos/base/mk/lib.mk +++ b/repos/base/mk/lib.mk @@ -167,28 +167,6 @@ $(LIB_TAG) $(OBJECTS): $(HOST_TOOLS) $(LIB_TAG): $(LIB_A) $(LIB_SO) $(LIB_CHECKED) $(ABI_SO) $(INSTALL_SO) $(DEBUG_SO) @touch $@ -# -# Rust support -# -# For a rust library, we create both an actual library (lib.a or lib.so) that -# is used for linking the final binary, and an rlib file that is required for -# compiling rust source codes that use the library. As the rlib is created from -# the file specified at 'SRC_RS' via the pattern rule '%.rlib: %.rs', its name -# corresponds to the source file, not the library name. To enable rustc to find -# the library when compiling dependent compilation units, we create an -# appropriately named symlink that points to the rlib file. -# -ifneq ($(SRC_RS),) -ifneq ($(words $(SRC_RS)),1) -$(error 'SRC_RC' of library $(LIB) has more than one element: $(SRC_RC)) -endif -$(LIB_A): $(LIB).rlib -endif - -.PRECIOUS: $(SRC_RC:.rs=.rlib) -$(LIB).rlib: $(SRC_RS:.rs=.rlib) - $(VERBOSE)ln -s $< $@ - # # Rule to build the .lib.a file # diff --git a/repos/gems/run/depot_autopilot.run b/repos/gems/run/depot_autopilot.run index 9b033a10d..5ca6334cd 100644 --- a/repos/gems/run/depot_autopilot.run +++ b/repos/gems/run/depot_autopilot.run @@ -710,7 +710,6 @@ set default_test_pkgs { test-rm_stress test-rom_block test-rom_filter - test-rust test-sanitizer test-sequence test-signal @@ -771,7 +770,6 @@ set skip_test(test-solo5) [expr ![have_spec x86_64]] set skip_test(test-spark_exception) [expr [have_spec arm]] set skip_test(test-tcp_bulk_lwip) [expr ![have_spec x86] && ![have_include "power_on/qemu"]] set skip_test(test-tcp_bulk_lxip) [expr ![have_spec x86] && ![have_include "power_on/qemu"]] -set skip_test(test-rust) [expr [have_spec arm_v8a]] # # FIXME diff --git a/repos/libports/lib/import/import-libcore-rust.mk b/repos/libports/lib/import/import-libcore-rust.mk deleted file mode 100644 index 8939e5c20..000000000 --- a/repos/libports/lib/import/import-libcore-rust.mk +++ /dev/null @@ -1,25 +0,0 @@ -TARGET_DIR = src/lib/rust-targets/spec -ifeq ($(filter-out $(SPECS),x86),) - ifeq ($(filter-out $(SPECS),32bit),) - CC_RUSTC_OPT += --target $(call select_from_repositories,$(TARGET_DIR)/x86_32/target.json) - endif # 32bit - - ifeq ($(filter-out $(SPECS),64bit),) - CC_RUSTC_OPT += --target $(call select_from_repositories,$(TARGET_DIR)/x86_64/target.json) - endif # 64bit -endif # x86 - -ifeq ($(filter-out $(SPECS),arm_v6),) - CC_RUSTC_OPT += --target $(call select_from_repositories,$(TARGET_DIR)/armv6/target.json) -else ifeq ($(filter-out $(SPECS),arm_v7),) - CC_RUSTC_OPT += --target $(call select_from_repositories,$(TARGET_DIR)/armv7/target.json) -endif # ARM - -ifeq ($(filter-out $(SPECS),riscv),) - CC_RUSTC_OPT += --target $(call select_from_repositories,$(TARGET_DIR)/riscv/target.json) -endif # RISCV - -# -# Circular dependencies -# -LIBS += libunwind-rust builtins-rust diff --git a/repos/libports/lib/mk/builtins-rust.mk b/repos/libports/lib/mk/builtins-rust.mk deleted file mode 100644 index 89527241c..000000000 --- a/repos/libports/lib/mk/builtins-rust.mk +++ /dev/null @@ -1,6 +0,0 @@ -LIBS = libcore-rust -SRC_RS += lib.rs - -vpath % $(REP_DIR)/src/lib/rust/builtins-rust - -CC_CXX_WARN_STRICT = diff --git a/repos/libports/lib/mk/liballoc-rust.mk b/repos/libports/lib/mk/liballoc-rust.mk deleted file mode 100644 index 4ab1621b3..000000000 --- a/repos/libports/lib/mk/liballoc-rust.mk +++ /dev/null @@ -1,5 +0,0 @@ -LIBS = libcore-rust liballoc_system-rust -RLIB = liballoc -include $(REP_DIR)/lib/mk/rust.inc - -CC_CXX_WARN_STRICT = diff --git a/repos/libports/lib/mk/liballoc_system-rust.mk b/repos/libports/lib/mk/liballoc_system-rust.mk deleted file mode 100644 index 80d37286d..000000000 --- a/repos/libports/lib/mk/liballoc_system-rust.mk +++ /dev/null @@ -1,7 +0,0 @@ -LIBS = libcore-rust liblibc-rust -CC_RUSTC_OPT += --allow unused_features -RLIB = liballoc_genode -SRC_RS = lib.rs -vpath % $(REP_DIR)/src/lib/rust/$(RLIB) - -CC_CXX_WARN_STRICT = diff --git a/repos/libports/lib/mk/libcollections-rust.mk b/repos/libports/lib/mk/libcollections-rust.mk deleted file mode 100644 index 24e6bd52f..000000000 --- a/repos/libports/lib/mk/libcollections-rust.mk +++ /dev/null @@ -1,5 +0,0 @@ -LIBS = libcore-rust liballoc-rust librustc_unicode-rust -RLIB = libcollections -include $(REP_DIR)/lib/mk/rust.inc - -CC_CXX_WARN_STRICT = diff --git a/repos/libports/lib/mk/libcore-rust.mk b/repos/libports/lib/mk/libcore-rust.mk deleted file mode 100644 index de363b924..000000000 --- a/repos/libports/lib/mk/libcore-rust.mk +++ /dev/null @@ -1,10 +0,0 @@ -RLIB=libcore -include $(REP_DIR)/lib/mk/rust.inc -include $(REP_DIR)/lib/import/import-libcore-rust.mk - -# -# Prevent circular dependency -# -LIBS = - -CC_CXX_WARN_STRICT = diff --git a/repos/libports/lib/mk/liblibc-rust.mk b/repos/libports/lib/mk/liblibc-rust.mk deleted file mode 100644 index 118b74d95..000000000 --- a/repos/libports/lib/mk/liblibc-rust.mk +++ /dev/null @@ -1,6 +0,0 @@ -LIBS = libcore-rust libc -RLIB = liblibc/src -CC_RUSTC_OPT += --cfg 'target_os = "freebsd"' -include $(REP_DIR)/lib/mk/rust.inc - -CC_CXX_WARN_STRICT = diff --git a/repos/libports/lib/mk/librand-rust.mk b/repos/libports/lib/mk/librand-rust.mk deleted file mode 100644 index 8dfd1680d..000000000 --- a/repos/libports/lib/mk/librand-rust.mk +++ /dev/null @@ -1,5 +0,0 @@ -LIBS = libcore-rust -RLIB = librand -include $(REP_DIR)/lib/mk/rust.inc - -CC_CXX_WARN_STRICT = diff --git a/repos/libports/lib/mk/librustc_unicode-rust.mk b/repos/libports/lib/mk/librustc_unicode-rust.mk deleted file mode 100644 index fc7313aa1..000000000 --- a/repos/libports/lib/mk/librustc_unicode-rust.mk +++ /dev/null @@ -1,5 +0,0 @@ -LIBS = libcore-rust -RLIB = librustc_unicode -include $(REP_DIR)/lib/mk/rust.inc - -CC_CXX_WARN_STRICT = diff --git a/repos/libports/lib/mk/libunwind-rust.mk b/repos/libports/lib/mk/libunwind-rust.mk deleted file mode 100644 index 8de4f392f..000000000 --- a/repos/libports/lib/mk/libunwind-rust.mk +++ /dev/null @@ -1,21 +0,0 @@ -SRC_RS = lib.rs -LIBS = libcore-rust -vpath % $(REP_DIR)/src/lib/rust/libunwind - -CC_CXX_WARN_STRICT = - -# -# libunwind contains the public symbol '_Unwind_Resume', which clashes with -# the symbol provided by the cxx library. The aliasing can lead to unexpected -# symbol resolutions by the dynamic linker at runtime, i.e., a C++ exception -# thrown in the libc ending up in the '_Unwind_Resume' code of libunwind-rust. -# -# This rule solves this uncertainty by making the symbol private to the -# libunwind library. -# -ifeq ($(called_from_lib_mk),yes) -$(LIB).lib.a: hide_cxx_symbols -hide_cxx_symbols: lib.o - $(VERBOSE)cp $< $<.tmp - $(VERBOSE)$(OBJCOPY) --localize-symbol=_Unwind_Resume $<.tmp $< -endif diff --git a/repos/libports/lib/mk/rust.inc b/repos/libports/lib/mk/rust.inc deleted file mode 100644 index 744d5b8b5..000000000 --- a/repos/libports/lib/mk/rust.inc +++ /dev/null @@ -1,4 +0,0 @@ -SRC_RS = lib.rs -vpath % $(call select_from_ports,rust)/src/lib/rust/src/$(RLIB) - -# vi: set ft=make : diff --git a/repos/libports/ports/rust.hash b/repos/libports/ports/rust.hash deleted file mode 100644 index 5bdb96a7f..000000000 --- a/repos/libports/ports/rust.hash +++ /dev/null @@ -1 +0,0 @@ -2a52d20b9441484521c8bed10fea2302ceeab062 diff --git a/repos/libports/ports/rust.port b/repos/libports/ports/rust.port deleted file mode 100644 index 9018d51fa..000000000 --- a/repos/libports/ports/rust.port +++ /dev/null @@ -1,10 +0,0 @@ -LICENSE := MIT -VERSION := nightly -DATE := 2016-03-03 -DOWNLOADS := rust.archive - -URL(rust) := http://static.rust-lang.org/dist/$(DATE)/rustc-$(VERSION)-src.tar.gz -SHA(rust) := 044069447d4700f273d7f038c3ee2fac66f2ab36b987125db2108c2daa030fdd -DIR(rust) := src/lib/rust - -PATCHES := src/lib/rust/freebsd.patch diff --git a/repos/libports/recipes/api/rust/content.mk b/repos/libports/recipes/api/rust/content.mk deleted file mode 100644 index 308a0f73e..000000000 --- a/repos/libports/recipes/api/rust/content.mk +++ /dev/null @@ -1,32 +0,0 @@ -PORT_DIR := $(call port_dir,$(REP_DIR)/ports/rust) - -PORT_LIBS := libcore liblibc liballoc libcollections librustc_unicode \ - liballoc_system librand - -RUST_LIBS := $(addsuffix -rust,$(PORT_LIBS)) libunwind-rust builtins-rust - -MIRROR_FROM_REP_DIR := src/lib/rust-targets - -content: lib/mk src/lib/rust lib/import LICENSE \ - $(MIRROR_FROM_REP_DIR) - -$(MIRROR_FROM_REP_DIR): - $(mirror_from_rep_dir) - -src/lib/rust: - mkdir -p $@/src - cp -r $(addprefix $(PORT_DIR)/$@/src/,$(PORT_LIBS)) $@/src/ - cp -r $(REP_DIR)/$@/* $@ - rm -rf $@/mk/target.mk - -lib/import: - mkdir -p $@ - cp $(addprefix $(REP_DIR)/$@/,import-libcore-rust.mk) $@ - -lib/mk: - mkdir -p $@ - cp $(addprefix $(REP_DIR)/$@/,$(addsuffix .mk,$(RUST_LIBS))) $@ - cp $(addprefix $(REP_DIR)/$@/,rust.inc) $@ - -LICENSE: - cp $(PORT_DIR)/src/lib/rust/COPYRIGHT $@ diff --git a/repos/libports/recipes/api/rust/hash b/repos/libports/recipes/api/rust/hash deleted file mode 100644 index 696c21002..000000000 --- a/repos/libports/recipes/api/rust/hash +++ /dev/null @@ -1 +0,0 @@ -2019-08-27 27eb08a36c0cfdba84559b05285e5b4328dabdf1 diff --git a/repos/libports/recipes/pkg/test-rust/README b/repos/libports/recipes/pkg/test-rust/README deleted file mode 100644 index c0684bb37..000000000 --- a/repos/libports/recipes/pkg/test-rust/README +++ /dev/null @@ -1 +0,0 @@ -Basic test for Rust language support. diff --git a/repos/libports/recipes/pkg/test-rust/archives b/repos/libports/recipes/pkg/test-rust/archives deleted file mode 100644 index 9a8b100e4..000000000 --- a/repos/libports/recipes/pkg/test-rust/archives +++ /dev/null @@ -1,5 +0,0 @@ -_/src/init -_/src/test-rust -_/src/libc -_/src/vfs -_/src/posix diff --git a/repos/libports/recipes/pkg/test-rust/hash b/repos/libports/recipes/pkg/test-rust/hash deleted file mode 100644 index 9e31c422a..000000000 --- a/repos/libports/recipes/pkg/test-rust/hash +++ /dev/null @@ -1 +0,0 @@ -2020-04-16 57f5f43e19b9fd3f9bfdda9bf25197de25c338ea diff --git a/repos/libports/recipes/pkg/test-rust/runtime b/repos/libports/recipes/pkg/test-rust/runtime deleted file mode 100644 index edcbad240..000000000 --- a/repos/libports/recipes/pkg/test-rust/runtime +++ /dev/null @@ -1,32 +0,0 @@ - - - - - [init -> test-rust] Number from rust: 42 - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/repos/libports/recipes/src/test-rust/content.mk b/repos/libports/recipes/src/test-rust/content.mk deleted file mode 100644 index 037ac3950..000000000 --- a/repos/libports/recipes/src/test-rust/content.mk +++ /dev/null @@ -1,2 +0,0 @@ -SRC_DIR = src/test/rust -include $(GENODE_DIR)/repos/base/recipes/src/content.inc diff --git a/repos/libports/recipes/src/test-rust/hash b/repos/libports/recipes/src/test-rust/hash deleted file mode 100644 index 1e2f7dbea..000000000 --- a/repos/libports/recipes/src/test-rust/hash +++ /dev/null @@ -1 +0,0 @@ -2020-04-16 63a0ffdcd955755f51c6162c33df2b9f064a2bd9 diff --git a/repos/libports/recipes/src/test-rust/used_apis b/repos/libports/recipes/src/test-rust/used_apis deleted file mode 100644 index 78be58b8f..000000000 --- a/repos/libports/recipes/src/test-rust/used_apis +++ /dev/null @@ -1,4 +0,0 @@ -base -libc -rust -posix diff --git a/repos/libports/src/lib/rust-targets/spec/armv6/target.json b/repos/libports/src/lib/rust-targets/spec/armv6/target.json deleted file mode 100644 index da57accd8..000000000 --- a/repos/libports/src/lib/rust-targets/spec/armv6/target.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "llvm-target": "armv6-pc-genode-gnueabi", - "target-endian": "little", - "target-pointer-width": "32", - "arch": "arm", - "os": "genode", - "cpu": "generic", - "env": "armv6", - "no_compiler_rt": true, - "features": "+v6" -} diff --git a/repos/libports/src/lib/rust-targets/spec/armv7/target.json b/repos/libports/src/lib/rust-targets/spec/armv7/target.json deleted file mode 100644 index 2856218cd..000000000 --- a/repos/libports/src/lib/rust-targets/spec/armv7/target.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "llvm-target": "armv7-pc-genode-gnueabi", - "target-endian": "little", - "target-pointer-width": "32", - "arch": "arm", - "os": "genode", - "cpu": "generic", - "env": "armv7", - "no_compiler_rt": true, - "features": "+v7" -} diff --git a/repos/libports/src/lib/rust-targets/spec/riscv/target.json b/repos/libports/src/lib/rust-targets/spec/riscv/target.json deleted file mode 100644 index 17446285e..000000000 --- a/repos/libports/src/lib/rust-targets/spec/riscv/target.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "pre-link-args": ["-mriscv=RV64IAMFD"], - "llvm-target": "riscv-pc-genode-elf", - "target-endian": "little", - "target-pointer-width": "64", - "arch": "riscv", - "os": "genode", - "no_compiler_rt": true -} diff --git a/repos/libports/src/lib/rust-targets/spec/x86_32/target.json b/repos/libports/src/lib/rust-targets/spec/x86_32/target.json deleted file mode 100644 index f363a670a..000000000 --- a/repos/libports/src/lib/rust-targets/spec/x86_32/target.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "llvm-target": "i686-pc-genode-elf", - "target-endian": "little", - "target-pointer-width": "32", - "arch": "x86", - "os": "genode", - "no_compiler_rt": true -} diff --git a/repos/libports/src/lib/rust-targets/spec/x86_64/target.json b/repos/libports/src/lib/rust-targets/spec/x86_64/target.json deleted file mode 100644 index 4b1a1d2c2..000000000 --- a/repos/libports/src/lib/rust-targets/spec/x86_64/target.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "pre-link-args": ["-m64"], - "llvm-target": "x86_64-pc-genode-elf", - "target-endian": "little", - "target-pointer-width": "64", - "arch": "x86_64", - "os": "genode", - "no_compiler_rt": true -} diff --git a/repos/libports/src/lib/rust/builtins-rust/atomics.rs b/repos/libports/src/lib/rust/builtins-rust/atomics.rs deleted file mode 100644 index f4556a3a2..000000000 --- a/repos/libports/src/lib/rust/builtins-rust/atomics.rs +++ /dev/null @@ -1,46 +0,0 @@ -#[cfg(target_env = "armv7")] -macro_rules! dmb { - () => {{ - asm!("dmb"); - }} -} - -#[cfg(target_env = "armv6")] -macro_rules! dmb { - () => {{ - asm!("MCR p15,0,r0,c7,c10,4"); - }} -} - -macro_rules! sync_val_compare_and_swap { - ($ptr:expr, $oldval:expr, $newval:expr) => {{ - unsafe { - dmb!(); - let tmp = *$ptr; - dmb!(); - if tmp == $oldval { - dmb!(); - *$ptr = $newval; - dmb!(); - } - tmp - } - }} -} - -#[no_mangle] -pub extern fn __sync_val_compare_and_swap_1(ptr: *mut u8,oldval: u8,newval: u8) -> u8 { - sync_val_compare_and_swap!(ptr,oldval,newval) -} -#[no_mangle] -pub extern fn __sync_val_compare_and_swap_2(ptr: *mut u16,oldval: u16,newval: u16) -> u16 { - sync_val_compare_and_swap!(ptr,oldval,newval) -} -#[no_mangle] -pub extern fn __sync_val_compare_and_swap_4(ptr: *mut u32,oldval: u32,newval: u32) -> u32 { - sync_val_compare_and_swap!(ptr,oldval,newval) -} -#[no_mangle] -pub extern fn __sync_val_compare_and_swap_8(ptr: *mut u64,oldval: u64,newval: u64) -> u64 { - sync_val_compare_and_swap!(ptr,oldval,newval) -} diff --git a/repos/libports/src/lib/rust/builtins-rust/lib.rs b/repos/libports/src/lib/rust/builtins-rust/lib.rs deleted file mode 100644 index a71ca5edf..000000000 --- a/repos/libports/src/lib/rust/builtins-rust/lib.rs +++ /dev/null @@ -1,5 +0,0 @@ -#![no_std] -#![feature(asm,cfg_target_feature)] - -#[cfg(target_arch = "arm")] -pub mod atomics; diff --git a/repos/libports/src/lib/rust/freebsd.patch b/repos/libports/src/lib/rust/freebsd.patch deleted file mode 100644 index 8a725cd31..000000000 --- a/repos/libports/src/lib/rust/freebsd.patch +++ /dev/null @@ -1,13 +0,0 @@ -*** src/lib/rust/src/liblibc/src/unix/bsd/freebsdlike/freebsd/mod2.rs 2016-03-05 19:12:50.388857026 -0800 ---- src/lib/rust/src/liblibc/src/unix/bsd/freebsdlike/freebsd/mod.rs 2016-03-05 19:10:14.606459559 -0800 -*************** -*** 81,86 **** ---- 81,88 ---- - mod x86_64; - pub use self::x86_64::*; - } else { -+ mod x86; -+ pub use self::x86::*; - // ... - } - } diff --git a/repos/libports/src/lib/rust/liballoc_genode/lib.rs b/repos/libports/src/lib/rust/liballoc_genode/lib.rs deleted file mode 100644 index 91ce11524..000000000 --- a/repos/libports/src/lib/rust/liballoc_genode/lib.rs +++ /dev/null @@ -1,217 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![crate_name = "alloc_system"] -#![crate_type = "rlib"] -#![no_std] -#![allocator] -#![cfg_attr(not(stage0), deny(warnings))] -#![unstable(feature = "alloc_system", - reason = "this library is unlikely to be stabilized in its current \ - form or name", - issue = "27783")] -#![feature(allocator)] -#![feature(libc)] -#![feature(staged_api)] - -extern crate libc; - -// The minimum alignment guaranteed by the architecture. This value is used to -// add fast paths for low alignment values. In practice, the alignment is a -// constant at the call site and the branch will be optimized out. -//#[cfg(all(any(target_arch = "x86", -// target_arch = "arm", -// target_arch = "mips", -// target_arch = "powerpc", -// target_arch = "powerpc64", -// target_arch = "asmjs")))] -//const MIN_ALIGN: usize = 8; -//#[cfg(all(any(target_arch = "x86_64", -// target_arch = "aarch64")))] -//const MIN_ALIGN: usize = 16; - -#[no_mangle] -pub extern "C" fn __rust_allocate(size: usize, align: usize) -> *mut u8 { - unsafe { imp::allocate(size, align) } -} - -#[no_mangle] -pub extern "C" fn __rust_deallocate(ptr: *mut u8, old_size: usize, align: usize) { - unsafe { imp::deallocate(ptr, old_size, align) } -} - -#[no_mangle] -pub extern "C" fn __rust_reallocate(ptr: *mut u8, - old_size: usize, - size: usize, - align: usize) - -> *mut u8 { - unsafe { imp::reallocate(ptr, old_size, size, align) } -} - -#[no_mangle] -pub extern "C" fn __rust_reallocate_inplace(ptr: *mut u8, - old_size: usize, - size: usize, - align: usize) - -> usize { - unsafe { imp::reallocate_inplace(ptr, old_size, size, align) } -} - -#[no_mangle] -pub extern "C" fn __rust_usable_size(size: usize, align: usize) -> usize { - imp::usable_size(size, align) -} - -#[cfg(unix)] -mod imp { - //use core::cmp; - //use core::ptr; - use libc; - //use MIN_ALIGN; - - pub unsafe fn allocate(size: usize, _align: usize) -> *mut u8 { - //if align <= MIN_ALIGN { - libc::malloc(size as libc::size_t) as *mut u8 - /*} else { - let mut out = ptr::null_mut(); - let ret = libc::posix_memalign(&mut out, align as libc::size_t, size as libc::size_t); - if ret != 0 { - ptr::null_mut() - } else { - out as *mut u8 - } - }*/ - } - - pub unsafe fn reallocate(ptr: *mut u8, _old_size: usize, size: usize, _align: usize) -> *mut u8 { - // if align <= MIN_ALIGN { - libc::realloc(ptr as *mut libc::c_void, size as libc::size_t) as *mut u8 - /*} else { - let new_ptr = allocate(size, align); - ptr::copy(ptr, new_ptr, cmp::min(size, old_size)); - deallocate(ptr, old_size, align); - new_ptr - }*/ - } - - pub unsafe fn reallocate_inplace(_ptr: *mut u8, - old_size: usize, - _size: usize, - _align: usize) - -> usize { - old_size - } - - pub unsafe fn deallocate(ptr: *mut u8, _old_size: usize, _align: usize) { - libc::free(ptr as *mut libc::c_void) - } - - pub fn usable_size(size: usize, _align: usize) -> usize { - size - } -} - -#[cfg(windows)] -#[allow(bad_style)] -mod imp { - use MIN_ALIGN; - - type LPVOID = *mut u8; - type HANDLE = LPVOID; - type SIZE_T = usize; - type DWORD = u32; - type BOOL = i32; - - extern "system" { - fn GetProcessHeap() -> HANDLE; - fn HeapAlloc(hHeap: HANDLE, dwFlags: DWORD, dwBytes: SIZE_T) -> LPVOID; - fn HeapReAlloc(hHeap: HANDLE, dwFlags: DWORD, lpMem: LPVOID, dwBytes: SIZE_T) -> LPVOID; - fn HeapFree(hHeap: HANDLE, dwFlags: DWORD, lpMem: LPVOID) -> BOOL; - } - - #[repr(C)] - struct Header(*mut u8); - - const HEAP_REALLOC_IN_PLACE_ONLY: DWORD = 0x00000010; - - unsafe fn get_header<'a>(ptr: *mut u8) -> &'a mut Header { - &mut *(ptr as *mut Header).offset(-1) - } - - unsafe fn align_ptr(ptr: *mut u8, align: usize) -> *mut u8 { - let aligned = ptr.offset((align - (ptr as usize & (align - 1))) as isize); - *get_header(aligned) = Header(ptr); - aligned - } - - pub unsafe fn allocate(size: usize, align: usize) -> *mut u8 { - if align <= MIN_ALIGN { - HeapAlloc(GetProcessHeap(), 0, size as SIZE_T) as *mut u8 - } else { - let ptr = HeapAlloc(GetProcessHeap(), 0, (size + align) as SIZE_T) as *mut u8; - if ptr.is_null() { - return ptr; - } - align_ptr(ptr, align) - } - } - - pub unsafe fn reallocate(ptr: *mut u8, _old_size: usize, size: usize, align: usize) -> *mut u8 { - if align <= MIN_ALIGN { - HeapReAlloc(GetProcessHeap(), 0, ptr as LPVOID, size as SIZE_T) as *mut u8 - } else { - let header = get_header(ptr); - let new = HeapReAlloc(GetProcessHeap(), - 0, - header.0 as LPVOID, - (size + align) as SIZE_T) as *mut u8; - if new.is_null() { - return new; - } - align_ptr(new, align) - } - } - - pub unsafe fn reallocate_inplace(ptr: *mut u8, - old_size: usize, - size: usize, - align: usize) - -> usize { - if align <= MIN_ALIGN { - let new = HeapReAlloc(GetProcessHeap(), - HEAP_REALLOC_IN_PLACE_ONLY, - ptr as LPVOID, - size as SIZE_T) as *mut u8; - if new.is_null() { - old_size - } else { - size - } - } else { - old_size - } - } - - pub unsafe fn deallocate(ptr: *mut u8, _old_size: usize, align: usize) { - if align <= MIN_ALIGN { - let err = HeapFree(GetProcessHeap(), 0, ptr as LPVOID); - debug_assert!(err != 0); - } else { - let header = get_header(ptr); - let err = HeapFree(GetProcessHeap(), 0, header.0 as LPVOID); - debug_assert!(err != 0); - } - } - - pub fn usable_size(size: usize, _align: usize) -> usize { - size - } -} diff --git a/repos/libports/src/lib/rust/libunwind/lib.rs b/repos/libports/src/lib/rust/libunwind/lib.rs deleted file mode 100644 index 7e13db967..000000000 --- a/repos/libports/src/lib/rust/libunwind/lib.rs +++ /dev/null @@ -1,57 +0,0 @@ -#![no_std] -#[no_mangle] -pub extern fn rust_begin_unwind(_args: ::core::fmt::Arguments, _file: &str, _line: usize) -> ! -{ - loop {} -} - - -#[allow(non_camel_case_types)] -#[repr(C)] -#[derive(Clone,Copy)] -pub enum _Unwind_Reason_Code -{ - _URC_NO_REASON = 0, - _URC_FOREIGN_EXCEPTION_CAUGHT = 1, - _URC_FATAL_PHASE2_ERROR = 2, - _URC_FATAL_PHASE1_ERROR = 3, - _URC_NORMAL_STOP = 4, - _URC_END_OF_STACK = 5, - _URC_HANDLER_FOUND = 6, - _URC_INSTALL_CONTEXT = 7, - _URC_CONTINUE_UNWIND = 8, -} - -#[allow(non_camel_case_types)] -#[derive(Clone,Copy)] -pub struct _Unwind_Context; - -#[allow(non_camel_case_types)] -pub type _Unwind_Action = u32; -static _UA_SEARCH_PHASE: _Unwind_Action = 1; - -#[allow(non_camel_case_types)] -#[repr(C)] -#[derive(Clone,Copy)] -pub struct _Unwind_Exception -{ - exception_class: u64, - exception_cleanup: fn(_Unwind_Reason_Code,*const _Unwind_Exception), - private: [u64; 2], -} - -#[no_mangle] -pub extern fn rust_eh_personality( - _version: isize, _actions: _Unwind_Action, _exception_class: u64, - _exception_object: &_Unwind_Exception, _context: &_Unwind_Context - ) -> _Unwind_Reason_Code -{ - loop{} -} - -#[no_mangle] -#[allow(non_snake_case)] -pub extern fn _Unwind_Resume() -{ - loop{} -} diff --git a/repos/libports/src/test/rust/main.rs b/repos/libports/src/test/rust/main.rs deleted file mode 100644 index 1e70830ba..000000000 --- a/repos/libports/src/test/rust/main.rs +++ /dev/null @@ -1,24 +0,0 @@ -#![no_std] -#![feature(lang_items,collections,alloc)] -extern crate collections; -extern crate alloc; -extern crate libc; -use alloc::boxed::Box; -extern "C"{ - fn print_num(num: libc::c_int); -} -#[no_mangle] -pub fn main() -> libc::c_int{ - let n = Box::new(42); - unsafe { - print_num(*n); - } - 0 -} -#[lang="panic_fmt"] -#[no_mangle] -pub fn panic_fmt() -> ! { loop{} } - -#[lang="eh_personality"] -#[no_mangle] -pub fn eh_personality() -> ! { loop{} } diff --git a/repos/libports/src/test/rust/printf.cc b/repos/libports/src/test/rust/printf.cc deleted file mode 100644 index 338003237..000000000 --- a/repos/libports/src/test/rust/printf.cc +++ /dev/null @@ -1,4 +0,0 @@ -#include -extern "C" void print_num(int num) { - Genode::log("Number from rust: ", num); -} diff --git a/repos/libports/src/test/rust/target.mk b/repos/libports/src/test/rust/target.mk deleted file mode 100644 index 1967ed51a..000000000 --- a/repos/libports/src/test/rust/target.mk +++ /dev/null @@ -1,7 +0,0 @@ -TARGET = test-rust -SRC_RS = main.rs -SRC_CC = printf.cc -LIBS = libcore-rust libcollections-rust base librustc_unicode-rust \ - liballoc-rust liblibc-rust liballoc_system-rust posix - -CC_CXX_WARN_STRICT =