aboutsummaryrefslogtreecommitdiff
path: root/lib/compilers
diff options
context:
space:
mode:
authorMarc Poulhiès <dkm@kataplop.net>2022-01-08 20:39:30 +0000
committerGitHub <noreply@github.com>2022-01-08 20:39:30 +0000
commit762a3f796f1ad10aa233fd7b4a71a93be0c43c88 (patch)
tree183ec7c948c2769c9d47999a0fccee4923bb274d /lib/compilers
parentbf9d2334b9ad34434f2051b03b52b761781a134c (diff)
parent8109f52af343300b2659756066b22659d064fc02 (diff)
downloadcompiler-explorer-gh-1567.tar.gz
compiler-explorer-gh-1567.zip
Merge 8109f52af343300b2659756066b22659d064fc02 into bf9d2334b9ad34434f2051b03b52b761781a134cgh-1567
Diffstat (limited to 'lib/compilers')
-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.
);
}