-
Notifications
You must be signed in to change notification settings - Fork 14.5k
Description
While building chromium with lld_emit_indexes_and_imports=true
(That's converted into -Wl,--thinlto-emit-index-files
), I'm getting
ld.lld: error: cannot open obj/third_party/rust/serde_json_lenient/v0_2/wrapper/libthird_uparty_srust_sserde_ujson_ulenient_sv0_u2_swrapper_cwrapper.rlib(libthird_uparty_srust_sserde_ujson_ulenient_sv0_u2_swrapper_cw
rapper.third_uparty_srust_sserde_ujson_ulenient_sv0_u2_swrapper_cwrapper.6e3eaf7b964e238a-cgu.0.rcgu.o at 67896).thinlto.bc: File name too long
On my linux with BTRFS. This is due to (1) The name mangling mechanism in Chromium: https://source.chromium.org/chromium/chromium/src/+/main:build/rust/rust_target.gni;l=44;drc=15d204f8bf5cc292f592792948823a2bbd77d82c and (2) Lack of handling of files with long filenames in LLVM:
llvm-project/llvm/lib/LTO/LTO.cpp
Lines 1402 to 1405 in 665299e
raw_fd_ostream OS(NewModulePath + ".thinlto.bc", EC, | |
sys::fs::OpenFlags::OF_None); | |
if (EC) | |
return createFileError("cannot open " + NewModulePath + ".thinlto.bc", EC); |
I've created an issue on Chromium's issue tracker and fix proposals in a CL there. But we are wondering if it'd be possible to change code in LLVM's side in a way that it creates shorter file names in the first place. Please see the discussion in the issue tracker on Chromium further information.