summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys-power/iasl/files/iasl-20190703-Makefile.patch105
-rw-r--r--sys-power/iasl/files/iasl-20190703-gcc10-fno-common.patch64
-rw-r--r--sys-power/iasl/iasl-20190703-r1.ebuild129
3 files changed, 298 insertions, 0 deletions
diff --git a/sys-power/iasl/files/iasl-20190703-Makefile.patch b/sys-power/iasl/files/iasl-20190703-Makefile.patch
new file mode 100644
index 000000000000..f245c97d5317
--- /dev/null
+++ b/sys-power/iasl/files/iasl-20190703-Makefile.patch
@@ -0,0 +1,105 @@
+--- a/generate/unix/acpiexec/Makefile
++++ b/generate/unix/acpiexec/Makefile
+@@ -256,12 +256,12 @@
+ endif
+
+ ifneq ($(HOST),_QNX)
+-LDFLAGS += -lpthread
++LIBS += -lpthread
+ endif
+
+ ifneq ($(HOST),_APPLE)
+ ifneq ($(HOST),_QNX)
+-LDFLAGS += -lrt
++LIBS += -lrt
+ endif
+ endif
+
+--- a/generate/unix/Makefile.config
++++ b/generate/unix/Makefile.config
+@@ -35,15 +35,14 @@
+ .SUFFIXES :
+ PROGS = acpibin acpidump acpiexamples acpiexec acpihelp acpinames acpisrc acpixtract iasl
+ HOST ?= _CYGWIN
+-CC ?= gcc
+
+ #
+ # Common defines
+ #
+ OBJDIR = obj
+ BINDIR = bin
+-COMPILEOBJ = $(CC) -c $(CFLAGS) $(OPT_CFLAGS) -o $@ $<
+-LINKPROG = $(CC) $(OBJECTS) -o $(PROG) $(LDFLAGS) $(OPT_LDFLAGS)
++COMPILEOBJ = $(CC) -c $(CFLAGS) $(CPPFLAGS) $(OPT_CFLAGS) -o $@ $<
++LINKPROG = $(CC) $(LDFLAGS) $(OBJECTS) -o $(PROG) $(LIBS)
+ PREFIX ?= /usr
+ INSTALLDIR = $(PREFIX)/bin
+ UNAME_S := $(shell uname -s)
+@@ -76,7 +75,7 @@
+ INSTALLFLAGS ?= -f
+ else
+ INSTALL = install
+-INSTALLFLAGS ?= -m 555 -s
++INSTALLFLAGS ?= -m 555
+ endif
+
+ INSTALLPROG = \
+@@ -153,26 +152,18 @@
+ #
+ ifeq ($(M32),TRUE)
+ CFLAGS +=-m32
+-LDFLAGS +=-m32
++LIBS +=-m32
+ endif
+
+ #
+ # Optionally disable optimizations. Optimization causes problems on
+ # some compilers such as gcc 4.4
+ #
+-ifneq ($(NOOPT),TRUE)
+-OPT_CFLAGS += -O2
+-else
+-OPT_CFLAGS += -O0
+-endif
+
+ #
+ # Optionally disable fortify source. This option can cause
+ # compile errors in toolchains where it is already defined.
+ #
+-ifneq ($(NOFORTIFY),TRUE)
+-OPT_CFLAGS += -D_FORTIFY_SOURCE=2
+-endif
+
+ CFLAGS += \
+ -D$(HOST)\
+@@ -264,11 +255,11 @@
+ #YACC= byacc
+ #YFLAGS +=
+ #
+-YACC= bison
++YACC= LC_ALL=C bison
+ YFLAGS += -y
+
+ MACROPROC= m4
+ MFLAGS= -P -I$(ASL_COMPILER)
+
+-LEX= flex
++LEX= LC_ALL=C flex
+ LFLAGS += -i -s
+--- a/generate/unix/Makefile.rules
++++ b/generate/unix/Makefile.rules
+@@ -12,12 +12,12 @@
+
+ $(PROG) : $(INTERMEDIATES) $(MISC) $(OBJECTS)
+ @echo "- Link" $(PROG)
+- @$(LINKPROG)
++ $(LINKPROG)
+ $(RENAMEPROG)
+
+ $(OBJDIR)/%.o : %.c $(HEADERS) $(ACPICA_HEADERS)
+ @echo $(PROG) $<
+- @$(COMPILEOBJ)
++ $(COMPILEOBJ)
+
+ clean :
+ @rm -f $(PROG) $(PROG).exe $(OBJECTS) $(OBJDIR)/*.o $(INTERMEDIATES) $(MISC)
diff --git a/sys-power/iasl/files/iasl-20190703-gcc10-fno-common.patch b/sys-power/iasl/files/iasl-20190703-gcc10-fno-common.patch
new file mode 100644
index 000000000000..d6b8fd83cf02
--- /dev/null
+++ b/sys-power/iasl/files/iasl-20190703-gcc10-fno-common.patch
@@ -0,0 +1,64 @@
+--- a/source/compiler/aslcompiler.l
++++ b/source/compiler/aslcompiler.l
+@@ -156,7 +156,7 @@
+
+ #include <stdlib.h>
+ #include <string.h>
+-YYSTYPE AslCompilerlval;
++#define YYSTYPE AslCompilerlval;
+
+ /*
+ * Generation: Use the following command line:
+--- a/source/compiler/dtparser.l
++++ b/source/compiler/dtparser.l
+@@ -208,7 +208,7 @@
+ /*
+ * Local support functions
+ */
+-YY_BUFFER_STATE LexBuffer;
++static YY_BUFFER_STATE LexBuffer;
+
+ /******************************************************************************
+ *
+--- a/source/compiler/prparser.l
++++ b/source/compiler/prparser.l
+@@ -224,7 +224,7 @@
+ /*
+ * Local support functions
+ */
+-YY_BUFFER_STATE LexBuffer;
++static YY_BUFFER_STATE LexBuffer;
+
+
+ /******************************************************************************
+--- a/source/include/acglobal.h
++++ b/source/include/acglobal.h
+@@ -438,7 +438,6 @@
+ ACPI_INIT_GLOBAL (ACPI_THREAD_ID, AcpiGbl_DbThreadId, ACPI_INVALID_THREAD_ID);
+
+ ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_NoIniMethods);
+-ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_NoRegionSupport);
+ ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOutputToFile);
+ ACPI_GLOBAL (char *, AcpiGbl_DbBuffer);
+ ACPI_GLOBAL (char *, AcpiGbl_DbFilename);
+--- a/source/include/acpixf.h
++++ b/source/include/acpixf.h
+@@ -231,6 +231,8 @@
+ *
+ ****************************************************************************/
+
++ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_NoRegionSupport, FALSE);
++
+ /*
+ * Enable "slack mode" of the AML interpreter? Default is FALSE, and the
+ * interpreter strictly follows the ACPI specification. Setting to TRUE
+--- a/source/tools/acpiexec/aemain.c
++++ b/source/tools/acpiexec/aemain.c
+@@ -192,7 +192,6 @@
+ UINT8 AcpiGbl_RegionFillValue = 0;
+ BOOLEAN AcpiGbl_IgnoreErrors = FALSE;
+ BOOLEAN AcpiGbl_AbortLoopOnTimeout = FALSE;
+-BOOLEAN AcpiGbl_DbOpt_NoRegionSupport = FALSE;
+ UINT8 AcpiGbl_UseHwReducedFadt = FALSE;
+ BOOLEAN AcpiGbl_DoInterfaceTests = FALSE;
+ BOOLEAN AcpiGbl_LoadTestTables = FALSE;
diff --git a/sys-power/iasl/iasl-20190703-r1.ebuild b/sys-power/iasl/iasl-20190703-r1.ebuild
new file mode 100644
index 000000000000..2bb7d450ab68
--- /dev/null
+++ b/sys-power/iasl/iasl-20190703-r1.ebuild
@@ -0,0 +1,129 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit eutils toolchain-funcs
+
+MY_PN=acpica-unix
+MY_P="${MY_PN}-${PV}"
+MY_TESTS_P="${MY_PN/ca/tests}-${PV}"
+
+DESCRIPTION="Intel ACPI Source Language (ASL) compiler"
+HOMEPAGE="https://www.acpica.org/downloads/"
+SRC_URI="
+ http://www.acpica.org/sites/acpica/files/${MY_P}.tar.gz
+ test? ( http://www.acpica.org/sites/acpica/files/${MY_TESTS_P}.tar.gz )"
+
+LICENSE="iASL"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~ppc ~x86"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+BDEPEND="
+ sys-devel/bison
+ sys-devel/flex"
+
+S="${WORKDIR}/${MY_P}"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-20190703-gcc10-fno-common.patch
+ "${FILESDIR}"/${PN}-20190703-Makefile.patch
+)
+
+pkg_setup() {
+ if use test && has test ${FEATURES}; then
+ ewarn 'You have selected USE="test". This will install the test results'
+ ewarn "into /usr/share/${PF}/, compressed as a tarball."
+ ewarn 'The tests themselves will only rarely die, but the test results'
+ ewarn 'are interesting for arch testing. The tests may take quite some'
+ ewarn 'time to complete.'
+ fi
+}
+
+src_prepare() {
+ default
+
+ find "${S}" -type f -name 'Makefile*' -print0 | \
+ xargs -0 -I '{}' \
+ sed -r -e 's:-\<Werror\>::g' -e "s:/usr:${EPREFIX}/usr:g" \
+ -i '{}' \
+ || die
+}
+
+src_configure() {
+ tc-export CC
+
+ # BITS is tied to ARCH - please set appropriately if you add new keywords
+ if [[ $ARCH == @(amd64|amd64-fbsd) ]] ; then
+ export BITS=64
+ else
+ export BITS=32
+ fi
+}
+
+src_compile() {
+ emake -C generate/unix BITS="${BITS}"
+}
+
+src_test() {
+ aslts_test
+ #The aapits test currently fails, missing include probably.
+ #aapits_test
+}
+
+src_install() {
+ cd generate/unix || die
+ emake install DESTDIR="${D}" BITS=${BITS}
+ default
+ #local bin
+ #for bin in $(<"${T}"/binlist) ; do
+ # dobin "${T}"/${bin}
+ #done
+ dodoc "${S}"/changes.txt
+ newdoc "${S}"/source/compiler/readme.txt compiler-readme.txt
+ newdoc "${S}"/generate/unix/readme.txt unix-readme.txt
+ newdoc "${S}"/generate/lint/readme.txt lint-readme.txt
+ newdoc "${S}"/source/compiler/new_table.txt compiler-new_table.txt
+
+ if use test && has test ${FEATURES}; then
+ tb="${T}"/testresults.tar.bz2
+ export ASLTSDIR="$(<"${T}"/asltdir)"
+ ebegin "Creating Test Tarball"
+ tar -cjf "${tb}" -C "${ASLTSDIR}"/tmp/RESULTS . || die "tar failed"
+ eend $?
+ insinto /usr/share/${PF}
+ doins ${tb}
+ fi
+}
+
+aslts_test() {
+ export ASL="${S}"/generate/unix/bin/iasl \
+ acpibin="${S}"/generate/unix/bin/acpibin \
+ acpiexec="${S}"/generate/unix/bin/acpiexec \
+ ASLTSDIR="${WORKDIR}/${MY_TESTS_P}"/tests/aslts
+ export PATH="${PATH}:${ASLTSDIR}/bin"
+ echo "$ASLTSDIR" >"${T}"/asltdir
+ cd "${ASLTSDIR}" || die
+ edos2unix $(find . -type 'f')
+ make install || die "make install aslts test failed"
+ chmod +x $(find bin/ ! -regex 'ERROR_OPCODES|HOW_TO_USE|README' ) || die "chmod bin +x failed"
+
+ #The below Do commands runs the tests twice and then dies if the results aren't
+ #Identical.
+ Do 1 || die "failed Do 1"
+ Do 2 || die "failed Do 2"
+}
+
+aapits_test() {
+ mv "${WORKDIR}/${MY_TESTS_P}/tests/aapits" "${S}/tools/" || die "mv failed"
+ cd "${S}/tools/aapits" || die "cannot find ${S}/tools/aapits"
+ edos2unix $(find . -type 'f')
+ chmod +x $(find bin/ | sed -r -e '/\/[A-Z_]+$/d') || die "chmod bin +x failed"
+ make || die "make in aapits failed"
+ cd asl || die "cd asl failed"
+ make || die "make in asl failed"
+ cd ../bin || die
+ ./aapitsrun || die "aapitsrun failed"
+}