Error: That is already defined!

After a quick re-run of compiling OmniRom for my Samsung Galaxy S4, T-Mobile variant (JFLTETMO SGH-M919), I ran into another issue:

[CODE]
including ./hardware/qcom/display/Android.mk …
build/core/copy_headers.mk:15: warning: overriding commands for target `/home/alaskalinuxuser/Documents/projects/phones/compile/omni5/out/target/product/jfltetmo/obj/include/qcom/display/copybit.h’
build/core/copy_headers.mk:15: warning: ignoring old commands for target `/home/alaskalinuxuser/Documents/projects/phones/compile/omni5/out/target/product/jfltetmo/obj/include/qcom/display/copybit.h’
build/core/copy_headers.mk:15: warning: overriding commands for target `/home/alaskalinuxuser/Documents/projects/phones/compile/omni5/out/target/product/jfltetmo/obj/include/qcom/display/copybit_priv.h’
build/core/copy_headers.mk:15: warning: ignoring old commands for target `/home/alaskalinuxuser/Documents/projects/phones/compile/omni5/out/target/product/jfltetmo/obj/include/qcom/display/copybit_priv.h’
build/core/copy_headers.mk:15: warning: overriding commands for target `/home/alaskalinuxuser/Documents/projects/phones/compile/omni5/out/target/product/jfltetmo/obj/include/qcom/display/c2d2.h’
build/core/copy_headers.mk:15: warning: ignoring old commands for target `/home/alaskalinuxuser/Documents/projects/phones/compile/omni5/out/target/product/jfltetmo/obj/include/qcom/display/c2d2.h’
build/core/base_rules.mk:156: *** hardware/qcom/display/msm8960/liblight: MODULE.TARGET.SHARED_LIBRARIES.lights.msm8960 already defined by device/samsung/jf-common/liblights. Stop.

real 5m41.413s
user 1m59.811s
sys 0m29.481s
[/CODE]

Here the problem is that liblight is already defined in the hardware settings for qcom (which is what is at the heart of the SGH-M919), and it conflicts with the device liblights definition. The compiler is confused because there can only be one definition or object. So, to make ammends, I edited device/samsung/jf-common/liblights/Android.mk and commented out all of the lines, like so:

[CODE]
#WJH LOCAL_PATH:= $(call my-dir)
# HAL module implemenation stored in
# hw/<COPYPIX_HARDWARE_MODULE_ID>.<ro.board.platform>.so
#WJH include $(CLEAR_VARS)

#WJH LOCAL_SRC_FILES := lights.c

#WJH LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw

#WJH LOCAL_SHARED_LIBRARIES := liblog

#WJH LOCAL_MODULE := lights.msm8960

#WJH LOCAL_MODULE_TAGS := optional

#WJH include $(BUILD_SHARED_LIBRARY)
[/CODE]

I try to always insert my initials when I do an edit, so I can easily find my personal edits later. A quick word search for my own initials makes finding my changes an easy task. In this case it is important, because I may need to comment out the hardware liblights and keep the device liblights definition if that function doesn’t work in the rom. I typically try to edit or comment out the device tree changes first, before messing with the source code, to keep the source code “clean”. This way, if those code changes work, I can copy this tree to another source to build it as well, provided they work. Let’s give it another run and see what happens.

Linux – Keep it simple.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s