Skip to content

Commit

Permalink
Remove system linker build options.
Browse files Browse the repository at this point in the history
  • Loading branch information
lerno committed Mar 12, 2024
1 parent 89ebbe2 commit d3218f5
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 42 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ jobs:
../build/c3c compile-run examples/load_world.c3
../build/c3c compile-run examples/process.c3
../build/c3c compile-run examples/ls.c3
../build/c3c compile-run --system-linker=no linux_stack.c3
../build/c3c compile-run --linker=builtin linux_stack.c3
../build/c3c compile-run linux_stack.c3
- name: Compile run unit tests
Expand All @@ -309,7 +309,7 @@ jobs:
- name: Build testproject direct linker
run: |
cd resources/testproject
../../build/c3c run --debug-log --system-linker=no
../../build/c3c run --debug-log --linker=builtin
- name: run compiler tests
run: |
Expand Down Expand Up @@ -400,7 +400,7 @@ jobs:
../build/c3c compile-run examples/factorial_macro.c3
../build/c3c compile-run examples/fasta.c3
../build/c3c compile-run examples/process.c3
../build/c3c compile-run --system-linker=no linux_stack.c3
../build/c3c compile-run --linker=builtin linux_stack.c3
../build/c3c compile-run linux_stack.c3
- name: Compile run unit tests
Expand All @@ -416,7 +416,7 @@ jobs:
- name: Build testproject direct linker
run: |
cd resources/testproject
../../build/c3c run --debug-log --system-linker=no
../../build/c3c run --debug-log --linker=builtin
- name: run compiler tests
run: |
Expand Down Expand Up @@ -488,7 +488,7 @@ jobs:
- name: Build testproject direct linker
run: |
cd resources/testproject
../../build/c3c run --debug-log --system-linker=no
../../build/c3c run --debug-log --linker=builtin
- name: Build testproject lib
run: |
Expand Down
1 change: 1 addition & 0 deletions releasenotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- Improved alignment handling.
- Add `--output-dir` to command line. #1155
- Allow making distinct types out of "void", "typeid", "anyfault" and faults.
- Removed `--system-linker` setting.

### Fixes
- Fixed issue in safe mode when converting enums.
Expand Down
6 changes: 3 additions & 3 deletions resources/examples/nolibc/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"link-libc": false,
"opt": "O0",
"safe": false,
"system-linker": true,
"linker": "builtin",
"use-stdlib": false,
},
},
Expand Down Expand Up @@ -68,8 +68,8 @@
// The size of the symtab, which limits the amount
// of symbols that can be used. Should usually not be changed.
"symtab": 1048576,
// Use the system linker.
"system-linker": false,
// Select linker.
"linker": "cc",
// Include the standard library.
"use-stdlib": true,
// Set general level of x64 cpu: "baseline", "ssse3", "sse4", "avx1", "avx2-v1", "avx2-v2", "avx512", "native".
Expand Down
2 changes: 1 addition & 1 deletion resources/examples/project_all_settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
// of symbols that can be used. Should usually not be changed.
"symtab": 1048576,
// Use the system linker.
"system-linker": false,
"linker": "cc",
// Include the standard library.
"use-stdlib": true,
// Set general level of x64 cpu: "baseline", "ssse3", "sse4", "avx1", "avx2-v1", "avx2-v2", "avx512", "native".
Expand Down
6 changes: 0 additions & 6 deletions src/build/build.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,6 @@ typedef enum
SINGLE_MODULE_ON = 1
} SingleModule;

typedef enum
{
SYSTEM_LINKER_NOT_SET = -1,
SYSTEM_LINKER_OFF = 0,
SYSTEM_LINKER_ON = 1
} SystemLinker;

typedef enum
{
Expand Down
27 changes: 0 additions & 27 deletions src/build/build_options.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,7 @@ static void usage(void)
OUTPUT(" -l <library> - Link with the library provided.");
OUTPUT(" -L <library dir> - Append the directory to the linker search paths.");
OUTPUT(" -z <argument> - Send the <argument> as a parameter to the linker.");
OUTPUT(" --system-linker=<yes|no> - Use the system linker (default: no for cross compilation, yes otherwise). [deprecated]");
OUTPUT(" --cc <path> - Set C compiler (for C files in projects and use as system linker).");
OUTPUT(" --linker <path> - Use the linker in the given path. [deprecated]");
OUTPUT(" --linker=<option> [<path>] - Linker: builtin, cc, custom (default is 'cc'), 'custom' requires a path.");
OUTPUT("");
OUTPUT(" --use-stdlib=<yes|no> - Include the standard library (default: yes).");
Expand Down Expand Up @@ -693,31 +691,6 @@ static void parse_option(BuildOptions *options)
}
return;
}
if ((argopt = match_argopt("system-linker")))
{
puts("NOTE: 'system-linker' is deprecated, please use --linker instead.");
options->custom_linker_path = NULL;
switch ((SystemLinker)parse_multi_option(argopt, 2, on_off))
{
case SYSTEM_LINKER_ON:
options->linker_type = LINKER_TYPE_CC;
break;
case SYSTEM_LINKER_OFF:
options->linker_type = LINKER_TYPE_BUILTIN;
break;
default:
UNREACHABLE
}
return;
}
if (match_longopt("linker"))
{
if (at_end() || next_is_opt()) error_exit("error: --linker expects a valid linker name.");
options->linker_type = LINKER_TYPE_CUSTOM;
options->custom_linker_path = next_arg();
puts("NOTE: 'linker' is deprecated, please use --linker=custom <path> instead.");
return;
}
if ((argopt = match_argopt("link-libc")))
{
options->link_libc = (LinkLibc)parse_multi_option(argopt, 2, on_off);
Expand Down

0 comments on commit d3218f5

Please sign in to comment.