[SLOF] [PATCH slof] make: Define default rule for .c when V=1 or V=2

Thomas Huth thuth at redhat.com
Tue Aug 31 19:56:12 AEST 2021


On 31/08/2021 11.52, Alexey Kardashevskiy wrote:
> 
> 
> On 31/08/2021 19:38, Thomas Huth wrote:
>> On 31/08/2021 11.30, Alexey Kardashevskiy wrote:
>>>
>>>
>>> On 31/08/2021 19:26, Thomas Huth wrote:
>>>> On 11/03/2020 03.37, Alexey Kardashevskiy wrote:
>>>>> The default .o:.c rule passes a short file name to gcc to when doing
>>>>> "make -C <dir>", we do this a lot for all the libraries.
>>>>> The file names printed in gcc errors are relative to <dir> and this
>>>>> prevents vim from navigating through errors.
>>>>>
>>>>> This passes the full file name to gcc to make it print errors with
>>>>> absolute path so vim can navigate through errors nicely.
>>>>>
>>>>> This makes it optional when V=1 or V=2 is passed.
>>>>>
>>>>> Signed-off-by: Alexey Kardashevskiy <aik at ozlabs.ru>
>>>>> ---
>>>>>
>>>>> Or there is a better way of doing this?
>>>>>
>>>>> I find it very annoying to work with ./lib/xxxx as we chdir a lot
>>>>> and gcc does not have a flag to print full file names.
>>>>
>>>> This patch broke the compilation of "make js2x" ... thus js2x does not 
>>>> compile anymore since more than a year now. Shall we fix it, or shall we 
>>>> maybe rather remove the js2x code from the repository?
>>>
>>> It does not compile for me neither way - upstream or upstream + reverted 
>>> "make: Define default rule for .c when V=1 or V=2". It should not affect 
>>> building with V=0 anyway, unless I missed something, did I?
>>
>> For me, js2x still compiles with some warnings if I revert the patch. What 
>> error do you get?
>> (I'm getting some errors with version.h when running "make distclean" 
>> after building js2x though)
> 
> 
> Many "multiple definition of" like this one:
> 
> [fstn1-p1 slof]$ make -j 100  js2x
> ******** Building js2x system ********
>   ====== Building clients ======
>   ====== Building common libraries ======
>   ====== Building llfw ======
>   ====== Building slof ======
>   ====== Building rtas ======
> ld: rtas_board.o:/home/aik/p/slof/board-js2x/include/bmc.h:27: multiple 
> definition of `bmc_get_blade_descr'; 
> rtas_flash.o:/home/aik/p/slof/board-js2x/include/bmc
> .h:27: first defined here

That sounds like your compiler defaults to -fno-common now ... try to add an 
"extern" in front of that line in bmc.h to see whether that fixes the issue.

  Thomas



More information about the SLOF mailing list