Added a very basic Linux standard library shamelessly stolen from the MacOS one.

Made Linux (almost) work. The generated binaries segfault, but it's so close I can almost taste it.
This commit is contained in:
Zachary Pierson
2017-02-07 00:28:21 -06:00
parent eeeb90c441
commit 8becbdc1b2
6 changed files with 245 additions and 7 deletions
+8 -1
View File
@@ -399,10 +399,14 @@ int main(int argc, char **argv) {
link_settings = "";
}
printf("Libs: %s\n", lib_str);
// TODO(zangent): I'm not sure what to do with lib_str.
// I'll have to look at the format that the libraries are listed to determine what to do.
lib_str = "";
exit_code = system_exec_command_line_app("ld-link", true,
"ld \"%.*s\".o -o \"%.*s%s\" %s "
"-lc "
@@ -411,8 +415,11 @@ int main(int argc, char **argv) {
#if defined(GB_SYSTEM_OSX)
// This sets a requirement of Mountain Lion and up, but the compiler doesn't work without this limit.
" -macosx_version_min 10.8.0 "
" -e _main "
#else
" -e main -dynamic-linker /lib64/ld-linux-x86-64.so.2 "
#endif
" -e _main ",
,
LIT(output), LIT(output), output_ext,
lib_str, LIT(build_context.link_flags),
link_settings