Fails to build with Clang 17: clang++ -print-search-dirs should not be used to search for libclang.so
Categories
(Firefox Build System :: General, defect)
Tracking
(Not tracked)
People
(Reporter: stransky, Assigned: sergesanspaille)
Details
Attachments
(1 file)
See https://bugzilla.redhat.com/show_bug.cgi?id=2239046
Firefox 117.0.1 fails to build with clang 17 due to changes how -print-search-dirs is printed.
print-search-dirs is internal clang tool and should not be used for system wide library scan.
Comment 1•3 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Firefox Build System::Toolchains' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
| Assignee | ||
Comment 2•2 years ago
|
||
Basically relying on llvm-config --libdir instead of clang -print-search-dirs
Updated•2 years ago
|
| Assignee | ||
Comment 3•2 years ago
•
|
||
Martin, can you confirm that the attached patch fixes the issue in your setup?
| Reporter | ||
Comment 4•2 years ago
|
||
Yes, I'll look at it. Thanks!
| Reporter | ||
Comment 5•2 years ago
|
||
The patch works for Fedora. But right now we use hardcoded with-libclang-path .mozbuild option:
ac_add_options --with-libclang-path=`llvm-config --libdir`
Updated•2 years ago
|
Comment 6•2 years ago
|
||
FYI I've encountered this with the current m-c. Build fails with cbindgen complaining that it can't find libclang.so and adding the option in comment 5 to my .mozconfig fixes the issue. No changes to my box, I just pull the latest m-c and it doesn't work anymore (it used to with a pull from last Friday).
Comment 7•2 years ago
|
||
(In reply to Gabriele Svelto [:gsvelto] from comment #6)
FYI I've encountered this with the current m-c. Build fails with cbindgen complaining that it can't find libclang.so and adding the option in comment 5 to my .mozconfig fixes the issue. No changes to my box, I just pull the latest m-c and it doesn't work anymore (it used to with a pull from last Friday).
what does your configure output look like?
Comment 8•2 years ago
|
||
I've re-tested today removing the change from comment 5 and got this error:
0:08.32 checking for libclang for bindgen... Trying "libclang.so" in "/home/gsvelto/.mozbuild/clang/lib"
0:08.32 Trying "libclang.so.*" in "/home/gsvelto/.mozbuild/clang/lib"
0:08.33 not found
0:08.33 ERROR: Could not find libclang to generate rust bindings for C/C++. Please install the necessary packages, run `mach bootstrap`, or use --with-libclang-path to give the path containing it.
I had run ./mach bootstrap just before running the configure step again. I looked into /home/gsvelto/.mozbuild/clang/lib and indeed there was no libclang.so there. So I removed the /home/gsvelto/.mozbuild/clang folder again, and now everything works! libclang.so is where the build system expects it to be. I'm unsure what happened, maybe bootstrap hadn't updated my clang somehow?
Description
•