Closed Bug 1104634 Opened 10 years ago Closed 10 years ago

jemalloc.o:jemalloc.c:function malloc_rtree_new: error: undefined reference to 'ffs'

Categories

(Core :: Memory Allocator, defect)

All
Android
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla37

People

(Reporter: glandium, Assigned: glandium)

References

(Depends on 1 open bug)

Details

Attachments

(1 file)

Bug 965870 fixed it for jemalloc, but not mozjemalloc. +++ This bug was initially created as a clone of Bug #965870 +++ I am unable to build Fennec with NDK toolchain r8e and r9 on Mac OS X. I will try r8c shortly. I see some old concern about ffs being available on Android (http://cphacker0901.wordpress.com/1900/09/25/build-alsa-with-androids-tool-chain/). Log: 11:01.45 libmozglue_android.a.desc 11:01.52 libmozglue.so 11:01.60 Executing: /usr/local/Cellar/android-ndk/r8e/toolchains/x86-4.7/prebuilt/darwin-x86/bin/i686-linux-android-g++ -idirafter /usr/local/Cellar/android-ndk/r8e/platforms/android-9/arch-x86/usr/include -Wall -Wpointer-arith -Woverloaded-virtual -Werror=return-type -Werror=int-to-pointer-cast -Wtype-limits -Wempty-body -Wsign-compare -Wno-invalid-offsetof -Wcast-align -mandroid -fno-short-enums -fno-exceptions -Wno-psabi -isystem ../../../build/stlport/stlport -isystem /usr/local/Cellar/android-ndk/r8e/sources/cxx-stl/system/include -fno-exceptions -fno-strict-aliasing -fno-rtti -fno-exceptions -fno-math-errno -std=gnu++0x -pipe -DNDEBUG -DTRIMMED -fno-omit-frame-pointer -funwind-tables -fPIC -shared -Wl,-z,defs -Wl,-h,libmozglue.so -o libmozglue.so /Users/nalexander/Mozilla/gecko/objdir-x86/mozglue/build/tmp2KXkM4.list -mandroid -L/usr/local/Cellar/android-ndk/r8e/platforms/android-9/arch-x86/usr/lib -Wl,-rpath-link=/usr/local/Cellar/android-ndk/r8e/platforms/android-9/arch-x86/usr/lib --sysroot=/usr/local/Cellar/android-ndk/r8e/platforms/android-9/arch-x86 -llog -Wl,--allow-shlib-undefined -Wl,-z,noexecstack -Wl,-z,text -Wl,--build-id -Wl,-rpath-link,/Users/nalexander/Mozilla/gecko/objdir-x86/dist/bin -Wl,-rpath-link,/usr/local/lib -Wl,--wrap=PR_GetEnv,--wrap=PR_SetEnv -Wl,--wrap=fork,--wrap=pthread_atfork,--wrap=raise -Wl,--wrap=memccpy,--wrap=memchr,--wrap=memrchr,--wrap=memcmp,--wrap=memcpy,--wrap=memmove,--wrap=memset,--wrap=memmem,--wrap=memswap,--wrap=index,--wrap=strchr,--wrap=strrchr,--wrap=strlen,--wrap=strcmp,--wrap=strcpy,--wrap=strcat,--wrap=strcasecmp,--wrap=strncasecmp,--wrap=strstr,--wrap=strcasestr,--wrap=strtok,--wrap=strtok_r,--wrap=strerror,--wrap=strerror_r,--wrap=strnlen,--wrap=strncat,--wrap=strncmp,--wrap=strncpy,--wrap=strlcat,--wrap=strlcpy,--wrap=strcspn,--wrap=strpbrk,--wrap=strsep,--wrap=strspn,--wrap=strcoll,--wrap=strxfrm -Wl,--wrap=malloc,--wrap=calloc,--wrap=valloc,--wrap=free,--wrap=realloc,--wrap=memalign -Wl,--wrap=__builtin_new,--wrap=__builtin_vec_new,--wrap=__builtin_delete,--wrap=__builtin_vec_delete -Wl,--wrap=strdup,--wrap=strndup -Wl,--wrap=vasprintf,--wrap=asprintf -Wl,--wrap=posix_memalign,--wrap=malloc_usable_size -Wl,--wrap=_Znwj,--wrap=_Znaj,--wrap=_ZdlPv,--wrap=_ZdaPv -Wl,--wrap=_ZnwjRKSt9nothrow_t,--wrap=_ZnajRKSt9nothrow_t,--wrap=_ZdlPvRKSt9nothrow_t,--wrap=_ZdaPvRKSt9nothrow_t -lz -Wl,--wrap=pthread_atfork ../../build/stlport/libstlport_static.a -static-libstdc++ 11:01.60 /Users/nalexander/Mozilla/gecko/objdir-x86/mozglue/build/tmp2KXkM4.list: 11:01.60 INPUT("BionicGlue.o") 11:01.60 INPUT("SSE.o") 11:01.60 INPUT("../../memory/build/jemalloc_config.o") 11:01.60 INPUT("../../memory/build/mozmemory_wrap.o") 11:01.60 INPUT("../../memory/mozjemalloc/jemalloc.o") 11:01.60 INPUT("../linker/CustomElf.o") 11:01.60 INPUT("../linker/ElfLoader.o") 11:01.60 INPUT("../linker/Mappable.o") 11:01.60 INPUT("../linker/SeekableZStream.o") 11:01.60 INPUT("../linker/Zip.o") 11:01.60 INPUT("../android/APKOpen.o") 11:01.60 INPUT("../android/nsGeckoUtils.o") 11:01.60 INPUT("../android/NSSBridge.o") 11:01.60 INPUT("../android/SQLiteBridge.o") 11:01.60 INPUT("../../mfbt/Compression.o") 11:01.60 INPUT("../../mfbt/Decimal.o") 11:01.60 INPUT("../../mfbt/FloatingPoint.o") 11:01.60 INPUT("../../mfbt/HashFunctions.o") 11:01.60 INPUT("../../mfbt/Poison.o") 11:01.60 INPUT("../../mfbt/SHA1.o") 11:01.60 INPUT("../../mfbt/bignum-dtoa.o") 11:01.60 INPUT("../../mfbt/bignum.o") 11:01.60 INPUT("../../mfbt/cached-powers.o") 11:01.60 INPUT("../../mfbt/diy-fp.o") 11:01.60 INPUT("../../mfbt/double-conversion.o") 11:01.60 INPUT("../../mfbt/fast-dtoa.o") 11:01.60 INPUT("../../mfbt/fixed-dtoa.o") 11:01.60 INPUT("../../mfbt/strtod.o") 11:01.60 11:01.60 /Users/nalexander/Mozilla/gecko/objdir-x86/mozglue/build/../../memory/mozjemalloc/jemalloc.o:jemalloc.c:function malloc_rtree_new: error: undefined reference to 'ffs' 11:01.60 /Users/nalexander/Mozilla/gecko/objdir-x86/mozglue/build/../../memory/mozjemalloc/jemalloc.o:jemalloc.c:function arena_run_reg_alloc: error: undefined reference to 'ffs' 11:01.60 /Users/nalexander/Mozilla/gecko/objdir-x86/mozglue/build/../../memory/mozjemalloc/jemalloc.o:jemalloc.c:function arena_run_reg_alloc: error: undefined reference to 'ffs' 11:01.60 /Users/nalexander/Mozilla/gecko/objdir-x86/mozglue/build/../../memory/mozjemalloc/jemalloc.o:jemalloc.c:function arena_malloc_small: error: undefined reference to 'ffs' 11:01.60 collect2: error: ld returned 1 exit status 11:01.60 make[5]: *** [libmozglue.so] Error 1 11:01.60 make[4]: *** [mozglue/build/libs] Error 2 11:01.60 make[3]: *** [libs] Error 2 11:01.60 make[2]: *** [default] Error 2 11:01.61 make[1]: *** [realbuild] Error 2 11:01.61 make: *** [build] Error 2 11:01.64 599 compiler warnings present.
The reason for --disable-optimize is to make debugging easier, but not many people actually need a high level of debuggability of the allocator itself. This works around the issue that the Android NDK's definition of ffs is broken when compiling without optimization, while avoiding to add yet another configure test.
Attachment #8529978 - Flags: review?(gps)
Assignee: nobody → mh+mozilla
Status: NEW → ASSIGNED
Comment on attachment 8529978 [details] [diff] [review] Force optimize mozjemalloc on --disable-optimize builds Review of attachment 8529978 [details] [diff] [review]: ----------------------------------------------------------------- ::: memory/mozjemalloc/Makefile.in @@ +3,5 @@ > # License, v. 2.0. If a copy of the MPL was not distributed with this > # file, You can obtain one at http://mozilla.org/MPL/2.0/. > > ifndef MOZ_JEMALLOC3 > +MOZ_OPTIMIZE = 1 I know you wrote a descriptive commit message. Perhaps something should be added in-line as well? This assignment just be itself feels too odd to not have a comment.
Attachment #8529978 - Flags: review?(gps) → review+
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla37
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: