From npiggin at gmail.com Mon Dec 2 16:43:34 2024 From: npiggin at gmail.com (Nicholas Piggin) Date: Mon, 02 Dec 2024 15:43:34 +1000 Subject: [Skiboot] build system: HOSTCC -m64? In-Reply-To: <1e2a70e4-c8a5-49e9-86bd-a5eff377104a@tls.msk.ru> References: <1e2a70e4-c8a5-49e9-86bd-a5eff377104a@tls.msk.ru> Message-ID: On Sun Dec 1, 2024 at 3:54 PM AEST, Michael Tokarev wrote: > Hi! > > I initially sent this to skiboot@ list, but it never appeared there. > Truing qemu-ppc too. > > 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: > > In file included from /usr/lib/gcc/i686-linux-gnu/12/include/stdint.h:9, > from roms/skiboot/ccan/short_types/short_types.h:4, > from roms/skiboot/extract-gcov.c:5: > /usr/include/stdint.h:26:10: fatal error: bits/libc-header-start.h: No such file or directory > > 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? Thanks, Nick From mjt at tls.msk.ru Sun Dec 1 16:54:48 2024 From: mjt at tls.msk.ru (Michael Tokarev) Date: Sun, 1 Dec 2024 08:54:48 +0300 Subject: [Skiboot] build system: HOSTCC -m64? Message-ID: <1e2a70e4-c8a5-49e9-86bd-a5eff377104a@tls.msk.ru> Hi! I initially sent this to skiboot@ list, but it never appeared there. Truing qemu-ppc too. 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: In file included from /usr/lib/gcc/i686-linux-gnu/12/include/stdint.h:9, from roms/skiboot/ccan/short_types/short_types.h:4, from roms/skiboot/extract-gcov.c:5: /usr/include/stdint.h:26:10: fatal error: bits/libc-header-start.h: No such file or directory 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. This -m64 flag has been introduced by this commit: commit 241daa24feaf9c9aa84ac45887b67ceb6918980a Author: Stewart Smith Date: Tue Oct 25 19:43:53 2016 +1100 extract-gcov: build with -m64 if compiler supports it Fixes build break on 32bit ppc64 (e.g. PowerMac G5, where user space is mostly 32bit). Fixes: https://github.com/open-power/skiboot/issues/42 Reported-by: Andrei Warkenti Signed-off-by: Stewart Smith diff --git a/Makefile.main b/Makefile.main index 86a54be45..7918a180b 100644 --- a/Makefile.main +++ b/Makefile.main @@ -35,6 +35,7 @@ HOSTCC=gcc HOSTEND=$(shell uname -m | sed -e 's/^i.*86$$/LITTLE/' -e 's/^x86.*/LITTLE/' -e 's/^ppc64le/LITTLE/' -e 's/^ppc.*/BIG/') HOSTCFLAGS=-O1 $(CWARNS) -DHAVE_$(HOSTEND)_ENDIAN -MMD HOSTCFLAGS += $(call try-cflag,$(HOSTCC),-std=gnu11) +HOSTCFLAGS += $(call try-cflag,$(HOSTCC),-m64) HOSTCFLAGS += $(call try-cflag,$(HOSTCC),-Wjump-misses-init) \ $(call try-cflag,$(HOSTCC),-Wsuggest-attribute=const) \ $(call try-cflag,$(HOSTCC),-Wsuggest-attribute=noreturn) \ which seems a bit wrong, since checking just for the -m64 *option* is obviously not enough. Also, even if the compiler can actually produce a 64bit executable, it isn't necessary for this executable to be able to *run* on this platform, - gcc might be configured to produce either 32 or 64 bit code even on ppc platform, and we might be running on a hardware not capable to run 64bit code. Now, having in mind diminishing role of 32bit platforms, I'm not sure what to do with this one.. :) Thanks, /mjt From mjt at tls.msk.ru Mon Dec 2 19:57:32 2024 From: mjt at tls.msk.ru (Michael Tokarev) Date: Mon, 2 Dec 2024 11:57:32 +0300 Subject: [Skiboot] build system: HOSTCC -m64? In-Reply-To: References: <1e2a70e4-c8a5-49e9-86bd-a5eff377104a@tls.msk.ru> Message-ID: <3735089f-1bf5-4421-926d-0b59f8aabe61@tls.msk.ru> 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 From arbab at linux.ibm.com Tue Dec 10 03:14:02 2024 From: arbab at linux.ibm.com (Reza Arbab) Date: Mon, 9 Dec 2024 10:14:02 -0600 Subject: [Skiboot] [PATCH] opal-ci: Drop fedora39, add fedora41 Message-ID: <20241209161402.75934-1-arbab@linux.ibm.com> Fedora 39 has reached end-of-life. Remove it and add Fedora 41. Signed-off-by: Reza Arbab --- .github/workflows/docker-builds-checks.yml | 2 +- opal-ci/Dockerfile-docs | 2 +- opal-ci/{Dockerfile-fedora39 => Dockerfile-fedora41} | 2 +- opal-ci/{build-fedora39.sh => build-fedora41.sh} | 0 4 files changed, 3 insertions(+), 3 deletions(-) rename opal-ci/{Dockerfile-fedora39 => Dockerfile-fedora41} (94%) rename opal-ci/{build-fedora39.sh => build-fedora41.sh} (100%) diff --git a/.github/workflows/docker-builds-checks.yml b/.github/workflows/docker-builds-checks.yml index a6e66147a840..8bc375de6d6e 100644 --- a/.github/workflows/docker-builds-checks.yml +++ b/.github/workflows/docker-builds-checks.yml @@ -12,7 +12,7 @@ jobs: fail-fast: false matrix: - os: [ ubuntu-18.04, ubuntu-20.04, ubuntu-22.04, ubuntu-rolling, fedora39, fedora40, fedora-rawhide, docs ] + os: [ ubuntu-18.04, ubuntu-20.04, ubuntu-22.04, ubuntu-rolling, fedora40, fedora41, fedora-rawhide, docs ] steps: - uses: actions/checkout at v4 diff --git a/opal-ci/Dockerfile-docs b/opal-ci/Dockerfile-docs index 028ae93df60c..90ccf0965505 120000 --- a/opal-ci/Dockerfile-docs +++ b/opal-ci/Dockerfile-docs @@ -1 +1 @@ -Dockerfile-fedora39 \ No newline at end of file +Dockerfile-fedora40 \ No newline at end of file diff --git a/opal-ci/Dockerfile-fedora39 b/opal-ci/Dockerfile-fedora41 similarity index 94% rename from opal-ci/Dockerfile-fedora39 rename to opal-ci/Dockerfile-fedora41 index 1a205e657fde..64c9f9a02d7b 100644 --- a/opal-ci/Dockerfile-fedora39 +++ b/opal-ci/Dockerfile-fedora41 @@ -1,4 +1,4 @@ -FROM registry.fedoraproject.org/fedora:39 +FROM registry.fedoraproject.org/fedora:41 RUN dnf -y update RUN dnf -y install --allowerasing wget curl xterm gcc git xz make diffutils findutils expect valgrind valgrind-devel ccache dtc openssl openssl-devel gcc-powerpc64-linux-gnu mbedtls-devel which qemu-system-ppc # for building documentation and the coverage report diff --git a/opal-ci/build-fedora39.sh b/opal-ci/build-fedora41.sh similarity index 100% rename from opal-ci/build-fedora39.sh rename to opal-ci/build-fedora41.sh -- 2.43.5 From dan at danny.cz Tue Dec 10 03:27:11 2024 From: dan at danny.cz (Dan =?UTF-8?B?SG9yw6Fr?=) Date: Mon, 9 Dec 2024 17:27:11 +0100 Subject: [Skiboot] [PATCH] opal-ci: Drop fedora39, add fedora41 In-Reply-To: <20241209161402.75934-1-arbab@linux.ibm.com> References: <20241209161402.75934-1-arbab@linux.ibm.com> Message-ID: <20241209172711.137b4ebecb4a5aebac1a4aa6@danny.cz> On Mon, 9 Dec 2024 10:14:02 -0600 Reza Arbab wrote: > Fedora 39 has reached end-of-life. Remove it and add Fedora 41. > > Signed-off-by: Reza Arbab LGTM Reviewed-by: Dan Hor?k Dan > --- > .github/workflows/docker-builds-checks.yml | 2 +- > opal-ci/Dockerfile-docs | 2 +- > opal-ci/{Dockerfile-fedora39 => Dockerfile-fedora41} | 2 +- > opal-ci/{build-fedora39.sh => build-fedora41.sh} | 0 > 4 files changed, 3 insertions(+), 3 deletions(-) > rename opal-ci/{Dockerfile-fedora39 => Dockerfile-fedora41} (94%) > rename opal-ci/{build-fedora39.sh => build-fedora41.sh} (100%) > > diff --git a/.github/workflows/docker-builds-checks.yml b/.github/workflows/docker-builds-checks.yml > index a6e66147a840..8bc375de6d6e 100644 > --- a/.github/workflows/docker-builds-checks.yml > +++ b/.github/workflows/docker-builds-checks.yml > @@ -12,7 +12,7 @@ jobs: > fail-fast: false > > matrix: > - os: [ ubuntu-18.04, ubuntu-20.04, ubuntu-22.04, ubuntu-rolling, fedora39, fedora40, fedora-rawhide, docs ] > + os: [ ubuntu-18.04, ubuntu-20.04, ubuntu-22.04, ubuntu-rolling, fedora40, fedora41, fedora-rawhide, docs ] > > steps: > - uses: actions/checkout at v4 > diff --git a/opal-ci/Dockerfile-docs b/opal-ci/Dockerfile-docs > index 028ae93df60c..90ccf0965505 120000 > --- a/opal-ci/Dockerfile-docs > +++ b/opal-ci/Dockerfile-docs > @@ -1 +1 @@ > -Dockerfile-fedora39 > \ No newline at end of file > +Dockerfile-fedora40 > \ No newline at end of file > diff --git a/opal-ci/Dockerfile-fedora39 b/opal-ci/Dockerfile-fedora41 > similarity index 94% > rename from opal-ci/Dockerfile-fedora39 > rename to opal-ci/Dockerfile-fedora41 > index 1a205e657fde..64c9f9a02d7b 100644 > --- a/opal-ci/Dockerfile-fedora39 > +++ b/opal-ci/Dockerfile-fedora41 > @@ -1,4 +1,4 @@ > -FROM registry.fedoraproject.org/fedora:39 > +FROM registry.fedoraproject.org/fedora:41 > RUN dnf -y update > RUN dnf -y install --allowerasing wget curl xterm gcc git xz make diffutils findutils expect valgrind valgrind-devel ccache dtc openssl openssl-devel gcc-powerpc64-linux-gnu mbedtls-devel which qemu-system-ppc > # for building documentation and the coverage report > diff --git a/opal-ci/build-fedora39.sh b/opal-ci/build-fedora41.sh > similarity index 100% > rename from opal-ci/build-fedora39.sh > rename to opal-ci/build-fedora41.sh > -- > 2.43.5 > > _______________________________________________ > Skiboot mailing list > Skiboot at lists.ozlabs.org > https://lists.ozlabs.org/listinfo/skiboot From eajames at linux.ibm.com Thu Dec 12 03:13:25 2024 From: eajames at linux.ibm.com (Eddie James) Date: Wed, 11 Dec 2024 10:13:25 -0600 Subject: [Skiboot] [PATCH] Add support for aarch64 Message-ID: <20241211161325.777822-1-eajames@linux.ibm.com> Update the external archictecture checker script and Makefile for aarch64. Signed-off-by: Eddie James --- external/common/get_arch.sh | 2 ++ external/shared/Makefile | 2 ++ 2 files changed, 4 insertions(+) diff --git a/external/common/get_arch.sh b/external/common/get_arch.sh index 682710fcb..3f3f8e863 100755 --- a/external/common/get_arch.sh +++ b/external/common/get_arch.sh @@ -5,6 +5,8 @@ echo "#if defined(__powerpc__) echo -n ARCH_POWERPC #elif defined(__arm__) echo -n ARCH_ARM +#elif defined(__aarch64__) +echo -n ARCH_AARCH64 #else echo -n ARCH_UNKNOWN #endif" | $1cpp | /bin/sh diff --git a/external/shared/Makefile b/external/shared/Makefile index 9ea4adc51..cc993b5c7 100644 --- a/external/shared/Makefile +++ b/external/shared/Makefile @@ -9,8 +9,10 @@ LIBDIR := $(PREFIX)/lib INCDIR := $(PREFIX)/include/libflash ifneq ($(ARCH), ARCH_ARM) +ifneq ($(ARCH), ARCH_AARCH64) CFLAGS += -m64 endif +endif CFLAGS += -Werror -Wall -g2 -ggdb -I. -fPIC LIBFLASH_OBJS := libflash-file.o libflash-libflash.o libflash-libffs.o \ -- 2.43.5