On 2019-01-28 18:47, Philippe Mathieu-Daudé wrote:
> Cc'ing Thomas/Paolo for Makefile rules...
> 
> On 1/24/19 12:43 PM, Gerd Hoffmann wrote:
>> On Thu, Jan 24, 2019 at 02:15:54AM +0100, Philippe Mathieu-Daudé wrote:
>>> Move the complexity of milkymist_tmu2_create() into the
>>> source file. Doing so we avoid to include the X11/OpenGL
>>> headers in all LM32 devices, and we also avoid the duplicate
>>> declaration of glx_fbconfig_attr[] (it is already declared
>>> in hw/display/milkymist-tmu2.c).
>>> Since TYPE_MILKYMIST_TMU2 is now accessible, use it.
>>
>> Oops, fails the build:
>>
>>   LINK    lm32-softmmu/qemu-system-lm32
>> hw/lm32/milkymist.o: In function `milkymist_init':
>> milkymist.c:(.text+0xb0f): undefined reference to `milkymist_tmu2_create'
> 
> The problem comes from patch #2:
> 
>> diff --git a/default-configs/lm32-softmmu.mak
> b/default-configs/lm32-softmmu.mak
>> index 4889348a10..4049b23562 100644
>> --- a/default-configs/lm32-softmmu.mak
>> +++ b/default-configs/lm32-softmmu.mak
>> @@ -2,7 +2,7 @@
>>
>>  CONFIG_LM32=y
>>  CONFIG_MILKYMIST=y
>> -CONFIG_MILKYMIST_TMU2=$(CONFIG_OPENGL)
>> +CONFIG_MILKYMIST_TMU2=$(call land,$(CONFIG_X11),$(CONFIG_OPENGL))
>>  CONFIG_FRAMEBUFFER=y
>>  CONFIG_PTIMER=y
>>  CONFIG_PFLASH_CFI01=y
>> diff --git a/hw/display/Makefile.objs b/hw/display/Makefile.objs
>> index 97acd5b6cb..079e702f25 100644
>> --- a/hw/display/Makefile.objs
>> +++ b/hw/display/Makefile.objs
>> @@ -29,8 +29,8 @@ common-obj-$(CONFIG_MILKYMIST) += milkymist-vgafb.o
>>  common-obj-$(CONFIG_ZAURUS) += tc6393xb.o
>>
>>  common-obj-$(CONFIG_MILKYMIST_TMU2) += milkymist-tmu2.o
>> -milkymist-tmu2.o-cflags := $(X11_CFLAGS)
>> -milkymist-tmu2.o-libs := $(X11_LIBS)
>> +milkymist-tmu2.o-cflags := $(X11_CFLAGS) $(OPENGL_CFLAGS)
>> +milkymist-tmu2.o-libs := $(X11_LIBS) $(OPENGL_LIBS)
>>
>>  obj-$(CONFIG_OMAP) += omap_dss.o
>>  obj-$(CONFIG_OMAP) += omap_lcdc.o
> 
> Using $(call land) seems to break CONFIG_MILKYMIST_TMU2 availability in
> $(common-obj), while it works correctly in the per-target $(obj).
> I'm not sure what is the cause, but moving milkymist-tmu2.o to $(obj)
> makes more sense and fix this, so I'll go this way.

You could try whether adding an additional

 common-obj-$(CONFIG_ALL) += milkymist-tmu2.o

fixes the issue for you, too.

OTOH, milkymist is only used by one target, so there is really no reason
that this file should be added to common-obj, thus using $(obj) is fine
here.

 Thomas

Reply via email to