To run tests on ppc64 and ppc64el, this patch install cross building packages for both architectures on the Debian image, these packages will be install every time the CI triggered. A proper fix would be to install these packages to the image directly. This patch follows a different approach to get access LD shared library for qemu. Other architectures install native libc6 packages while both ppc64 and ppc64el install cross libc6 packages and export QEMU_LD_PREFIX to point to LD path which is more reasonable.
.gitlab-ci.yml | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9f3b5c63..7f12ecfa 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -139,6 +139,11 @@ Debian.cross.x86: before_script: # remove any previously installed nettle headers to avoid conflicts - for arch in armhf mips arm64;do apt-get remove -y nettle-dev:$arch;done + - host="${CI_JOB_NAME#*.cross.}" + - if [ "$host" == "powerpc64-linux-gnu" ];then apt-get update && apt-get install -y gcc-$host && + apt-get install -y g++-$host && apt-get install -y libstdc++6-ppc64-cross && export QEMU_LD_PREFIX=/usr/$host;fi + - if [ "$host" == "powerpc64le-linux-gnu" ];then apt-get update && apt-get install -y gcc-$host && + apt-get install -y g++-$host && apt-get install -y libstdc++6-ppc64el-cross && export QEMU_LD_PREFIX=/usr/$host;fi script: - build=$(dpkg-architecture -qDEB_HOST_GNU_TYPE) - host="${CI_JOB_NAME#*.cross.}" @@ -162,3 +167,7 @@ Debian.cross.mips-linux-gnu: <<: *Debian_cross_template Debian.cross.aarch64-linux-gnu: <<: *Debian_cross_template +Debian.cross.powerpc64-linux-gnu: + <<: *Debian_cross_template +Debian.cross.powerpc64le-linux-gnu: + <<: *Debian_cross_template
Hi, I no longer talk for the gnutls developers, but why don't you submit an MR at: https://gitlab.com/gnutls/build-images/
to add a ppc64le image? If you mention that this is used by nettle, I doubt there will be an objection to it. That way you can use it directly for testing nettle.
regards, Nikos
On Wed, Jun 24, 2020 at 2:09 AM Maamoun TK maamoun.tk@googlemail.com wrote:
To run tests on ppc64 and ppc64el, this patch install cross building packages for both architectures on the Debian image, these packages will be install every time the CI triggered. A proper fix would be to install these packages to the image directly. This patch follows a different approach to get access LD shared library for qemu. Other architectures install native libc6 packages while both ppc64 and ppc64el install cross libc6 packages and export QEMU_LD_PREFIX to point to LD path which is more reasonable.
.gitlab-ci.yml | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9f3b5c63..7f12ecfa 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -139,6 +139,11 @@ Debian.cross.x86: before_script: # remove any previously installed nettle headers to avoid conflicts
- for arch in armhf mips arm64;do apt-get remove -y nettle-dev:$arch;done
- host="${CI_JOB_NAME#*.cross.}"
- if [ "$host" == "powerpc64-linux-gnu" ];then apt-get update && apt-get
install -y gcc-$host &&
- apt-get install -y g++-$host && apt-get install -y
libstdc++6-ppc64-cross && export QEMU_LD_PREFIX=/usr/$host;fi
- if [ "$host" == "powerpc64le-linux-gnu" ];then apt-get update &&
apt-get install -y gcc-$host &&
- apt-get install -y g++-$host && apt-get install -y
libstdc++6-ppc64el-cross && export QEMU_LD_PREFIX=/usr/$host;fi script:
- build=$(dpkg-architecture -qDEB_HOST_GNU_TYPE)
- host="${CI_JOB_NAME#*.cross.}"
@@ -162,3 +167,7 @@ Debian.cross.mips-linux-gnu: <<: *Debian_cross_template Debian.cross.aarch64-linux-gnu: <<: *Debian_cross_template +Debian.cross.powerpc64-linux-gnu:
- <<: *Debian_cross_template
+Debian.cross.powerpc64le-linux-gnu:
- <<: *Debian_cross_template
nettle-bugs mailing list nettle-bugs@lists.lysator.liu.se http://lists.lysator.liu.se/mailman/listinfo/nettle-bugs
Maamoun TK maamoun.tk@googlemail.com writes:
To run tests on ppc64 and ppc64el, this patch install cross building packages for both architectures on the Debian image,
Speaking of ppc64 (big-endian, I assume) vs ppc64el, do you think it's possible and reasonable to use same assembly files? That's how the current ARM big-endian support works.
This patch follows a different approach to get access LD shared library for qemu. Other architectures install native libc6 packages while both ppc64 and ppc64el install cross libc6 packages and export QEMU_LD_PREFIX to point to LD path which is more reasonable.
Can you explain why it's different? I thought the point of the debian multilib organization was to enable installing the native packages, i.e., apt-get install libstdc++6:ppc64el rather than apt-get install libstdc++6-ppc64el-cross. But I'm not that familiar with the details of the debian cross packages.
From a quick look, it seems that e.g., gcc-mips-linux-gnu depends on
libc6-dev-mips-cross, and gcc-powerpc64-linux-gnu has a similar dependency.
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9f3b5c63..7f12ecfa 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -139,6 +139,11 @@ Debian.cross.x86: before_script: # remove any previously installed nettle headers to avoid conflicts
- for arch in armhf mips arm64;do apt-get remove -y nettle-dev:$arch;done
- host="${CI_JOB_NAME#*.cross.}"
- if [ "$host" == "powerpc64-linux-gnu" ];then apt-get update && apt-get
install -y gcc-$host &&
- apt-get install -y g++-$host && apt-get install -y
libstdc++6-ppc64-cross && export QEMU_LD_PREFIX=/usr/$host;fi
Do you need to explicitly install libstdc++? I would expect the g++-$host to depend (or recommend) on the right library packages.
Regards, /Niels
On Wed, Jun 24, 2020 at 10:43 AM Niels Möller nisse@lysator.liu.se wrote:
Speaking of ppc64 (big-endian, I assume) vs ppc64el, do you think it's
possible and reasonable to use same assembly files? That's how the current ARM big-endian support works.
Yes, that is what I'm working on. nettle has IF_LE and IF_BE macros to be used in assembly files for this purpose. It's not reasonable to make two different files of the same implementation just to change permuting loaded data for big-endian version.
Can you explain why it's different? I thought the point of the debian multilib organization was to enable installing the native packages, i.e., apt-get install libstdc++6:ppc64el rather than apt-get install libstdc++6-ppc64el-cross. But I'm not that familiar with the details of the debian cross packages.
Yes it's possible but I think if the cross packages would do the job it's less reasonable to install the native ones. Another reason to do that is Debian doesn't support ppc64 officially, I didn't figure out how to install libstdc++6:ppc64 so the cross package is the only option here.
Do you need to explicitly install libstdc++? I would expect the g++-$host to depend (or recommend) on the right library packages.
My fault, seems to explicitly install libstdc++ is not needed.
Thanks, Mamone
Maamoun TK maamoun.tk@googlemail.com writes:
To run tests on ppc64 and ppc64el, this patch install cross building packages for both architectures on the Debian image, these packages will be install every time the CI triggered. A proper fix would be to install these packages to the image directly.
I've committed a change based on this patch. I dropped big-endian ppc support for now (the "apt-get remove nettle-dev:$arch" failed because it's not an arch in official debian. Not sure if that was the only problem, but I wanted to get ppc64el working first, before investigating further). And I had to add a dpkg --add-architecture, since that was also missing in the build image.
It would be great if you could prepare a merge request for the image repository. And any advice on what's needed for big-endian ppc, should it work fine to install the cross-compiler packages, despite it not being an official debian arch?
Regards, /Niels
On Mon, Jun 29, 2020 at 3:15 PM Niels Möller nisse@lysator.liu.se wrote:
I've committed a change based on this patch. I dropped big-endian ppc support for now (the "apt-get remove nettle-dev:$arch" failed because it's not an arch in official debian. Not sure if that was the only problem, but I wanted to get ppc64el working first, before investigating further). And I had to add a dpkg --add-architecture, since that was also missing in the build image.
Is nettle-dev:ppe64el installed in the image? If not installed, there is no point in removing it.
It would be great if you could prepare a merge request for the image repository. And any advice on what's needed for big-endian ppc, should it work fine to install the cross-compiler packages, despite it not being an official debian arch?
I have no experience modifying build images, I will open an issue in the image repository asking to add support for powerpc64. The cross-compiler packages are supported officially. libc6-ppc64-cross installs the same required files that are installed by libc6:ppc64 but without copying the LD shared library to the default directory so the patch exports QEMU_LD_PREFIX to point out to the LD location. So yes, it works fine since it behaves the same.
Thank you, Mamone
Maamoun TK maamoun.tk@googlemail.com writes:
Is nettle-dev:ppe64el installed in the image? If not installed, there is no point in removing it.
There was a loop over all archs. But I guess I should just remove ppc64 from that list. I was a bit in a hurry to get something working.
I have no experience modifying build images, I will open an issue in the image repository asking to add support for powerpc64.
I too have no experience with docker, but it looks like it should be fairly easy to add.
The cross-compiler packages are supported officially. libc6-ppc64-cross installs the same required files that are installed by libc6:ppc64 but without copying the LD shared library to the default directory so the patch exports QEMU_LD_PREFIX to point out to the LD location. So yes, it works fine since it behaves the same.
Nice, I'll try enabling that then. Does that mean that explicitly setting QEMU_LD_PREFIX is needed only for ppc64 (big-endian), but not for ppc64el?
Regards, /Niels
On Tue, Jun 30, 2020 at 12:26 PM Niels Möller nisse@lysator.liu.se wrote:
Does that mean that explicitly setting QEMU_LD_PREFIX is needed only for ppc64 (big-endian), but not for ppc64el?
It's needed for both, I just give ppc64 as an example.
Maamoun TK maamoun.tk@googlemail.com writes:
It's needed for both, I just give ppc64 as an example.
I see.
And I just pushed the change to enable big-endian too.
Regards, /Niels
nettle-bugs@lists.lysator.liu.se