You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "PMExtra (via GitHub)" <gi...@apache.org> on 2023/10/10 08:08:03 UTC

[I] Build for Linux on aarch64 [maven-mvnd]

PMExtra opened a new issue, #888:
URL: https://github.com/apache/maven-mvnd/issues/888

   I found some issues and resolved them when building mvnd for Linux on aarch64.
   
   I'm using docker image `ubuntu:22.04` on aarch64 machine.
   
   This is my patch:
   
   ```patch
   diff --git a/client/pom.xml b/client/pom.xml
   index 679cc23d..3a900043 100644
   --- a/client/pom.xml
   +++ b/client/pom.xml
   @@ -228,6 +228,8 @@
                             -H:-ParseRuntimeOptions
                             -H:+AddAllCharsets
                             -H:+ReportExceptionStackTraces
   +                         -H:+TraceNativeToolUsage
   +                         -H:PageSize=65536
                             -ea</buildArgs>
                </configuration>
                <executions>
   diff --git a/client/src/main/resources/glibc/dynamic-libc-start.c b/client/src/main/resources/glibc/dynamic-libc-start.c
   index 2272b255..09097cbc 100644
   --- a/client/src/main/resources/glibc/dynamic-libc-start.c
   +++ b/client/src/main/resources/glibc/dynamic-libc-start.c
   @@ -27,8 +27,8 @@
    #include <dlfcn.h>
    #include <stdint.h>
   
   -__asm__(".symver dlsym,dlsym@GLIBC_2.2.5");
   -__asm__(".symver dlvsym,dlvsym@GLIBC_2.2.5");
   +__asm__(".symver dlsym,dlsym@GLIBC_2.17");
   +__asm__(".symver dlvsym,dlvsym@GLIBC_2.17");
   
    /* __libc_csu_init is statically linked into each program, and passed to __libc_start_main
     * when the program is running with an old glibc (<2.34).
   diff --git a/client/src/main/resources/glibc/glibc.redef b/client/src/main/resources/glibc/glibc.redef
   index 10342159..4d330e02 100644
   --- a/client/src/main/resources/glibc/glibc.redef
   +++ b/client/src/main/resources/glibc/glibc.redef
   @@ -15,21 +15,21 @@
    # specific language governing permissions and limitations
    # under the License.
    __libc_start_main __dynamic_libc_start_main
   -clock_gettime clock_gettime@GLIBC_2.2.5
   -dlopen dlopen@GLIBC_2.2.5
   -dlsym dlsym@GLIBC_2.2.5
   -memcpy memcpy@GLIBC_2.2.5
   -posix_spawn posix_spawn@GLIBC_2.2.5
   -pthread_attr_getguardsize pthread_attr_getguardsize@GLIBC_2.2.5
   -pthread_attr_getstack pthread_attr_getstack@GLIBC_2.2.5
   -pthread_attr_setstacksize pthread_attr_setstacksize@GLIBC_2.2.5
   -pthread_condattr_setclock pthread_condattr_setclock@GLIBC_2.3.3
   -pthread_create pthread_create@GLIBC_2.2.5
   -pthread_getattr_np pthread_getattr_np@GLIBC_2.2.5
   -pthread_join pthread_join@GLIBC_2.2.5
   -pthread_kill pthread_kill@GLIBC_2.2.5
   -pthread_setname_np pthread_setname_np@GLIBC_2.12
   -sem_destroy sem_destroy@GLIBC_2.2.5
   -sem_init sem_init@GLIBC_2.2.5
   -sem_post sem_post@GLIBC_2.2.5
   -sem_wait sem_wait@GLIBC_2.2.5
   +clock_gettime clock_gettime@GLIBC_2.17
   +dlopen dlopen@GLIBC_2.17
   +dlsym dlsym@GLIBC_2.17
   +memcpy memcpy@GLIBC_2.17
   +posix_spawn posix_spawn@GLIBC_2.17
   +pthread_attr_getguardsize pthread_attr_getguardsize@GLIBC_2.17
   +pthread_attr_getstack pthread_attr_getstack@GLIBC_2.17
   +pthread_attr_setstacksize pthread_attr_setstacksize@GLIBC_2.17
   +pthread_condattr_setclock pthread_condattr_setclock@GLIBC_2.17
   +pthread_create pthread_create@GLIBC_2.17
   +pthread_getattr_np pthread_getattr_np@GLIBC_2.17
   +pthread_join pthread_join@GLIBC_2.17
   +pthread_kill pthread_kill@GLIBC_2.17
   +pthread_setname_np pthread_setname_np@GLIBC_2.17
   +sem_destroy sem_destroy@GLIBC_2.17
   +sem_init sem_init@GLIBC_2.17
   +sem_post sem_post@GLIBC_2.17
   +sem_wait sem_wait@GLIBC_2.17
   ```
   
   After the patch, it builds successfully and works fine on my machine.
   
   I'm looking forward to the official release of Linux aarch64 pre-built distribution. But until then, this patch may help some people in need, so I share it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Build for Linux on aarch64 [maven-mvnd]

Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on issue #888:
URL: https://github.com/apache/maven-mvnd/issues/888#issuecomment-1767863966

   > By the way, I built the project by Docker which runs on my Apple M1 Macbook.
   > 
   > So, can we use the macOS runner to start up a container and then build the project for linux-aarch64?
   
   The mentioned runner is my laptop :-)  If you can create a PR that would add provide a script that can generate the linux-aarch64 binaries, I should be able to upload those during the release process (please add the step to https://github.com/apache/maven-mvnd/blob/master/RELEASING.adoc in the PR...)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Build for Linux on aarch64 [maven-mvnd]

Posted by "slachiewicz (via GitHub)" <gi...@apache.org>.
slachiewicz closed issue #888: Build for Linux on aarch64
URL: https://github.com/apache/maven-mvnd/issues/888


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Build for Linux on aarch64 [maven-mvnd]

Posted by "PMExtra (via GitHub)" <gi...@apache.org>.
PMExtra commented on issue #888:
URL: https://github.com/apache/maven-mvnd/issues/888#issuecomment-1767766564

   I'm sorry that I do not specialize in native programming. So, I'm unsure if my build only requires glibc@2.12.
   
   But I built the project followed by the official workflow (https://github.com/apache/maven-mvnd/blob/1.0-m7/.github/workflows/release.yaml#L67) which contains #825 that solves #823.
   
   I just replaced all `amd64` or `x86_64` with `aarch64` after this patch.
   
   Then everything was fine, even the `Verify native binary for only requiring glibc 2.12` script passed. (https://github.com/apache/maven-mvnd/blob/1.0-m7/.github/workflows/release.yaml#L91).
   
   When I copy the target to another aarch64 machine that runs Kylin-OS (a Linux distribution that seems like CentOS 8), it still works fine.
   
   
   It is worth mentioning that my `PAGE_SIZE` is 64k rather than 4k (maybe 4k is more common). So I have to set `-H:PageSize=65536`. We can get more information from https://github.com/oracle/graal/pull/5605


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Build for Linux on aarch64 [maven-mvnd]

Posted by "gzm55 (via GitHub)" <gi...@apache.org>.
gzm55 commented on issue #888:
URL: https://github.com/apache/maven-mvnd/issues/888#issuecomment-1873664250

   > I'm sorry that I do not specialize in native programming. So, I'm unsure if my build only requires glibc@2.12.
   > 
   > But I built the project followed by the official workflow (https://github.com/apache/maven-mvnd/blob/1.0-m7/.github/workflows/release.yaml#L67) which contains #825 that solves #823.
   > 
   > I just replaced all `amd64` or `x86_64` with `aarch64` after this patch.
   > 
   > Then everything was fine, even the `Verify native binary for only requiring glibc 2.12` script passed. (https://github.com/apache/maven-mvnd/blob/1.0-m7/.github/workflows/release.yaml#L91).
   > 
   > When I copy the target to another aarch64 machine that runs Kylin-OS (a Linux distribution that seems like CentOS 8), it still works fine.
   > 
   > It is worth mentioning that my `PAGE_SIZE` is 64k rather than 4k (maybe 4k is more common). So I have to set `-H:PageSize=65536`. We can get more information from [oracle/graal#5605](https://github.com/oracle/graal/pull/5605)
   
   For aarch64 arch, the oldest public released glibc is glibc-2.17 for CentOS7. It is reasonable that we limit the running glibc >= 2.17 on aarch64 cpu. But the resource should be upload for each hardware (x64/arm64). Also the UT in CI could be improved to check dependencies strictly for each arch.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Build for Linux on aarch64 [maven-mvnd]

Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on issue #888:
URL: https://github.com/apache/maven-mvnd/issues/888#issuecomment-1767722017

   My understanding is that it would go against https://github.com/apache/maven-mvnd/issues/823.
   Can this patch be adapted  to be inlined and only require glibc 2.12 ?
   
   It would be nice to be able to provide native binaries for linux-arm64, but I don't think GitHub action has any runner yet (see https://github.com/actions/runner-images/issues/5631).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Build for Linux on aarch64 [maven-mvnd]

Posted by "PMExtra (via GitHub)" <gi...@apache.org>.
PMExtra commented on issue #888:
URL: https://github.com/apache/maven-mvnd/issues/888#issuecomment-1767772118

   By the way, I built the project by Docker which runs on my Apple M1 Macbook.
   
   So, can we use the macOS runner to start up a container and then build the project for linux-aarch64?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Build for Linux on aarch64 [maven-mvnd]

Posted by "ggjulio (via GitHub)" <gi...@apache.org>.
ggjulio commented on issue #888:
URL: https://github.com/apache/maven-mvnd/issues/888#issuecomment-2938798030

   +1, would be quite useful for people using MacOS since they only sell arm laptops.
   
   Is it okay to bump to `2.17` or should we use a different glibc version between arm and amd ?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Build for Linux on aarch64 [maven-mvnd]

Posted by "gzm55 (via GitHub)" <gi...@apache.org>.
gzm55 commented on issue #888:
URL: https://github.com/apache/maven-mvnd/issues/888#issuecomment-2581555789

   > @gnodet question: why we need to be compatible with this specific glibc 2.12 - seams to me that it's pretty old one
   > 
   > like here: https://repology.org/project/glibc/versions
   
   glibc supports arm from 2.17, we could use different verify conditions for x64 and arm.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Build for Linux on aarch64 [maven-mvnd]

Posted by "slachiewicz (via GitHub)" <gi...@apache.org>.
slachiewicz commented on issue #888:
URL: https://github.com/apache/maven-mvnd/issues/888#issuecomment-2581381689

   @gnodet question: why we need to be compatible with this specific glibc 2.12 - seams to me that it's pretty old one
   
   like here: https://repology.org/project/glibc/versions
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Build for Linux on aarch64 [maven-mvnd]

Posted by "huilaokedejuzi (via GitHub)" <gi...@apache.org>.
huilaokedejuzi commented on issue #888:
URL: https://github.com/apache/maven-mvnd/issues/888#issuecomment-2409858969

   > By the way, I built the project by Docker which runs on my Apple M1 Macbook.
   > 
   > So, can we use the macOS runner to start up a container and then build the project for linux-aarch64?
   
   I used Windows to run the container and tried to build the project in the linux-aarch64 container, but the build time was too long and there were always errors in the mvnd-client build:["pool-1-thread-1" Id=47 in TIMED_WAITING on lock=java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject@5733b0b1], with some threads experiencing deadlocks. It has already taken a week. Could you please send me the mvnd of your aarch64 machine running on Kylin OS email or other means so that I can try using it.Thank you very much.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Build for Linux on aarch64 [maven-mvnd]

Posted by "slachiewicz (via GitHub)" <gi...@apache.org>.
slachiewicz commented on issue #888:
URL: https://github.com/apache/maven-mvnd/issues/888#issuecomment-6249607715

   Linux aarch64 distributions are published from 1.0.5 on (https://github.com/apache/maven-mvnd/pull/1527), built on a native arm64 runner. The 2.x line has the same workflow and ships them from its next release.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org