Files
guru/sys-libs/gcompat/gcompat-1.1.0.ebuild
Violet Purcell a2c44a4063 sys-libs/gcompat: fix arm64 dynamic loader name logic
Due to arm* being above arm64 in the switch statement, arm64 would end
up with ld-linux-armhf.so.3 instead of ld-linux-aarch64.so.1. Move the
arm64 case above so the correct dynamic loader name is used.

Signed-off-by: Violet Purcell <vimproved@inventati.org>
2025-02-07 15:18:45 -05:00

59 lines
1.4 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Copyright 2018-2020 Haelwenn (lanodan) Monnier <contact@hacktivis.me>
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit multilib-minimal flag-o-matic
DESCRIPTION="The GNU C Library compatibility layer for musl"
HOMEPAGE="https://git.adelielinux.org/adelie/gcompat"
SRC_URI="https://distfiles.adelielinux.org/source/${PN}/${P}.tar.xz"
LICENSE="UoI-NCSA"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="libucontext obstack"
DEPEND="
libucontext? ( sys-libs/libucontext )
obstack? ( sys-libs/obstack-standalone )
"
RDEPEND="${DEPEND}"
get_loader_name() {
# Loosely based on Adélie APKBUILD
# TODO: Check against glibcs logic
case "$ABI" in
x86) echo "ld-linux.so.2" ;;
amd64) echo "ld-linux-x86-64.so.2" ;;
arm64) echo "ld-linux-aarch64.so.1" ;;
arm*) echo "ld-linux-armhf.so.3" ;;
mips | powerpc | s390) echo "ld.so.1" ;;
esac
}
get_linker_path() {
local arch=$(ldd 2>&1 | sed -n '1s/^musl libc (\(.*\))$/\1/p')
echo "/lib/ld-musl-${arch}.so.1"
}
src_compile() {
filter-flags "-Wl,--as-needed"
emake \
LINKER_PATH="$(get_linker_path)" \
LOADER_NAME="$(get_loader_name)" \
WITH_OBSTACK="$(usex obstack 'obstack-standalone' 'no')" \
$(usex libucontext WITH_LIBUCONTEXT=yes '')
}
src_install() {
emake \
LINKER_PATH="$(get_linker_path)" \
LOADER_NAME="$(get_loader_name)" \
WITH_OBSTACK="$(usex obstack 'obstack-standalone' 'no')" \
$(usex libucontext WITH_LIBUCONTEXT=yes '') \
DESTDIR="${D}" \
install
}