This commit is contained in:
Ian A. Mason 2018-05-23 14:31:45 -07:00
commit 5f307cc3da
3 changed files with 22 additions and 12 deletions

View File

@ -40,11 +40,13 @@ package shared
// 1.0.0
// 1.0.1 various bug fixes
// 1.2.0 April 28 2018 linux kernel work, sorting bitcode files, etc.
// May 2 2018 handleArchives rewritten to handle multiple occurrences of files with the same name.
// corresponds with wllvm 1.1.6
// May 2 2018 handleArchives rewritten to handle multiple occurrences of files with the same name.
// corresponds with wllvm 1.2.0. Gonna try and keep them in synch.
// 1.2.1 May 13th 2018 -fsanitize= needs to be compile AND link.
//
const gllvmVersion = "1.2.0"
const gllvmReleaseDate = "May 4 2018"
const gllvmVersion = "1.2.1"
const gllvmReleaseDate = "May 23 2018"
const osDARWIN = "darwin"
const osLINUX = "linux"

View File

@ -324,8 +324,12 @@ func listArchiveFiles(inputFile string) (contents []string) {
func extractFile(archive string, filename string, instance int) bool {
var arArgs []string
arArgs = append(arArgs, "xN")
arArgs = append(arArgs, strconv.Itoa(instance))
if runtime.GOOS != osDARWIN {
arArgs = append(arArgs, "xN")
arArgs = append(arArgs, strconv.Itoa(instance))
} else {
arArgs = append(arArgs, "x")
}
arArgs = append(arArgs, archive)
arArgs = append(arArgs, filename)
_, err := runCmd("ar", arArgs)
@ -342,7 +346,8 @@ func fetchTOC(inputFile string) map[string]int {
contents := listArchiveFiles(inputFile)
for _, item := range contents {
if item != "" {
//iam: this is a hack to make get-bc work on libcurl.a
if item != "" && !strings.HasPrefix(item, "__.SYMDEF") {
toc[item]++
}
}
@ -370,7 +375,7 @@ func handleArchive(ea extractionArgs) {
inputFile, _ := filepath.Abs(ea.InputFile)
LogWarning("handleArchive: extractionArgs = %v\n", ea)
LogInfo("handleArchive: extractionArgs = %v\n", ea)
// Create tmp dir
tmpDirName, err := ioutil.TempDir("", "gllvm")
@ -466,7 +471,7 @@ func archiveBcFiles(ea extractionArgs, bcFiles []string) {
LogFatal("There was an error creating the bitcode archive: %v.\n", err)
}
}
LogWarning("Built bitcode archive: %s.", ea.OutputFile)
informUser("Built bitcode archive: %s.\n", ea.OutputFile)
}
func getsize(stringslice []string) (totalLength int) {
@ -565,7 +570,7 @@ func linkBitcodeFilesIncrementally(ea extractionArgs, filesToLink []string, argM
if !success {
LogFatal("There was an error linking input files into %s because %v.\n", ea.OutputFile, err)
}
LogWarning("Bitcode file extracted to: %s, from files %v \n", ea.OutputFile, tmpFileList)
LogInfo("Bitcode file extracted to: %s, from files %v \n", ea.OutputFile, tmpFileList)
}
func linkBitcodeFiles(ea extractionArgs, filesToLink []string) {
@ -584,7 +589,7 @@ func linkBitcodeFiles(ea extractionArgs, filesToLink []string) {
if !success {
LogFatal("There was an error linking input files into %s because %v.\n", ea.OutputFile, err)
}
LogWarning("Bitcode file extracted to: %s \n", ea.OutputFile)
informUser("Bitcode file extracted to: %s.\n", ea.OutputFile)
}
}
@ -661,5 +666,5 @@ func writeManifest(ea extractionArgs, bcFiles []string, artifactFiles []string)
LogFatal("There was an error while writing the manifest file: ", err)
}
}
LogWarning("Manifest file written to %s.", manifestFilename)
informUser("Manifest file written to %s.\n", manifestFilename)
}

View File

@ -223,6 +223,7 @@ func parse(argList []string) parserResult {
"-L": {1, pr.linkBinaryCallback},
"-T": {1, pr.linkBinaryCallback},
"-u": {1, pr.linkBinaryCallback},
"-install_name": {1, pr.linkBinaryCallback},
"-e": {1, pr.linkBinaryCallback},
"-rpath": {1, pr.linkBinaryCallback},
@ -241,6 +242,7 @@ func parse(argList []string) parserResult {
"-print-multi-directory": {0, pr.compileUnaryCallback},
"-print-multi-lib": {0, pr.compileUnaryCallback},
"-print-libgcc-file-name": {0, pr.compileUnaryCallback},
"-print-search-dirs": {0, pr.compileUnaryCallback},
"-fprofile-arcs": {0, pr.compileLinkUnaryCallback},
"-coverage": {0, pr.compileLinkUnaryCallback},
@ -272,6 +274,7 @@ func parse(argList []string) parserResult {
`^--sysroot=.+$`: {0, pr.compileUnaryCallback},
`^-print-prog-name=.*$`: {0, pr.compileUnaryCallback},
`^-print-file-name=.*$`: {0, pr.compileUnaryCallback},
`^-mmacosx-version-min=.+$`: {0, pr.compileLinkUnaryCallback},
`^-mstack-alignment=.+$`: {0, pr.compileUnaryCallback}, //iam: linux kernel stuff
`^-march=.+$`: {0, pr.compileUnaryCallback}, //iam: linux kernel stuff
`^-mregparm=.+$`: {0, pr.compileUnaryCallback}, //iam: linux kernel stuff