From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tremer To: development@lists.ipfire.org Subject: Re: [PATCH 1/2] Added x86_64 i586 aarch64 armv5tel support for GO language required for node_exporter compilation. Date: Mon, 26 Jul 2021 15:09:47 +0100 Message-ID: <9A7581E3-1BA2-4A1D-874E-36C3DD5FC788@ipfire.org> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8908722646721912740==" List-Id: --===============8908722646721912740== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hey, > On 24 Jul 2021, at 20:13, Holger Sunke wrote: >=20 > Hello, >=20 > I'm using Ubuntu focal. After pulling a newer version of qemu and locally m= oving up the 'go' package in the make.sh script, I finally got the logs to cr= eate rootfiles for aarch64 and armv5tel. >=20 > What exact distro are you using? I could not manage do complete a build for= aarch64 nor armv5tel as I ran into segmentation faults. I am using Debian Buster with maybe a couple of backports. I didn=E2=80=99t t= est bullseye, yet, but all these including Ubuntu should be fine. The segmentation faults can happen and you can just restart the build and it = should eventually go through. For the nightly builds with are using native systems on AWS with their Gravit= on 2 processors. AFAIK there is no =E2=80=9Cbudget=E2=80=9D alternative to th= at. -Michael >=20 > Kind reagards >=20 > Holger >=20 > Am 21.07.21 um 20:15 schrieb Michael Tremer: >> Hello, >> We had this one before on the list. I can=E2=80=99t find it though. >> What distribution are you using? It looks like QEMU is too old. The statx = syscall (291) isn=E2=80=99t supported. >> -Michael >>> On 21 Jul 2021, at 18:55, Holger Sunke wrote: >>>=20 >>> Hello Michael, >>>=20 >>> I think this should generally work, but currently I'm stuck with strange = issues like these: >>>=20 >>> Jul 21 17:51:53: Building glibc glibc-2.32.tar.xz checksum OK >>> + cd /usr/src/lfs >>> + make -f glibc LFS_BASEDIR=3D/usr/src install >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Installing glibc-2.32 ... >>> Install started; saving file list to /usr/src/lsalr ... >>> cd /usr/src/glibc-2.32 && patch -Np1 < /usr/src/src/patches/glibc-loca= ledef-no-archive.patch >>> patching file localedata/Makefile >>> Hunk #1 succeeded at 440 with fuzz 1 (offset 217 lines). >>> cd /usr/src/glibc-build && \ >>> CFLAGS=3D"-O2 -pipe -Wall -fexceptions -fPIC -fstack-clash-protection = -Wp,-D_FORTIFY_SOURCE=3D2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong = -Wno-error=3Dmaybe-uninitialized -fno-asynchronous-unwind-tables" \ >>> /usr/src/glibc-2.32/configure --build=3Daarch64-unknown-linux-gnu --pr= efix=3D/usr --libexecdir=3D/usr/lib/glibc --enable-stack-protector=3Dstrong -= -disable-profile --enable-kernel=3D4.14.0 --enable-add-ons --without-selinux = --enable-experimental-malloc --enable-bind-now --disable-crypt >>> qemu: Unsupported syscall: 291 >>> /tools_aarch64/bin/ls: cannot access '.': Function not implemented >>> configure: error: working directory cannot be determined >>> make: *** [glibc:114: /usr/src/log/glibc-2.32] Error 2 >>>=20 >>> ERROR: Building glibc [ FAIL ] >>> Check /home/holger/development/ipfire/ipfire-2.x/log/_build.base.log f= or errors if applicable [ FAIL ] >>>=20 >>>=20 >>> I tried building in schroot using Ubuntu bionic and focal. >>>=20 >>> Did you already encounter these errors? >>>=20 >>> Kind regards >>> Holger >>>=20 >>>=20 >>> Am 19.07.21 um 13:11 schrieb Michael Tremer: >>>> Hello Holger, >>>>> On 15 Jul 2021, at 20:32, Holger Sunke wrote: >>>>>=20 >>>>> I guess I have to build ipfire for each different arch to get the log f= iles as source for the root files. >>>> Yes, that would be the easiest way. For most packages this is not requir= es as the list of installed files is identical but compilers and other archit= ecture-specific package tends to require this extra work. >>>>> How do you build ipfire for all the archs? Do you use some kind of VMs? >>>> You can do either that or use qemu-user-static. This will emulate the ot= her architecture for you instead. >>>> So you would install qemu-user-static (https://packages.debian.org/buste= r/qemu-user-static) or whatever the equivalent is in our your distribution of= choice and then run these commands: >>>> Erase the old build: >>>> ./make.sh clean >>>> Download a toolchain for the target architecture: >>>> ./make.sh =E2=80=94-target=3Daarch64 gettoolchain >>>> And then you run the build: >>>> ./make.sh =E2=80=94-target=3Daarch64 build >>>> You can then do this for armv6l in next, too. >>>> The emulated build will take a little bit longer due to the emulation. >>>> Let me know if this has worked. >>>> Best, >>>> -Michael >>>>>=20 >>>>> Kind regards >>>>>=20 >>>>> Holger >>>>>=20 >>>>>=20 >>>>>=20 >>>>> On 08.06.21 18:54, Michael Tremer wrote: >>>>>> Hello Holger, >>>>>> This patch looks good so far, but the root files are missing. >>>>>> Do you know what those are? >>>>>> Otherwise this would be mergeable. >>>>>> Best, >>>>>> -Michael >>>>>>> On 6 Jun 2021, at 18:48, Holger Sunke wrot= e: >>>>>>>=20 >>>>>>> --- >>>>>>> lfs/Config | 8 ++++++++ >>>>>>> lfs/go | 9 ++++++--- >>>>>>> 2 files changed, 14 insertions(+), 3 deletions(-) >>>>>>>=20 >>>>>>> diff --git a/lfs/Config b/lfs/Config >>>>>>> index 7d98e303b..c8be227a1 100644 >>>>>>> --- a/lfs/Config >>>>>>> +++ b/lfs/Config >>>>>>> @@ -138,6 +138,14 @@ ifeq "$(BUILD_ARCH)" "aarch64" >>>>>>> GOARCH =3D arm64 >>>>>>> endif >>>>>>>=20 >>>>>>> +ifeq "$(BUILD_ARCH)" "armv5tel" >>>>>>> + GOARCH =3D armv6l >>>>>>> +endif >>>>>>> + >>>>>>> +ifeq "$(BUILD_ARCH)" "i586" >>>>>>> + GOARCH =3D 386 >>>>>>> +endif >>>>>>> + >>>>>>> #####################################################################= ########## >>>>>>> # Common Macro Definitions >>>>>>> #####################################################################= ########## >>>>>>> diff --git a/lfs/go b/lfs/go >>>>>>> index 6ebb37080..487ad8486 100644 >>>>>>> --- a/lfs/go >>>>>>> +++ b/lfs/go >>>>>>> @@ -28,10 +28,10 @@ VER =3D 1.15.4 >>>>>>>=20 >>>>>>> THISAPP =3D go-$(VER) >>>>>>> DL_FILE =3D go$(VER).$(GOOS)-$(GOARCH).tar.gz >>>>>>> -DL_FROM =3D $(URL_IPFIRE) >>>>>>> +DL_FROM =3D https://golang.org/dl/ >>>>>>> DIR_APP =3D $(DIR_SRC)/go >>>>>>> TARGET =3D $(DIR_INFO)/$(THISAPP) >>>>>>> -SUP_ARCH =3D x86_64 >>>>>>> +SUP_ARCH =3D x86_64 i586 aarch64 armv5tel >>>>>>>=20 >>>>>>> #####################################################################= ########## >>>>>>> # Top-level Rules >>>>>>> @@ -41,7 +41,10 @@ objects =3D $(DL_FILE) >>>>>>>=20 >>>>>>> $(DL_FILE) =3D $(DL_FROM)/$(DL_FILE) >>>>>>>=20 >>>>>>> -$(DL_FILE)_MD5 =3D 8e9d11a16f03372c82c5134278a0bd7d >>>>>>> +go$(VER).$(GOOS)-amd64.tar.gz_MD5 =3D 8e9d11a16f03372c82c5134278a0bd= 7d >>>>>>> +go$(VER).$(GOOS)-386.tar.gz_MD5 =3D 8d1c3539c88710273f61b0c810b7448c >>>>>>> +go$(VER).$(GOOS)-arm64.tar.gz_MD5 =3D b1846fb093f0261707bda44e158bc5= be >>>>>>> +go$(VER).$(GOOS)-armv6l.tar.gz_MD5 =3D cf04e0d84de6cbb7d224be1f42a83= f02 >>>>>>>=20 >>>>>>> install : $(TARGET) >>>>>>>=20 >>>>>>> --=20 >>>>>>> 2.30.2 >>>>>>>=20 --===============8908722646721912740==--