Browse Source

Fix up wine compilations

dev/git-series/gccdum
Matt Godbolt 6 years ago
parent
commit
2a240712ad
  1. 17
      lib/base-compiler.js

17
lib/base-compiler.js

@ -62,8 +62,13 @@ Compile.prototype.getRemote = function () {
return false;
};
Compile.prototype.exec = function(compiler, args, options) {
// Here only so can be overridden by compiler implementations.
return exec.execute(compiler, args, options);
};
Compile.prototype.runCompiler = function (compiler, options, inputFilename) {
return exec.execute(compiler, options, {
return this.exec(compiler, options, {
timeoutMs: this.env.gccProps("compileTimeoutMs", 100),
maxErrorOutput: this.env.gccProps("max-error-output", 5000),
env: this.env.getEnv(this.compiler.needsMulti),
@ -82,7 +87,7 @@ Compile.prototype.supportsObjdump = function () {
Compile.prototype.objdump = function (outputFilename, result, maxSize, intelAsm) {
var args = ["-d", "-C", outputFilename, "-l", "--insn-width=16"];
if (intelAsm) args = args.concat(["-M", "intel"]);
return exec.execute("objdump", args, {maxOutput: maxSize})
return this.exec("objdump", args, {maxOutput: maxSize})
.then(function (objResult) {
result.asm = objResult.stdout;
if (objResult.code !== 0) {
@ -196,7 +201,7 @@ Compile.prototype.postProcessAsm = function (result) {
if (!result.okToCache) return result;
var demangler = this.compiler.demangler;
if (!demangler) return result;
return exec.execute(demangler, [], {input: _.pluck(result.asm, 'text').join("\n")})
return this.exec(demangler, [], {input: _.pluck(result.asm, 'text').join("\n")})
.then(function (demangleResult) {
var lines = utils.splitLines(demangleResult.stdout);
for (var i = 0; i < result.asm.length; ++i)
@ -226,7 +231,7 @@ Compile.prototype.postProcess = function (result, outputFilename, filters) {
}
if (postProcess.length) {
var postCommand = 'cat "' + outputFilename + '" | ' + postProcess.join(" | ");
return exec.execute("bash", ["-c", postCommand], {maxOutput: maxSize})
return this.exec("bash", ["-c", postCommand], {maxOutput: maxSize})
.then(function (postResult) {
result.asm = postResult.stdout;
if (postResult.code !== 0) {
@ -276,7 +281,7 @@ Compile.prototype.initialise = function () {
var versionFlag = this.compiler.versionFlag || '--version';
var versionRe = new RegExp(this.compiler.versionRe || '.*');
logger.info("Gathering version information on", compiler);
return exec.execute(compiler, [versionFlag])
return this.exec(compiler, [versionFlag])
.then(_.bind(function (result) {
if (result.code !== 0) {
logger.error("Unable to get version for compiler '" + compiler + "' - non-zero result " + result.code);
@ -296,7 +301,7 @@ Compile.prototype.initialise = function () {
logger.info(compiler + " is version '" + version + "'");
this.compiler.version = version;
if (this.compiler.intelAsm) return this;
return exec.execute(compiler, ['--target-help'])
return this.exec(compiler, ['--target-help'])
.then(_.bind(function (result) {
var options = {};
if (result.code === 0) {

Loading…
Cancel
Save