Dav1d: compilation error when disabling jemalloc

RESOLVED FIXED in Firefox 67

Status

()

defect
P2
normal
Rank:
15
RESOLVED FIXED
6 months ago
6 months ago

People

(Reporter: jya, Assigned: achronop)

Tracking

unspecified
mozilla67
Unspecified
Windows
Points:
---

Firefox Tracking Flags

(firefox67 fixed)

Details

Attachments

(1 attachment)

this is my mozconfig:


mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../obj-ff-dbg

ac_add_options --target=x86_64-pc-mingw32
ac_add_options --host=x86_64-pc-mingw32

#ac_add_options --enable-debug
ac_add_options --enable-debug-symbols
ac_add_options --enable-eme=widevine
ac_add_options --enable-rust-debug

#disable jemalloc for debugging memory overwrite
ac_add_options --disable-jemalloc

ac_add_options --disable-launcher-process

#remove if too slow
ac_add_options --disable-optimize

mk_add_options 'export CARGO_INCREMENTAL=1'

export CC="/c/Users/jyavenard/.mozbuild/clang/bin/clang-cl.exe"
export CXX="/c/Users/jyavenard/.mozbuild/clang/bin/clang-cl.exe"
export LINKER=lld-link


When disabling jemalloc (required for asan build), dav1d compilation with fail with:

10:54.05 toolkit/library/xul.dll
10:56.88 lld-link.exe: error: undefined symbol: posix_memalign
10:56.88 >>> referenced by c:\Users\jyavenard\Work\Mozilla\mozilla-central\third_party\dav1d\include\common\mem.h:46
10:56.88 >>> ....\media\libdav1d\decode.obj:(dav1d_alloc_aligned)
10:56.88 lld-link.exe: error: undefined symbol: posix_memalign
10:56.88 >>> referenced by c:\Users\jyavenard\Work\Mozilla\mozilla-central\third_party\dav1d\include\common\mem.h:46
10:56.88 >>> ....\media\libdav1d\lib.obj:(dav1d_alloc_aligned)
10:56.88 lld-link.exe: error: undefined symbol: posix_memalign
10:56.88 >>> referenced by c:\Users\jyavenard\Work\Mozilla\mozilla-central\third_party\dav1d\include\common\mem.h:46
10:56.88 >>> ....\media\libdav1d\picture.obj:(dav1d_alloc_aligned)
10:56.89 lld-link.exe: error: undefined symbol: posix_memalign
10:56.89 >>> referenced by c:\Users\jyavenard\Work\Mozilla\mozilla-central\third_party\dav1d\include\common\mem.h:46
10:56.89 >>> ....\media\libdav1d\ref.obj:(dav1d_alloc_aligned)
10:57.15 mozmake.EXE[4]: *** [c:/Users/jyavenard/Work/Mozilla/mozilla-central/config/rules.mk:690: xul.dll] Error 1
10:57.15 mozmake.EXE[3]: *** [c:/Users/jyavenard/Work/Mozilla/mozilla-central/config/recurse.mk:74: toolkit/library/target] Error 2
10:57.16 mozmake.EXE[2]: *** [c:/Users/jyavenard/Work/Mozilla/mozilla-central/config/recurse.mk:34: compile] Error 2
10:57.17 mozmake.EXE[1]: *** [c:/Users/jyavenard/Work/Mozilla/mozilla-central/config/rules.mk:415: default] Error 2
10:57.18 mozmake.EXE: *** [client.mk:125: build] Error 2
10:57.22 291 compiler warnings present.

Could you please try with the following patch on [1]. Building on Windows locally lasts ~75 mins and I am using it today ...

[1] https://hg.mozilla.org/try/raw-rev/39761ebe0bccaf2c5f0c8c3ada48d9511c39222f

Rank: 15
Priority: -- → P2

The problem here is that HAVE_ALIGNED_MALLOC should have been defined instead of HAVE_POSIX_MEMALIGN. I have verified that on a local build using the patch in comment 1.

Discussing this issue on IRC with jya, I found out that those macros are set globally and it is better to avoid redefining in a library configuration file. However, HAVE_ALIGNED_MALLOC is not set at all in global macros. I have created a patch to add it there. Patch gives me a green try [1] and solves this issue.

[1] https://treeherder.mozilla.org/#/jobs?repo=try&revision=a19e2ff6a986a332d1347aa3dd07e596bf049318

Pushed by achronopoulos@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ea623b660dc6
Set HAVE_ALIGNED_MALLOC as global macro and avoid redefining in libdav1d. r=firefox-build-system-reviewers,mshal
Status: NEW → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
Assignee: nobody → achronop
You need to log in before you can comment on or make changes to this bug.