aboutsummaryrefslogtreecommitdiff
path: root/lib/compilers/ada.js
diff options
context:
space:
mode:
authorMarc Poulhiès <dkm@kataplop.net>2022-01-25 08:54:42 +0100
committerGitHub <noreply@github.com>2022-01-25 08:54:42 +0100
commitb83dafac61c0972498b0dd8c0ea41db57d4edc81 (patch)
tree6676b448f5f7e2721a5480b561df91f8ddbe4123 /lib/compilers/ada.js
parentc57cf785643abd4f957bbf1ea9fc382a1f592ab9 (diff)
downloadcompiler-explorer-b83dafac61c0972498b0dd8c0ea41db57d4edc81.tar.gz
compiler-explorer-b83dafac61c0972498b0dd8c0ea41db57d4edc81.zip
Add comment for GNAT handling of command line options and enable strings (#3252)gh-1702
Add some comments around the command line options handling of GNAT. Add strings tool for Ada. Also enable binary and execution in the default config. Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
Diffstat (limited to 'lib/compilers/ada.js')
-rw-r--r--lib/compilers/ada.js16
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/compilers/ada.js b/lib/compilers/ada.js
index daa6d538e..105ee8ae1 100644
--- a/lib/compilers/ada.js
+++ b/lib/compilers/ada.js
@@ -41,10 +41,14 @@ export class AdaCompiler extends BaseCompiler {
}
getExecutableFilename(dirPath) {
+ // The name here must match the value used in the pragma Source_File
+ // in the user provided source.
return path.join(dirPath, 'example');
}
getOutputFilename(dirPath) {
+ // The basename here must match the value used in the pragma Source_File
+ // in the user provided source.
return path.join(dirPath, 'example.o');
}
@@ -66,7 +70,13 @@ export class AdaCompiler extends BaseCompiler {
optionsForFilter(filters, outputFilename) {
let options = [];
+ // Always add -cargs to the options. If not needed here, put it last.
+ // It's used in runCompiler to insert the input filename at the correct
+ // location in the command line.
+ // input filename is inserted before -cargs.
+
if (!filters.binary) {
+ // produce assembly output in outputFilename
options.push(
'compile',
'-g', // enable debugging
@@ -84,12 +94,14 @@ export class AdaCompiler extends BaseCompiler {
options = options.concat(this.compiler.intelAsm.split(' '));
}
} else {
+ // produce an executable in the file specified in getExecutableFilename.
+ // The output file is automatically decided by GNAT based on the Source_File_Name being used.
+ // As we are for forcing 'example.adb', the output here will be 'example'.
options.push(
'make',
'-eS',
'-g',
- 'example',
- '-cargs',
+ '-cargs', // Compiler Switches for gcc.
);
}