diff --git a/shared/constants.go b/shared/constants.go index c10e0c0..b9f8dd2 100644 --- a/shared/constants.go +++ b/shared/constants.go @@ -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" diff --git a/shared/extractor.go b/shared/extractor.go index c2e2e7c..61ab35c 100644 --- a/shared/extractor.go +++ b/shared/extractor.go @@ -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) } diff --git a/shared/parser.go b/shared/parser.go index 2ba5138..feffe9a 100644 --- a/shared/parser.go +++ b/shared/parser.go @@ -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