[Skiboot] build system: HOSTCC -m64?

Reza Arbab arbab at linux.ibm.com
Sat Mar 15 04:59:02 AEDT 2025


On Mon, Dec 02, 2024 at 03:43:34PM +1000, Nicholas Piggin wrote:
>On Sun Dec 1, 2024 at 3:54 PM AEST, Michael Tokarev wrote:
>> However, skiboot build procedure tries to force -m64 flag to the
>> default/native ${HOSTCC}:
>>
>>   Makefile.main: HOSTCFLAGS += $(call try-cflag,$(HOSTCC),-m64)
>>
>> And on i386, native gcc does support this option.  But it does no
>> necessary have all the headers/libraries to actually build any 64bit
>> executable - which is exactly the case here.
>
>Yeah, I think you have a point. Should fix it.
>
>extract-gcov.c should be fixed for 32-bit host, and -m64 flag
>removed. If you just remove -m64 I assume you hit the type
>errors that the original issue reported?

Well, the first move is to get extract-gcov working again on 64-bit. :) 
I just sent a series to do that.

Nobody hold their breath, but if I get time I'll investigate making it 
32-bit safe. I did verify in an i386/debian container that if you revert 
241daa24feaf ("extract-gcov: build with -m64 if compiler supports it"),
the original problem returns; i.e. you get these kinds of errors:

   extract-gcov.c: In function 'SKIBOOT_ADDR':
   extract-gcov.c:114:41: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
     114 |         const char* r= (addr + (be64toh((const u64)p) - SKIBOOT_OFFSET));

As an alternative, we could also just not build extract-gcov on 32-bit 
hosts.

-- 
Reza Arbab


More information about the Skiboot mailing list