cross compile glibc startup files

This commit is contained in:
Andrew Kelley
2019-03-06 13:22:36 -05:00
parent 697b1233f0
commit ccdef8c0fb
3 changed files with 86 additions and 22 deletions

View File

@@ -409,7 +409,6 @@ int main(int argc, char **argv) {
const char *dynamic_linker = nullptr;
const char *libc_txt = nullptr;
ZigList<const char *> clang_argv = {0};
ZigList<const char *> llvm_argv = {0};
ZigList<const char *> lib_dirs = {0};
ZigList<const char *> link_libs = {0};
ZigList<const char *> forbidden_link_libs = {0};
@@ -443,6 +442,9 @@ int main(int argc, char **argv) {
Buf *main_pkg_path = nullptr;
ValgrindSupport valgrind_support = ValgrindSupportAuto;
ZigList<const char *> llvm_argv = {0};
llvm_argv.append("zig (LLVM option parsing)");
if (argc >= 2 && strcmp(argv[1], "build") == 0) {
Buf zig_exe_path_buf = BUF_INIT;
if ((err = os_self_exe_path(&zig_exe_path_buf))) {
@@ -1027,7 +1029,13 @@ int main(int argc, char **argv) {
codegen_set_each_lib_rpath(g, each_lib_rpath);
codegen_set_clang_argv(g, clang_argv.items, clang_argv.length);
codegen_set_llvm_argv(g, llvm_argv.items, llvm_argv.length);
if (llvm_argv.length > 1) {
llvm_argv.append(nullptr);
ZigLLVMParseCommandLineOptions(llvm_argv.length, llvm_argv.items);
}
codegen_set_llvm_argv(g, llvm_argv.items + 1, llvm_argv.length - 2);
codegen_set_strip(g, strip);
codegen_set_is_static(g, is_static);
if (dynamic_linker != nullptr)