Skip to content
Snippets Groups Projects
Forked from Glasgow Haskell Compiler / GHC
Source project has a limited visibility.
  • Cheng Shao's avatar
    7eea38c8
    driver: fix wasm backend sysroot lookup logic when -flto is passed · 7eea38c8
    Cheng Shao authored and Marge Bot's avatar Marge Bot committed
    For the wasm target, the driver calls `wasm32-wasi-clang
    --print-search-dirs` and finds the sysroot directory that contains
    libc.so etc, then passes the directory path to dyld. However, when GHC
    is configured with -flto as a part of C/C++ compiler flags, the clang
    driver would insert a llvm-lto specific directory in the
    --print-search-dirs output and the driver didn't take that into
    account. This patch fixes it and always selects the non-lto sysroot
    directory to be passed to dyld. This is one small step towards
    supporting building all cbits with lto for wasm.
    7eea38c8
    History
    driver: fix wasm backend sysroot lookup logic when -flto is passed
    Cheng Shao authored and Marge Bot's avatar Marge Bot committed
    For the wasm target, the driver calls `wasm32-wasi-clang
    --print-search-dirs` and finds the sysroot directory that contains
    libc.so etc, then passes the directory path to dyld. However, when GHC
    is configured with -flto as a part of C/C++ compiler flags, the clang
    driver would insert a llvm-lto specific directory in the
    --print-search-dirs output and the driver didn't take that into
    account. This patch fixes it and always selects the non-lto sysroot
    directory to be passed to dyld. This is one small step towards
    supporting building all cbits with lto for wasm.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.