Closed Bug 1790482 Opened 3 years ago Closed 3 years ago

wasm-ld error: comparetf2.c.obj: Bad relocation type:

Categories

(Firefox Build System :: General, defect)

defect

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: yizh.zhai, Unassigned)

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.2 Safari/605.1.15

Steps to reproduce:

I applied a research sanitizers for clang to build the Firefox and met the following error:
wasm-ld: error: comparetf2.c.obj: Bad relocation type:
clang-10: error: linker command failed with exit code 1 (use -v to see invocation)

The command is :
$CLANGXX -std=gnu++17 -v --target=wasm32-wasi --sysroot=/home/yzhai003/.mozbuild/sysroot-wasm32-wasi -o rlbox.wasm -Wl,--export-all -Wl,--stack-first -Wl,-z,stack-size=262144 -Wl,--no-entry -Wl,--growable-table ogg_alloc.wasm ogg_bitwise.wasm ogg_framing.wasm xmlparse.wasm xmlrole.wasm xmltok.wasm wasm2c_sandbox_wrapper.wasm mozHunspellRLBoxSandbox.wasm affentry.wasm affixmgr.wasm csutil.wasm hashmgr.wasm hunspell.wasm phonet.wasm replist.wasm suggestmgr.wasm GraphiteExtra.wasm CmapCache.wasm Code.wasm Collider.wasm Decompressor.wasm Face.wasm FeatureMap.wasm FileFace.wasm Font.wasm GlyphCache.wasm GlyphFace.wasm Intervals.wasm Justifier.wasm NameTable.wasm Pass.wasm Position.wasm Segment.wasm Silf.wasm Slot.wasm Sparse.wasm TtfUtil.wasm UtfCodec.wasm call_machine.wasm gr_char_info.wasm gr_face.wasm gr_features.wasm gr_font.wasm gr_logging.wasm gr_segment.wasm gr_slot.wasm json.wasm RLBoxWOFF2Sandbox.wasm table_tags.wasm variable_length.wasm woff2_common.wasm woff2_dec.wasm woff2_out.wasm -lwasi-emulated-process-clocks

The Bugbug bot thinks this bug should belong to the 'Firefox Build System::General' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → General
Product: Firefox → Firefox Build System

It looks like you're using clang-10, and that appears be too old. I think we bootstrap clang-14. It should work if you upgrade to that.

(In reply to Alex Hochheiden [:ahochheiden] from comment #2)

It looks like you're using clang-10, and that appears be too old. I think we bootstrap clang-14. It should work if you upgrade to that.
It builds smoothly without the sanitizer, based on this, is it still the version problem?

Yes, I think the clang version is still the problem.

(In reply to Alex Hochheiden [:ahochheiden] from comment #4)

Yes, I think the clang version is still the problem.

Thanks, I can try llvm14 then, but there are llvm 14, 14.0.1, 14.0.2, 14.0.3, 14.0.4, 14.0.5 and 14.0.6, which one are more recommended?

./mach boostrap downloads the version of clang we expect. It should be in ~/.mozbuild/clang.

(In reply to Alex Hochheiden [:ahochheiden] from comment #6)

./mach boostrap downloads the version of clang we expect. It should be in ~/.mozbuild/clang.

It looks like this in my machine, I would try 14.0.5then.

$ .mozbuild/clang/bin/clang --version
clang version 14.0.5 (taskcluster-SA_bYfBKQtmPx_DeJfE8gA)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: ~/.mozbuild/clang/bin

this isn't a bug on our side, please use the clang provided by mach bootstrap

Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Resolution: --- → INVALID

(In reply to Alex Hochheiden [:ahochheiden] from comment #6)

./mach boostrap downloads the version of clang we expect. It should be in ~/.mozbuild/clang.

Have you released the source code of your bootstrapped clang?

(In reply to Sylvestre Ledru [:Sylvestre] from comment #10)

Same as upstream with a few patches
https://searchfox.org/mozilla-central/source/build/build-clang

Thank you so much!

welcome, a few of Firefox devs are also contributing to clang

You need to log in before you can comment on or make changes to this bug.