mirror of
https://github.com/izzy2lost/Diddy-Kong-Racing.git
synced 2026-06-19 01:16:26 -07:00
Remove ido compiler beofore submoduling it
This commit is contained in:
@@ -1,7 +0,0 @@
|
||||
recomp
|
||||
cc
|
||||
cfe
|
||||
uopt
|
||||
ugen
|
||||
as1
|
||||
err.english.cc
|
||||
@@ -1,45 +0,0 @@
|
||||
# Originally from: https://github.com/farisawan-2000/libreultra/tree/master/tools/ido-5.3recomp/ido5.3_recomp
|
||||
|
||||
IRIX_ROOT := ../ido5.3_compiler
|
||||
OUT := ../ido5.3_recomp
|
||||
CXX := g++
|
||||
GCC := gcc
|
||||
|
||||
DUMMY != echo "Statically recompiling IDO 5.3 tools. This might take a while." >&2 || echo FAIL
|
||||
DUMMY != mkdir -p $(OUT) >&2 || echo FAIL
|
||||
|
||||
cc: OPT_CFLAGS := -O2
|
||||
cfe: OPT_CFLAGS := -O2
|
||||
uopt: OPT_CFLAGS := -O2
|
||||
ugen: OPT_CFLAGS := -O2
|
||||
ujoin: OPT_CFLAGS := -O2
|
||||
usplit: OPT_CFLAGS := -O2
|
||||
umerge: OPT_CFLAGS := -O2
|
||||
uld: OPT_CFLAGS := -O2
|
||||
as1: OPT_CFLAGS := -O2
|
||||
acpp: OPT_CFLAGS := -O2
|
||||
|
||||
RECOMP := recomp
|
||||
|
||||
all: cc cfe uopt ugen as1 ujoin uld usplit umerge err.english.cc
|
||||
|
||||
clean:
|
||||
$(RM) cc* cfe* uopt* ugen* as1* ujoin* uld* usplit* umerge* err.english.cc $(RECOMP)
|
||||
|
||||
recomp: recomp.cpp
|
||||
g++ recomp.cpp -o $(RECOMP) -g -lcapstone
|
||||
|
||||
err.english.cc: $(IRIX_ROOT)/usr/lib/err.english.cc
|
||||
cp $^ $(OUT)/$@
|
||||
|
||||
cc_c.c: $(IRIX_ROOT)/usr/bin/cc $(RECOMP)
|
||||
./$(RECOMP) $< > $@
|
||||
|
||||
%_c.c: $(IRIX_ROOT)/usr/lib/% $(RECOMP)
|
||||
./$(RECOMP) $< > $@
|
||||
|
||||
%: %_c.c
|
||||
$(GCC) libc_impl.c $< -o $@ $(OPT_CFLAGS) -fno-strict-aliasing -lm -no-pie -DIDO53
|
||||
mv $@ $(OUT)/$@
|
||||
|
||||
.PHONY: all clean
|
||||
@@ -1,118 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
import argparse
|
||||
import subprocess
|
||||
import os
|
||||
import sys
|
||||
import re
|
||||
import platform
|
||||
import threading
|
||||
import shutil
|
||||
|
||||
BINS = [
|
||||
"/usr/lib/as1",
|
||||
"/usr/lib/cfe",
|
||||
"/usr/lib/ugen",
|
||||
"/usr/lib/uopt",
|
||||
"/usr/bin/cc",
|
||||
]
|
||||
|
||||
|
||||
def call(args, output_file=None):
|
||||
print(args)
|
||||
p = subprocess.Popen(args, shell=True, universal_newlines=True, stdout=output_file)
|
||||
p.wait()
|
||||
if output_file:
|
||||
output_file.flush()
|
||||
|
||||
def process_prog(prog, ido_path, ido_flag, build_dir, out_dir, args, recomp_path):
|
||||
print("Recompiling " + ido_path + prog + "...")
|
||||
|
||||
c_file_path = os.path.join(build_dir, os.path.basename(prog) + "_c.c")
|
||||
out_file_path = os.path.join(out_dir, os.path.basename(prog))
|
||||
if platform.system().startswith("CYGWIN_NT"):
|
||||
out_file_path += ".exe"
|
||||
|
||||
if not args.onlylibc:
|
||||
with open(c_file_path, "w") as cFile:
|
||||
call(recomp_path + " " + ido_path + prog, cFile)
|
||||
|
||||
flags = " -g -fno-strict-aliasing"
|
||||
if args.O2:
|
||||
flags += " -O2"
|
||||
|
||||
flags = " -g -fno-strict-aliasing -lm"
|
||||
if platform.system() == "Darwin":
|
||||
flags += " -fno-pie"
|
||||
else:
|
||||
flags += " -no-pie"
|
||||
if args.O2:
|
||||
flags += " -O2"
|
||||
|
||||
call("gcc libc_impl.c " + c_file_path + " -o " + out_file_path + flags + ido_flag)
|
||||
|
||||
return
|
||||
|
||||
def main(args):
|
||||
ido_path = args.ido_path
|
||||
if ido_path[len(ido_path)-1] == "/":
|
||||
ido_path = ido_path[:len(ido_path)-1]
|
||||
|
||||
ido_dir = ido_path.split(os.path.sep)[-1]
|
||||
if "7.1" in ido_dir:
|
||||
print("Detected IDO version 7.1")
|
||||
ido_flag = " -DIDO71"
|
||||
ugen_flag = ""
|
||||
build_dir = "build71"
|
||||
elif "5.3" in ido_dir:
|
||||
print("Detected IDO version 5.3")
|
||||
ido_flag = " -DIDO53"
|
||||
ugen_flag = " -Dugen53"
|
||||
build_dir = "build53"
|
||||
else:
|
||||
sys.exit("Unsupported ido dir: " + ido_dir)
|
||||
|
||||
if args.multhreading and args.O2:
|
||||
print("WARNING: -O2 and -multhreading used together")
|
||||
|
||||
if not os.path.exists(build_dir):
|
||||
os.mkdir(build_dir)
|
||||
shutil.copy("header.h", build_dir)
|
||||
shutil.copy("libc_impl.h", build_dir)
|
||||
shutil.copy("helpers.h", build_dir)
|
||||
|
||||
out_dir = os.path.join(build_dir, "out")
|
||||
if not os.path.exists(out_dir):
|
||||
os.mkdir(out_dir)
|
||||
|
||||
std_flag = ""
|
||||
if platform.system() == "Darwin":
|
||||
std_flag = " -std=c++11"
|
||||
|
||||
recomp_path = os.path.join(build_dir, "recomp")
|
||||
if platform.system().startswith("CYGWIN_NT"):
|
||||
recomp_path += ".exe"
|
||||
call("g++ recomp.cpp -o " + recomp_path + " -g -lcapstone" + std_flag + ugen_flag)
|
||||
|
||||
threads = []
|
||||
for prog in BINS:
|
||||
if args.multhreading:
|
||||
t = threading.Thread(target=process_prog, args=(prog, ido_path, ido_flag, build_dir, out_dir, args, recomp_path))
|
||||
threads.append(t)
|
||||
t.start()
|
||||
else:
|
||||
process_prog(prog, ido_path, ido_flag, build_dir, out_dir, args, recomp_path)
|
||||
|
||||
if args.multhreading:
|
||||
for t in threads:
|
||||
t.join()
|
||||
|
||||
shutil.copyfile(os.path.join(ido_path, "usr/lib/err.english.cc"), os.path.join(out_dir, "err.english.cc"))
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser(description="Static ido recompilation build utility")
|
||||
parser.add_argument("ido_path", help="Path to ido")
|
||||
parser.add_argument("-O2", help="Build binaries with -O2 (warning: may take forever)", action='store_true')
|
||||
parser.add_argument("-onlylibc", help="Builds libc_impl.c only", action='store_true')
|
||||
parser.add_argument("-multhreading", help="Enables multi threading (deprecated with O2)", action='store_true')
|
||||
rgs = parser.parse_args()
|
||||
main(rgs)
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,99 +0,0 @@
|
||||
#ifndef ELF_H
|
||||
#define ELF_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define EI_DATA 5
|
||||
#define EI_NIDENT 16
|
||||
#define SHT_SYMTAB 2
|
||||
#define SHT_DYNAMIC 6
|
||||
#define SHT_REL 9
|
||||
#define SHT_DYNSYM 11
|
||||
#define SHT_MIPS_REGINFO 0x70000006
|
||||
#define STN_UNDEF 0
|
||||
#define STT_OBJECT 1
|
||||
#define STT_FUNC 2
|
||||
#define DT_PLTGOT 3
|
||||
#define DT_MIPS_LOCAL_GOTNO 0x7000000a
|
||||
#define DT_MIPS_SYMTABNO 0x70000011
|
||||
#define DT_MIPS_GOTSYM 0x70000013
|
||||
|
||||
#define ELF32_R_SYM(info) ((info) >> 8)
|
||||
#define ELF32_R_TYPE(info) ((info) & 0xff)
|
||||
|
||||
#define ELF32_ST_TYPE(info) ((info) & 0xf)
|
||||
|
||||
#define R_MIPS_26 4
|
||||
#define R_MIPS_HI16 5
|
||||
#define R_MIPS_LO16 6
|
||||
|
||||
#define SHN_UNDEF 0
|
||||
#define SHN_COMMON 0xfff2
|
||||
#define SHN_MIPS_ACOMMON 0xff00
|
||||
#define SHN_MIPS_TEXT 0xff01
|
||||
#define SHN_MIPS_DATA 0xff02
|
||||
|
||||
typedef uint32_t Elf32_Addr;
|
||||
typedef uint32_t Elf32_Off;
|
||||
|
||||
typedef struct {
|
||||
uint8_t e_ident[EI_NIDENT];
|
||||
uint16_t e_type;
|
||||
uint16_t e_machine;
|
||||
uint32_t e_version;
|
||||
Elf32_Addr e_entry;
|
||||
Elf32_Off e_phoff;
|
||||
Elf32_Off e_shoff;
|
||||
uint32_t e_flags;
|
||||
uint16_t e_ehsize;
|
||||
uint16_t e_phentsize;
|
||||
uint16_t e_phnum;
|
||||
uint16_t e_shentsize;
|
||||
uint16_t e_shnum;
|
||||
uint16_t e_shstrndx;
|
||||
} Elf32_Ehdr;
|
||||
|
||||
typedef struct {
|
||||
uint32_t sh_name;
|
||||
uint32_t sh_type;
|
||||
uint32_t sh_flags;
|
||||
Elf32_Addr sh_addr;
|
||||
Elf32_Off sh_offset;
|
||||
uint32_t sh_size;
|
||||
uint32_t sh_link;
|
||||
uint32_t sh_info;
|
||||
uint32_t sh_addralign;
|
||||
uint32_t sh_entsize;
|
||||
} Elf32_Shdr;
|
||||
|
||||
typedef struct {
|
||||
uint32_t st_name;
|
||||
Elf32_Addr st_value;
|
||||
uint32_t st_size;
|
||||
uint8_t st_info;
|
||||
uint8_t st_other;
|
||||
uint16_t st_shndx;
|
||||
} Elf32_Sym;
|
||||
|
||||
typedef struct {
|
||||
Elf32_Addr r_offset;
|
||||
uint32_t r_info;
|
||||
} Elf32_Rel;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t ri_gprmask; /* General registers used. */
|
||||
uint32_t ri_cprmask[4]; /* Coprocessor registers used. */
|
||||
int32_t ri_gp_value; /* $gp register value. */
|
||||
} Elf32_RegInfo;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int32_t d_tag; /* Dynamic entry type */
|
||||
union {
|
||||
uint32_t d_val; /* Integer value */
|
||||
Elf32_Addr d_ptr; /* Address value */
|
||||
} d_un;
|
||||
} Elf32_Dyn;
|
||||
|
||||
#endif
|
||||
@@ -1,30 +0,0 @@
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "libc_impl.h"
|
||||
#include "helpers.h"
|
||||
|
||||
#define RM_RN 0
|
||||
#define RM_RZ 1
|
||||
#define RM_RP 2
|
||||
#define RM_RM 3
|
||||
|
||||
union FloatReg {
|
||||
float f[2];
|
||||
uint32_t w[2];
|
||||
double d;
|
||||
};
|
||||
|
||||
#define cvt_w_d(f) \
|
||||
((fcsr & RM_RZ) ? ((isnan(f) || f <= -2147483649.0 || f >= 2147483648.0) ? (fcsr |= 0x40, 2147483647) : (int)f) : (assert(0), 0))
|
||||
|
||||
#define cvt_w_s(f) cvt_w_d((double)f)
|
||||
|
||||
static union FloatReg f0 = {{0, 0}}, f2 = {{0, 0}}, f4 = {{0, 0}}, f6 = {{0, 0}}, f8 = {{0, 0}},
|
||||
f10 = {{0, 0}}, f12 = {{0, 0}}, f14 = {{0, 0}}, f16 = {{0, 0}}, f18 = {{0, 0}}, f20 = {{0, 0}},
|
||||
f22 = {{0, 0}}, f24 = {{0, 0}}, f26 = {{0, 0}}, f28 = {{0, 0}}, f30 = {{0, 0}};
|
||||
static uint32_t fcsr = 1;
|
||||
@@ -1,13 +0,0 @@
|
||||
#ifndef HELPERS_H
|
||||
#define HELPERS_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define MEM_U32(a) (*(uint32_t *)(mem + a))
|
||||
#define MEM_S32(a) (*(int32_t *)(mem + a))
|
||||
#define MEM_U16(a) (*(uint16_t *)(mem + ((a) ^ 2)))
|
||||
#define MEM_S16(a) (*(int16_t *)(mem + ((a) ^ 2)))
|
||||
#define MEM_U8(a) (*(uint8_t *)(mem + ((a) ^ 3)))
|
||||
#define MEM_S8(a) (*(int8_t *)(mem + ((a) ^ 3)))
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,163 +0,0 @@
|
||||
#include <stdint.h>
|
||||
|
||||
void mmap_initial_data_range(uint8_t *mem, uint32_t start, uint32_t end);
|
||||
void setup_libc_data(uint8_t *mem);
|
||||
|
||||
uint32_t wrapper_sbrk(uint8_t *mem, int increment);
|
||||
uint32_t wrapper_malloc(uint8_t *mem, uint32_t size);
|
||||
uint32_t wrapper_calloc(uint8_t *mem, uint32_t num, uint32_t size);
|
||||
uint32_t wrapper_realloc(uint8_t *mem, uint32_t data_addr, uint32_t size);
|
||||
int wrapper_fscanf(uint8_t *mem, uint32_t fp_addr, uint32_t format_addr, uint32_t sp);
|
||||
int wrapper_printf(uint8_t *mem, uint32_t format_addr, uint32_t sp);
|
||||
int wrapper_sprintf(uint8_t *mem, uint32_t str_addr, uint32_t format_addr, uint32_t sp);
|
||||
int wrapper_fprintf(uint8_t *mem, uint32_t fp_addr, uint32_t format_addr, uint32_t sp);
|
||||
int wrapper__doprnt(uint8_t *mem, uint32_t format_addr, uint32_t params_addr, uint32_t fp_addr);
|
||||
void wrapper_free(uint8_t *mem, uint32_t data_addr);
|
||||
uint32_t wrapper_strlen(uint8_t *mem, uint32_t str_addr);
|
||||
int wrapper_open(uint8_t *mem, uint32_t pathname_addr, int flags, int mode);
|
||||
int wrapper_creat(uint8_t *mem, uint32_t pathname_addr, int mode);
|
||||
int wrapper_access(uint8_t *mem, uint32_t pathname_addr, int mode);
|
||||
int wrapper_rename(uint8_t *mem, uint32_t oldpath_addr, uint32_t newpath_addr);
|
||||
int wrapper_utime(uint8_t *mem, uint32_t filename_addr, uint32_t times_addr);
|
||||
int wrapper_flock(uint8_t *mem, int fd, int operation);
|
||||
int wrapper_chmod(uint8_t *mem, uint32_t path_addr, uint32_t mode);
|
||||
int wrapper_umask(int mode);
|
||||
uint32_t wrapper_ecvt(uint8_t *mem, double number, int ndigits, uint32_t decpt_addr, uint32_t sign_addr);
|
||||
uint32_t wrapper_fcvt(uint8_t *mem, double number, int ndigits, uint32_t decpt_addr, uint32_t sign_addr);
|
||||
double wrapper_sqrt(double v);
|
||||
float wrapper_sqrtf(float v);
|
||||
int wrapper_atoi(uint8_t *mem, uint32_t nptr_addr);
|
||||
int wrapper_atol(uint8_t *mem, uint32_t nptr_addr);
|
||||
double wrapper_atof(uint8_t *mem, uint32_t nptr_addr);
|
||||
int wrapper_strtol(uint8_t *mem, uint32_t nptr_addr, uint32_t endptr_addr, int base);
|
||||
uint32_t wrapper_strtoul(uint8_t *mem, uint32_t nptr_addr, uint32_t endptr_addr, int base);
|
||||
double wrapper_strtod(uint8_t *mem, uint32_t nptr_addr, uint32_t endptr_addr);
|
||||
uint32_t wrapper_strchr(uint8_t *mem, uint32_t str_addr, int c);
|
||||
uint32_t wrapper_strrchr(uint8_t *mem, uint32_t str_addr, int c);
|
||||
uint32_t wrapper_strcspn(uint8_t *mem, uint32_t str_addr, uint32_t invalid_addr);
|
||||
uint32_t wrapper_strpbrk(uint8_t *mem, uint32_t str_addr, uint32_t accept_addr);
|
||||
int wrapper_fstat(uint8_t *mem, int fildes, uint32_t buf_addr);
|
||||
int wrapper_stat(uint8_t *mem, uint32_t pathname_addr, uint32_t buf_addr);
|
||||
int wrapper_ftruncate(uint8_t *mem, int fd, int length);
|
||||
void wrapper_bcopy(uint8_t *mem, uint32_t src_addr, uint32_t dst_addr, uint32_t len);
|
||||
uint32_t wrapper_memcpy(uint8_t *mem, uint32_t dst_addr, uint32_t src_addr, uint32_t len);
|
||||
uint32_t wrapper_memccpy(uint8_t *mem, uint32_t dst_addr, uint32_t src_addr, int c, uint32_t len);
|
||||
int wrapper_read(uint8_t *mem, int fd, uint32_t buf_addr, uint32_t nbytes);
|
||||
int wrapper_write(uint8_t *mem, int fd, uint32_t buf_addr, uint32_t nbytes);
|
||||
uint32_t wrapper_fopen(uint8_t *mem, uint32_t path_addr, uint32_t mode_addr);
|
||||
uint32_t wrapper_freopen(uint8_t *mem, uint32_t path_addr, uint32_t mode_addr, uint32_t fp_addr);
|
||||
int wrapper_fclose(uint8_t *mem, uint32_t fp_addr);
|
||||
int wrapper_fflush(uint8_t *mem, uint32_t fp_addr);
|
||||
int wrapper_ftell(uint8_t *mem, uint32_t fp_addr);
|
||||
int wrapper_rewind(uint8_t *mem, uint32_t fp_addr);
|
||||
int wrapper_fseek(uint8_t *mem, uint32_t fp_addr, int offset, int origin);
|
||||
int wrapper_lseek(uint8_t *mem, int fd, int offset, int whence);
|
||||
int wrapper_dup(uint8_t *mem, int fd);
|
||||
int wrapper_dup2(uint8_t *mem, int oldfd, int newfd);
|
||||
int wrapper_pipe(uint8_t *mem, uint32_t pipefd_addr);
|
||||
void wrapper_perror(uint8_t *mem, uint32_t str_addr);
|
||||
int wrapper_fdopen(uint8_t *mem, int fd, uint32_t mode_addr);
|
||||
uint32_t wrapper_memset(uint8_t *mem, uint32_t dest_addr, int byte, uint32_t n);
|
||||
int wrapper_bcmp(uint8_t *mem, uint32_t s1_addr, uint32_t s2_addr, uint32_t n);
|
||||
int wrapper_memcmp(uint8_t *mem, uint32_t s1_addr, uint32_t s2_addr, uint32_t n);
|
||||
int wrapper_getpid(void);
|
||||
int wrapper_getpgrp(uint8_t *mem);
|
||||
int wrapper_remove(uint8_t *mem, uint32_t path_addr);
|
||||
int wrapper_unlink(uint8_t *mem, uint32_t path_addr);
|
||||
int wrapper_close(uint8_t *mem, int fd);
|
||||
int wrapper_strcmp(uint8_t *mem, uint32_t s1_addr, uint32_t s2_addr);
|
||||
int wrapper_strncmp(uint8_t *mem, uint32_t s1_addr, uint32_t s2_addr, uint32_t n);
|
||||
uint32_t wrapper_strcpy(uint8_t *mem, uint32_t dest_addr, uint32_t src_addr);
|
||||
uint32_t wrapper_strncpy(uint8_t *mem, uint32_t dest_addr, uint32_t src_addr, uint32_t n);
|
||||
uint32_t wrapper_strcat(uint8_t *mem, uint32_t dest_addr, uint32_t src_addr);
|
||||
uint32_t wrapper_strncat(uint8_t *mem, uint32_t dest_addr, uint32_t src_addr, uint32_t n);
|
||||
uint32_t wrapper_strtok(uint8_t *mem, uint32_t str_addr, uint32_t delimiters_addr);
|
||||
uint32_t wrapper_strstr(uint8_t *mem, uint32_t str1_addr, uint32_t str2_addr);
|
||||
uint32_t wrapper_strdup(uint8_t *mem, uint32_t str_addr);
|
||||
int wrapper_toupper(int c);
|
||||
int wrapper_tolower(int c);
|
||||
int wrapper_gethostname(uint8_t *mem, uint32_t name_addr, uint32_t len);
|
||||
int wrapper_isatty(uint8_t *mem, int fd);
|
||||
int wrapper_times(uint8_t *mem, uint32_t buffer_addr);
|
||||
uint32_t wrapper_strftime(uint8_t *mem, uint32_t ptr_addr, uint32_t maxsize, uint32_t format_addr, uint32_t timeptr_addr);
|
||||
int wrapper_clock(void);
|
||||
uint32_t wrapper_ctime(uint8_t *mem, uint32_t timep_addr);
|
||||
uint32_t wrapper_localtime(uint8_t *mem, uint32_t timep_addr);
|
||||
int wrapper_setvbuf(uint8_t *mem, uint32_t fp_addr, uint32_t buf_addr, int mode, uint32_t size);
|
||||
int wrapper___semgetc(uint8_t *mem, uint32_t fp_addr);
|
||||
int wrapper___semputc(uint8_t *mem, int c, uint32_t fp_addr);
|
||||
int wrapper_fgetc(uint8_t *mem, uint32_t fp_addr);
|
||||
int wrapper_fgets(uint8_t *mem, uint32_t str_addr, int count, uint32_t fp_addr);
|
||||
int wrapper___filbuf(uint8_t *mem, uint32_t fp_addr);
|
||||
int wrapper___flsbuf(uint8_t *mem, int ch, uint32_t fp_addr);
|
||||
int wrapper_ungetc(uint8_t *mem, int ch, uint32_t fp_addr);
|
||||
uint32_t wrapper_gets(uint8_t *mem, uint32_t str_addr);
|
||||
uint32_t wrapper_fread(uint8_t *mem, uint32_t data_addr, uint32_t size, uint32_t count, uint32_t fp_addr);
|
||||
uint32_t wrapper_fwrite(uint8_t *mem, uint32_t data_addr, uint32_t size, uint32_t count, uint32_t fp_addr);
|
||||
int wrapper_fputs(uint8_t *mem, uint32_t str_addr, uint32_t fp_addr);
|
||||
int wrapper_puts(uint8_t *mem, uint32_t str_addr);
|
||||
uint32_t wrapper_getcwd(uint8_t *mem, uint32_t buf_addr, uint32_t size);
|
||||
int wrapper_time(uint8_t *mem, uint32_t tloc_addr);
|
||||
void wrapper_bzero(uint8_t *mem, uint32_t str_addr, uint32_t n);
|
||||
int wrapper_fp_class_d(double d);
|
||||
double wrapper_ldexp(double d, int i);
|
||||
int64_t wrapper___ll_mul(int64_t a0, int64_t a1);
|
||||
int64_t wrapper___ll_div(int64_t a0, int64_t a1);
|
||||
int64_t wrapper___ll_rem(uint64_t a0, int64_t a1);
|
||||
int64_t wrapper___ll_lshift(int64_t a0, uint64_t shift);
|
||||
int64_t wrapper___ll_rshift(int64_t a0, uint64_t shift);
|
||||
uint64_t wrapper___ull_div(uint64_t a0, uint64_t a1);
|
||||
uint64_t wrapper___ull_rem(uint64_t a0, uint64_t a1);
|
||||
uint64_t wrapper___ull_rshift(uint64_t a0, uint64_t shift);
|
||||
uint64_t wrapper___d_to_ull(double d);
|
||||
int64_t wrapper___d_to_ll(double d);
|
||||
uint64_t wrapper___f_to_ull(float f);
|
||||
int64_t wrapper___f_to_ll(float f);
|
||||
float wrapper___ull_to_f(uint64_t v);
|
||||
float wrapper___ll_to_f(int64_t v);
|
||||
double wrapper___ull_to_d(uint64_t v);
|
||||
double wrapper___ll_to_d(int64_t v);
|
||||
void wrapper_abort(uint8_t *mem);
|
||||
void wrapper_exit(uint8_t *mem, int status);
|
||||
void wrapper__exit(uint8_t *mem, int status);
|
||||
void wrapper__cleanup(uint8_t *mem);
|
||||
uint32_t wrapper__rld_new_interface(uint8_t *mem, uint32_t operation, uint32_t sp);
|
||||
void wrapper__exithandle(uint8_t *mem);
|
||||
int wrapper__prctl(uint8_t *mem, int operation, uint32_t sp);
|
||||
double wrapper__atod(uint8_t *mem, uint32_t buffer_addr, int ndigits, int dexp);
|
||||
int wrapper_pathconf(uint8_t *mem, uint32_t path_addr, int name);
|
||||
uint32_t wrapper_getenv(uint8_t *mem, uint32_t name_addr);
|
||||
uint32_t wrapper_gettxt(uint8_t *mem, uint32_t msgid_addr, uint32_t default_str_addr);
|
||||
uint32_t wrapper_setlocale(uint8_t *mem, int category, uint32_t locale_addr);
|
||||
uint32_t wrapper_mmap(uint8_t *mem, uint32_t addr, uint32_t length, int prot, int flags, int fd, int offset);
|
||||
int wrapper_munmap(uint8_t *mem, uint32_t addr, uint32_t length);
|
||||
int wrapper_mprotect(uint8_t *mem, uint32_t addr, uint32_t length, int prot);
|
||||
int wrapper_sysconf(uint8_t *mem, int name);
|
||||
int wrapper_getpagesize(uint8_t *mem);
|
||||
int wrapper_strerror(uint8_t *mem, int errnum);
|
||||
int wrapper_ioctl(uint8_t *mem, int fd, uint32_t request, uint32_t sp);
|
||||
int wrapper_fcntl(uint8_t *mem, int fd, int cmd, uint32_t sp);
|
||||
uint32_t wrapper_signal(uint8_t *mem, int signum, uint64_t (*trampoline)(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3, uint32_t fp_dest), uint32_t handler_addr, uint32_t sp);
|
||||
uint32_t wrapper_sigset(uint8_t *mem, int signum, uint64_t (*trampoline)(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3, uint32_t fp_dest), uint32_t disp_addr, uint32_t sp);
|
||||
int wrapper_get_fpc_csr(uint8_t *mem);
|
||||
int wrapper_set_fpc_csr(uint8_t *mem, int csr);
|
||||
int wrapper_setjmp(uint8_t *mem, uint32_t addr);
|
||||
void wrapper_longjmp(uint8_t *mem, uint32_t addr, int status);
|
||||
uint32_t wrapper_tempnam(uint8_t *mem, uint32_t dir_addr, uint32_t pfx_addr);
|
||||
uint32_t wrapper_tmpnam(uint8_t *mem, uint32_t str_addr);
|
||||
uint32_t wrapper_mktemp(uint8_t *mem, uint32_t template_addr);
|
||||
int wrapper_mkstemp(uint8_t *mem, uint32_t name_addr);
|
||||
uint32_t wrapper_tmpfile(uint8_t *mem);
|
||||
int wrapper_wait(uint8_t *mem, uint32_t wstatus_addr);
|
||||
int wrapper_kill(uint8_t *mem, int pid, int sig);
|
||||
int wrapper_execlp(uint8_t *mem, uint32_t file_addr, uint32_t sp);
|
||||
int wrapper_execv(uint8_t *mem, uint32_t pathname_addr, uint32_t argv_addr);
|
||||
int wrapper_execvp(uint8_t *mem, uint32_t file_addr, uint32_t argv_addr);
|
||||
int wrapper_fork(uint8_t *mem);
|
||||
int wrapper_system(uint8_t *mem, uint32_t command_addr);
|
||||
uint32_t wrapper_tsearch(uint8_t *mem, uint32_t key_addr, uint32_t rootp_addr, uint32_t compar_addr);
|
||||
uint32_t wrapper_tfind(uint8_t *mem, uint32_t key_addr, uint32_t rootp_addr, uint32_t compar_addr);
|
||||
uint32_t wrapper_qsort(uint8_t *mem, uint32_t base_addr, uint32_t num, uint32_t size, uint64_t (*trampoline)(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3, uint32_t fp_dest), uint32_t compare_addr, uint32_t sp);
|
||||
uint32_t wrapper_regcmp(uint8_t *mem, uint32_t string1_addr, uint32_t sp);
|
||||
uint32_t wrapper_regex(uint8_t *mem, uint32_t re_addr, uint32_t subject_addr, uint32_t sp);
|
||||
void wrapper___assert(uint8_t *mem, uint32_t assertion_addr, uint32_t file_addr, int line);
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,41 +0,0 @@
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "../libc_impl.h"
|
||||
#include "../helpers.h"
|
||||
|
||||
#define RM_RN 0
|
||||
#define RM_RZ 1
|
||||
#define RM_RP 2
|
||||
#define RM_RM 3
|
||||
|
||||
union FloatReg {
|
||||
float f[2];
|
||||
uint32_t w[2];
|
||||
double d;
|
||||
};
|
||||
|
||||
#define cvt_w_d(f) \
|
||||
((fcsr & RM_RZ) ? ((isnan(f) || f <= -2147483649.0 || f >= 2147483648.0) ? (fcsr |= 0x40, 2147483647) : (int)f) : (assert(0), 0))
|
||||
|
||||
#define cvt_w_s(f) cvt_w_d((double)f)
|
||||
|
||||
int func(uint8_t *mem, int argc, char *argv[]) {
|
||||
const uint32_t zero = 0;
|
||||
uint32_t at = 0, v0 = 0, v1 = 0, a0 = 0, a1 = 0, a2 = 0, a3 = 0, t0 = 0, t1 = 0, t2 = 0,
|
||||
t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0,
|
||||
s6 = 0, s7 = 0, t8 = 0, t9 = 0, k0 = 0, k1 = 0, gp = 0, sp = 0, fp = 0, s8 = 0, ra = 0;
|
||||
uint32_t lo = 0, hi = 0;
|
||||
union FloatReg f0 = {{0, 0}}, f2 = {{0, 0}}, f4 = {{0, 0}}, f6 = {{0, 0}}, f8 = {{0, 0}},
|
||||
f10 = {{0, 0}}, f12 = {{0, 0}}, f14 = {{0, 0}}, f16 = {{0, 0}}, f18 = {{0, 0}}, f20 = {{0, 0}},
|
||||
f22 = {{0, 0}}, f24 = {{0, 0}}, f26 = {{0, 0}}, f28 = {{0, 0}}, f30 = {{0, 0}};
|
||||
int cf = 0;
|
||||
uint32_t fcsr = 1;
|
||||
void *dest = NULL;
|
||||
uint64_t temp64;
|
||||
#include "dummy.c"
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
# Silicon Graphics Freeware Legal Notice
|
||||
## Copyright 1995, Silicon Graphics, Inc. -- ALL RIGHTS RESERVED
|
||||
|
||||
You may copy, modify, use and distribute this software, (i) provided that you include the entirety of this reservation of rights notice in all such copies, and (ii) you comply with any additional or different obligations and/or use restrictions specified by any third party owner or supplier of the software in other notices that may be included with the software.
|
||||
|
||||
**SGI DISCLAIMS ALL WARRANTIES WITH RESPECT TO THIS SOFTWARE, EXPRESS, IMPLIED, OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ALL WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. SGI SHALL NOT BE LIABLE FOR ANY SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING, WITHOUT LIMITATION, LOST REVENUES, LOST PROFITS, OR LOSS OF PROSPECTIVE ECONOMIC ADVANTAGE, RESULTING FROM THE USE OR MISUSE OF THIS SOFTWARE.**
|
||||
|
||||
**U.S. GOVERNMENT RESTRICTED RIGHTS LEGEND:**
|
||||
|
||||
Use, duplication or disclosure by the Government is subject to restrictions as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Software clause at DFARS 252.227-7013 and/or in similar or successor clauses in the FAR, or the DOD or NASA FAR Supplement. Unpublished - rights reserved under the Copyright Laws of United States. Contractor/manufacturer is Silicon Graphics, Inc., 2011 N. Shoreline Blvd. Mountain View, CA 94039-7311.
|
||||
|
||||
## Product Support
|
||||
|
||||
Freeware products are not supported by Silicon Graphics or any of its support providers. The software contained in this package is made available through the generous efforts of their authors. Although they are interested in your feedback, they are under no obligation to address bugs, enhancements, or answer questions.
|
||||
|
||||
----
|
||||
|
||||
**NOTE:** This license was copied verbatim from https://web.archive.org/web/19991008090202/http://toolbox.sgi.com/TasteOfDT/public/freeware1.0/legal_notice.html .
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user