9

I am trying to build kernel for AOSP 4.4.2 for a device. When I compile the kernel I get

build/core/base_rules.mk:134: *** vendor/google/libs: 
MODULE.TARGET.SHARED_LIBRARIES.libjpeg already defined by external/jpeg.  Stop.

I understand that the shared variable libjpeg is already defined and I need to remove one of them. Is that correct?

I tried looking in external/jpeg folder and I am not sure which file I have to look into. Could some one please tell me how to deal with this situation.

ChanChow
  • 1,346
  • 7
  • 28
  • 57
  • 2
    Yes, you can't have two modules with the same name and type. One needs to go. AOSP 4.4.2 doesn't include a vendor/google directory. Where does that stuff come from? – Magnus Bäck Aug 25 '14 at 05:48
  • @MagnusBäck AFAIK vendor folder contain device specific configuration files. When I tried removing those files and start building, I get vendor files missing errors. But external/jpeg has just c and header files. I can't find where the shared variable is declared – ChanChow Aug 25 '14 at 14:14
  • Yes, the vendor tree contains device-specific files. But again, AOSP 4.4.2 doesn't contain a vendor/google directory so the question of what code you're actually trying to build is relevant, even more so since your contents of vendor/google isn't compatible with the rest of the source tree. Not sure what you mean by shared variable. Your problem is that two directories attempt to define the same module. – Magnus Bäck Aug 25 '14 at 17:28
  • @MagnusBäck Thanks for getting back. In shared_variable I mean libjpeg, I can see libjpeg folder in vendor/google/libs folder but not in external/jpeg. I am not sure if I am going in right direction to solve the issue. Could you please explain what should I check and remove. – ChanChow Aug 25 '14 at 18:53
  • Modules in the Android build system are defined in Android.mk files. Both vendor/google/libs/Android.mk and external/jpeg/Android.mk attempt to define a module named libjpeg. Without knowing more about what's in your vendor/google directory I can't tell what you should keep. – Magnus Bäck Aug 25 '14 at 20:19
  • @MagnusBäck # GoogleCamera include $(CLEAR_VARS) LOCAL_PREBUILT_LIBS := libgcam.so \ libgcam_swig_jni.so \ libjni_tinyplanet.so \ libjpeg.so \ liblightcycle.so \ libnativehelper_compat_libc++.so \ librefocus.so \ librs.layered_filter_f32.so \ librsjni.so \ libRSSupport.so LOCAL_MODULE_TAGS := optional – ChanChow Aug 25 '14 at 20:45
  • 1
    That doesn't shed any light on my question. I'm outta here. Maybe someone else can help. – Magnus Bäck Aug 26 '14 at 05:32
  • @MagnusBäck Thanks for your help. As I mentioned earlier, when I tried removing any of the folders, I get some other errors stating missing files from those paths – ChanChow Aug 26 '14 at 16:51

2 Answers2

8

The error states that the Shared object libjpeg is already defined in other module google/libs and you are again trying to create it. So just try to rename the Android.mk file in google/libs folder or in external/jpeg folder. It fixes the issue.

DOSKrupp
  • 240
  • 4
  • 15
3

I had encountered your error but the solution was not to change any Makefile or source. Simply I had forgotten to run environment setup script(in may AOSP tree: build/envsetup.sh) After running that, no error happens.

Saleh
  • 1,819
  • 1
  • 17
  • 44