[PATCH] D105223: [lld-macho] Add support for LTO optimization level

Leonard Grey via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 30 12:53:28 PDT 2021


lgrey added inline comments.


================
Comment at: lld/MachO/Config.h:129
   llvm::StringRef thinLTOJobs;
+  uint32_t ltoo = 2;
   bool deadStripDylibs = false;
----------------
thakis wrote:
> Is this the same default ld64 seems to use?
AFAICT, it doesn't optimize.

```
$ cat opt_check.c
void foo() {
    return;
}

int main(int argc, char** argv) {
    foo();
    return 0;
}
$ clang -flto=thin opt_check.c && nm -pa a.out
0000000100003f80 t _foo
0000000100000000 T __mh_execute_header
0000000100003f90 T _main
                 U dyld_stub_binder
```

Should we change it to 0 for compat?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105223/new/

https://reviews.llvm.org/D105223



More information about the llvm-commits mailing list