From d409c23832c89e014e86f3f09a3601032b163d80 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Sun, 13 Feb 2022 12:01:47 +0100 Subject: [PATCH] bootstrap: If the mold linker is available prefer it over gold The gold linker will be deprecated soon. However we got a new linker called mold: https://github.com/rui314/mold/ Signed-off-by: Andreas Schneider Reviewed-by: Alexander Bokovoy --- .gitlab-ci-main.yml | 2 +- bootstrap/config.py | 2 ++ bootstrap/generated-dists/centos7/Dockerfile | 2 ++ bootstrap/generated-dists/centos8s/Dockerfile | 2 ++ bootstrap/generated-dists/debian10/Dockerfile | 2 ++ bootstrap/generated-dists/debian11/Dockerfile | 2 ++ bootstrap/generated-dists/fedora34/Dockerfile | 2 ++ bootstrap/generated-dists/fedora35/Dockerfile | 2 ++ bootstrap/generated-dists/opensuse151/Dockerfile | 2 ++ bootstrap/generated-dists/opensuse152/Dockerfile | 2 ++ bootstrap/generated-dists/ubuntu1804/Dockerfile | 2 ++ bootstrap/generated-dists/ubuntu2004/Dockerfile | 2 ++ bootstrap/sha1sum.txt | 2 +- 13 files changed, 24 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci-main.yml b/.gitlab-ci-main.yml index 8f5c0581cf9..f6eed880fe1 100644 --- a/.gitlab-ci-main.yml +++ b/.gitlab-ci-main.yml @@ -42,7 +42,7 @@ variables: # Set this to the contents of bootstrap/sha1sum.txt # which is generated by bootstrap/template.py --render # - SAMBA_CI_CONTAINER_TAG: 751901cf8356d45e7027b23a60e7a8179e014b98 + SAMBA_CI_CONTAINER_TAG: db1a33142c66b8dabd5bc3ac439364ff55d60461 # # We use the ubuntu1804 image as default as # it matches what we have on sn-devel-184. diff --git a/bootstrap/config.py b/bootstrap/config.py index 9abef5074d0..27e6d22d3f5 100644 --- a/bootstrap/config.py +++ b/bootstrap/config.py @@ -354,6 +354,8 @@ RUN /tmp/bootstrap.sh && /tmp/locale.sh # if ld.gold exists, force link it to ld RUN set -x; LD=$(which ld); LD_GOLD=$(which ld.gold); test -x $LD_GOLD && ln -sf $LD_GOLD $LD && test -x $LD && echo "$LD is now $LD_GOLD" +# if ld.mold exists, force link it to ld (prefer mold over gold! ;-) +RUN set -x; LD=$(which ld); LD_MOLD=$(which ld.mold); test -x $LD_MOLD && ln -sf $LD_MOLD $LD && test -x $LD && echo "$LD is now $LD_MOLD" # make test can not work with root, so we have to create a new user RUN useradd -m -U -s /bin/bash samba && \ diff --git a/bootstrap/generated-dists/centos7/Dockerfile b/bootstrap/generated-dists/centos7/Dockerfile index 2f171ad1c62..3b43da9216d 100644 --- a/bootstrap/generated-dists/centos7/Dockerfile +++ b/bootstrap/generated-dists/centos7/Dockerfile @@ -15,6 +15,8 @@ RUN /tmp/bootstrap.sh && /tmp/locale.sh # if ld.gold exists, force link it to ld RUN set -x; LD=$(which ld); LD_GOLD=$(which ld.gold); test -x $LD_GOLD && ln -sf $LD_GOLD $LD && test -x $LD && echo "$LD is now $LD_GOLD" +# if ld.mold exists, force link it to ld (prefer mold over gold! ;-) +RUN set -x; LD=$(which ld); LD_MOLD=$(which ld.mold); test -x $LD_MOLD && ln -sf $LD_MOLD $LD && test -x $LD && echo "$LD is now $LD_MOLD" # make test can not work with root, so we have to create a new user RUN useradd -m -U -s /bin/bash samba && \ diff --git a/bootstrap/generated-dists/centos8s/Dockerfile b/bootstrap/generated-dists/centos8s/Dockerfile index 1c932f58a94..80a2f099026 100644 --- a/bootstrap/generated-dists/centos8s/Dockerfile +++ b/bootstrap/generated-dists/centos8s/Dockerfile @@ -15,6 +15,8 @@ RUN /tmp/bootstrap.sh && /tmp/locale.sh # if ld.gold exists, force link it to ld RUN set -x; LD=$(which ld); LD_GOLD=$(which ld.gold); test -x $LD_GOLD && ln -sf $LD_GOLD $LD && test -x $LD && echo "$LD is now $LD_GOLD" +# if ld.mold exists, force link it to ld (prefer mold over gold! ;-) +RUN set -x; LD=$(which ld); LD_MOLD=$(which ld.mold); test -x $LD_MOLD && ln -sf $LD_MOLD $LD && test -x $LD && echo "$LD is now $LD_MOLD" # make test can not work with root, so we have to create a new user RUN useradd -m -U -s /bin/bash samba && \ diff --git a/bootstrap/generated-dists/debian10/Dockerfile b/bootstrap/generated-dists/debian10/Dockerfile index a7141db7e17..c3ef8cef539 100644 --- a/bootstrap/generated-dists/debian10/Dockerfile +++ b/bootstrap/generated-dists/debian10/Dockerfile @@ -15,6 +15,8 @@ RUN /tmp/bootstrap.sh && /tmp/locale.sh # if ld.gold exists, force link it to ld RUN set -x; LD=$(which ld); LD_GOLD=$(which ld.gold); test -x $LD_GOLD && ln -sf $LD_GOLD $LD && test -x $LD && echo "$LD is now $LD_GOLD" +# if ld.mold exists, force link it to ld (prefer mold over gold! ;-) +RUN set -x; LD=$(which ld); LD_MOLD=$(which ld.mold); test -x $LD_MOLD && ln -sf $LD_MOLD $LD && test -x $LD && echo "$LD is now $LD_MOLD" # make test can not work with root, so we have to create a new user RUN useradd -m -U -s /bin/bash samba && \ diff --git a/bootstrap/generated-dists/debian11/Dockerfile b/bootstrap/generated-dists/debian11/Dockerfile index 6a16324f201..cfd184a1d89 100644 --- a/bootstrap/generated-dists/debian11/Dockerfile +++ b/bootstrap/generated-dists/debian11/Dockerfile @@ -15,6 +15,8 @@ RUN /tmp/bootstrap.sh && /tmp/locale.sh # if ld.gold exists, force link it to ld RUN set -x; LD=$(which ld); LD_GOLD=$(which ld.gold); test -x $LD_GOLD && ln -sf $LD_GOLD $LD && test -x $LD && echo "$LD is now $LD_GOLD" +# if ld.mold exists, force link it to ld (prefer mold over gold! ;-) +RUN set -x; LD=$(which ld); LD_MOLD=$(which ld.mold); test -x $LD_MOLD && ln -sf $LD_MOLD $LD && test -x $LD && echo "$LD is now $LD_MOLD" # make test can not work with root, so we have to create a new user RUN useradd -m -U -s /bin/bash samba && \ diff --git a/bootstrap/generated-dists/fedora34/Dockerfile b/bootstrap/generated-dists/fedora34/Dockerfile index 0ce89448a5f..6e28a7440bd 100644 --- a/bootstrap/generated-dists/fedora34/Dockerfile +++ b/bootstrap/generated-dists/fedora34/Dockerfile @@ -15,6 +15,8 @@ RUN /tmp/bootstrap.sh && /tmp/locale.sh # if ld.gold exists, force link it to ld RUN set -x; LD=$(which ld); LD_GOLD=$(which ld.gold); test -x $LD_GOLD && ln -sf $LD_GOLD $LD && test -x $LD && echo "$LD is now $LD_GOLD" +# if ld.mold exists, force link it to ld (prefer mold over gold! ;-) +RUN set -x; LD=$(which ld); LD_MOLD=$(which ld.mold); test -x $LD_MOLD && ln -sf $LD_MOLD $LD && test -x $LD && echo "$LD is now $LD_MOLD" # make test can not work with root, so we have to create a new user RUN useradd -m -U -s /bin/bash samba && \ diff --git a/bootstrap/generated-dists/fedora35/Dockerfile b/bootstrap/generated-dists/fedora35/Dockerfile index c9aa524b831..e66eb84d9f3 100644 --- a/bootstrap/generated-dists/fedora35/Dockerfile +++ b/bootstrap/generated-dists/fedora35/Dockerfile @@ -15,6 +15,8 @@ RUN /tmp/bootstrap.sh && /tmp/locale.sh # if ld.gold exists, force link it to ld RUN set -x; LD=$(which ld); LD_GOLD=$(which ld.gold); test -x $LD_GOLD && ln -sf $LD_GOLD $LD && test -x $LD && echo "$LD is now $LD_GOLD" +# if ld.mold exists, force link it to ld (prefer mold over gold! ;-) +RUN set -x; LD=$(which ld); LD_MOLD=$(which ld.mold); test -x $LD_MOLD && ln -sf $LD_MOLD $LD && test -x $LD && echo "$LD is now $LD_MOLD" # make test can not work with root, so we have to create a new user RUN useradd -m -U -s /bin/bash samba && \ diff --git a/bootstrap/generated-dists/opensuse151/Dockerfile b/bootstrap/generated-dists/opensuse151/Dockerfile index 5a5fd645700..fa3745b5802 100644 --- a/bootstrap/generated-dists/opensuse151/Dockerfile +++ b/bootstrap/generated-dists/opensuse151/Dockerfile @@ -15,6 +15,8 @@ RUN /tmp/bootstrap.sh && /tmp/locale.sh # if ld.gold exists, force link it to ld RUN set -x; LD=$(which ld); LD_GOLD=$(which ld.gold); test -x $LD_GOLD && ln -sf $LD_GOLD $LD && test -x $LD && echo "$LD is now $LD_GOLD" +# if ld.mold exists, force link it to ld (prefer mold over gold! ;-) +RUN set -x; LD=$(which ld); LD_MOLD=$(which ld.mold); test -x $LD_MOLD && ln -sf $LD_MOLD $LD && test -x $LD && echo "$LD is now $LD_MOLD" # make test can not work with root, so we have to create a new user RUN useradd -m -U -s /bin/bash samba && \ diff --git a/bootstrap/generated-dists/opensuse152/Dockerfile b/bootstrap/generated-dists/opensuse152/Dockerfile index 3d79adcb07d..65de9438e5b 100644 --- a/bootstrap/generated-dists/opensuse152/Dockerfile +++ b/bootstrap/generated-dists/opensuse152/Dockerfile @@ -15,6 +15,8 @@ RUN /tmp/bootstrap.sh && /tmp/locale.sh # if ld.gold exists, force link it to ld RUN set -x; LD=$(which ld); LD_GOLD=$(which ld.gold); test -x $LD_GOLD && ln -sf $LD_GOLD $LD && test -x $LD && echo "$LD is now $LD_GOLD" +# if ld.mold exists, force link it to ld (prefer mold over gold! ;-) +RUN set -x; LD=$(which ld); LD_MOLD=$(which ld.mold); test -x $LD_MOLD && ln -sf $LD_MOLD $LD && test -x $LD && echo "$LD is now $LD_MOLD" # make test can not work with root, so we have to create a new user RUN useradd -m -U -s /bin/bash samba && \ diff --git a/bootstrap/generated-dists/ubuntu1804/Dockerfile b/bootstrap/generated-dists/ubuntu1804/Dockerfile index 21686560ad9..a66dc3f2324 100644 --- a/bootstrap/generated-dists/ubuntu1804/Dockerfile +++ b/bootstrap/generated-dists/ubuntu1804/Dockerfile @@ -15,6 +15,8 @@ RUN /tmp/bootstrap.sh && /tmp/locale.sh # if ld.gold exists, force link it to ld RUN set -x; LD=$(which ld); LD_GOLD=$(which ld.gold); test -x $LD_GOLD && ln -sf $LD_GOLD $LD && test -x $LD && echo "$LD is now $LD_GOLD" +# if ld.mold exists, force link it to ld (prefer mold over gold! ;-) +RUN set -x; LD=$(which ld); LD_MOLD=$(which ld.mold); test -x $LD_MOLD && ln -sf $LD_MOLD $LD && test -x $LD && echo "$LD is now $LD_MOLD" # make test can not work with root, so we have to create a new user RUN useradd -m -U -s /bin/bash samba && \ diff --git a/bootstrap/generated-dists/ubuntu2004/Dockerfile b/bootstrap/generated-dists/ubuntu2004/Dockerfile index f94e8801aad..7ae6a93143f 100644 --- a/bootstrap/generated-dists/ubuntu2004/Dockerfile +++ b/bootstrap/generated-dists/ubuntu2004/Dockerfile @@ -15,6 +15,8 @@ RUN /tmp/bootstrap.sh && /tmp/locale.sh # if ld.gold exists, force link it to ld RUN set -x; LD=$(which ld); LD_GOLD=$(which ld.gold); test -x $LD_GOLD && ln -sf $LD_GOLD $LD && test -x $LD && echo "$LD is now $LD_GOLD" +# if ld.mold exists, force link it to ld (prefer mold over gold! ;-) +RUN set -x; LD=$(which ld); LD_MOLD=$(which ld.mold); test -x $LD_MOLD && ln -sf $LD_MOLD $LD && test -x $LD && echo "$LD is now $LD_MOLD" # make test can not work with root, so we have to create a new user RUN useradd -m -U -s /bin/bash samba && \ diff --git a/bootstrap/sha1sum.txt b/bootstrap/sha1sum.txt index ba31d4aff3c..4efaba8152f 100644 --- a/bootstrap/sha1sum.txt +++ b/bootstrap/sha1sum.txt @@ -1 +1 @@ -751901cf8356d45e7027b23a60e7a8179e014b98 +db1a33142c66b8dabd5bc3ac439364ff55d60461 -- 2.34.1