Issue 75441
Summary Distributed thinlto `Error loading imported file` return 0
Labels new issue
Assignees
Reporter zcfh
    #problem
The following script can reproduce the scenario I mentioned. When using `-fthinlto-index` to optimization, if the dependent file cannot be found, only an error will be output, and the return value will still be 0, making it impossible to determine whether an error occurred.
# script
```shell
project=tmp_thinlto_test
# mkdir -p $project
# cd $project

main_str='int lib_func(int val);
int main(int argc, char **argv) {
  return lib_func(1);
}
'

lib_str='int lib_func(int val) {
  return val + 123;
}
'

echo "$main_str" > file1.cc
echo "$lib_str" > file2.cc


set -x
pwd
clang++ -c file1.cc file2.cc -O2 -g -flto=thin
clang++ -flto=thin -fuse-ld=lld -Wl,--thinlto-emit-imports-files,--thinlto-index-only -O2 file1.o file2.o

# file1.o dep file2.o
rm file2.o
clang++ -O2 -o file1.native.o -x ir file1.o -c -fthinlto-index=./file1.o.thinlto.bc


echo "return code $?"
```

_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to