Closed Bug 1126519 Opened 9 years ago Closed 9 years ago

Compile error for lollipop nexus 5 on Mac OS 10.8.5

Categories

(Firefox OS Graveyard :: GonkIntegration, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1126499

People

(Reporter: nhirata, Unassigned)

Details

Run:
./config nexus-5-l
./build.sh -j1

Expected: no errors and compiled

Actual:
/Volumes/Projects/B2G_N5/gecko/dom/media/mediasource/ContainerParser.cpp:267: error: undefined reference to 'mozilla::MP4Stream::MP4Stream(mozilla::MediaResource*)'
collect2: error: ld returned 1 exit status
Oops.  Wrong error.  This is after I tried experimenting.

The correct error that I received without modification of code : 

In file included from /Volumes/Projects/B2G_N5/objdir-gecko/dom/media/mediasource/Unified_cpp_media_mediasource0.cpp:2:0:
/Volumes/Projects/B2G_N5/gecko/dom/media/mediasource/ContainerParser.cpp:14:23:fatal error: MP4Stream.h: No such file or directory
 #include "MP4Stream.h"
Note : MP4Stream.h is located in $<B2G_Dir>/gecko/dom/media/fmp4
I think somewhere in the compilation it's just missing an include to include the gecko/dom/media/fmp4 directory?
So inside : gecko/dom/media
there's a moz.build file that does have : 
if CONFIG['MOZ_FMP4']:
    DIRS += ['fmp4']

and the moz.build in fmp4 : 
EXPORTS += [
    'AVCCDecoderModule.h',
    'MP4Decoder.h',
    'MP4Reader.h',
    'MP4Stream.h',
    'PlatformDecoderModule.h',
    'SharedDecoderManager.h',
]

UNIFIED_SOURCES += [
    'AVCCDecoderModule.cpp',
    'BlankDecoderModule.cpp',
    'MP4Decoder.cpp',
    'MP4Stream.cpp',
    'PlatformDecoderModule.cpp',
    'SharedDecoderManager.cpp',
]

So I guess I was wrong...  I'm not sure...
Oh interesting.  I think the if CONFIG['MOZ_FMP4'] is actually being set to false here...
I added the folder in the dir just to see what would happen and I got further.  I had assumed it was true, but decided to test if my assumption was wrong.

I ended up getting : 
In member function 'virtual android::sp<android::MediaCodecProxy> mozilla::GonkVideoDecoderManager::Init(mozilla::MediaDataDecoderCallback*)':
/Volumes/Projects/B2G_N5/gecko/dom/media/fmp4/gonk/GonkVideoDecoderManager.cpp:118:42: error: no matching function for call to 'android::GonkNativeWindow::GonkNativeWindow()'
     mNativeWindow = new GonkNativeWindow();

which I think is caused because /dom/media/fmp4/gonk/GonkVideoDecoderManager.h isn't listed in the exports?  Going to try that out.
Oops. noticed : 
if CONFIG['ANDROID_VERSION'] >= '18'and CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
    DEFINES['MOZ_GONK_MEDIACODEC'] = True
    DIRS += ['gonk']

It appears the if statement might be false again?
http://mxr.mozilla.org/mozilla-central/source/configure.in#292
MOZ_FMP4 isn't configured to 1.

I think that's the root cause of the failure.
Also noticed : 
         MOZ_NFC=1
         MOZ_RTSP=1
         MOZ_OMX_ENCODER=1

are missing compared to kk and jb.  Trying first to compile without them.
so I reverted back my code change and changed the configure.in file so that MOZ_FMP4=1; that seemed to resolve the initial error.  I still get an error compiling.  I need to figure out where to initialize : 'MOZ_WIDGET_TOOLKIT' == 'gonk' 

The compilation error I received is this:

In file included from /Volumes/Projects/B2G_N5/objdir-gecko/dom/media/fmp4/gonk/Unified_cpp_dom_media_fmp4_gonk0.cpp:29:0:
/Volumes/Projects/B2G_N5/gecko/dom/media/fmp4/gonk/GonkVideoDecoderManager.cpp: In member function 'void mozilla::GonkVideoDecoderManager::codecReserved()':
/Volumes/Projects/B2G_N5/gecko/dom/media/fmp4/gonk/GonkVideoDecoderManager.cpp:494:42: error: 'class android::GonkNativeWindow' has no member named 'getBufferQueue'
     surface = new Surface(mNativeWindow->getBufferQueue());
                                          ^

In the directory  /Volumes/Projects/B2G_N5/objdir-gecko/dom/media/fmp4/gonk
The following command failed to execute properly:
/usr/local/bin/ccache /Volumes/Projects/B2G_N5/prebuilts/gcc/darwin-x86/arm/arm-linux-androideabi-4.8/bin/arm-linux-androideabi-g++ -o Unified_cpp_dom_media_fmp4_gonk0.o -c -I../../../../dist/system_wrappers -include /Volumes/Projects/B2G_N5/gecko/config/gcc_hidden.h -DOS_POSIX=1 -DOS_LINUX=1 -DSTATIC_EXPORTABLE_JS_API -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -DAB_CD=en-US -DNO_NSPR_10_SUPPORT -I/Volumes/Projects/B2G_N5/gecko/dom/media/fmp4/gonk -I. -I/Volumes/Projects/B2G_N5/objdir-gecko/ipc/ipdl/_ipdlheaders -I/Volumes/Projects/B2G_N5/gecko/dom/media/omx/ -I/Volumes/Projects/B2G_N5/gecko/dom/media/omx/mediaresourcemanager -I/Volumes/Projects/B2G_N5/gecko/ipc/chromium/src -I/Volumes/Projects/B2G_N5/gecko/ipc/glue -I../../../../dist/include -I/Volumes/Projects/B2G_N5/objdir-gecko/dist/include/nspr -I/Volumes/Projects/B2G_N5/objdir-gecko/dist/include/nss -fPIC -DANDROID -isystem /Volumes/Projects/B2G_N5/bionic/libc/arch-arm/include -isystem /Volumes/Projects/B2G_N5/bionic/libc/include -isystem /Volumes/Projects/B2G_N5/bionic/libstdc++/include -isystem /Volumes/Projects/B2G_N5/bionic/libc/kernel/uapi -isystem /Volumes/Projects/B2G_N5/bionic/libc/kernel/uapi/asm-arm -isystem /Volumes/Projects/B2G_N5/bionic/libm/include -isystem /Volumes/Projects/B2G_N5/bionic/libm/include/arm -I/Volumes/Projects/B2G_N5/system -I/Volumes/Projects/B2G_N5/system/core/include -isystem /Volumes/Projects/B2G_N5/bionic -I/Volumes/Projects/B2G_N5/hardware/libhardware/include -I/Volumes/Projects/B2G_N5/external/valgrind/fxos-include -I/Volumes/Projects/B2G_N5/frameworks/native/include -I/Volumes/Projects/B2G_N5/frameworks/av/include -I/Volumes/Projects/B2G_N5/frameworks/av/include/media -I/Volumes/Projects/B2G_N5/frameworks/av/include/camera -I/Volumes/Projects/B2G_N5/frameworks/native/include/media/openmax -I/Volumes/Projects/B2G_N5/frameworks/av/media/libstagefright/include -DMOZILLA_CLIENT -include ../../../../mozilla-config.h -MD -MP -MF .deps/Unified_cpp_dom_media_fmp4_gonk0.o.pp -DANDROID -isystem /Volumes/Projects/B2G_N5/bionic/libc/arch-arm/include -isystem /Volumes/Projects/B2G_N5/bionic/libc/include -isystem /Volumes/Projects/B2G_N5/bionic/libstdc++/include -isystem /Volumes/Projects/B2G_N5/bionic/libc/kernel/uapi -isystem /Volumes/Projects/B2G_N5/bionic/libc/kernel/uapi/asm-arm -isystem /Volumes/Projects/B2G_N5/bionic/libm/include -isystem /Volumes/Projects/B2G_N5/bionic/libm/include/arm -I/Volumes/Projects/B2G_N5/system -I/Volumes/Projects/B2G_N5/system/core/include -isystem /Volumes/Projects/B2G_N5/bionic -I/Volumes/Projects/B2G_N5/hardware/libhardware/include -I/Volumes/Projects/B2G_N5/external/valgrind/fxos-include -I/Volumes/Projects/B2G_N5/frameworks/native/include -I/Volumes/Projects/B2G_N5/frameworks/av/include -I/Volumes/Projects/B2G_N5/frameworks/av/include/media -I/Volumes/Projects/B2G_N5/frameworks/av/include/camera -I/Volumes/Projects/B2G_N5/frameworks/native/include/media/openmax -I/Volumes/Projects/B2G_N5/frameworks/av/media/libstagefright/include -Wall -Wempty-body -Woverloaded-virtual -Wsign-compare -Wwrite-strings -Wno-invalid-offsetof -mandroid -fno-short-enums -fno-exceptions -Wno-psabi -DMOZ_ENABLE_JS_DUMP -include /Volumes/Projects/B2G_N5/gonk-misc/Unicode.h -I/Volumes/Projects/B2G_N5/gecko/build/stlport/stlport -I/Volumes/Projects/B2G_N5/ndk/sources/cxx-stl/system/include -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=softfp -mno-unaligned-access -fno-exceptions -fno-strict-aliasing -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -std=gnu++0x -pipe -DNDEBUG -DTRIMMED -g -freorder-blocks -Os -fno-reorder-functions -funwind-tables -Wno-error=attributes -Wno-error=multichar -I/Volumes/Projects/B2G_N5/frameworks/native/opengl/include /Volumes/Projects/B2G_N5/objdir-gecko/dom/media/fmp4/gonk/Unified_cpp_dom_media_fmp4_gonk0.cpp
make[6]: *** [Unified_cpp_dom_media_fmp4_gonk0.o] Error 1
make[5]: *** [dom/media/fmp4/gonk/target] Error 2
make[4]: *** [compile] Error 2
make[3]: *** [default] Error 2
make[2]: *** [realbuild] Error 2
make[1]: *** [build] Error 2
make: *** [out/target/product/hammerhead/obj/DATA/gecko_intermediates/gecko] Error 2
While looking into it, it seems like I have to make sure that the target is set correctly for the build.

While doing so I was looking at the hammerhead repo and I noticed : 
https://github.com/mozilla-b2g/device-hammerhead/blob/6c3221f690d0883b9039efb4c1743591816876ed/BoardConfig.mk#L24

Should we not have that line?  I might have to file a separate bug?
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → DUPLICATE
Well, might as well continue documenting my adventures in compilation:

I also ran into a repo build issue.  Speaking with Kaizhen, it's noted in bug 1127166 
Kaizhen also mentioned that MozMP4 was turned off for L at this moment, as are 
 MOZ_NFC=1, MOZ_RTSP=1, MOZ_OMX_ENCODER=1

He also mentioned the first time you FLASH, you need an Android Lollipop version due to some changes that end up occurring on the low level binary side.  It's not necessary for building purposes, as the binaries get pulled in via repo

Recap: pull in patches from bug 1127166 and bug 1126499
Build still failed : 
configure:2494: checking for arm-linux-androideabi-gcc
configure:2528: checking for gcc
configure:2641: checking whether the C compiler (/usr/local/bin/ccache /Volumes/Projects/B2G_N5_L/prebuilts/gcc/darwin-x86/arm/arm-linux-androideabi-4.7/bin/arm-linux-androideabi-gcc -mandroid -fno-short-enums -fno-exceptions  -mandroid -L/Volumes/Projects/B2G_N5_L/out/target/product/hammerhead/obj/lib -Wl,-rpath-link=/Volumes/Projects/B2G_N5_L/out/target/product/hammerhead/obj/lib --sysroot=/Volumes/Projects/B2G_N5_L/out/target/product/hammerhead/obj/ ) works
configure:2657: /usr/local/bin/ccache /Volumes/Projects/B2G_N5_L/prebuilts/gcc/darwin-x86/arm/arm-linux-androideabi-4.7/bin/arm-linux-androideabi-gcc -o conftest -mandroid -fno-short-enums -fno-exceptions  -DANDROID -isystem /Volumes/Projects/B2G_N5_L/bionic/libc/arch-arm/include -isystem /Volumes/Projects/B2G_N5_L/bionic/libc/include -isystem /Volumes/Projects/B2G_N5_L/bionic/libstdc++/include -isystem /Volumes/Projects/B2G_N5_L/bionic/libc/kernel/uapi -isystem /Volumes/Projects/B2G_N5_L/bionic/libc/kernel/uapi/asm-arm -isystem /Volumes/Projects/B2G_N5_L/bionic/libm/include -isystem /Volumes/Projects/B2G_N5_L/bionic/libm/include/arm -I/Volumes/Projects/B2G_N5_L/system -I/Volumes/Projects/B2G_N5_L/system/core/include -isystem /Volumes/Projects/B2G_N5_L/bionic -I/Volumes/Projects/B2G_N5_L/hardware/libhardware/include -I/Volumes/Projects/B2G_N5_L/external/valgrind/fxos-include -I/Volumes/Projects/B2G_N5_L/frameworks/native/include -I/Volumes/Projects/B2G_N5_L/frameworks/av/include -I/Volumes/Projects/B2G_N5_L/frameworks/av/include/media -I/Volumes/Projects/B2G_N5_L/frameworks/av/include/camera -I/Volumes/Projects/B2G_N5_L/frameworks/native/include/media/openmax -I/Volumes/Projects/B2G_N5_L/frameworks/av/media/libstagefright/include  -mandroid -L/Volumes/Projects/B2G_N5_L/out/target/product/hammerhead/obj/lib -Wl,-rpath-link=/Volumes/Projects/B2G_N5_L/out/target/product/hammerhead/obj/lib --sysroot=/Volumes/Projects/B2G_N5_L/out/target/product/hammerhead/obj/  conftest.c  -llog 1>&5
ccache: FATAL: /Volumes/Projects/B2G_N5_L/prebuilts/gcc/darwin-x86/arm/arm-linux-androideabi-4.7/bin/arm-linux-androideabi-gcc: execv returned (No such file or directory)
configure: failed program was:

#line 2652 "configure"
#include "confdefs.h"

main(){return(0);}
configure: error: installation or configuration problem: C compiler cannot create executables.
*** Fix above errors and then restart with               "make -f client.mk build"
make[3]: *** [configure] Error 1
make[2]: *** [/Volumes/Projects/B2G_N5_L/objdir-gecko/config.status] Error 2
make[1]: *** [build] Error 2
make: *** [out/target/product/hammerhead/obj/DATA/gecko_intermediates/gecko] Error 2


I checked my dir : /Volumes/Projects/B2G_N5_L/prebuilts/gcc/darwin-x86/arm and only found : 
arm-eabi-4.8			arm-linux-androideabi-4.8

I have to figure out how to point the it to the 4.8 version.
Weird.  Failing because the repo isn't up to date: 
gecko is showing that it's up to date with : commit 8e960009be915a67284ba3edd2b8ca67ff601f7c
which doesn't contain Kaizhen's patch in the other bug...
Oh.  http://git.mozilla.org/?p=releases/gecko.git;a=summary hasn't updated :
8e960009be915a67284ba3edd2b8ca67ff601f7c
https://groups.google.com/forum/#!msg/mozilla.dev.b2g/KjnxKND2b3I/8WQEaTFSQCwJ

Found out that gecko isn't quite up to date because of the reason in the newsgroup.
Gaia seems to be ok.
decided to pull directly from hg mozilla for gecko.
Forgot to clobber...
Still erroring: 

In file included from /Volumes/Projects/B2G_N5_L/objdir-gecko/dom/media/mediasource/Unified_cpp_media_mediasource0.cpp:29:0:
/Volumes/Projects/B2G_N5_L/gecko/dom/media/mediasource/MediaSourceReader.cpp: In member function 'void mozilla::MediaSourceReader::ContinueShutdown()':
/Volumes/Projects/B2G_N5_L/gecko/dom/media/mediasource/MediaSourceReader.cpp:406:7: error: 'mSharedDecoderManager' was not declared in this scope
   if (mSharedDecoderManager) {
       ^

In the directory  /Volumes/Projects/B2G_N5_L/objdir-gecko/dom/media/mediasource
The following command failed to execute properly:
/usr/local/bin/ccache /Volumes/Projects/B2G_N5_L/prebuilts/gcc/darwin-x86/arm/arm-linux-androideabi-4.8/bin/arm-linux-androideabi-g++ -o Unified_cpp_media_mediasource0.o -c -I../../../dist/system_wrappers -include /Volumes/Projects/B2G_N5_L/gecko/config/gcc_hidden.h -DSTATIC_EXPORTABLE_JS_API -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -DAB_CD=en-US -DNO_NSPR_10_SUPPORT -I/Volumes/Projects/B2G_N5_L/gecko/dom/media/mediasource -I. -I../../../dist/include -I/Volumes/Projects/B2G_N5_L/objdir-gecko/dist/include/nspr -I/Volumes/Projects/B2G_N5_L/objdir-gecko/dist/include/nss -fPIC -DANDROID -isystem /Volumes/Projects/B2G_N5_L/bionic/libc/arch-arm/include -isystem /Volumes/Projects/B2G_N5_L/bionic/libc/include -isystem /Volumes/Projects/B2G_N5_L/bionic/libstdc++/include -isystem /Volumes/Projects/B2G_N5_L/bionic/libc/kernel/uapi -isystem /Volumes/Projects/B2G_N5_L/bionic/libc/kernel/uapi/asm-arm -isystem /Volumes/Projects/B2G_N5_L/bionic/libm/include -isystem /Volumes/Projects/B2G_N5_L/bionic/libm/include/arm -I/Volumes/Projects/B2G_N5_L/system -I/Volumes/Projects/B2G_N5_L/system/core/include -isystem /Volumes/Projects/B2G_N5_L/bionic -I/Volumes/Projects/B2G_N5_L/hardware/libhardware/include -I/Volumes/Projects/B2G_N5_L/external/valgrind/fxos-include -I/Volumes/Projects/B2G_N5_L/frameworks/native/include -I/Volumes/Projects/B2G_N5_L/frameworks/av/include -I/Volumes/Projects/B2G_N5_L/frameworks/av/include/media -I/Volumes/Projects/B2G_N5_L/frameworks/av/include/camera -I/Volumes/Projects/B2G_N5_L/frameworks/native/include/media/openmax -I/Volumes/Projects/B2G_N5_L/frameworks/av/media/libstagefright/include -DMOZILLA_CLIENT -include ../../../mozilla-config.h -MD -MP -MF .deps/Unified_cpp_media_mediasource0.o.pp -DANDROID -isystem /Volumes/Projects/B2G_N5_L/bionic/libc/arch-arm/include -isystem /Volumes/Projects/B2G_N5_L/bionic/libc/include -isystem /Volumes/Projects/B2G_N5_L/bionic/libstdc++/include -isystem /Volumes/Projects/B2G_N5_L/bionic/libc/kernel/uapi -isystem /Volumes/Projects/B2G_N5_L/bionic/libc/kernel/uapi/asm-arm -isystem /Volumes/Projects/B2G_N5_L/bionic/libm/include -isystem /Volumes/Projects/B2G_N5_L/bionic/libm/include/arm -I/Volumes/Projects/B2G_N5_L/system -I/Volumes/Projects/B2G_N5_L/system/core/include -isystem /Volumes/Projects/B2G_N5_L/bionic -I/Volumes/Projects/B2G_N5_L/hardware/libhardware/include -I/Volumes/Projects/B2G_N5_L/external/valgrind/fxos-include -I/Volumes/Projects/B2G_N5_L/frameworks/native/include -I/Volumes/Projects/B2G_N5_L/frameworks/av/include -I/Volumes/Projects/B2G_N5_L/frameworks/av/include/media -I/Volumes/Projects/B2G_N5_L/frameworks/av/include/camera -I/Volumes/Projects/B2G_N5_L/frameworks/native/include/media/openmax -I/Volumes/Projects/B2G_N5_L/frameworks/av/media/libstagefright/include -Wall -Wempty-body -Woverloaded-virtual -Wsign-compare -Wwrite-strings -Wno-invalid-offsetof -mandroid -fno-short-enums -fno-exceptions -Wno-psabi -DMOZ_ENABLE_JS_DUMP -include /Volumes/Projects/B2G_N5_L/gonk-misc/Unicode.h -I/Volumes/Projects/B2G_N5_L/gecko/build/stlport/stlport -I/Volumes/Projects/B2G_N5_L/ndk/sources/cxx-stl/system/include -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=softfp -mno-unaligned-access -fno-exceptions -fno-strict-aliasing -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -std=gnu++0x -pipe -DNDEBUG -DTRIMMED -g -freorder-blocks -Os -fno-reorder-functions -funwind-tables /Volumes/Projects/B2G_N5_L/objdir-gecko/dom/media/mediasource/Unified_cpp_media_mediasource0.cpp
make[6]: *** [Unified_cpp_media_mediasource0.o] Error 1
make[5]: *** [dom/media/mediasource/target] Error 2
make[4]: *** [compile] Error 2
make[3]: *** [default] Error 2
make[2]: *** [realbuild] Error 2
make[1]: *** [build] Error 2
make: *** [out/target/product/hammerhead/obj/DATA/gecko_intermediates/gecko] Error 2
Created a patch based on Kaizhen's previous patch.

rebuilt and finally made a build!
You need to log in before you can comment on or make changes to this bug.