commit: 1cf69245665c7122c72e7f0402749fd959f653f2 Author: Sam James <sam <AT> gentoo <DOT> org> AuthorDate: Wed Mar 13 02:20:55 2024 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Wed Mar 13 04:02:09 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1cf69245
dev-libs/libx86: fix modern C issue Closes: https://bugs.gentoo.org/880429 Signed-off-by: Sam James <sam <AT> gentoo.org> dev-libs/libx86/files/libx86-1.1-c99.patch | 17 +++++++++++++ dev-libs/libx86/libx86-1.1-r6.ebuild | 40 ++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) diff --git a/dev-libs/libx86/files/libx86-1.1-c99.patch b/dev-libs/libx86/files/libx86-1.1-c99.patch new file mode 100644 index 000000000000..619ecfefeb03 --- /dev/null +++ b/dev-libs/libx86/files/libx86-1.1-c99.patch @@ -0,0 +1,17 @@ +https://bugs.gentoo.org/880429 +https://src.fedoraproject.org/rpms/libx86/blob/rawhide/f/libx86-c99-2.patch +--- a/thunk.c ++++ b/thunk.c +@@ -157,10 +157,10 @@ int LRMI_init() { + X86EMU_pioFuncs pioFuncs = { + (&x_inb), + (&x_inw), +- (&x_inl), ++ ((x86emuu32 (*)(X86EMU_pioAddr)) &x_inl), + (&x_outb), + (&x_outw), +- (&x_outl) ++ ((void (*)(X86EMU_pioAddr, x86emuu32)) &x_outl) + }; + + X86EMU_setupPioFuncs(&pioFuncs); diff --git a/dev-libs/libx86/libx86-1.1-r6.ebuild b/dev-libs/libx86/libx86-1.1-r6.ebuild new file mode 100644 index 000000000000..924c7e02a2ab --- /dev/null +++ b/dev-libs/libx86/libx86-1.1-r6.ebuild @@ -0,0 +1,40 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit flag-o-matic toolchain-funcs + +DESCRIPTION="A hardware-independent library for executing real-mode x86 code" +HOMEPAGE="https://www.codon.org.uk/~mjg59/libx86/" +SRC_URI="https://www.codon.org.uk/~mjg59/${PN}/downloads/${P}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~arm -ppc -riscv -sparc ~x86" + +PATCHES=( + # fix compile failure with linux-headers-2.6.26, bug 235599 + "${FILESDIR}"/${PN}-0.99-ifmask.patch + # Patch for bugs #236888 and #456648 + "${FILESDIR}"/${P}-makefile.patch + # Wider arch compatibility, bug #579682 + "${FILESDIR}"/${P}-x86emu.patch + "${FILESDIR}"/${P}-c99.patch +) + +src_configure() { + tc-export AR CC + append-cflags -fno-delete-null-pointer-checks #523276 +} + +src_compile() { + emake $(usev !x86 BACKEND=x86emu) LIBRARY=shared shared +} + +src_install() { + emake \ + LIBDIR=/usr/$(get_libdir) \ + DESTDIR="${ED}" \ + install-header install-shared +}
