-
Notifications
You must be signed in to change notification settings - Fork 11k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ELF] --save-temps --lto-emit-asm: derive ELF/asm file names from bitcode file names #78835
[ELF] --save-temps --lto-emit-asm: derive ELF/asm file names from bitcode file names #78835
Conversation
Created using spr 1.3.4
@llvm/pr-subscribers-lld-elf @llvm/pr-subscribers-lld Author: Fangrui Song (MaskRay) ChangesPort COFF's https://reviews.llvm.org/D78221 and The relocatable file name from the first regular LTO partition does not
Full diff: https://github.com/llvm/llvm-project/pull/78835.diff 12 Files Affected:
diff --git a/lld/ELF/LTO.cpp b/lld/ELF/LTO.cpp
index 504c12aac6c5696..843ee59479eae92 100644
--- a/lld/ELF/LTO.cpp
+++ b/lld/ELF/LTO.cpp
@@ -12,6 +12,7 @@
#include "SymbolTable.h"
#include "Symbols.h"
#include "lld/Common/Args.h"
+#include "lld/Common/CommonLinkerContext.h"
#include "lld/Common/ErrorHandler.h"
#include "lld/Common/Filesystem.h"
#include "lld/Common/Strings.h"
@@ -26,6 +27,7 @@
#include "llvm/Support/Caching.h"
#include "llvm/Support/CodeGen.h"
#include "llvm/Support/Error.h"
+#include "llvm/Support/Path.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/MemoryBuffer.h"
#include <algorithm>
@@ -303,6 +305,7 @@ std::vector<InputFile *> BitcodeCompiler::compile() {
unsigned maxTasks = ltoObj->getMaxTasks();
buf.resize(maxTasks);
files.resize(maxTasks);
+ filenames.resize(maxTasks);
// The --thinlto-cache-dir option specifies the path to a directory in which
// to cache native object files for ThinLTO incremental builds. If a path was
@@ -313,13 +316,15 @@ std::vector<InputFile *> BitcodeCompiler::compile() {
[&](size_t task, const Twine &moduleName,
std::unique_ptr<MemoryBuffer> mb) {
files[task] = std::move(mb);
+ filenames[task] = moduleName.str();
}));
if (!ctx.bitcodeFiles.empty())
checkError(ltoObj->run(
[&](size_t task, const Twine &moduleName) {
+ buf[task].first = moduleName.str();
return std::make_unique<CachedFileStream>(
- std::make_unique<raw_svector_ostream>(buf[task]));
+ std::make_unique<raw_svector_ostream>(buf[task].second));
},
cache));
@@ -338,7 +343,7 @@ std::vector<InputFile *> BitcodeCompiler::compile() {
if (config->thinLTOIndexOnly) {
if (!config->ltoObjPath.empty())
- saveBuffer(buf[0], config->ltoObjPath);
+ saveBuffer(buf[0].second, config->ltoObjPath);
// ThinLTO with index only option is required to generate only the index
// files. After that, we exit from linker and ThinLTO backend runs in a
@@ -352,32 +357,49 @@ std::vector<InputFile *> BitcodeCompiler::compile() {
pruneCache(config->thinLTOCacheDir, config->thinLTOCachePolicy, files);
if (!config->ltoObjPath.empty()) {
- saveBuffer(buf[0], config->ltoObjPath);
+ saveBuffer(buf[0].second, config->ltoObjPath);
for (unsigned i = 1; i != maxTasks; ++i)
- saveBuffer(buf[i], config->ltoObjPath + Twine(i));
- }
-
- if (config->saveTempsArgs.contains("prelink")) {
- if (!buf[0].empty())
- saveBuffer(buf[0], config->outputFile + ".lto.o");
- for (unsigned i = 1; i != maxTasks; ++i)
- saveBuffer(buf[i], config->outputFile + Twine(i) + ".lto.o");
- }
-
- if (config->ltoEmitAsm) {
- saveBuffer(buf[0], config->outputFile);
- for (unsigned i = 1; i != maxTasks; ++i)
- saveBuffer(buf[i], config->outputFile + Twine(i));
- return {};
+ saveBuffer(buf[i].second, config->ltoObjPath + Twine(i));
}
+ bool savePrelink = config->saveTempsArgs.contains("prelink");
std::vector<InputFile *> ret;
- for (unsigned i = 0; i != maxTasks; ++i)
- if (!buf[i].empty())
- ret.push_back(createObjFile(MemoryBufferRef(buf[i], "lto.tmp")));
+ const char *ext = config->ltoEmitAsm ? ".s" : ".o";
+ for (unsigned i = 0; i != maxTasks; ++i) {
+ StringRef bitcodeFilePath;
+ StringRef objBuf;
+ if (files[i]) {
+ objBuf = files[i]->getBuffer();
+ bitcodeFilePath = filenames[i];
+ } else {
+ objBuf = buf[i].second;
+ bitcodeFilePath = buf[i].first;
+ }
+ if (objBuf.empty())
+ continue;
- for (std::unique_ptr<MemoryBuffer> &file : files)
- if (file)
- ret.push_back(createObjFile(*file));
+ // If the input bitcode file is path/to/a.o and -o specifies a.out, then the
+ // corresponding lto object file name will look something like:
+ // path/to/a.out.lto.a.o.
+ StringRef ltoObjName;
+ if (bitcodeFilePath == "ld-temp.o") {
+ ltoObjName =
+ saver().save(Twine(config->outputFile) + ".lto" +
+ (i == 0 ? Twine("") : Twine('.') + Twine(i)) + ext);
+ } else {
+ StringRef directory = sys::path::parent_path(bitcodeFilePath);
+ StringRef baseName = sys::path::stem(bitcodeFilePath);
+ StringRef outputFileBaseName = sys::path::filename(config->outputFile);
+ SmallString<256> path;
+ sys::path::append(path, directory,
+ outputFileBaseName + ".lto." + baseName + ext);
+ sys::path::remove_dots(path, true);
+ ltoObjName = saver().save(path.str());
+ }
+ if (savePrelink || config->ltoEmitAsm)
+ saveBuffer(buf[i].second, ltoObjName);
+ if (!config->ltoEmitAsm)
+ ret.push_back(createObjFile(MemoryBufferRef(objBuf, ltoObjName)));
+ }
return ret;
}
diff --git a/lld/ELF/LTO.h b/lld/ELF/LTO.h
index 7ab654101f2487d..d3c22883c1da347 100644
--- a/lld/ELF/LTO.h
+++ b/lld/ELF/LTO.h
@@ -46,8 +46,9 @@ class BitcodeCompiler {
private:
std::unique_ptr<llvm::lto::LTO> ltoObj;
- std::vector<SmallString<0>> buf;
+ SmallVector<std::pair<std::string, SmallString<0>>, 0> buf;
std::vector<std::unique_ptr<MemoryBuffer>> files;
+ SmallVector<std::string, 0> filenames;
llvm::DenseSet<StringRef> usedStartStop;
std::unique_ptr<llvm::raw_fd_ostream> indexFile;
llvm::DenseSet<StringRef> thinIndices;
diff --git a/lld/test/ELF/common-archive-lookup.s b/lld/test/ELF/common-archive-lookup.s
index 297d3d9b6f36ec9..abf3feb4e751fb6 100644
--- a/lld/test/ELF/common-archive-lookup.s
+++ b/lld/test/ELF/common-archive-lookup.s
@@ -61,10 +61,11 @@
# RUN: ld.lld --no-fortran-common -o 11 main.o --start-lib 1.o strong_data_only.o --end-lib
# RUN: llvm-readobj --syms 11 | FileCheck --check-prefix=NFC %s
-# RUN: ld.lld -o - main.o 4.a --fortran-common --lto-emit-asm | FileCheck --check-prefix=ASM %s
+# RUN: ld.lld -o out main.o 4.a --fortran-common --lto-emit-asm
+# RUN: FileCheck --check-prefix=ASM %s < out.lto.s
-# RUN: ld.lld -o - main.o --start-lib 1.bc 2.bc --end-lib --fortran-common --lto-emit-asm | \
-# RUN: FileCheck --check-prefix=ASM %s
+# RUN: ld.lld -o out main.o --start-lib 1.bc 2.bc --end-lib --fortran-common --lto-emit-asm
+# RUN: FileCheck --check-prefix=ASM %s < out.lto.s
## COMMON overrides weak. Don't extract 3.bc which provides a weak definition.
# RUN: ld.lld -o /dev/null main.o --start-lib 1.bc 3.bc --end-lib -y block | FileCheck --check-prefix=LTO_WEAK %s
diff --git a/lld/test/ELF/lto/comdat-mixed-archive.test b/lld/test/ELF/lto/comdat-mixed-archive.test
index d7ea4eb18c72ec3..88e294ed9872219 100644
--- a/lld/test/ELF/lto/comdat-mixed-archive.test
+++ b/lld/test/ELF/lto/comdat-mixed-archive.test
@@ -35,8 +35,8 @@ TRACE-NEXT: lib.a(obj.o): definition of bar
TRACE-NEXT: lib.a(obj.o): reference to foo
TRACE-NEXT: <internal>: reference to foo
;; The definition of "foo" is visible outside the LTO result.
-TRACE-NEXT: lto.tmp: definition of foo
-TRACE-NEXT: lto.tmp: reference to bar
+TRACE-NEXT: {{.*}}.lto.o: definition of foo
+TRACE-NEXT: {{.*}}.lto.o: reference to bar
;--- start.s
.global _start, baz
diff --git a/lld/test/ELF/lto/emit-asm.ll b/lld/test/ELF/lto/emit-asm.ll
index 03cf32d904520fd..463b4fc3c5f6207 100644
--- a/lld/test/ELF/lto/emit-asm.ll
+++ b/lld/test/ELF/lto/emit-asm.ll
@@ -1,13 +1,14 @@
; REQUIRES: x86
; RUN: rm -rf %t && mkdir %t && cd %t
; RUN: llvm-as %s -o a.bc
-; RUN: ld.lld --lto-emit-asm -shared a.bc -o - | FileCheck %s
-; RUN: ld.lld --plugin-opt=emit-asm --plugin-opt=lto-partitions=2 -shared a.bc -o out.s
-; RUN: cat out.s out.s1 | FileCheck %s
+; RUN: ld.lld --lto-emit-asm -shared a.bc -o out 2>&1 | count 0
+; RUN: FileCheck %s < out.lto.s
+; RUN: ld.lld --plugin-opt=emit-asm --plugin-opt=lto-partitions=2 -shared a.bc -o out
+; RUN: cat out.lto.s out.lto.1.s | FileCheck %s
-; RUN: ld.lld --lto-emit-asm --save-temps -shared a.bc -o out.s
-; RUN: FileCheck --input-file out.s %s
-; RUN: llvm-dis out.s.0.4.opt.bc -o - | FileCheck --check-prefix=OPT %s
+; RUN: ld.lld --lto-emit-asm --save-temps -shared a.bc -o out
+; RUN: FileCheck --input-file out.lto.s %s
+; RUN: llvm-dis out.0.4.opt.bc -o - | FileCheck --check-prefix=OPT %s
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
diff --git a/lld/test/ELF/lto/exclude-libs-libcall.ll b/lld/test/ELF/lto/exclude-libs-libcall.ll
index 3fdffb4276d9ede..8e1d54853cc3795 100644
--- a/lld/test/ELF/lto/exclude-libs-libcall.ll
+++ b/lld/test/ELF/lto/exclude-libs-libcall.ll
@@ -7,7 +7,7 @@
; RUN: llvm-readelf --dyn-syms %t.so | FileCheck %s
; TRACE: {{.*}}/b.a(b.o): lazy definition of __divti3
-; TRACE-NEXT: lto.tmp: reference to __divti3
+; TRACE-NEXT: {{.*}}.lto.o: reference to __divti3
; TRACE-NEXT: {{.*}}/b.a(b.o): definition of __divti3
; CHECK: Symbol table '.dynsym' contains 2 entries:
diff --git a/lld/test/ELF/lto/obj-path.ll b/lld/test/ELF/lto/obj-path.ll
index 23b593bd36fa8fb..c0bb4addf24666f 100644
--- a/lld/test/ELF/lto/obj-path.ll
+++ b/lld/test/ELF/lto/obj-path.ll
@@ -67,12 +67,12 @@
;; Ensure lld emits empty combined module if specific obj-path.
; RUN: mkdir obj
; RUN: ld.lld --plugin-opt=obj-path=objpath.o -shared 1.bc d/2.bc -o obj/out --save-temps
-; RUN: ls obj/out.lto.o obj/out1.lto.o obj/out2.lto.o
+; RUN: ls obj/out.lto.o out.lto.1.o d/out.lto.2.o
;; Ensure lld does not emit empty combined module by default.
; RUN: rm -fr obj && mkdir obj
; RUN: ld.lld -shared 1.bc d/2.bc -o obj/out --save-temps
-; RUN: ls obj/out*.lto.* | count 2
+; RUN: not test -e obj/out.lto.o
; EMPTY: file format elf64-x86-64
; EMPTY-NOT: {{.}}
diff --git a/lld/test/ELF/lto/parallel-internalize.ll b/lld/test/ELF/lto/parallel-internalize.ll
index 9cd080360d396ba..a1511d6f6867d47 100644
--- a/lld/test/ELF/lto/parallel-internalize.ll
+++ b/lld/test/ELF/lto/parallel-internalize.ll
@@ -4,7 +4,7 @@
; RUN: ld.lld --lto-partitions=2 -save-temps -o out a.bc -e foo --lto-O0
; RUN: llvm-readobj --symbols --dyn-syms out | FileCheck %s
; RUN: llvm-nm out.lto.o | FileCheck --check-prefix=CHECK0 %s
-; RUN: llvm-nm out1.lto.o | FileCheck --check-prefix=CHECK1 %s
+; RUN: llvm-nm out.lto.1.o | FileCheck --check-prefix=CHECK1 %s
; CHECK: Symbols [
; CHECK-NEXT: Symbol {
diff --git a/lld/test/ELF/lto/parallel.ll b/lld/test/ELF/lto/parallel.ll
index c6c9a185677b83a..6b2c352b0a9654f 100644
--- a/lld/test/ELF/lto/parallel.ll
+++ b/lld/test/ELF/lto/parallel.ll
@@ -3,7 +3,7 @@
; RUN: llvm-as -o a.bc %s
; RUN: ld.lld --lto-partitions=2 -save-temps -o out a.bc -shared
; RUN: llvm-nm out.lto.o | FileCheck --check-prefix=CHECK0 %s
-; RUN: llvm-nm out1.lto.o | FileCheck --check-prefix=CHECK1 %s
+; RUN: llvm-nm out.lto.1.o | FileCheck --check-prefix=CHECK1 %s
; RUN: not ld.lld --lto-partitions=0 a.bc -o /dev/null 2>&1 | FileCheck --check-prefix=INVALID %s
; INVALID: --lto-partitions: number of threads must be > 0
diff --git a/lld/test/ELF/lto/pseudo-probe-lto.ll b/lld/test/ELF/lto/pseudo-probe-lto.ll
index 3840c7c2281c064..cabd69da33fe2cf 100644
--- a/lld/test/ELF/lto/pseudo-probe-lto.ll
+++ b/lld/test/ELF/lto/pseudo-probe-lto.ll
@@ -1,6 +1,7 @@
; REQUIRES: x86
; RUN: opt < %s -passes=pseudo-probe -function-sections -o %t.o
-; RUN: ld.lld %t.o -shared --lto-emit-asm -o - | FileCheck %s
+; RUN: ld.lld %t.o -shared --lto-emit-asm -o %t
+; RUN: FileCheck %s < %t.lto.s
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-scei-ps4"
diff --git a/lld/test/ELF/lto/save-temps-eq.ll b/lld/test/ELF/lto/save-temps-eq.ll
index ed9c3970347f3c4..9befc99af925346 100644
--- a/lld/test/ELF/lto/save-temps-eq.ll
+++ b/lld/test/ELF/lto/save-temps-eq.ll
@@ -14,14 +14,14 @@
;; Create the .all dir with save-temps saving everything, this will be used to compare
;; with the output from individualized save-temps later
; RUN: ld.lld main.o thin1.o --save-temps -o %t/all/a.out
-; RUN: mv *.o.* %t/all
+; RUN: mv a.out.lto.* *.o.*.bc %t/all
;; Sanity check that everything got moved
; RUN: ls | count 2
;; Check precedence if both --save-temps and --save-temps= are present
; RUN: ld.lld main.o thin1.o --save-temps=preopt --save-temps --save-temps=\opt -o %t/all2/a.out
; RUN: cmp %t/all2/a.out %t/all/a.out
-; RUN: mv *.o.* %t/all2
+; RUN: mv a.out.lto.* *.o.* %t/all2
; RUN: ls | count 2
; RUN: diff -r %t/all %t/all2
@@ -83,8 +83,8 @@
;; Check prelink
; RUN: ld.lld main.o thin1.o --save-temps=prelink
; RUN: cmp %t/all/a.out a.out && rm -f a.out
-; RUN: cp *.lto.o %t/subset2
-; RUN: mv *.lto.o %t/all3
+; RUN: cp a.out.lto.*.o %t/subset2
+; RUN: mv a.out.lto.*.o %t/all3
; RUN: ls | count 2
;; Check resolution
@@ -104,7 +104,7 @@
; RUN: cmp %t/all/a.out a.out && rm -f a.out
; RUN: mv *.0.preopt.* %t/subset
; RUN: mv *.4.opt* %t/subset
-; RUN: mv *.lto.o %t/subset
+; RUN: mv a.out.lto.*.o %t/subset
; RUN: ls | count 2
; RUN: diff -r %t/subset2 %t/subset
diff --git a/lld/test/ELF/lto/thinlto.ll b/lld/test/ELF/lto/thinlto.ll
index 4145007d9b20166..326938bd1fd7238 100644
--- a/lld/test/ELF/lto/thinlto.ll
+++ b/lld/test/ELF/lto/thinlto.ll
@@ -7,56 +7,56 @@
; RUN: opt -module-summary %p/Inputs/thinlto.ll -o d/2.o
; First force single-threaded mode
-; RUN: rm -f e/out1.lto.o e/out2.lto.o
+; RUN: rm -f out.lto.1.o d/out.lto.2.o
; RUN: ld.lld -save-temps --thinlto-jobs=1 -shared 1.o d/2.o -o e/out
-; RUN: llvm-nm e/out1.lto.o | FileCheck %s --check-prefix=NM1
-; RUN: llvm-nm e/out2.lto.o | FileCheck %s --check-prefix=NM2
+; RUN: llvm-nm out.lto.1.o | FileCheck %s --check-prefix=NM1
+; RUN: llvm-nm d/out.lto.2.o | FileCheck %s --check-prefix=NM2
; Next force multi-threaded mode
-; RUN: rm -f e/out1.lto.o e/out2.lto.o
+; RUN: rm -f out.lto.1.o d/out.lto.2.o
; RUN: ld.lld -save-temps --thinlto-jobs=2 -shared 1.o d/2.o -o e/out
-; RUN: llvm-nm e/out1.lto.o | FileCheck %s --check-prefix=NM1
-; RUN: llvm-nm e/out2.lto.o | FileCheck %s --check-prefix=NM2
+; RUN: llvm-nm out.lto.1.o | FileCheck %s --check-prefix=NM1
+; RUN: llvm-nm d/out.lto.2.o | FileCheck %s --check-prefix=NM2
;; --plugin-opt=jobs= is an alias.
-; RUN: rm -f e/out1.lto.o e/out2.lto.o
+; RUN: rm -f out.lto.1.o d/out.lto.2.o
; RUN: ld.lld -save-temps --plugin-opt=jobs=2 -shared 1.o d/2.o -o e/out
-; RUN: llvm-nm e/out1.lto.o | FileCheck %s --check-prefix=NM1
-; RUN: llvm-nm e/out2.lto.o | FileCheck %s --check-prefix=NM2
+; RUN: llvm-nm out.lto.1.o | FileCheck %s --check-prefix=NM1
+; RUN: llvm-nm d/out.lto.2.o | FileCheck %s --check-prefix=NM2
;; --thinlto-jobs= defaults to --threads=.
-; RUN: rm -f e/out1.lto.o e/out2.lto.o
+; RUN: rm -f out.lto.1.o d/out.lto.2.o
; RUN: ld.lld -save-temps --threads=2 -shared 1.o d/2.o -o e/out
-; RUN: llvm-nm e/out1.lto.o | FileCheck %s --check-prefix=NM1
-; RUN: llvm-nm e/out2.lto.o | FileCheck %s --check-prefix=NM2
+; RUN: llvm-nm out.lto.1.o | FileCheck %s --check-prefix=NM1
+; RUN: llvm-nm d/out.lto.2.o | FileCheck %s --check-prefix=NM2
;; --thinlto-jobs= overrides --threads=.
-; RUN: rm -f e/out1.lto.o e/out2.lto.o
+; RUN: rm -f out.lto.1.o d/out.lto.2.o
; RUN: ld.lld -save-temps --threads=1 --plugin-opt=jobs=2 -shared 1.o d/2.o -o e/out
-; RUN: llvm-nm e/out1.lto.o | FileCheck %s --check-prefix=NM1
-; RUN: llvm-nm e/out2.lto.o | FileCheck %s --check-prefix=NM2
+; RUN: llvm-nm out.lto.1.o | FileCheck %s --check-prefix=NM1
+; RUN: llvm-nm d/out.lto.2.o | FileCheck %s --check-prefix=NM2
; Test with all threads, on all cores, on all CPU sockets
-; RUN: rm -f e/out1.lto.o e/out2.lto.o
+; RUN: rm -f out.lto.1.o d/out.lto.2.o
; RUN: ld.lld -save-temps --thinlto-jobs=all -shared 1.o d/2.o -o e/out
-; RUN: llvm-nm e/out1.lto.o | FileCheck %s --check-prefix=NM1
-; RUN: llvm-nm e/out2.lto.o | FileCheck %s --check-prefix=NM2
+; RUN: llvm-nm out.lto.1.o | FileCheck %s --check-prefix=NM1
+; RUN: llvm-nm d/out.lto.2.o | FileCheck %s --check-prefix=NM2
; Test with many more threads than the system has
-; RUN: rm -f e/out1.lto.o e/out2.lto.o
+; RUN: rm -f out.lto.1.o d/out.lto.2.o
; RUN: ld.lld -save-temps --thinlto-jobs=100 -shared 1.o d/2.o -o e/out
-; RUN: llvm-nm e/out1.lto.o | FileCheck %s --check-prefix=NM1
-; RUN: llvm-nm e/out2.lto.o | FileCheck %s --check-prefix=NM2
+; RUN: llvm-nm out.lto.1.o | FileCheck %s --check-prefix=NM1
+; RUN: llvm-nm d/out.lto.2.o | FileCheck %s --check-prefix=NM2
; Test with a bad value
-; RUN: rm -f e/out1.lto.o e/out2.lto.o
+; RUN: rm -f out.lto.1.o d/out.lto.2.o
; RUN: not ld.lld -save-temps --thinlto-jobs=foo -shared 1.o d/2.o -o e/out 2>&1 | FileCheck %s --check-prefix=BAD-JOBS
; BAD-JOBS: error: --thinlto-jobs: invalid job count: foo
; Then check without --thinlto-jobs (which currently defaults to heavyweight_hardware_concurrency, meanning one thread per hardware core -- not SMT)
; RUN: ld.lld -shared -save-temps 1.o d/2.o -o e/out
-; RUN: llvm-nm e/out1.lto.o | FileCheck %s --check-prefix=NM1
-; RUN: llvm-nm e/out2.lto.o | FileCheck %s --check-prefix=NM2
+; RUN: llvm-nm out.lto.1.o | FileCheck %s --check-prefix=NM1
+; RUN: llvm-nm d/out.lto.2.o | FileCheck %s --check-prefix=NM2
; Check that -save-temps is usable with thin archives
; RUN: mkdir dir
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there any tests checking that --save-temps on something like a.o results in a.out.lto.a.o? I am only seeing enumerated temp files in the tests.
@@ -46,8 +46,9 @@ class BitcodeCompiler { | |||
|
|||
private: | |||
std::unique_ptr<llvm::lto::LTO> ltoObj; | |||
std::vector<SmallString<0>> buf; | |||
SmallVector<std::pair<std::string, SmallString<0>>, 0> buf; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Document the members of the pair
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ping on this comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a comment
for (unsigned i = 0; i != maxTasks; ++i) { | ||
StringRef bitcodeFilePath; | ||
StringRef objBuf; | ||
if (files[i]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A comment explaining the two different cases handled here would be good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, those are helpful. Can you also add a comment before 373 on meaning of files[i] being null vs not - reading through the comments you added it sounds like files[i] is non-null when object file was found in the cache?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clarified the comment a bit
# RUN: ld.lld -o - main.o --start-lib 1.bc 2.bc --end-lib --fortran-common --lto-emit-asm | \ | ||
# RUN: FileCheck --check-prefix=ASM %s | ||
# RUN: ld.lld -o out main.o --start-lib 1.bc 2.bc --end-lib --fortran-common --lto-emit-asm | ||
# RUN: FileCheck --check-prefix=ASM %s < out.lto.s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should out.lto.s be removed to ensure we aren't rechecking the one produced by the prior ld.lld invocation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestion. Removed.
Created using spr 1.3.4
for (unsigned i = 0; i != maxTasks; ++i) { | ||
StringRef bitcodeFilePath; | ||
StringRef objBuf; | ||
if (files[i]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, those are helpful. Can you also add a comment before 373 on meaning of files[i] being null vs not - reading through the comments you added it sounds like files[i] is non-null when object file was found in the cache?
@@ -46,8 +46,9 @@ class BitcodeCompiler { | |||
|
|||
private: | |||
std::unique_ptr<llvm::lto::LTO> ltoObj; | |||
std::vector<SmallString<0>> buf; | |||
SmallVector<std::pair<std::string, SmallString<0>>, 0> buf; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ping on this comment.
|
||
; MAP: llvmcache-{{.*}}:(.text) | ||
; MAP: llvmcache-{{.*}}:(.text) | ||
; MAP: out.lto.b.o:(.text) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confused about what changed in the latest commit to cause these lines to need updating - was this just a missed test update in the prior commit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a new test. I noticed the -Map
difference, so I pre-committed a test and changed this PR to demonstrate the difference.
Created using spr 1.3.4
Created using spr 1.3.4
We're seeing a test failure on our buildbot after this patch landed. Could you take a look? https://lab.llvm.org/buildbot/#/builders/216/builds/33382/steps/7/logs/FAIL__lld__defsym_ll
|
We're seeing a test failure on our buildbot after this patch landed. Could you take a look? lab.llvm.org/buildbot/#/builders/216/builds/33382/steps/7/logs/FAIL__lld__defsym_ll
Sorry for the failure. I did not remove stale output files and failed to noticed this. |
…17-g3f5fcb59-1 / cd6d8f2a04528f827ad3d399581c0f3502b15a72-1 : cdaa12e3dff109f72a5a8a0a67ea225052122a79-1 https://chromium.googlesource.com/external/github.com/llvm/llvm-project/+log/f670112a..3f5fcb59 https://chromium.googlesource.com/external/github.com/rust-lang/rust/+log/cd6d8f2a0452..cdaa12e3dff1 Ran: ./tools/clang/scripts/upload_revision.py 3f5fcb59ae582ebfbe3f23050d90f86a2cb76eb0 Additionally: * ran tools/rust/gnrt_stdlib.py * replaced usages of the flag -fvisibility-global-new-delete-hidden with -fvisibility-global-new-delete=force-hidden as the former is now deprecated. * disabled the warning -Wnan-infinity-disabled where -ffast-math is enabled. * ran third_party/abseil-cpp/generate_def_files.py * update the Android binary size script to be compatible with the new ThinLTO file name format introduced in llvm/llvm-project#78835. Bug: 1522774,1523764,1523787,1523808,41496774 Change-Id: I42916db8001b4f5a76bb989a71e3043900d1dc3d Disable-Rts: True Cq-Include-Trybots: chromium/try:chromeos-amd64-generic-cfi-thin-lto-rel Cq-Include-Trybots: chromium/try:dawn-win10-x86-deps-rel Cq-Include-Trybots: chromium/try:lacros-arm64-generic-rel Cq-Include-Trybots: chromium/try:linux-chromeos-dbg Cq-Include-Trybots: chromium/try:linux_chromium_cfi_rel_ng Cq-Include-Trybots: chromium/try:linux_chromium_chromeos_msan_rel_ng Cq-Include-Trybots: chromium/try:linux_chromium_msan_rel_ng Cq-Include-Trybots: chromium/try:mac11-arm64-rel,mac_chromium_asan_rel_ng Cq-Include-Trybots: chromium/try:ios-catalyst,win-asan,android-official Cq-Include-Trybots: chromium/try:fuchsia-arm64-cast-receiver-rel Cq-Include-Trybots: chromium/try:mac-official,linux-official Cq-Include-Trybots: chromium/try:win-official,win32-official Cq-Include-Trybots: chromium/try:linux-swangle-try-x64,win-swangle-try-x86 Cq-Include-Trybots: chromium/try:android-cronet-mainline-clang-arm64-dbg Cq-Include-Trybots: chromium/try:android-cronet-mainline-clang-arm64-rel Cq-Include-Trybots: chromium/try:android-cronet-mainline-clang-x86-dbg Cq-Include-Trybots: chromium/try:android-cronet-mainline-clang-x86-rel Cq-Include-Trybots: chromium/try:android-cronet-riscv64-dbg Cq-Include-Trybots: chromium/try:android-cronet-riscv64-rel Cq-Include-Trybots: chrome/try:ipad-device Cq-Include-Trybots: chrome/try:linux-chromeos-chrome Cq-Include-Trybots: chrome/try:win-chrome,win64-chrome,linux-chrome,mac-chrome Cq-Include-Trybots: chrome/try:linux-pgo Cq-Include-Trybots: chromium/try:android-rust-arm32-rel Cq-Include-Trybots: chromium/try:android-rust-arm64-dbg Cq-Include-Trybots: chromium/try:android-rust-arm64-rel Cq-Include-Trybots: chromium/try:linux-rust-x64-dbg Cq-Include-Trybots: chromium/try:linux-rust-x64-rel Cq-Include-Trybots: chromium/try:mac-rust-x64-dbg Cq-Include-Trybots: chromium/try:win-rust-x64-dbg Cq-Include-Trybots: chromium/try:win-rust-x64-rel Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5254957 Reviewed-by: Nico Weber <thakis@chromium.org> Commit-Queue: Nico Weber <thakis@chromium.org> Owners-Override: Nico Weber <thakis@chromium.org> Auto-Submit: Alan Zhao <ayzhao@google.com> Cr-Commit-Position: refs/heads/main@{#1257358}
…9-init-817-g3f5fcb59-1 / cd6d8f2a04528f827ad3d399581c0f3502b15a72-1 : cdaa12e3dff109f72a5a8a0a67ea225052122a79-1" This reverts commit ebbab76. Reason for revert: causes https://crbug.com/324262101 Original change's description: > Roll clang+rust llvmorg-18-init-17730-gf670112a-1 : llvmorg-19-init-817-g3f5fcb59-1 / cd6d8f2a04528f827ad3d399581c0f3502b15a72-1 : cdaa12e3dff109f72a5a8a0a67ea225052122a79-1 > > https://chromium.googlesource.com/external/github.com/llvm/llvm-project/+log/f670112a..3f5fcb59 > > https://chromium.googlesource.com/external/github.com/rust-lang/rust/+log/cd6d8f2a0452..cdaa12e3dff1 > > Ran: ./tools/clang/scripts/upload_revision.py 3f5fcb59ae582ebfbe3f23050d90f86a2cb76eb0 > > Additionally: > > * ran tools/rust/gnrt_stdlib.py > * replaced usages of the flag -fvisibility-global-new-delete-hidden with > -fvisibility-global-new-delete=force-hidden as the former is now > deprecated. > * disabled the warning -Wnan-infinity-disabled where -ffast-math is > enabled. > * ran third_party/abseil-cpp/generate_def_files.py > * update the Android binary size script to be compatible with the new > ThinLTO file name format introduced in > llvm/llvm-project#78835. > > Bug: 1522774,1523764,1523787,1523808,41496774 > Change-Id: I42916db8001b4f5a76bb989a71e3043900d1dc3d > Disable-Rts: True > Cq-Include-Trybots: chromium/try:chromeos-amd64-generic-cfi-thin-lto-rel > Cq-Include-Trybots: chromium/try:dawn-win10-x86-deps-rel > Cq-Include-Trybots: chromium/try:lacros-arm64-generic-rel > Cq-Include-Trybots: chromium/try:linux-chromeos-dbg > Cq-Include-Trybots: chromium/try:linux_chromium_cfi_rel_ng > Cq-Include-Trybots: chromium/try:linux_chromium_chromeos_msan_rel_ng > Cq-Include-Trybots: chromium/try:linux_chromium_msan_rel_ng > Cq-Include-Trybots: chromium/try:mac11-arm64-rel,mac_chromium_asan_rel_ng > Cq-Include-Trybots: chromium/try:ios-catalyst,win-asan,android-official > Cq-Include-Trybots: chromium/try:fuchsia-arm64-cast-receiver-rel > Cq-Include-Trybots: chromium/try:mac-official,linux-official > Cq-Include-Trybots: chromium/try:win-official,win32-official > Cq-Include-Trybots: chromium/try:linux-swangle-try-x64,win-swangle-try-x86 > Cq-Include-Trybots: chromium/try:android-cronet-mainline-clang-arm64-dbg > Cq-Include-Trybots: chromium/try:android-cronet-mainline-clang-arm64-rel > Cq-Include-Trybots: chromium/try:android-cronet-mainline-clang-x86-dbg > Cq-Include-Trybots: chromium/try:android-cronet-mainline-clang-x86-rel > Cq-Include-Trybots: chromium/try:android-cronet-riscv64-dbg > Cq-Include-Trybots: chromium/try:android-cronet-riscv64-rel > Cq-Include-Trybots: chrome/try:ipad-device > Cq-Include-Trybots: chrome/try:linux-chromeos-chrome > Cq-Include-Trybots: chrome/try:win-chrome,win64-chrome,linux-chrome,mac-chrome > Cq-Include-Trybots: chrome/try:linux-pgo > Cq-Include-Trybots: chromium/try:android-rust-arm32-rel > Cq-Include-Trybots: chromium/try:android-rust-arm64-dbg > Cq-Include-Trybots: chromium/try:android-rust-arm64-rel > Cq-Include-Trybots: chromium/try:linux-rust-x64-dbg > Cq-Include-Trybots: chromium/try:linux-rust-x64-rel > Cq-Include-Trybots: chromium/try:mac-rust-x64-dbg > Cq-Include-Trybots: chromium/try:win-rust-x64-dbg > Cq-Include-Trybots: chromium/try:win-rust-x64-rel > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5254957 > Reviewed-by: Nico Weber <thakis@chromium.org> > Commit-Queue: Nico Weber <thakis@chromium.org> > Owners-Override: Nico Weber <thakis@chromium.org> > Auto-Submit: Alan Zhao <ayzhao@google.com> > Cr-Commit-Position: refs/heads/main@{#1257358} Bug: 1522774,1523764,1523787,1523808,41496774,324262101 Change-Id: Id25af8252488797e6fb191210559d42f28540e9d Cq-Include-Trybots: chromium/try:chromeos-amd64-generic-cfi-thin-lto-rel Cq-Include-Trybots: chromium/try:dawn-win10-x86-deps-rel Cq-Include-Trybots: chromium/try:lacros-arm64-generic-rel Cq-Include-Trybots: chromium/try:linux-chromeos-dbg Cq-Include-Trybots: chromium/try:linux_chromium_cfi_rel_ng Cq-Include-Trybots: chromium/try:linux_chromium_chromeos_msan_rel_ng Cq-Include-Trybots: chromium/try:linux_chromium_msan_rel_ng Cq-Include-Trybots: chromium/try:mac11-arm64-rel,mac_chromium_asan_rel_ng Cq-Include-Trybots: chromium/try:ios-catalyst,win-asan,android-official Cq-Include-Trybots: chromium/try:fuchsia-arm64-cast-receiver-rel Cq-Include-Trybots: chromium/try:mac-official,linux-official Cq-Include-Trybots: chromium/try:win-official,win32-official Cq-Include-Trybots: chromium/try:linux-swangle-try-x64,win-swangle-try-x86 Cq-Include-Trybots: chromium/try:android-cronet-mainline-clang-arm64-dbg Cq-Include-Trybots: chromium/try:android-cronet-mainline-clang-arm64-rel Cq-Include-Trybots: chromium/try:android-cronet-mainline-clang-x86-dbg Cq-Include-Trybots: chromium/try:android-cronet-mainline-clang-x86-rel Cq-Include-Trybots: chromium/try:android-cronet-riscv64-dbg Cq-Include-Trybots: chromium/try:android-cronet-riscv64-rel Cq-Include-Trybots: chrome/try:ipad-device Cq-Include-Trybots: chrome/try:linux-chromeos-chrome Cq-Include-Trybots: chrome/try:win-chrome,win64-chrome,linux-chrome,mac-chrome Cq-Include-Trybots: chrome/try:linux-pgo Cq-Include-Trybots: chromium/try:android-rust-arm32-rel Cq-Include-Trybots: chromium/try:android-rust-arm64-dbg Cq-Include-Trybots: chromium/try:android-rust-arm64-rel Cq-Include-Trybots: chromium/try:linux-rust-x64-dbg Cq-Include-Trybots: chromium/try:linux-rust-x64-rel Cq-Include-Trybots: chromium/try:mac-rust-x64-dbg Cq-Include-Trybots: chromium/try:win-rust-x64-dbg Cq-Include-Trybots: chromium/try:win-rust-x64-rel No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5278077 Commit-Queue: Nico Weber <thakis@chromium.org> Owners-Override: Nico Weber <thakis@chromium.org> Auto-Submit: Alan Zhao <ayzhao@google.com> Reviewed-by: Nico Weber <thakis@chromium.org> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Cr-Commit-Position: refs/heads/main@{#1257591}
…17-g3f5fcb59-1 / cd6d8f2a04528f827ad3d399581c0f3502b15a72-1 : cdaa12e3dff109f72a5a8a0a67ea225052122a79-1 https://chromium.googlesource.com/external/github.com/llvm/llvm-project/+log/f670112a..3f5fcb59 https://chromium.googlesource.com/external/github.com/rust-lang/rust/+log/cd6d8f2a0452..cdaa12e3dff1 Ran: ./tools/clang/scripts/upload_revision.py 3f5fcb59ae582ebfbe3f23050d90f86a2cb76eb0 Additionally: * ran tools/rust/gnrt_stdlib.py * replaced usages of the flag -fvisibility-global-new-delete-hidden with -fvisibility-global-new-delete=force-hidden as the former is now deprecated. * disabled the warning -Wnan-infinity-disabled where -ffast-math is enabled. * ran third_party/abseil-cpp/generate_def_files.py * update the Android binary size script to be compatible with the new ThinLTO file name format introduced in llvm/llvm-project#78835. Bug: 1522774,1523764,1523787,1523808,41496774 Change-Id: I42916db8001b4f5a76bb989a71e3043900d1dc3d Disable-Rts: True Cq-Include-Trybots: chromium/try:chromeos-amd64-generic-cfi-thin-lto-rel Cq-Include-Trybots: chromium/try:dawn-win10-x86-deps-rel Cq-Include-Trybots: chromium/try:lacros-arm64-generic-rel Cq-Include-Trybots: chromium/try:linux-chromeos-dbg Cq-Include-Trybots: chromium/try:linux_chromium_cfi_rel_ng Cq-Include-Trybots: chromium/try:linux_chromium_chromeos_msan_rel_ng Cq-Include-Trybots: chromium/try:linux_chromium_msan_rel_ng Cq-Include-Trybots: chromium/try:mac11-arm64-rel,mac_chromium_asan_rel_ng Cq-Include-Trybots: chromium/try:ios-catalyst,win-asan,android-official Cq-Include-Trybots: chromium/try:fuchsia-arm64-cast-receiver-rel Cq-Include-Trybots: chromium/try:mac-official,linux-official Cq-Include-Trybots: chromium/try:win-official,win32-official Cq-Include-Trybots: chromium/try:linux-swangle-try-x64,win-swangle-try-x86 Cq-Include-Trybots: chromium/try:android-cronet-mainline-clang-arm64-dbg Cq-Include-Trybots: chromium/try:android-cronet-mainline-clang-arm64-rel Cq-Include-Trybots: chromium/try:android-cronet-mainline-clang-x86-dbg Cq-Include-Trybots: chromium/try:android-cronet-mainline-clang-x86-rel Cq-Include-Trybots: chromium/try:android-cronet-riscv64-dbg Cq-Include-Trybots: chromium/try:android-cronet-riscv64-rel Cq-Include-Trybots: chrome/try:ipad-device Cq-Include-Trybots: chrome/try:linux-chromeos-chrome Cq-Include-Trybots: chrome/try:win-chrome,win64-chrome,linux-chrome,mac-chrome Cq-Include-Trybots: chrome/try:linux-pgo Cq-Include-Trybots: chromium/try:android-rust-arm32-rel Cq-Include-Trybots: chromium/try:android-rust-arm64-dbg Cq-Include-Trybots: chromium/try:android-rust-arm64-rel Cq-Include-Trybots: chromium/try:linux-rust-x64-dbg Cq-Include-Trybots: chromium/try:linux-rust-x64-rel Cq-Include-Trybots: chromium/try:mac-rust-x64-dbg Cq-Include-Trybots: chromium/try:win-rust-x64-dbg Cq-Include-Trybots: chromium/try:win-rust-x64-rel Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5254957 Reviewed-by: Nico Weber <thakis@chromium.org> Commit-Queue: Nico Weber <thakis@chromium.org> Owners-Override: Nico Weber <thakis@chromium.org> Auto-Submit: Alan Zhao <ayzhao@google.com> Cr-Commit-Position: refs/heads/main@{#1257358} NOKEYCHECK=True GitOrigin-RevId: ebbab76f116bb0afd91881b1640e834f69540fd1
…9-init-817-g3f5fcb59-1 / cd6d8f2a04528f827ad3d399581c0f3502b15a72-1 : cdaa12e3dff109f72a5a8a0a67ea225052122a79-1" This reverts commit ebbab76f116bb0afd91881b1640e834f69540fd1. Reason for revert: causes https://crbug.com/324262101 Original change's description: > Roll clang+rust llvmorg-18-init-17730-gf670112a-1 : llvmorg-19-init-817-g3f5fcb59-1 / cd6d8f2a04528f827ad3d399581c0f3502b15a72-1 : cdaa12e3dff109f72a5a8a0a67ea225052122a79-1 > > https://chromium.googlesource.com/external/github.com/llvm/llvm-project/+log/f670112a..3f5fcb59 > > https://chromium.googlesource.com/external/github.com/rust-lang/rust/+log/cd6d8f2a0452..cdaa12e3dff1 > > Ran: ./tools/clang/scripts/upload_revision.py 3f5fcb59ae582ebfbe3f23050d90f86a2cb76eb0 > > Additionally: > > * ran tools/rust/gnrt_stdlib.py > * replaced usages of the flag -fvisibility-global-new-delete-hidden with > -fvisibility-global-new-delete=force-hidden as the former is now > deprecated. > * disabled the warning -Wnan-infinity-disabled where -ffast-math is > enabled. > * ran third_party/abseil-cpp/generate_def_files.py > * update the Android binary size script to be compatible with the new > ThinLTO file name format introduced in > llvm/llvm-project#78835. > > Bug: 1522774,1523764,1523787,1523808,41496774 > Change-Id: I42916db8001b4f5a76bb989a71e3043900d1dc3d > Disable-Rts: True > Cq-Include-Trybots: chromium/try:chromeos-amd64-generic-cfi-thin-lto-rel > Cq-Include-Trybots: chromium/try:dawn-win10-x86-deps-rel > Cq-Include-Trybots: chromium/try:lacros-arm64-generic-rel > Cq-Include-Trybots: chromium/try:linux-chromeos-dbg > Cq-Include-Trybots: chromium/try:linux_chromium_cfi_rel_ng > Cq-Include-Trybots: chromium/try:linux_chromium_chromeos_msan_rel_ng > Cq-Include-Trybots: chromium/try:linux_chromium_msan_rel_ng > Cq-Include-Trybots: chromium/try:mac11-arm64-rel,mac_chromium_asan_rel_ng > Cq-Include-Trybots: chromium/try:ios-catalyst,win-asan,android-official > Cq-Include-Trybots: chromium/try:fuchsia-arm64-cast-receiver-rel > Cq-Include-Trybots: chromium/try:mac-official,linux-official > Cq-Include-Trybots: chromium/try:win-official,win32-official > Cq-Include-Trybots: chromium/try:linux-swangle-try-x64,win-swangle-try-x86 > Cq-Include-Trybots: chromium/try:android-cronet-mainline-clang-arm64-dbg > Cq-Include-Trybots: chromium/try:android-cronet-mainline-clang-arm64-rel > Cq-Include-Trybots: chromium/try:android-cronet-mainline-clang-x86-dbg > Cq-Include-Trybots: chromium/try:android-cronet-mainline-clang-x86-rel > Cq-Include-Trybots: chromium/try:android-cronet-riscv64-dbg > Cq-Include-Trybots: chromium/try:android-cronet-riscv64-rel > Cq-Include-Trybots: chrome/try:ipad-device > Cq-Include-Trybots: chrome/try:linux-chromeos-chrome > Cq-Include-Trybots: chrome/try:win-chrome,win64-chrome,linux-chrome,mac-chrome > Cq-Include-Trybots: chrome/try:linux-pgo > Cq-Include-Trybots: chromium/try:android-rust-arm32-rel > Cq-Include-Trybots: chromium/try:android-rust-arm64-dbg > Cq-Include-Trybots: chromium/try:android-rust-arm64-rel > Cq-Include-Trybots: chromium/try:linux-rust-x64-dbg > Cq-Include-Trybots: chromium/try:linux-rust-x64-rel > Cq-Include-Trybots: chromium/try:mac-rust-x64-dbg > Cq-Include-Trybots: chromium/try:win-rust-x64-dbg > Cq-Include-Trybots: chromium/try:win-rust-x64-rel > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5254957 > Reviewed-by: Nico Weber <thakis@chromium.org> > Commit-Queue: Nico Weber <thakis@chromium.org> > Owners-Override: Nico Weber <thakis@chromium.org> > Auto-Submit: Alan Zhao <ayzhao@google.com> > Cr-Commit-Position: refs/heads/main@{#1257358} Bug: 1522774,1523764,1523787,1523808,41496774,324262101 Change-Id: Id25af8252488797e6fb191210559d42f28540e9d Cq-Include-Trybots: chromium/try:chromeos-amd64-generic-cfi-thin-lto-rel Cq-Include-Trybots: chromium/try:dawn-win10-x86-deps-rel Cq-Include-Trybots: chromium/try:lacros-arm64-generic-rel Cq-Include-Trybots: chromium/try:linux-chromeos-dbg Cq-Include-Trybots: chromium/try:linux_chromium_cfi_rel_ng Cq-Include-Trybots: chromium/try:linux_chromium_chromeos_msan_rel_ng Cq-Include-Trybots: chromium/try:linux_chromium_msan_rel_ng Cq-Include-Trybots: chromium/try:mac11-arm64-rel,mac_chromium_asan_rel_ng Cq-Include-Trybots: chromium/try:ios-catalyst,win-asan,android-official Cq-Include-Trybots: chromium/try:fuchsia-arm64-cast-receiver-rel Cq-Include-Trybots: chromium/try:mac-official,linux-official Cq-Include-Trybots: chromium/try:win-official,win32-official Cq-Include-Trybots: chromium/try:linux-swangle-try-x64,win-swangle-try-x86 Cq-Include-Trybots: chromium/try:android-cronet-mainline-clang-arm64-dbg Cq-Include-Trybots: chromium/try:android-cronet-mainline-clang-arm64-rel Cq-Include-Trybots: chromium/try:android-cronet-mainline-clang-x86-dbg Cq-Include-Trybots: chromium/try:android-cronet-mainline-clang-x86-rel Cq-Include-Trybots: chromium/try:android-cronet-riscv64-dbg Cq-Include-Trybots: chromium/try:android-cronet-riscv64-rel Cq-Include-Trybots: chrome/try:ipad-device Cq-Include-Trybots: chrome/try:linux-chromeos-chrome Cq-Include-Trybots: chrome/try:win-chrome,win64-chrome,linux-chrome,mac-chrome Cq-Include-Trybots: chrome/try:linux-pgo Cq-Include-Trybots: chromium/try:android-rust-arm32-rel Cq-Include-Trybots: chromium/try:android-rust-arm64-dbg Cq-Include-Trybots: chromium/try:android-rust-arm64-rel Cq-Include-Trybots: chromium/try:linux-rust-x64-dbg Cq-Include-Trybots: chromium/try:linux-rust-x64-rel Cq-Include-Trybots: chromium/try:mac-rust-x64-dbg Cq-Include-Trybots: chromium/try:win-rust-x64-dbg Cq-Include-Trybots: chromium/try:win-rust-x64-rel No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5278077 Commit-Queue: Nico Weber <thakis@chromium.org> Owners-Override: Nico Weber <thakis@chromium.org> Auto-Submit: Alan Zhao <ayzhao@google.com> Reviewed-by: Nico Weber <thakis@chromium.org> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Cr-Commit-Position: refs/heads/main@{#1257591} NOKEYCHECK=True GitOrigin-RevId: b0713f02dc21f7eca9e50554e75ff2c0bb46cf0e
This is a reland of the changes made in https://crrev.com/c/5254957 with an additional fix to _DetectLto(...). A consequence of llvm/llvm-project#78835 is that map files will no longer include the lto cache directory (see maskray@'s comment at https://g-issues.chromium.org/issues/41496774#comment17). This CL updates libsupersize to support that new filename format. Bug: 41496774 Change-Id: I8bc08cd8f54f7b241cd4a0d4f40879e640d03d04 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5277968 Reviewed-by: Andrew Grieve <agrieve@chromium.org> Commit-Queue: Alan Zhao <ayzhao@google.com> Cr-Commit-Position: refs/heads/main@{#1258047}
…17-g3f5fcb59-1 / cd6d8f2a04528f827ad3d399581c0f3502b15a72-1 : cdaa12e3dff109f72a5a8a0a67ea225052122a79-1 https://chromium.googlesource.com/external/github.com/llvm/llvm-project/+log/f670112a..3f5fcb59 https://chromium.googlesource.com/external/github.com/rust-lang/rust/+log/cd6d8f2a0452..cdaa12e3dff1 Ran: ./tools/clang/scripts/upload_revision.py 3f5fcb59ae582ebfbe3f23050d90f86a2cb76eb0 Additionally: * ran tools/rust/gnrt_stdlib.py * replaced usages of the flag -fvisibility-global-new-delete-hidden with -fvisibility-global-new-delete=force-hidden as the former is now deprecated. * disabled the warning -Wnan-infinity-disabled where -ffast-math is enabled. * ran third_party/abseil-cpp/generate_def_files.py * update the Android binary size script to be compatible with the new ThinLTO file name format introduced in llvm/llvm-project#78835. Bug: 1522774,1523764,1523787,1523808,41496774 Change-Id: I42916db8001b4f5a76bb989a71e3043900d1dc3d Disable-Rts: True Cq-Include-Trybots: chromium/try:chromeos-amd64-generic-cfi-thin-lto-rel Cq-Include-Trybots: chromium/try:dawn-win10-x86-deps-rel Cq-Include-Trybots: chromium/try:lacros-arm64-generic-rel Cq-Include-Trybots: chromium/try:linux-chromeos-dbg Cq-Include-Trybots: chromium/try:linux_chromium_cfi_rel_ng Cq-Include-Trybots: chromium/try:linux_chromium_chromeos_msan_rel_ng Cq-Include-Trybots: chromium/try:linux_chromium_msan_rel_ng Cq-Include-Trybots: chromium/try:mac11-arm64-rel,mac_chromium_asan_rel_ng Cq-Include-Trybots: chromium/try:ios-catalyst,win-asan,android-official Cq-Include-Trybots: chromium/try:fuchsia-arm64-cast-receiver-rel Cq-Include-Trybots: chromium/try:mac-official,linux-official Cq-Include-Trybots: chromium/try:win-official,win32-official Cq-Include-Trybots: chromium/try:linux-swangle-try-x64,win-swangle-try-x86 Cq-Include-Trybots: chromium/try:android-cronet-mainline-clang-arm64-dbg Cq-Include-Trybots: chromium/try:android-cronet-mainline-clang-arm64-rel Cq-Include-Trybots: chromium/try:android-cronet-mainline-clang-x86-dbg Cq-Include-Trybots: chromium/try:android-cronet-mainline-clang-x86-rel Cq-Include-Trybots: chromium/try:android-cronet-riscv64-dbg Cq-Include-Trybots: chromium/try:android-cronet-riscv64-rel Cq-Include-Trybots: chrome/try:ipad-device Cq-Include-Trybots: chrome/try:linux-chromeos-chrome Cq-Include-Trybots: chrome/try:win-chrome,win64-chrome,linux-chrome,mac-chrome Cq-Include-Trybots: chrome/try:linux-pgo Cq-Include-Trybots: chromium/try:android-rust-arm32-rel Cq-Include-Trybots: chromium/try:android-rust-arm64-dbg Cq-Include-Trybots: chromium/try:android-rust-arm64-rel Cq-Include-Trybots: chromium/try:linux-rust-x64-dbg Cq-Include-Trybots: chromium/try:linux-rust-x64-rel Cq-Include-Trybots: chromium/try:mac-rust-x64-dbg Cq-Include-Trybots: chromium/try:win-rust-x64-dbg Cq-Include-Trybots: chromium/try:win-rust-x64-rel Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5254957 Reviewed-by: Nico Weber <thakis@chromium.org> Commit-Queue: Nico Weber <thakis@chromium.org> Owners-Override: Nico Weber <thakis@chromium.org> Auto-Submit: Alan Zhao <ayzhao@google.com> Cr-Commit-Position: refs/heads/main@{#1257358} NOKEYCHECK=True GitOrigin-RevId: ebbab76f116bb0afd91881b1640e834f69540fd1
…9-init-817-g3f5fcb59-1 / cd6d8f2a04528f827ad3d399581c0f3502b15a72-1 : cdaa12e3dff109f72a5a8a0a67ea225052122a79-1" This reverts commit ebbab76f116bb0afd91881b1640e834f69540fd1. Reason for revert: causes https://crbug.com/324262101 Original change's description: > Roll clang+rust llvmorg-18-init-17730-gf670112a-1 : llvmorg-19-init-817-g3f5fcb59-1 / cd6d8f2a04528f827ad3d399581c0f3502b15a72-1 : cdaa12e3dff109f72a5a8a0a67ea225052122a79-1 > > https://chromium.googlesource.com/external/github.com/llvm/llvm-project/+log/f670112a..3f5fcb59 > > https://chromium.googlesource.com/external/github.com/rust-lang/rust/+log/cd6d8f2a0452..cdaa12e3dff1 > > Ran: ./tools/clang/scripts/upload_revision.py 3f5fcb59ae582ebfbe3f23050d90f86a2cb76eb0 > > Additionally: > > * ran tools/rust/gnrt_stdlib.py > * replaced usages of the flag -fvisibility-global-new-delete-hidden with > -fvisibility-global-new-delete=force-hidden as the former is now > deprecated. > * disabled the warning -Wnan-infinity-disabled where -ffast-math is > enabled. > * ran third_party/abseil-cpp/generate_def_files.py > * update the Android binary size script to be compatible with the new > ThinLTO file name format introduced in > llvm/llvm-project#78835. > > Bug: 1522774,1523764,1523787,1523808,41496774 > Change-Id: I42916db8001b4f5a76bb989a71e3043900d1dc3d > Disable-Rts: True > Cq-Include-Trybots: chromium/try:chromeos-amd64-generic-cfi-thin-lto-rel > Cq-Include-Trybots: chromium/try:dawn-win10-x86-deps-rel > Cq-Include-Trybots: chromium/try:lacros-arm64-generic-rel > Cq-Include-Trybots: chromium/try:linux-chromeos-dbg > Cq-Include-Trybots: chromium/try:linux_chromium_cfi_rel_ng > Cq-Include-Trybots: chromium/try:linux_chromium_chromeos_msan_rel_ng > Cq-Include-Trybots: chromium/try:linux_chromium_msan_rel_ng > Cq-Include-Trybots: chromium/try:mac11-arm64-rel,mac_chromium_asan_rel_ng > Cq-Include-Trybots: chromium/try:ios-catalyst,win-asan,android-official > Cq-Include-Trybots: chromium/try:fuchsia-arm64-cast-receiver-rel > Cq-Include-Trybots: chromium/try:mac-official,linux-official > Cq-Include-Trybots: chromium/try:win-official,win32-official > Cq-Include-Trybots: chromium/try:linux-swangle-try-x64,win-swangle-try-x86 > Cq-Include-Trybots: chromium/try:android-cronet-mainline-clang-arm64-dbg > Cq-Include-Trybots: chromium/try:android-cronet-mainline-clang-arm64-rel > Cq-Include-Trybots: chromium/try:android-cronet-mainline-clang-x86-dbg > Cq-Include-Trybots: chromium/try:android-cronet-mainline-clang-x86-rel > Cq-Include-Trybots: chromium/try:android-cronet-riscv64-dbg > Cq-Include-Trybots: chromium/try:android-cronet-riscv64-rel > Cq-Include-Trybots: chrome/try:ipad-device > Cq-Include-Trybots: chrome/try:linux-chromeos-chrome > Cq-Include-Trybots: chrome/try:win-chrome,win64-chrome,linux-chrome,mac-chrome > Cq-Include-Trybots: chrome/try:linux-pgo > Cq-Include-Trybots: chromium/try:android-rust-arm32-rel > Cq-Include-Trybots: chromium/try:android-rust-arm64-dbg > Cq-Include-Trybots: chromium/try:android-rust-arm64-rel > Cq-Include-Trybots: chromium/try:linux-rust-x64-dbg > Cq-Include-Trybots: chromium/try:linux-rust-x64-rel > Cq-Include-Trybots: chromium/try:mac-rust-x64-dbg > Cq-Include-Trybots: chromium/try:win-rust-x64-dbg > Cq-Include-Trybots: chromium/try:win-rust-x64-rel > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5254957 > Reviewed-by: Nico Weber <thakis@chromium.org> > Commit-Queue: Nico Weber <thakis@chromium.org> > Owners-Override: Nico Weber <thakis@chromium.org> > Auto-Submit: Alan Zhao <ayzhao@google.com> > Cr-Commit-Position: refs/heads/main@{#1257358} Bug: 1522774,1523764,1523787,1523808,41496774,324262101 Change-Id: Id25af8252488797e6fb191210559d42f28540e9d Cq-Include-Trybots: chromium/try:chromeos-amd64-generic-cfi-thin-lto-rel Cq-Include-Trybots: chromium/try:dawn-win10-x86-deps-rel Cq-Include-Trybots: chromium/try:lacros-arm64-generic-rel Cq-Include-Trybots: chromium/try:linux-chromeos-dbg Cq-Include-Trybots: chromium/try:linux_chromium_cfi_rel_ng Cq-Include-Trybots: chromium/try:linux_chromium_chromeos_msan_rel_ng Cq-Include-Trybots: chromium/try:linux_chromium_msan_rel_ng Cq-Include-Trybots: chromium/try:mac11-arm64-rel,mac_chromium_asan_rel_ng Cq-Include-Trybots: chromium/try:ios-catalyst,win-asan,android-official Cq-Include-Trybots: chromium/try:fuchsia-arm64-cast-receiver-rel Cq-Include-Trybots: chromium/try:mac-official,linux-official Cq-Include-Trybots: chromium/try:win-official,win32-official Cq-Include-Trybots: chromium/try:linux-swangle-try-x64,win-swangle-try-x86 Cq-Include-Trybots: chromium/try:android-cronet-mainline-clang-arm64-dbg Cq-Include-Trybots: chromium/try:android-cronet-mainline-clang-arm64-rel Cq-Include-Trybots: chromium/try:android-cronet-mainline-clang-x86-dbg Cq-Include-Trybots: chromium/try:android-cronet-mainline-clang-x86-rel Cq-Include-Trybots: chromium/try:android-cronet-riscv64-dbg Cq-Include-Trybots: chromium/try:android-cronet-riscv64-rel Cq-Include-Trybots: chrome/try:ipad-device Cq-Include-Trybots: chrome/try:linux-chromeos-chrome Cq-Include-Trybots: chrome/try:win-chrome,win64-chrome,linux-chrome,mac-chrome Cq-Include-Trybots: chrome/try:linux-pgo Cq-Include-Trybots: chromium/try:android-rust-arm32-rel Cq-Include-Trybots: chromium/try:android-rust-arm64-dbg Cq-Include-Trybots: chromium/try:android-rust-arm64-rel Cq-Include-Trybots: chromium/try:linux-rust-x64-dbg Cq-Include-Trybots: chromium/try:linux-rust-x64-rel Cq-Include-Trybots: chromium/try:mac-rust-x64-dbg Cq-Include-Trybots: chromium/try:win-rust-x64-dbg Cq-Include-Trybots: chromium/try:win-rust-x64-rel No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5278077 Commit-Queue: Nico Weber <thakis@chromium.org> Owners-Override: Nico Weber <thakis@chromium.org> Auto-Submit: Alan Zhao <ayzhao@google.com> Reviewed-by: Nico Weber <thakis@chromium.org> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Cr-Commit-Position: refs/heads/main@{#1257591} NOKEYCHECK=True GitOrigin-RevId: b0713f02dc21f7eca9e50554e75ff2c0bb46cf0e
Port COFF's https://reviews.llvm.org/D78221 and
https://reviews.llvm.org/D137217 to ELF. For the in-process ThinLTO
link,
ld.lld --save-temps a.o d/b.o -o out
will createELF relocatable files
out.lto.a.o
/d/out.lto.b.o
instead ofout1.lto.o
/out2.lto.o
. Deriving the LTO-generated relocatable filename from bitcode file names helps debugging.
The relocatable file name from the first regular LTO partition does not
change:
out.lto.o
. The second, if present due to--lto-partition=
,changes from
out1.lto.o
tolto.1.o
.For an archive member, e.g.
d/a.a(coll.o at 8)
,the relocatable file is
d/out.lto.a.a(coll.o at 8).o
.--lto-emit-asm
file names are changed similarly.--lto-emit-asm -o out
now createsout.lto.s
instead ofout
, therefore the--lto-emit-asm -o -
idiom no longer works. However, I think this newbehavior (which matches COFF) is better since keeping or removing
--lto-emit-asm
will dump different files, instead of overwriting the-o
output file from an executable/shared object to an assembly file.