implemented /noimplib /noexp

This commit is contained in:
Nikita Smith
2024-10-22 11:02:50 -07:00
parent dcffefd0c6
commit 9ec7fb61ed
3 changed files with 22 additions and 9 deletions
+1 -1
View File
@@ -3253,7 +3253,7 @@ l.count += 1; \
B32 build_win32_header = 1;
B32 patch_relocs = 1;
B32 sort_exception_info = 1;
B32 build_imp_lib = 1;
B32 build_imp_lib = config->build_imp_lib;
LNK_ObjList obj_list = {0};
LNK_LibList lib_index[LNK_InputSource_Count] = {0};
String8 image_data = str8_zero();
+17 -6
View File
@@ -85,8 +85,8 @@ read_only struct
{ LNK_CmdSwitch_NotImplemented, "NOASSEMBLY", "", "" },
{ LNK_CmdSwitch_NoDefaultLib, "NODEFAULTLIB", ":LIBNAME", "" },
{ LNK_CmdSwitch_NotImplemented, "NOENTRY", "", "" },
{ LNK_CmdSwitch_NotImplemented, "NOEXP", "", "" },
{ LNK_CmdSwitch_NotImplemented, "NOIMPLIB", "", "" },
{ LNK_CmdSwitch_NoExp, "NOEXP", "", ".exp is not supported." },
{ LNK_CmdSwitch_NoImpLib, "NOIMPLIB", "", "" },
{ LNK_CmdSwitch_NoLogo, "NOLOGO", "", "" },
{ LNK_CmdSwitch_NxCompat, "NXCOMPAT", "[:NO]", "" },
{ LNK_CmdSwitch_Opt, "OPT", "", "" },
@@ -911,8 +911,9 @@ lnk_config_from_cmd_line(Arena *arena, String8List raw_cmd_line)
#if BUILD_DEBUG
lnk_cmd_line_push_optionf(scratch.arena, &cmd_line, LNK_CmdSwitch_Rad_Log, "debug");
lnk_cmd_line_push_optionf(scratch.arena, &cmd_line, LNK_CmdSwitch_Rad_Log, "io_write");
#else
lnk_cmd_line_push_optionf(scratch.arena, &cmd_line, LNK_CmdSwitch_Rad_SuppressError, "37");
lnk_cmd_line_push_optionf(scratch.arena, &cmd_line, LNK_CmdSwitch_Rad_SuppressError, "%u", LNK_Error_InvalidTypeIndex);
#endif
if (!lnk_cmd_line_has_switch(cmd_line, LNK_CmdSwitch_Rad_MtPath)) {
@@ -920,9 +921,11 @@ lnk_config_from_cmd_line(Arena *arena, String8List raw_cmd_line)
lnk_cmd_line_push_option_if_not_presentf(scratch.arena, &cmd_line, LNK_CmdSwitch_Rad_MtPath, "%S", mt_path);
}
LNK_Config *config = push_array(arena, LNK_Config, 1);
config->raw_cmd_line = raw_cmd_line;
config->work_dir = os_get_current_path(scratch.arena);
LNK_Config *config = push_array(arena, LNK_Config, 1);
config->raw_cmd_line = raw_cmd_line;
config->work_dir = os_get_current_path(scratch.arena);
config->build_imp_lib = 1;
config->build_exp = 1;
// process command line switches
for (LNK_CmdOption *cmd = cmd_line.first_option; cmd != 0; cmd = cmd->next) {
@@ -1297,6 +1300,14 @@ lnk_config_from_cmd_line(Arena *arena, String8List raw_cmd_line)
str8_list_concat_in_place(&config->disallow_lib_list, &no_default_lib_list);
} break;
case LNK_CmdSwitch_NoExp: {
config->build_exp = 0;
} break;
case LNK_CmdSwitch_NoImpLib: {
config->build_imp_lib = 0;
} break;
case LNK_CmdSwitch_NoLogo: {
// we don't print logo
} break;
+4 -2
View File
@@ -42,6 +42,8 @@ typedef enum
LNK_CmdSwitch_ManifestUac,
LNK_CmdSwitch_Natvis,
LNK_CmdSwitch_NoDefaultLib,
LNK_CmdSwitch_NoExp,
LNK_CmdSwitch_NoImpLib,
LNK_CmdSwitch_NoLogo,
LNK_CmdSwitch_NxCompat,
LNK_CmdSwitch_Opt,
@@ -96,8 +98,6 @@ typedef enum
LNK_CmdSwitch_Midl,
LNK_CmdSwitch_NoAssembly,
LNK_CmdSwitch_NoEntry,
LNK_CmdSwitch_NoExp,
LNK_CmdSwitch_NoImpLib,
LNK_CmdSwitch_Order,
LNK_CmdSwitch_PdbStripped,
LNK_CmdSwitch_Profile,
@@ -290,6 +290,8 @@ typedef struct LNK_Config
U64 symbol_table_cap_internal;
U64 symbol_table_cap_weak;
U64 symbol_table_cap_lib;
B32 build_imp_lib;
B32 build_exp;
} LNK_Config;
typedef enum