Skip to content

Commit

Permalink
Limits + windows linking (compiler-explorer#4898)
Browse files Browse the repository at this point in the history
  • Loading branch information
partouf authored Mar 23, 2023
1 parent 01935ec commit 21d071a
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 0 deletions.
2 changes: 2 additions & 0 deletions etc/cewrapper/compilers-and-tools.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"use_appcontainer": false,
"pids_max": 72,
"mem_max": 1342177280,
"allowed_paths": [],
"allowed_registry": []
}
2 changes: 2 additions & 0 deletions etc/cewrapper/user-execution.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"use_appcontainer": true,
"pids_max": 14,
"mem_max": 209715200,
"allowed_paths": [],
"allowed_registry": []
}
1 change: 1 addition & 0 deletions etc/config/c++.amazonwin.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ group.mingw64.isSemVer=true
group.mingw64.licenseLink=https://directory.fsf.org/wiki/Mingw-w64#tab=Details
group.mingw64.licenseName=multiple licenses (GPL, ZPL and more)
group.mingw64.instructionSet=amd64
group.mingw64.libPath=${exePath}/../lib;${exePath}/../x86_64-w64-mingw32/lib

group.mingw64_ucrt_gcc.compilers=mingw64_ucrt_gcc_1220:mingw64_ucrt_gcc_1210:mingw64_ucrt_gcc_1130
group.mingw64_ucrt_gcc.compilerType=win32-mingw-gcc
Expand Down
1 change: 1 addition & 0 deletions etc/config/c.amazonwin.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ group.cmingw64.isSemVer=true
group.cmingw64.licenseLink=https://directory.fsf.org/wiki/Mingw-w64#tab=Details
group.cmingw64.licenseName=multiple licenses (GPL, ZPL and more)
group.cmingw64.instructionSet=amd64
group.cmingw64.libPath=${exePath}/../lib;${exePath}/../x86_64-w64-mingw32/lib

group.cmingw64_ucrt_gcc.compilers=cmingw64_ucrt_gcc_1220:cmingw64_ucrt_gcc_1210:cmingw64_ucrt_gcc_1130
group.cmingw64_ucrt_gcc.compilerType=win32-mingw-gcc
Expand Down
25 changes: 25 additions & 0 deletions lib/compilers/win32-mingw-clang.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,31 @@ export class Win32MingWClang extends ClangCompiler {
return super.optionsForFilter(filters, outputFilename, userOptions);
}

override orderArguments(
options: string[],
inputFilename: string,
libIncludes: string[],
libOptions: string[],
libPaths: string[],
libLinks: string[],
userOptions: string[],
staticLibLinks: string[],
) {
const newUserOptions = userOptions.filter((opt) => !opt.startsWith('-l'));
const newLinkOptions = userOptions.filter((opt) => opt.startsWith('-l'));

return options.concat(
newUserOptions,
[this.filename(inputFilename)],
libIncludes,
libOptions,
libPaths,
newLinkOptions,
libLinks,
staticLibLinks,
);
}

override getDefaultExecOptions(): ExecutionOptions {
const options = super.getDefaultExecOptions();
if (!options.env) options.env = {};
Expand Down
25 changes: 25 additions & 0 deletions lib/compilers/win32-mingw-gcc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,31 @@ export class Win32MingWGcc extends GCCCompiler {
return super.optionsForFilter(filters, outputFilename, userOptions);
}

override orderArguments(
options: string[],
inputFilename: string,
libIncludes: string[],
libOptions: string[],
libPaths: string[],
libLinks: string[],
userOptions: string[],
staticLibLinks: string[],
) {
const newUserOptions = userOptions.filter((opt) => !opt.startsWith('-l'));
const newLinkOptions = userOptions.filter((opt) => opt.startsWith('-l'));

return options.concat(
newUserOptions,
[this.filename(inputFilename)],
libIncludes,
libOptions,
libPaths,
newLinkOptions,
libLinks,
staticLibLinks,
);
}

override getDefaultExecOptions(): ExecutionOptions {
const options = super.getDefaultExecOptions();
if (!options.env) options.env = {};
Expand Down

0 comments on commit 21d071a

Please sign in to comment.