[Skiboot] build system: HOSTCC -m64?
Michael Tokarev
mjt at tls.msk.ru
Mon Dec 2 19:57:32 AEDT 2024
02.12.2024 08:43, Nicholas Piggin wrote:
> On Sun Dec 1, 2024 at 3:54 PM AEST, Michael Tokarev wrote:
>> I stumbled across a somewhat stupid "issue", - while building skiboot
>> as part of qemu package build in debian, I tried running the build on
>> an i386 host (usually I do this on amd64 or aarch64 host). And skiboot
>> build failed:
>> This is ${HOSTCC}, not ${CC} - which is supposed to be a compiler for
>> native architecture - it is building a helper binary to generate some
>> build-time tables, so any native/default architecture is fine.
>>
>> 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?
I tried to build skiboot on i386 after removing the mentioned line from
Makefile.main, - the compilation goes fine. The commit introduced this
line says something about specific ppc variant - maybe the prob happens
only there, I dunno. There's no warnings from current gcc, either,
besides an unrelated:
core/hmi.c:860:25: warning: ‘pau’ may be used uninitialized [-Wmaybe-uninitialized]
860 | pau_opencapi_dump_scoms(pau);
(which might be worth to check regardless).
I didn't try booting/testing the resulting firmware though.
Thanks,
/mjt
More information about the Skiboot
mailing list