Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
generator/linux: copy ELF interpreter from architecture-specific loca…
…tions Issue swiftlang#147 occurs because the ELF interpreter is found at different paths, and with different names, on different architectures. We happen to pick up the x86_64 interpreter because it is stored in /lib64, which we aready copy, but we miss the aarch64 interpreter. An ELF binary contains an interpreter path which can point anywhere, but there are defacto standard default locations. * According to https://refspecs.linuxbase.org/elf/x86_64-abi-0.99.pdf) the x86_64 / amd64 ABI specifies that the interpreter should be at /lib/ld64.so.1, but Linux overrides this and uses /lib64/ld-linux-x86-64.so.2. * I couldn't find a similar document for ARM64 / aarch64 - https://github.com/ARM-software/abi-aa/tree/main/aaelf64 is silent on the interpreter path - but most sources I could find place it at /lib/ld-linux-aarch64.so.1 - for example zulu-openjdk/zulu-openjdk#11 There is a pattern to the paths and filenames but it seems risky to try to construct them; instead this PR adds a new field to `Triple` which returns the default path for each architecture. For now we only support x86_64 and aarch64 - if new architectures are added in future we will need to add new entries for them. This change fixes issue swiftlang#147. Compared to swiftlang#153, all the basic 'hello world' tests now pass. The tests which import Foundation still fail on all Swift 6.0 SDKs. | SDK | Hello World | Foundation | | ----------------------------------------- | ----------- | ---------- | | ubuntu_aarch64_5.9.2-RELEASE | ok | ok | | ubuntu_aarch64_5.9.2-RELEASE_with-docker | ok | ok | | ubuntu_aarch64_5.10.1-RELEASE | ok | ok | | ubuntu_aarch64_5.10.1-RELEASE_with-docker | ok | ok | | ubuntu_aarch64_6.0.2-RELEASE | ok | FAIL2 | | ubuntu_aarch64_6.0.2-RELEASE_with-docker | ok | FAIL2 | | | | | | ubuntu_x86_64_5.9.2-RELEASE | ok | ok | | ubuntu_x86_64_5.9.2-RELEASE_with-docker | ok | ok | | ubuntu_x86_64_5.10.1-RELEASE | ok | ok | | ubuntu_x86_64_5.10.1-RELEASE_with-docker | ok | ok | | ubuntu_x86_64_6.0.2-RELEASE | ok | FAIL2 | | ubuntu_x86_64_6.0.2-RELEASE_with-docker | ok | FAIL2 | | | | | | rhel_aarch64_5.9.2-RELEASE_with-docker | ok | ok | | rhel_aarch64_5.10.1-RELEASE_with-docker | ok | ok | | rhel_aarch64_6.0.2-RELEASE_with-docker | ok | FAIL2 | | | | | | rhel_x86_64_5.9.2-RELEASE_with-docker | ok | ok | | rhel_x86_64_5.10.1-RELEASE_with-docker | ok | ok | | rhel_x86_64_6.0.2-RELEASE_with-docker | ok | FAIL2 | FAIL1: cannot find /lib/ld-linux-aarch64.so.1 FAIL2: missing required module '_FoundationCShims' Fixes: swiftlang#147
- Loading branch information