$(_BIN): $(OBJ) $(_LIBS)
@mkdir -p $(dir $(_BIN))
@echo [LD] -o $(BIN) $(OBJ)
- @$(LD) $(LDFLAGS) -o $(_BIN) $(OBJ)
+ $(LD) $(LDFLAGS) -o $(_BIN) $(OBJ) $(shell $(CC) -print-libgcc-file-name)
@$(DISASM) -S $(_BIN) > $(_OBJPREFIX)$(BIN).dsm
$(_OBJPREFIX)%.o: %.c
# create libld-acess.so
$(_XBIN): $(_OBJPREFIX)_stublib.o
@echo [LD] -o -shared libld-acess.so
- $(LD) -shared -o $@ $<
+ $(LD) -shared -o $@ $< $(LDFLAGS)
# @$(LD) $(LDFLAGS) -o $@ $(OBJ)
#include "arch/syscalls.s.h"
// libgcc functions
+#if 0
uint64_t __udivdi3(uint64_t Num, uint64_t Den){return 0;}
uint64_t __umoddi3(uint64_t Num, uint64_t Den){return 0;}
int32_t __modsi3(int32_t Num, int32_t Den){return 0;}
uint32_t __udivsi3(uint32_t Num, uint32_t Den){return 0;}
uint32_t __umodsi3(uint32_t Num, uint32_t Den){return 0;}
+#endif
void *_crt0_exit_handler;
} caLocalExports[] = {
EXP(gLoadedLibraries),
EXP(_exit),
+ EXP(_errno),
EXP(clone),
EXP(kill),
EXP(yield),
EXP(_SysAllocate),
EXP(_SysDebug),
+#if 0
EXP(__umoddi3),
EXP(__udivdi3),
EXP(__divsi3),
EXP(__modsi3),
EXP(__udivsi3),
EXP(__umodsi3)
+#endif
};
const int ciNumLocalExports = sizeof(caLocalExports)/sizeof(caLocalExports[0]);
return ret;
}
+#if 0
uint32_t __divmod32(uint32_t Num, uint32_t Den, uint32_t *Rem)
{
uint32_t ret = 0, add = 1;
__divmod32(Num, Den, &ret);
return ret;
}
+#endif
\r
/* --- StdLib --- */\r
extern void _exit(int code) __attribute__((noreturn)); /* NOTE: Also defined in acess/sys.h */\r
+extern long long strtoll(const char *ptr, char **end, int base);\r
+extern long strtol(const char *ptr, char **end, int base);\r
extern int atoi(const char *ptr);\r
extern void exit(int status) __attribute__((noreturn));\r
extern void atexit(void (*__func)(void));\r
extern void qsort(void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *));\r
+extern int abs(int j);\r
+extern long int labs(long int j);\r
+extern long long int llabs(long long int j);\r
\r
/* --- Environment --- */\r
extern char *getenv(const char *name);\r