FreeBSD bug fix (pico extension)

This commit is contained in:
Ian A Mason 2020-10-30 15:43:40 +00:00
parent 7a13605571
commit c917b673cf
3 changed files with 9 additions and 2 deletions

View File

@ -14,6 +14,7 @@ help:
@echo ''
install: develop
develop:
go install github.com/SRI-CSL/gllvm/cmd/...

View File

@ -134,12 +134,14 @@ func buildAndAttachBitcode(compilerExecName string, pr ParserResult, bcObjLinks
func attachBitcodePathToObject(bcFile, objFile string) (success bool) {
// We can only attach a bitcode path to certain file types
// this is too fragile, we need to look into a better way to do this.
switch filepath.Ext(objFile) {
case
".o",
".lo",
".os",
".So",
".pico", //iam: pico is FreeBSD
".po":
// Store bitcode path to temp file
var absBcPath, _ = filepath.Abs(bcFile)

View File

@ -352,11 +352,15 @@ func Parse(argList []string) ParserResult {
// iam: this is a list because matching needs to be done in order.
// if you add a NEW pattern; make sure it is before any existing pattern that also
// matches and has a conflicting flagInfo value.
// matches and has a conflicting flagInfo value. Also be careful with flags that can contain filenames, like
// linker info flags or dependency flags
var argPatterns = [...]argPattern{
{`^.+\.(c|cc|cpp|C|cxx|i|s|S|bc)$`, flagInfo{0, pr.inputFileCallback}},
{`^.+\.([fF](|[0-9][0-9]|or|OR|pp|PP))$`, flagInfo{0, pr.inputFileCallback}},
{`^.+\.(o|lo|So|so|po|a|dylib|pico)$`, flagInfo{0, pr.objectFileCallback}}, //iam: pico is FreeBSD
//iam: it's a bit fragile as to what we recognize as an object file.
// this also shows up in the compile function attachBitcodePathToObject, so additions
// here, should also be additions there.
{`^.+\.(o|lo|So|so|po|a|dylib|pico)$`, flagInfo{0, pr.objectFileCallback}}, //iam: pico is FreeBSD
{`^.+\.dylib(\.\d)+$`, flagInfo{0, pr.objectFileCallback}},
{`^.+\.(So|so)(\.\d)+$`, flagInfo{0, pr.objectFileCallback}},
{`^-(l|L).+$`, flagInfo{0, pr.linkUnaryCallback}},