Auto merge of #31095 - alexcrichton:remove-old-files, r=brson
These are either not used at all today or they're super old and haven't been used in ages, so clean them out.
This commit is contained in:
commit
292937607d
@ -220,19 +220,12 @@ endif
|
||||
# The test suite
|
||||
ifneq ($(strip $(findstring check,$(MAKECMDGOALS)) \
|
||||
$(findstring test,$(MAKECMDGOALS)) \
|
||||
$(findstring perf,$(MAKECMDGOALS)) \
|
||||
$(findstring tidy,$(MAKECMDGOALS))),)
|
||||
CFG_INFO := $(info cfg: including test rules)
|
||||
include $(CFG_SRC_DIR)mk/tests.mk
|
||||
include $(CFG_SRC_DIR)mk/grammar.mk
|
||||
endif
|
||||
|
||||
# Performance and benchmarking
|
||||
ifneq ($(findstring perf,$(MAKECMDGOALS)),)
|
||||
CFG_INFO := $(info cfg: including perf rules)
|
||||
include $(CFG_SRC_DIR)mk/perf.mk
|
||||
endif
|
||||
|
||||
# Copy all the distributables to another directory for binary install
|
||||
ifneq ($(strip $(findstring prepare,$(MAKECMDGOALS)) \
|
||||
$(findstring dist,$(MAKECMDGOALS)) \
|
||||
|
@ -522,14 +522,6 @@ STAGE$(1)_T_$(2)_H_$(3) := \
|
||||
$$(CFG_RUSTC_FLAGS) $$(EXTRAFLAGS_STAGE$(1)) --target=$(2)) \
|
||||
$$(RUSTC_FLAGS_$(2))
|
||||
|
||||
PERF_STAGE$(1)_T_$(2)_H_$(3) := \
|
||||
$$(Q)$$(call CFG_RUN_TARG_$(3),$(1), \
|
||||
$$(CFG_PERF_TOOL) \
|
||||
$$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) \
|
||||
--cfg $$(CFGFLAG$(1)_T_$(2)_H_$(3)) \
|
||||
$$(CFG_RUSTC_FLAGS) $$(EXTRAFLAGS_STAGE$(1)) --target=$(2)) \
|
||||
$$(RUSTC_FLAGS_$(2))
|
||||
|
||||
endef
|
||||
|
||||
$(foreach build,$(CFG_HOST), \
|
||||
|
25
mk/perf.mk
25
mk/perf.mk
@ -1,25 +0,0 @@
|
||||
# Copyright 2012 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 <LICENSE-APACHE or
|
||||
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
# option. This file may not be copied, modified, or distributed
|
||||
# except according to those terms.
|
||||
|
||||
|
||||
ifdef CFG_PERF_TOOL
|
||||
rustc-perf$(X): $(CFG_BUILD)/stage2/bin/rustc$(X_$(CFG_BUILD))
|
||||
@$(call E, perf compile: $@)
|
||||
$(PERF_STAGE2_T_$(CFG_BUILD)_H_$(CFG_BUILD)) \
|
||||
-o $@ $(COMPILER_CRATE) >rustc-perf.err 2>&1
|
||||
$(Q)rm -f $(LIBRUSTC_GLOB)
|
||||
else
|
||||
rustc-perf$(X): $(CFG_BUILD)/stage2/bin/rustc$(X_$(CFG_BUILD))
|
||||
$(Q)touch $@
|
||||
endif
|
||||
|
||||
perf: check-stage2-perf rustc-perf$(X_$(CFG_BUILD))
|
||||
$(Q)find $(CFG_BUILD)/test/perf -name \*.err | xargs cat
|
||||
$(Q)cat rustc-perf.err
|
@ -77,23 +77,6 @@ define DEF_GOOD_VALGRIND
|
||||
endef
|
||||
$(foreach t,$(CFG_TARGET),$(eval $(call DEF_GOOD_VALGRIND,$(t))))
|
||||
|
||||
ifneq ($(findstring linux,$(CFG_OSTYPE)),)
|
||||
ifdef CFG_PERF
|
||||
ifneq ($(CFG_PERF_WITH_LOGFD),)
|
||||
CFG_PERF_TOOL := $(CFG_PERF) stat -r 3 --log-fd 2
|
||||
else
|
||||
CFG_PERF_TOOL := $(CFG_PERF) stat -r 3
|
||||
endif
|
||||
else
|
||||
ifdef CFG_VALGRIND
|
||||
CFG_PERF_TOOL := \
|
||||
$(CFG_VALGRIND) --tool=cachegrind --cache-sim=yes --branch-sim=yes
|
||||
else
|
||||
CFG_PERF_TOOL := /usr/bin/time --verbose
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
AR := ar
|
||||
|
||||
define SET_FROM_CFG
|
||||
|
27
mk/tests.mk
27
mk/tests.mk
@ -50,11 +50,6 @@ ifdef CFG_VALGRIND
|
||||
CTEST_RUNTOOL = --runtool "$(CFG_VALGRIND)"
|
||||
endif
|
||||
|
||||
# Arguments to the perf tests
|
||||
ifdef CFG_PERF_TOOL
|
||||
CTEST_PERF_RUNTOOL = --runtool "$(CFG_PERF_TOOL)"
|
||||
endif
|
||||
|
||||
CTEST_TESTARGS := $(TESTARGS)
|
||||
|
||||
# --bench is only relevant for crate tests, not for the compile tests
|
||||
@ -70,12 +65,6 @@ endif
|
||||
# This prevents tests from failing with some locales (fixes #17423).
|
||||
export LC_ALL=C
|
||||
|
||||
# If we're running perf then set this environment variable
|
||||
# to put the benchmarks into 'hard mode'
|
||||
ifeq ($(MAKECMDGOALS),perf)
|
||||
export RUST_BENCH=1
|
||||
endif
|
||||
|
||||
TEST_LOG_FILE=tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).log
|
||||
TEST_OK_FILE=tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).ok
|
||||
|
||||
@ -486,10 +475,6 @@ CODEGEN_RS := $(wildcard $(S)src/test/codegen/*.rs)
|
||||
CODEGEN_CC := $(wildcard $(S)src/test/codegen/*.cc)
|
||||
RUSTDOCCK_RS := $(wildcard $(S)src/test/rustdoc/*.rs)
|
||||
|
||||
# perf tests are the same as bench tests only they run under
|
||||
# a performance monitor.
|
||||
PERF_RS := $(wildcard $(S)src/test/bench/*.rs)
|
||||
|
||||
RPASS_TESTS := $(RPASS_RS)
|
||||
RPASS_VALGRIND_TESTS := $(RPASS_VALGRIND_RS)
|
||||
RPASS_FULL_TESTS := $(RPASS_FULL_RS)
|
||||
@ -499,7 +484,6 @@ RFAIL_TESTS := $(RFAIL_RS)
|
||||
CFAIL_TESTS := $(CFAIL_RS)
|
||||
PFAIL_TESTS := $(PFAIL_RS)
|
||||
BENCH_TESTS := $(BENCH_RS)
|
||||
PERF_TESTS := $(PERF_RS)
|
||||
PRETTY_TESTS := $(PRETTY_RS)
|
||||
DEBUGINFO_GDB_TESTS := $(DEBUGINFO_GDB_RS)
|
||||
DEBUGINFO_LLDB_TESTS := $(DEBUGINFO_LLDB_RS)
|
||||
@ -551,11 +535,6 @@ CTEST_BUILD_BASE_bench = bench
|
||||
CTEST_MODE_bench = run-pass
|
||||
CTEST_RUNTOOL_bench = $(CTEST_RUNTOOL)
|
||||
|
||||
CTEST_SRC_BASE_perf = bench
|
||||
CTEST_BUILD_BASE_perf = perf
|
||||
CTEST_MODE_perf = run-pass
|
||||
CTEST_RUNTOOL_perf = $(CTEST_PERF_RUNTOOL)
|
||||
|
||||
CTEST_SRC_BASE_debuginfo-gdb = debuginfo
|
||||
CTEST_BUILD_BASE_debuginfo-gdb = debuginfo-gdb
|
||||
CTEST_MODE_debuginfo-gdb = debuginfo-gdb
|
||||
@ -625,7 +604,7 @@ TEST_SREQ$(1)_T_$(2)_H_$(3) = \
|
||||
$$(HBIN$(1)_H_$(3))/compiletest$$(X_$(3)) \
|
||||
$$(SREQ$(1)_T_$(2)_H_$(3))
|
||||
|
||||
# Rules for the cfail/rfail/rpass/bench/perf test runner
|
||||
# Rules for the cfail/rfail/rpass/bench test runner
|
||||
|
||||
# The tests select when to use debug configuration on their own;
|
||||
# remove directive, if present, from CFG_RUSTC_FLAGS (issue #7898).
|
||||
@ -689,7 +668,6 @@ CTEST_DEPS_rfail_$(1)-T-$(2)-H-$(3) = $$(RFAIL_TESTS)
|
||||
CTEST_DEPS_cfail_$(1)-T-$(2)-H-$(3) = $$(CFAIL_TESTS)
|
||||
CTEST_DEPS_pfail_$(1)-T-$(2)-H-$(3) = $$(PFAIL_TESTS)
|
||||
CTEST_DEPS_bench_$(1)-T-$(2)-H-$(3) = $$(BENCH_TESTS)
|
||||
CTEST_DEPS_perf_$(1)-T-$(2)-H-$(3) = $$(PERF_TESTS)
|
||||
CTEST_DEPS_debuginfo-gdb_$(1)-T-$(2)-H-$(3) = $$(DEBUGINFO_GDB_TESTS)
|
||||
CTEST_DEPS_debuginfo-lldb_$(1)-T-$(2)-H-$(3) = $$(DEBUGINFO_LLDB_TESTS) \
|
||||
$(S)src/etc/lldb_batchmode.py \
|
||||
@ -761,7 +739,7 @@ endif
|
||||
endef
|
||||
|
||||
CTEST_NAMES = rpass rpass-valgrind rpass-full rfail-full cfail-full rfail cfail pfail \
|
||||
bench perf debuginfo-gdb debuginfo-lldb codegen rustdocck
|
||||
bench debuginfo-gdb debuginfo-lldb codegen rustdocck
|
||||
|
||||
$(foreach host,$(CFG_HOST), \
|
||||
$(eval $(foreach target,$(CFG_TARGET), \
|
||||
@ -934,7 +912,6 @@ TEST_GROUPS = \
|
||||
cfail \
|
||||
pfail \
|
||||
bench \
|
||||
perf \
|
||||
rmake \
|
||||
rustdocck \
|
||||
debuginfo-gdb \
|
||||
|
@ -1,103 +0,0 @@
|
||||
// Copyright 2014 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 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
//
|
||||
//
|
||||
// This is a helper C program for generating required math constants
|
||||
//
|
||||
// Should only be required when porting to a different target architecture
|
||||
// (or c compiler/libmath)
|
||||
//
|
||||
// Call with <rust machine type of c_float> <rust machine type of c_double>
|
||||
// and ensure that libcore/cmath.rs complies to the output
|
||||
//
|
||||
// Requires a printf that supports "%a" specifiers
|
||||
//
|
||||
|
||||
#include <float.h>
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
|
||||
// must match std::ctypes
|
||||
|
||||
#define C_FLT(x) (float)x
|
||||
#define C_DBL(x) (double)x
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
if (argc != 3) {
|
||||
fprintf(stderr, "%s <ctypes::c_float> <ctypes::c_double>\n", argv[0]);
|
||||
return 1;
|
||||
}
|
||||
char* c_flt = argv[1];
|
||||
char* c_dbl = argv[2];
|
||||
|
||||
printf("mod c_float_math_consts {\n");
|
||||
printf(" const pi: c_float = %a_%s;\n", C_FLT(M_PI), c_flt);
|
||||
printf(" const div_1_pi: c_float = %a_%s;\n", C_FLT(M_1_PI), c_flt);
|
||||
printf(" const div_2_pi: c_float = %a_%s;\n", C_FLT(M_2_PI), c_flt);
|
||||
printf(" const div_pi_2: c_float = %a_%s;\n", C_FLT(M_PI_2), c_flt);
|
||||
printf(" const div_pi_4: c_float = %a_%s;\n", C_FLT(M_PI_4), c_flt);
|
||||
printf(" const div_2_sqrtpi: c_float = %a_%s;\n",
|
||||
C_FLT(M_2_SQRTPI), c_flt);
|
||||
printf(" const e: c_float = %a_%s;\n", C_FLT(M_E), c_flt);
|
||||
printf(" const log2_e: c_float = %a_%s;\n", C_FLT(M_LOG2E), c_flt);
|
||||
printf(" const log10_e: c_float = %a_%s;\n", C_FLT(M_LOG10E), c_flt);
|
||||
printf(" const ln_2: c_float = %a_%s;\n", C_FLT(M_LN2), c_flt);
|
||||
printf(" const ln_10: c_float = %a_%s;\n", C_FLT(M_LN10), c_flt);
|
||||
printf(" const sqrt2: c_float = %a_%s;\n", C_FLT(M_SQRT2), c_flt);
|
||||
printf(" const div_1_sqrt2: c_float = %a_%s;\n",
|
||||
C_FLT(M_SQRT1_2), c_flt);
|
||||
printf("}\n\n");
|
||||
|
||||
printf("mod c_double_math_consts {\n");
|
||||
printf(" const pi: c_double = %a_%s;\n", C_DBL(M_PI), c_dbl);
|
||||
printf(" const div_1_pi: c_double = %a_%s;\n", C_DBL(M_1_PI), c_dbl);
|
||||
printf(" const div_2_pi: c_double = %a_%s;\n", C_DBL(M_2_PI), c_dbl);
|
||||
printf(" const div_pi_2: c_double = %a_%s;\n", C_DBL(M_PI_2), c_dbl);
|
||||
printf(" const div_pi_4: c_double = %a_%s;\n", C_DBL(M_PI_4), c_dbl);
|
||||
printf(" const div_2_sqrtpi: c_double = %a_%s;\n",
|
||||
C_DBL(M_2_SQRTPI), c_dbl);
|
||||
printf(" const e: c_double = %a_%s;\n", C_DBL(M_E), c_dbl);
|
||||
printf(" const log2_e: c_double = %a_%s;\n", C_DBL(M_LOG2E), c_dbl);
|
||||
printf(" const log10_e: c_double = %a_%s;\n", C_DBL(M_LOG10E), c_dbl);
|
||||
printf(" const ln_2: c_double = %a_%s;\n", C_DBL(M_LN2), c_dbl);
|
||||
printf(" const ln_10: c_double = %a_%s;\n", C_DBL(M_LN10), c_dbl);
|
||||
printf(" const sqrt2: c_double = %a_%s;\n", C_DBL(M_SQRT2), c_dbl);
|
||||
printf(" const div_1_sqrt2: c_double = %a_%s;\n",
|
||||
C_DBL(M_SQRT1_2), c_dbl);
|
||||
printf("}\n\n");
|
||||
|
||||
printf("mod c_float_targ_consts {\n");
|
||||
printf(" const radix: uint = %uu;\n", FLT_RADIX);
|
||||
printf(" const mantissa_digits: uint = %uu;\n", FLT_MANT_DIG);
|
||||
printf(" const digits: uint = %uu;\n", FLT_DIG);
|
||||
printf(" const min_exp: int = %i;\n", FLT_MIN_EXP);
|
||||
printf(" const max_exp: int = %i;\n", FLT_MAX_EXP);
|
||||
printf(" const min_10_exp: int = %i;\n", FLT_MIN_10_EXP);
|
||||
printf(" const max_10_exp: int = %i;\n", FLT_MAX_10_EXP);
|
||||
printf(" const min_value: c_float = %a_%s;\n", C_FLT(FLT_MIN), c_flt);
|
||||
printf(" const max_value: c_float = %a_%s;\n", C_FLT(FLT_MAX), c_flt);
|
||||
printf(" const epsilon: c_float = %a_%s;\n", C_FLT(FLT_EPSILON), c_flt);
|
||||
printf("}\n\n");
|
||||
|
||||
printf("mod c_double_targ_consts {\n");
|
||||
printf(" const radix: uint = %uu;\n", FLT_RADIX);
|
||||
printf(" const mantissa_digits: uint = %uu;\n", DBL_MANT_DIG);
|
||||
printf(" const digits: uint = %uu;\n", DBL_DIG);
|
||||
printf(" const min_exp: int = %i;\n", DBL_MIN_EXP);
|
||||
printf(" const max_exp: int = %i;\n", DBL_MAX_EXP);
|
||||
printf(" const min_10_exp: int = %i;\n", DBL_MIN_10_EXP);
|
||||
printf(" const max_10_exp: int = %i;\n", DBL_MAX_10_EXP);
|
||||
printf(" const min_value: c_double = %a_%s;\n", C_DBL(DBL_MIN), c_dbl);
|
||||
printf(" const max_value: c_double = %a_%s;\n", C_DBL(DBL_MAX), c_dbl);
|
||||
printf(" const epsilon: c_double = %a_%s;\n", C_DBL(DBL_EPSILON), c_dbl);
|
||||
printf("}\n");
|
||||
|
||||
return 0;
|
||||
}
|
266
src/etc/libc.c
266
src/etc/libc.c
@ -1,266 +0,0 @@
|
||||
// Copyright 2014 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 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
/*
|
||||
* This calculates the platform-variable portion of the libc module.
|
||||
* Move code in here only as you discover it is platform-variable.
|
||||
*
|
||||
*/
|
||||
|
||||
/* c95 */
|
||||
#include <stddef.h>
|
||||
#include <time.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <limits.h>
|
||||
#include <wchar.h>
|
||||
|
||||
/* c99 */
|
||||
#include <inttypes.h>
|
||||
|
||||
/* posix */
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#define S(T) ((((T)-1)<0) ? 'i' : 'u')
|
||||
#define B(T) (((int)sizeof(T)) * CHAR_BIT)
|
||||
#define put_type(N,T) \
|
||||
printf(" type %s = %c%d;\n", N, S(T), B(T))
|
||||
|
||||
#define put_ftype(N,T) \
|
||||
printf(" type %s = f%d;\n", N, B(T))
|
||||
|
||||
#define CT(T) ((((T)-1)<0) ? "int" : "uint")
|
||||
#define CS(T) ((((T)-1)<0) ? "" : "_u")
|
||||
#define put_const(N,T) \
|
||||
printf(" const %s : %s = %d%s;\n", \
|
||||
#N, CT(T), N, CS(T))
|
||||
|
||||
void c95_types() {
|
||||
printf(" mod c95 {\n");
|
||||
|
||||
put_type("c_char", char);
|
||||
put_type("c_schar", signed char);
|
||||
put_type("c_uchar", unsigned char);
|
||||
|
||||
put_type("c_short", short);
|
||||
put_type("c_ushort", unsigned short);
|
||||
|
||||
put_type("c_int", int);
|
||||
put_type("c_uint", unsigned int);
|
||||
|
||||
put_type("c_long", long);
|
||||
put_type("c_ulong", unsigned long);
|
||||
|
||||
put_ftype("c_float", float);
|
||||
put_ftype("c_double", double);
|
||||
|
||||
put_type("size_t", size_t);
|
||||
put_type("ptrdiff_t", ptrdiff_t);
|
||||
|
||||
put_type("clock_t", clock_t);
|
||||
put_type("time_t", time_t);
|
||||
|
||||
put_type("wchar_t", wchar_t);
|
||||
|
||||
printf(" }\n");
|
||||
}
|
||||
|
||||
void c99_types() {
|
||||
printf(" mod c99 {\n");
|
||||
|
||||
put_type("c_longlong", long long);
|
||||
put_type("c_ulonglong", unsigned long long);
|
||||
|
||||
put_type("intptr_t", intptr_t);
|
||||
put_type("uintptr_t", uintptr_t);
|
||||
|
||||
printf(" }\n");
|
||||
}
|
||||
|
||||
void posix88_types() {
|
||||
printf(" mod posix88 {\n");
|
||||
|
||||
put_type("off_t", off_t);
|
||||
put_type("dev_t", dev_t);
|
||||
put_type("ino_t", ino_t);
|
||||
put_type("pid_t", pid_t);
|
||||
#ifndef __WIN32__
|
||||
put_type("uid_t", uid_t);
|
||||
put_type("gid_t", gid_t);
|
||||
#endif
|
||||
put_type("useconds_t", useconds_t);
|
||||
put_type("mode_t", mode_t);
|
||||
|
||||
put_type("ssize_t", ssize_t);
|
||||
|
||||
printf(" }\n");
|
||||
}
|
||||
|
||||
void extra_types() {
|
||||
printf(" mod extra {\n");
|
||||
printf(" }\n");
|
||||
}
|
||||
|
||||
|
||||
void c95_consts() {
|
||||
printf(" mod c95 {\n");
|
||||
|
||||
put_const(EXIT_FAILURE, int);
|
||||
put_const(EXIT_SUCCESS, int);
|
||||
put_const(RAND_MAX, int);
|
||||
|
||||
put_const(EOF, int);
|
||||
put_const(SEEK_SET, int);
|
||||
put_const(SEEK_CUR, int);
|
||||
put_const(SEEK_END, int);
|
||||
|
||||
put_const(_IOFBF, int);
|
||||
put_const(_IONBF, int);
|
||||
put_const(_IOLBF, int);
|
||||
|
||||
put_const(BUFSIZ, size_t);
|
||||
put_const(FOPEN_MAX, size_t);
|
||||
put_const(FILENAME_MAX, size_t);
|
||||
put_const(L_tmpnam, size_t);
|
||||
put_const(TMP_MAX, size_t);
|
||||
|
||||
printf(" }\n");
|
||||
}
|
||||
|
||||
|
||||
void posix88_consts() {
|
||||
printf(" mod posix88 {\n");
|
||||
put_const(O_RDONLY, int);
|
||||
put_const(O_WRONLY, int);
|
||||
put_const(O_RDWR, int);
|
||||
put_const(O_APPEND, int);
|
||||
put_const(O_CREAT, int);
|
||||
put_const(O_EXCL, int);
|
||||
put_const(O_TRUNC, int);
|
||||
|
||||
put_const(S_IFIFO, int);
|
||||
put_const(S_IFCHR, int);
|
||||
put_const(S_IFBLK, int);
|
||||
put_const(S_IFDIR, int);
|
||||
put_const(S_IFREG, int);
|
||||
put_const(S_IFLNK, int);
|
||||
put_const(S_IFMT, int);
|
||||
|
||||
put_const(S_IEXEC, int);
|
||||
put_const(S_IWRITE, int);
|
||||
put_const(S_IREAD, int);
|
||||
|
||||
put_const(S_IRWXU, int);
|
||||
put_const(S_IXUSR, int);
|
||||
put_const(S_IWUSR, int);
|
||||
put_const(S_IRUSR, int);
|
||||
|
||||
put_const(S_IRWXG, int);
|
||||
put_const(S_IXGRP, int);
|
||||
put_const(S_IWGRP, int);
|
||||
put_const(S_IRGRP, int);
|
||||
|
||||
put_const(S_IRWXO, int);
|
||||
put_const(S_IXOTH, int);
|
||||
put_const(S_IWOTH, int);
|
||||
put_const(S_IROTH, int);
|
||||
|
||||
#ifdef F_OK
|
||||
put_const(F_OK, int);
|
||||
#endif
|
||||
#ifdef R_OK
|
||||
put_const(R_OK, int);
|
||||
#endif
|
||||
#ifdef W_OK
|
||||
put_const(W_OK, int);
|
||||
#endif
|
||||
#ifdef X_OK
|
||||
put_const(X_OK, int);
|
||||
#endif
|
||||
|
||||
#ifdef STDIN_FILENO
|
||||
put_const(STDIN_FILENO, int);
|
||||
#endif
|
||||
#ifdef STDOUT_FILENO
|
||||
put_const(STDOUT_FILENO, int);
|
||||
#endif
|
||||
#ifdef STDERR_FILENO
|
||||
put_const(STDERR_FILENO, int);
|
||||
#endif
|
||||
|
||||
#ifdef F_LOCK
|
||||
put_const(F_LOCK, int);
|
||||
#endif
|
||||
|
||||
#ifdef F_TEST
|
||||
put_const(F_TEST, int);
|
||||
#endif
|
||||
|
||||
#ifdef F_TLOCK
|
||||
put_const(F_TLOCK, int);
|
||||
#endif
|
||||
|
||||
#ifdef F_ULOCK
|
||||
put_const(F_ULOCK, int);
|
||||
#endif
|
||||
|
||||
printf(" }\n");
|
||||
}
|
||||
|
||||
void extra_consts() {
|
||||
printf(" mod extra {\n");
|
||||
#ifdef O_RSYNC
|
||||
put_const(O_RSYNC, int);
|
||||
#endif
|
||||
|
||||
#ifdef O_DSYNC
|
||||
put_const(O_DSYNC, int);
|
||||
#endif
|
||||
|
||||
#ifdef O_SYNC
|
||||
put_const(O_SYNC, int);
|
||||
#endif
|
||||
|
||||
#ifdef O_TEXT
|
||||
put_const(O_TEXT, int);
|
||||
#endif
|
||||
|
||||
#ifdef O_BINARY
|
||||
put_const(O_BINARY, int);
|
||||
#endif
|
||||
|
||||
#ifdef O_IRUSR
|
||||
put_const(O_IRUSR, int);
|
||||
#endif
|
||||
|
||||
#ifdef O_IWUSR
|
||||
put_const(O_IWUSR, int);
|
||||
#endif
|
||||
|
||||
printf(" }\n");
|
||||
}
|
||||
|
||||
int main() {
|
||||
printf("mod types {");
|
||||
c95_types();
|
||||
c99_types();
|
||||
posix88_types();
|
||||
extra_types();
|
||||
printf("}\n");
|
||||
|
||||
printf("mod consts {\n");
|
||||
c95_consts();
|
||||
posix88_consts();
|
||||
extra_consts();
|
||||
printf("}\n");
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
The purpose of these headers is to fix issues with mingw v4.0, as described in #9246.
|
||||
|
||||
This works by adding this directory to GCC include search path before mingw system headers directories,
|
||||
so we can intercept their inclusions and add missing definitions without having to modify files in mingw/include.
|
||||
|
||||
Once mingw fixes all 3 issues mentioned in #9246, this directory and all references to it from rust/mk/* may be removed.
|
@ -1,18 +0,0 @@
|
||||
// Copyright 2014 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 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#ifndef _FIX_CXXCONFIG_H
|
||||
#define _FIX_CXXCONFIG_H 1
|
||||
|
||||
#define _GLIBCXX_HAVE_FENV_H 1
|
||||
|
||||
#include_next <bits/c++config.h>
|
||||
|
||||
#endif
|
@ -1,18 +0,0 @@
|
||||
// Copyright 2014 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 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#ifndef _FIX_WINBASE_H
|
||||
#define _FIX_WINBASE_H 1
|
||||
|
||||
#define NTDDK_VERSION NTDDI_VERSION
|
||||
|
||||
#include_next <winbase.h>
|
||||
|
||||
#endif
|
@ -1,27 +0,0 @@
|
||||
// Copyright 2014 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 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#ifndef _FIX_WINSOCK2_H
|
||||
#define _FIX_WINSOCK2_H 1
|
||||
|
||||
#include_next <winsock2.h>
|
||||
|
||||
// mingw 4.0.x has broken headers (#9246) but mingw-w64 does not.
|
||||
#if defined(__MINGW_MAJOR_VERSION) && __MINGW_MAJOR_VERSION == 4
|
||||
|
||||
typedef struct pollfd {
|
||||
SOCKET fd;
|
||||
short events;
|
||||
short revents;
|
||||
} WSAPOLLFD, *PWSAPOLLFD, *LPWSAPOLLFD;
|
||||
|
||||
#endif
|
||||
|
||||
#endif // _FIX_WINSOCK2_H
|
@ -1,25 +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 <LICENSE-APACHE or
|
||||
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
# option. This file may not be copied, modified, or distributed
|
||||
# except according to those terms.
|
||||
|
||||
import sys
|
||||
|
||||
input_file = sys.argv[1]
|
||||
output_file = sys.argv[2]
|
||||
name = sys.argv[3]
|
||||
|
||||
with open(input_file, 'r') as f:
|
||||
with open(output_file, 'w') as g:
|
||||
print >> g, 'LIBRARY ' + name
|
||||
print >> g, 'EXPORTS'
|
||||
for x in f:
|
||||
x = str(x)
|
||||
if not x.startswith(' pub fn LLVM'): continue
|
||||
name = x[11:x.find('(')]
|
||||
print >> g, ' ' + name
|
Loading…
x
Reference in New Issue
Block a user