1
1
mirror of https://github.com/rui314/mold.git synced 2024-09-20 09:27:45 +03:00

[Mach-O] Define -weak_framework as an alias for -framework for now

This commit is contained in:
Rui Ueyama 2022-06-04 13:29:36 +08:00
parent 1b52d228d4
commit eee1a87742
2 changed files with 9 additions and 4 deletions

View File

@ -75,7 +75,9 @@ Options:
-uexported_symbol <SYMBOL> Export all but a given symbol
-unexported_symbols_list <FILE>
Read a list of unexported symbols from a given file
-v Report version information)";
-v Report version information
-weak-framework <NAME>[,<SUFFIX>]
Search for a given framework)";
template <typename E>
static i64 parse_platform(Context<E> &ctx, std::string_view arg) {
@ -327,7 +329,7 @@ std::vector<std::string> parse_nonpositional_args(Context<E> &ctx) {
} else if (read_arg("-needed_framework")) {
remaining.push_back("-needed_framework");
remaining.push_back(std::string(arg));
} else if (read_flag("-no_deduplicate")) {
} else if (read_flag("-no_deduplicate")) {
} else if (read_flag("-no_uuid")) {
ctx.arg.uuid = UUID_NONE;
} else if (read_arg("-o")) {
@ -373,7 +375,10 @@ std::vector<std::string> parse_nonpositional_args(Context<E> &ctx) {
append(ctx.arg.unexported_symbols_list, read_lines(ctx, arg));
} else if (read_flag("-v")) {
SyncOut(ctx) << mold_version;
} else {
} else if (read_arg("-weak_framework")) {
remaining.push_back("-weak_framework");
remaining.push_back(std::string(arg));
} else {
if (args[i][0] == '-')
Fatal(ctx) << "unknown command line option: " << args[i];
remaining.push_back(std::string(args[i]));

View File

@ -603,7 +603,7 @@ static void read_input_files(Context<E> &ctx, std::span<std::string> args) {
read_file(ctx, MappedFile<Context<E>>::must_open(ctx, args[0]));
ctx.all_load = orig;
args = args.subspan(1);
} else if (arg == "-framework") {
} else if (arg == "-framework" || arg == "-weak_framework") {
read_file(ctx, find_framework(ctx, args[0]));
args = args.subspan(1);
} else if (arg == "-needed_framework") {