aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.txt20
-rw-r--r--arm-linux-gnueabi-binutils/PKGBUILD87
-rw-r--r--arm-linux-gnueabi-gcc/COPYING.DOC451
-rw-r--r--arm-linux-gnueabi-gcc/PKGBUILD155
-rwxr-xr-xarm-linux-gnueabi-glibc/PKGBUILD163
-rw-r--r--arm-linux-gnueabi-linux-libre-lts-api-headers/PKGBUILD43
-rw-r--r--binutils-source/PKGBUILD93
-rw-r--r--gcc-source/PKGBUILD100
-rw-r--r--glibc-source/PKGBUILD95
-rw-r--r--linux-libre-lts-source/0001-usb-serial-gadget-no-TTY-hangup-on-USB-disconnect-WI.patch39
-rw-r--r--linux-libre-lts-source/0002-fix-Atmel-maXTouch-touchscreen-support.patch37
-rw-r--r--linux-libre-lts-source/PKGBUILD91
-rw-r--r--linux-libre-lts-source/change-default-console-loglevel.patch11
-rw-r--r--linux-libre-lts-source/radeon_hack.patch53
14 files changed, 1438 insertions, 0 deletions
diff --git a/README.txt b/README.txt
new file mode 100644
index 0000000..e83b8b4
--- /dev/null
+++ b/README.txt
@@ -0,0 +1,20 @@
+This repository contains PKGBUILDs for gcc arm cross-compiler.
+I made these in 2019 because back then there was no working
+arm-linux-gnueabi-gcc in any of: Arch, Parabola, Hyperbola, AUR.
+If you want to make use of this now, you'll need to adapt it to
+newer versions of packages...
+
+I did all this in a bit non-standard way (using -source packages)
+because it seemed cleaner than having to pull the same sources
+for builds of both glibc and gcc...
+These packages actually bootstrap the arm cross-compiler without
+the need for an earlier version of it to be present. This
+is like (professional) Debian's approach and unlike Arch's.
+
+I inspired heavily from Debian's packaging of gcc cross-compilers.
+
+I (obviously) release my contributions to the PKGBUILDs under
+Creative Commons Zero. The original PKGBUILDs I based on were
+available on AUR and in Hyperbola's (and maybe Parabola's) repos and
+I couldn't find any explicit license notice for them. By common sense
+I assume they were not non-free.
diff --git a/arm-linux-gnueabi-binutils/PKGBUILD b/arm-linux-gnueabi-binutils/PKGBUILD
new file mode 100644
index 0000000..e22deb5
--- /dev/null
+++ b/arm-linux-gnueabi-binutils/PKGBUILD
@@ -0,0 +1,87 @@
+# Contributor: Wojtek Kosior <kwojtus@protonmail.com>
+
+# TODO check if it really breaks on i686 (as some PKGBUILDs suggest) and why
+
+_target=arm-linux-gnueabi
+pkgname=$_target-binutils
+_pkgver=2.28
+pkgver=${_pkgver}.0
+_debrel=5
+pkgrel=1
+pkgdesc='A set of programs to assemble and manipulate binary and object files for the ARM GNU/Linux EABI target'
+arch=(i686 x86_64)
+url='http://www.gnu.org/software/binutils/'
+license=('GPL-3' 'LGPL-3')
+groups=('cross-devel')
+depends=('glibc>=2.25' 'zlib')
+makedepends=(binutils-source=$pkgver)
+checkdepends=('dejagnu' 'bc')
+options=('staticlibs' '!distcc' '!ccache')
+
+conflicts=(arm-unknown-linux-gnueabi-binutils)
+
+prepare() {
+ prepare-binutils-source "${srcdir}"
+
+ cd "${srcdir}/binutils-$_pkgver"
+
+ # hack! - libiberty configure tests for header files using "$CPP $CPPFLAGS"
+ sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" libiberty/configure
+
+ mkdir -p ${srcdir}/binutils-build
+}
+
+build() {
+ cd "${srcdir}/binutils-build"
+
+ # There's some gossip about --enable-gold causing fail on i686. Needs checking.
+ "${srcdir}/binutils-$_pkgver/configure" \
+ --target=$_target \
+ --prefix=/usr \
+ --with-lib-path=/lib:/usr/lib:/usr/local/lib \
+ --with-bugurl=https://issues.hyperbola.info/ \
+ --with-sysroot=/usr/$_target \
+ --prefix=/usr \
+ --with-gnu-as \
+ --with-gnu-ld \
+ --with-pic \
+ --enable-threads \
+ --enable-ld=default \
+ --enable-gold \
+ --enable-plugins \
+ --enable-deterministic-archives \
+ --disable-multilib \
+ --disable-werror \
+ --disable-gdb \
+ --disable-nls
+
+ # check the host environment and makes sure all the necessary tools are available
+ make configure-host
+
+ make
+}
+
+check() {
+ cd "${srcdir}/binutils-build"
+
+ # unset LDFLAGS as testsuite makes assumptions about which ones are active
+ # do not abort on errors - manually check log files
+ make -k LDFLAGS="" check || true
+}
+
+package() {
+ cd "${srcdir}/binutils-build"
+
+ make DESTDIR="$pkgdir" install
+
+ # Remove manpages for MS Windows tools
+ rm "$pkgdir"/usr/share/man/man1/$_target-{dlltool,nlmconv,windres,windmc}*
+
+ # Remove info documents that conflict with host version
+ rm -r "$pkgdir"/usr/share/info
+
+ # install license files
+ install -dm755 "${pkgdir}/usr/share/licenses/${pkgname}"
+ install -m644 "${srcdir}/binutils-$_pkgver/"COPYING3{,.LIB} \
+ "${pkgdir}/usr/share/licenses/${pkgname}"
+}
diff --git a/arm-linux-gnueabi-gcc/COPYING.DOC b/arm-linux-gnueabi-gcc/COPYING.DOC
new file mode 100644
index 0000000..bf128be
--- /dev/null
+++ b/arm-linux-gnueabi-gcc/COPYING.DOC
@@ -0,0 +1,451 @@
+
+ GNU Free Documentation License
+ Version 1.3, 3 November 2008
+
+
+ Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
+ <https://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+0. PREAMBLE
+
+The purpose of this License is to make a manual, textbook, or other
+functional and useful document "free" in the sense of freedom: to
+assure everyone the effective freedom to copy and redistribute it,
+with or without modifying it, either commercially or noncommercially.
+Secondarily, this License preserves for the author and publisher a way
+to get credit for their work, while not being considered responsible
+for modifications made by others.
+
+This License is a kind of "copyleft", which means that derivative
+works of the document must themselves be free in the same sense. It
+complements the GNU General Public License, which is a copyleft
+license designed for free software.
+
+We have designed this License in order to use it for manuals for free
+software, because free software needs free documentation: a free
+program should come with manuals providing the same freedoms that the
+software does. But this License is not limited to software manuals;
+it can be used for any textual work, regardless of subject matter or
+whether it is published as a printed book. We recommend this License
+principally for works whose purpose is instruction or reference.
+
+
+1. APPLICABILITY AND DEFINITIONS
+
+This License applies to any manual or other work, in any medium, that
+contains a notice placed by the copyright holder saying it can be
+distributed under the terms of this License. Such a notice grants a
+world-wide, royalty-free license, unlimited in duration, to use that
+work under the conditions stated herein. The "Document", below,
+refers to any such manual or work. Any member of the public is a
+licensee, and is addressed as "you". You accept the license if you
+copy, modify or distribute the work in a way requiring permission
+under copyright law.
+
+A "Modified Version" of the Document means any work containing the
+Document or a portion of it, either copied verbatim, or with
+modifications and/or translated into another language.
+
+A "Secondary Section" is a named appendix or a front-matter section of
+the Document that deals exclusively with the relationship of the
+publishers or authors of the Document to the Document's overall
+subject (or to related matters) and contains nothing that could fall
+directly within that overall subject. (Thus, if the Document is in
+part a textbook of mathematics, a Secondary Section may not explain
+any mathematics.) The relationship could be a matter of historical
+connection with the subject or with related matters, or of legal,
+commercial, philosophical, ethical or political position regarding
+them.
+
+The "Invariant Sections" are certain Secondary Sections whose titles
+are designated, as being those of Invariant Sections, in the notice
+that says that the Document is released under this License. If a
+section does not fit the above definition of Secondary then it is not
+allowed to be designated as Invariant. The Document may contain zero
+Invariant Sections. If the Document does not identify any Invariant
+Sections then there are none.
+
+The "Cover Texts" are certain short passages of text that are listed,
+as Front-Cover Texts or Back-Cover Texts, in the notice that says that
+the Document is released under this License. A Front-Cover Text may
+be at most 5 words, and a Back-Cover Text may be at most 25 words.
+
+A "Transparent" copy of the Document means a machine-readable copy,
+represented in a format whose specification is available to the
+general public, that is suitable for revising the document
+straightforwardly with generic text editors or (for images composed of
+pixels) generic paint programs or (for drawings) some widely available
+drawing editor, and that is suitable for input to text formatters or
+for automatic translation to a variety of formats suitable for input
+to text formatters. A copy made in an otherwise Transparent file
+format whose markup, or absence of markup, has been arranged to thwart
+or discourage subsequent modification by readers is not Transparent.
+An image format is not Transparent if used for any substantial amount
+of text. A copy that is not "Transparent" is called "Opaque".
+
+Examples of suitable formats for Transparent copies include plain
+ASCII without markup, Texinfo input format, LaTeX input format, SGML
+or XML using a publicly available DTD, and standard-conforming simple
+HTML, PostScript or PDF designed for human modification. Examples of
+transparent image formats include PNG, XCF and JPG. Opaque formats
+include proprietary formats that can be read and edited only by
+proprietary word processors, SGML or XML for which the DTD and/or
+processing tools are not generally available, and the
+machine-generated HTML, PostScript or PDF produced by some word
+processors for output purposes only.
+
+The "Title Page" means, for a printed book, the title page itself,
+plus such following pages as are needed to hold, legibly, the material
+this License requires to appear in the title page. For works in
+formats which do not have any title page as such, "Title Page" means
+the text near the most prominent appearance of the work's title,
+preceding the beginning of the body of the text.
+
+The "publisher" means any person or entity that distributes copies of
+the Document to the public.
+
+A section "Entitled XYZ" means a named subunit of the Document whose
+title either is precisely XYZ or contains XYZ in parentheses following
+text that translates XYZ in another language. (Here XYZ stands for a
+specific section name mentioned below, such as "Acknowledgements",
+"Dedications", "Endorsements", or "History".) To "Preserve the Title"
+of such a section when you modify the Document means that it remains a
+section "Entitled XYZ" according to this definition.
+
+The Document may include Warranty Disclaimers next to the notice which
+states that this License applies to the Document. These Warranty
+Disclaimers are considered to be included by reference in this
+License, but only as regards disclaiming warranties: any other
+implication that these Warranty Disclaimers may have is void and has
+no effect on the meaning of this License.
+
+2. VERBATIM COPYING
+
+You may copy and distribute the Document in any medium, either
+commercially or noncommercially, provided that this License, the
+copyright notices, and the license notice saying this License applies
+to the Document are reproduced in all copies, and that you add no
+other conditions whatsoever to those of this License. You may not use
+technical measures to obstruct or control the reading or further
+copying of the copies you make or distribute. However, you may accept
+compensation in exchange for copies. If you distribute a large enough
+number of copies you must also follow the conditions in section 3.
+
+You may also lend copies, under the same conditions stated above, and
+you may publicly display copies.
+
+
+3. COPYING IN QUANTITY
+
+If you publish printed copies (or copies in media that commonly have
+printed covers) of the Document, numbering more than 100, and the
+Document's license notice requires Cover Texts, you must enclose the
+copies in covers that carry, clearly and legibly, all these Cover
+Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
+the back cover. Both covers must also clearly and legibly identify
+you as the publisher of these copies. The front cover must present
+the full title with all words of the title equally prominent and
+visible. You may add other material on the covers in addition.
+Copying with changes limited to the covers, as long as they preserve
+the title of the Document and satisfy these conditions, can be treated
+as verbatim copying in other respects.
+
+If the required texts for either cover are too voluminous to fit
+legibly, you should put the first ones listed (as many as fit
+reasonably) on the actual cover, and continue the rest onto adjacent
+pages.
+
+If you publish or distribute Opaque copies of the Document numbering
+more than 100, you must either include a machine-readable Transparent
+copy along with each Opaque copy, or state in or with each Opaque copy
+a computer-network location from which the general network-using
+public has access to download using public-standard network protocols
+a complete Transparent copy of the Document, free of added material.
+If you use the latter option, you must take reasonably prudent steps,
+when you begin distribution of Opaque copies in quantity, to ensure
+that this Transparent copy will remain thus accessible at the stated
+location until at least one year after the last time you distribute an
+Opaque copy (directly or through your agents or retailers) of that
+edition to the public.
+
+It is requested, but not required, that you contact the authors of the
+Document well before redistributing any large number of copies, to
+give them a chance to provide you with an updated version of the
+Document.
+
+
+4. MODIFICATIONS
+
+You may copy and distribute a Modified Version of the Document under
+the conditions of sections 2 and 3 above, provided that you release
+the Modified Version under precisely this License, with the Modified
+Version filling the role of the Document, thus licensing distribution
+and modification of the Modified Version to whoever possesses a copy
+of it. In addition, you must do these things in the Modified Version:
+
+A. Use in the Title Page (and on the covers, if any) a title distinct
+ from that of the Document, and from those of previous versions
+ (which should, if there were any, be listed in the History section
+ of the Document). You may use the same title as a previous version
+ if the original publisher of that version gives permission.
+B. List on the Title Page, as authors, one or more persons or entities
+ responsible for authorship of the modifications in the Modified
+ Version, together with at least five of the principal authors of the
+ Document (all of its principal authors, if it has fewer than five),
+ unless they release you from this requirement.
+C. State on the Title page the name of the publisher of the
+ Modified Version, as the publisher.
+D. Preserve all the copyright notices of the Document.
+E. Add an appropriate copyright notice for your modifications
+ adjacent to the other copyright notices.
+F. Include, immediately after the copyright notices, a license notice
+ giving the public permission to use the Modified Version under the
+ terms of this License, in the form shown in the Addendum below.
+G. Preserve in that license notice the full lists of Invariant Sections
+ and required Cover Texts given in the Document's license notice.
+H. Include an unaltered copy of this License.
+I. Preserve the section Entitled "History", Preserve its Title, and add
+ to it an item stating at least the title, year, new authors, and
+ publisher of the Modified Version as given on the Title Page. If
+ there is no section Entitled "History" in the Document, create one
+ stating the title, year, authors, and publisher of the Document as
+ given on its Title Page, then add an item describing the Modified
+ Version as stated in the previous sentence.
+J. Preserve the network location, if any, given in the Document for
+ public access to a Transparent copy of the Document, and likewise
+ the network locations given in the Document for previous versions
+ it was based on. These may be placed in the "History" section.
+ You may omit a network location for a work that was published at
+ least four years before the Document itself, or if the original
+ publisher of the version it refers to gives permission.
+K. For any section Entitled "Acknowledgements" or "Dedications",
+ Preserve the Title of the section, and preserve in the section all
+ the substance and tone of each of the contributor acknowledgements
+ and/or dedications given therein.
+L. Preserve all the Invariant Sections of the Document,
+ unaltered in their text and in their titles. Section numbers
+ or the equivalent are not considered part of the section titles.
+M. Delete any section Entitled "Endorsements". Such a section
+ may not be included in the Modified Version.
+N. Do not retitle any existing section to be Entitled "Endorsements"
+ or to conflict in title with any Invariant Section.
+O. Preserve any Warranty Disclaimers.
+
+If the Modified Version includes new front-matter sections or
+appendices that qualify as Secondary Sections and contain no material
+copied from the Document, you may at your option designate some or all
+of these sections as invariant. To do this, add their titles to the
+list of Invariant Sections in the Modified Version's license notice.
+These titles must be distinct from any other section titles.
+
+You may add a section Entitled "Endorsements", provided it contains
+nothing but endorsements of your Modified Version by various
+parties--for example, statements of peer review or that the text has
+been approved by an organization as the authoritative definition of a
+standard.
+
+You may add a passage of up to five words as a Front-Cover Text, and a
+passage of up to 25 words as a Back-Cover Text, to the end of the list
+of Cover Texts in the Modified Version. Only one passage of
+Front-Cover Text and one of Back-Cover Text may be added by (or
+through arrangements made by) any one entity. If the Document already
+includes a cover text for the same cover, previously added by you or
+by arrangement made by the same entity you are acting on behalf of,
+you may not add another; but you may replace the old one, on explicit
+permission from the previous publisher that added the old one.
+
+The author(s) and publisher(s) of the Document do not by this License
+give permission to use their names for publicity for or to assert or
+imply endorsement of any Modified Version.
+
+
+5. COMBINING DOCUMENTS
+
+You may combine the Document with other documents released under this
+License, under the terms defined in section 4 above for modified
+versions, provided that you include in the combination all of the
+Invariant Sections of all of the original documents, unmodified, and
+list them all as Invariant Sections of your combined work in its
+license notice, and that you preserve all their Warranty Disclaimers.
+
+The combined work need only contain one copy of this License, and
+multiple identical Invariant Sections may be replaced with a single
+copy. If there are multiple Invariant Sections with the same name but
+different contents, make the title of each such section unique by
+adding at the end of it, in parentheses, the name of the original
+author or publisher of that section if known, or else a unique number.
+Make the same adjustment to the section titles in the list of
+Invariant Sections in the license notice of the combined work.
+
+In the combination, you must combine any sections Entitled "History"
+in the various original documents, forming one section Entitled
+"History"; likewise combine any sections Entitled "Acknowledgements",
+and any sections Entitled "Dedications". You must delete all sections
+Entitled "Endorsements".
+
+
+6. COLLECTIONS OF DOCUMENTS
+
+You may make a collection consisting of the Document and other
+documents released under this License, and replace the individual
+copies of this License in the various documents with a single copy
+that is included in the collection, provided that you follow the rules
+of this License for verbatim copying of each of the documents in all
+other respects.
+
+You may extract a single document from such a collection, and
+distribute it individually under this License, provided you insert a
+copy of this License into the extracted document, and follow this
+License in all other respects regarding verbatim copying of that
+document.
+
+
+7. AGGREGATION WITH INDEPENDENT WORKS
+
+A compilation of the Document or its derivatives with other separate
+and independent documents or works, in or on a volume of a storage or
+distribution medium, is called an "aggregate" if the copyright
+resulting from the compilation is not used to limit the legal rights
+of the compilation's users beyond what the individual works permit.
+When the Document is included in an aggregate, this License does not
+apply to the other works in the aggregate which are not themselves
+derivative works of the Document.
+
+If the Cover Text requirement of section 3 is applicable to these
+copies of the Document, then if the Document is less than one half of
+the entire aggregate, the Document's Cover Texts may be placed on
+covers that bracket the Document within the aggregate, or the
+electronic equivalent of covers if the Document is in electronic form.
+Otherwise they must appear on printed covers that bracket the whole
+aggregate.
+
+
+8. TRANSLATION
+
+Translation is considered a kind of modification, so you may
+distribute translations of the Document under the terms of section 4.
+Replacing Invariant Sections with translations requires special
+permission from their copyright holders, but you may include
+translations of some or all Invariant Sections in addition to the
+original versions of these Invariant Sections. You may include a
+translation of this License, and all the license notices in the
+Document, and any Warranty Disclaimers, provided that you also include
+the original English version of this License and the original versions
+of those notices and disclaimers. In case of a disagreement between
+the translation and the original version of this License or a notice
+or disclaimer, the original version will prevail.
+
+If a section in the Document is Entitled "Acknowledgements",
+"Dedications", or "History", the requirement (section 4) to Preserve
+its Title (section 1) will typically require changing the actual
+title.
+
+
+9. TERMINATION
+
+You may not copy, modify, sublicense, or distribute the Document
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense, or distribute it is void, and
+will automatically terminate your rights under this License.
+
+However, if you cease all violation of this License, then your license
+from a particular copyright holder is reinstated (a) provisionally,
+unless and until the copyright holder explicitly and finally
+terminates your license, and (b) permanently, if the copyright holder
+fails to notify you of the violation by some reasonable means prior to
+60 days after the cessation.
+
+Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, receipt of a copy of some or all of the same material does
+not give you any rights to use it.
+
+
+10. FUTURE REVISIONS OF THIS LICENSE
+
+The Free Software Foundation may publish new, revised versions of the
+GNU Free Documentation License from time to time. Such new versions
+will be similar in spirit to the present version, but may differ in
+detail to address new problems or concerns. See
+https://www.gnu.org/licenses/.
+
+Each version of the License is given a distinguishing version number.
+If the Document specifies that a particular numbered version of this
+License "or any later version" applies to it, you have the option of
+following the terms and conditions either of that specified version or
+of any later version that has been published (not as a draft) by the
+Free Software Foundation. If the Document does not specify a version
+number of this License, you may choose any version ever published (not
+as a draft) by the Free Software Foundation. If the Document
+specifies that a proxy can decide which future versions of this
+License can be used, that proxy's public statement of acceptance of a
+version permanently authorizes you to choose that version for the
+Document.
+
+11. RELICENSING
+
+"Massive Multiauthor Collaboration Site" (or "MMC Site") means any
+World Wide Web server that publishes copyrightable works and also
+provides prominent facilities for anybody to edit those works. A
+public wiki that anybody can edit is an example of such a server. A
+"Massive Multiauthor Collaboration" (or "MMC") contained in the site
+means any set of copyrightable works thus published on the MMC site.
+
+"CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0
+license published by Creative Commons Corporation, a not-for-profit
+corporation with a principal place of business in San Francisco,
+California, as well as future copyleft versions of that license
+published by that same organization.
+
+"Incorporate" means to publish or republish a Document, in whole or in
+part, as part of another Document.
+
+An MMC is "eligible for relicensing" if it is licensed under this
+License, and if all works that were first published under this License
+somewhere other than this MMC, and subsequently incorporated in whole or
+in part into the MMC, (1) had no cover texts or invariant sections, and
+(2) were thus incorporated prior to November 1, 2008.
+
+The operator of an MMC Site may republish an MMC contained in the site
+under CC-BY-SA on the same site at any time before August 1, 2009,
+provided the MMC is eligible for relicensing.
+
+
+ADDENDUM: How to use this License for your documents
+
+To use this License in a document you have written, include a copy of
+the License in the document and put the following copyright and
+license notices just after the title page:
+
+ Copyright (c) YEAR YOUR NAME.
+ Permission is granted to copy, distribute and/or modify this document
+ under the terms of the GNU Free Documentation License, Version 1.3
+ or any later version published by the Free Software Foundation;
+ with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
+ A copy of the license is included in the section entitled "GNU
+ Free Documentation License".
+
+If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
+replace the "with...Texts." line with this:
+
+ with the Invariant Sections being LIST THEIR TITLES, with the
+ Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
+
+If you have Invariant Sections without Cover Texts, or some other
+combination of the three, merge those two alternatives to suit the
+situation.
+
+If your document contains nontrivial examples of program code, we
+recommend releasing these examples in parallel under your choice of
+free software license, such as the GNU General Public License,
+to permit their use in free software.
diff --git a/arm-linux-gnueabi-gcc/PKGBUILD b/arm-linux-gnueabi-gcc/PKGBUILD
new file mode 100644
index 0000000..bd3825d
--- /dev/null
+++ b/arm-linux-gnueabi-gcc/PKGBUILD
@@ -0,0 +1,155 @@
+# Contributor: Wojtek Kosior <kwojtus@protonmail.com>
+
+# TODO Maybe enable more languages? And pack them separately?
+
+_target=arm-linux-gnueabi
+pkgname=${_target}-gcc
+pkgver=6.3.0
+pkgrel=1
+pkgdesc="The GNU Compiler Collection - cross compiler for ARM GNU/Linux EABI target"
+arch=('i686' 'x86_64')
+license=('GPL-3' 'LGPL-3' 'custom:GCC-Exception-3.1' 'FDL-1.3')
+url="https://gcc.gnu.org"
+groups=('cross-devel')
+depends=("${_target}-binutils>=2.28" "${_target}-glibc" 'libmpc')
+makedepends=('gcc-ada' 'doxygen' "gcc-source=${pkgver}")
+# Check()ing a cross-compiler would require using an emulator (qemu), I believe.
+# For now - leave checkdepends commented-out
+# checkdepends=('dejagnu' 'inetutils')
+options=('!emptydirs' 'staticlibs' '!strip')
+source=(COPYING.DOC)
+sha512sums=('bea1788b2bdc84f470e459114b871cf4ee991718964a63e18adde65116806d7676484cb30857cf74dece5eef5f96a015ee4a21900e019623e5d3484868b28b7f')
+
+prepare() {
+ cd "${srcdir}"
+
+ prepare-gcc-source .
+
+ # Do not run fixincludes
+ sed -i 's@\./fixinc\.sh@-c true@' gcc-${pkgver}/gcc/Makefile.in
+
+ # hack! - some configure tests for header files using "$CPP $CPPFLAGS"
+ sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" gcc-${pkgver}/{libiberty,gcc}/configure
+
+ mkdir gcc_build
+}
+
+build() {
+ cd "${srcdir}/gcc_build"
+
+ # using -pipe causes spurious test-suite failures
+ # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48565
+ CFLAGS=${CFLAGS/-pipe/}
+ CXXFLAGS=${CXXFLAGS/-pipe/}
+
+ # libmpx seems to be some intel stuff - x86 only
+ "${srcdir}/gcc-${pkgver}/configure" \
+ --prefix=/usr \
+ --libdir=/usr/lib \
+ --libexecdir=/usr/libexec \
+ --with-local-prefix=/usr/${_target} \
+ --with-sysroot=/usr/${_target} \
+ --with-build-sysroot=/usr/${_target} \
+ --with-as=/usr/bin/${_target}-as \
+ --with-ld=/usr/bin/${_target}-ld \
+ --with-native-system-header-dir=/include \
+ --with-bugurl=https://issues.hyperbola.info/ \
+ --enable-languages=c,c++,lto \
+ --enable-shared \
+ --enable-threads=posix \
+ `[[ $_target =~ (i686)|(x86_64) ]] &&
+ echo --enable-libmpx` \
+ --with-system-zlib \
+ --with-isl \
+ --enable-__cxa_atexit \
+ --disable-libunwind-exceptions \
+ --enable-clocale=gnu \
+ --disable-libstdcxx-pch \
+ --disable-libssp \
+ --enable-gnu-unique-object \
+ --enable-linker-build-id \
+ --enable-lto \
+ --enable-plugin \
+ --enable-install-libiberty \
+ --with-linker-hash-style=gnu \
+ --enable-gnu-indirect-function \
+ --disable-multilib \
+ --disable-werror \
+ --enable-checking=release \
+ --disable-nls \
+ --target=${_target}
+
+ make
+}
+
+# maybe check() using qemu?
+
+package() {
+ cd "${srcdir}/gcc_build"
+
+ make DESTDIR="${pkgdir}" install-gcc \
+ install-target-{libgcc,libstdc++-v3,libgomp,libquadmath}
+
+ # TODO I'm not sure about this stripping. Everybody seems to be doing it a different way...
+ # I commented out all 2>/dev/null to be able to see what's going on. Uncomment them once
+ # everything works as it should :)
+
+ # strip target binaries
+ find "${pkgdir}/usr/lib/gcc/${_target}/" "${pkgdir}/usr/${_target}/lib" \
+ -type f -and \( -name \*.a -or -name \*.o \) \
+ -exec ${_target}-strip $STRIP_STATIC '{}' + 2>/dev/null
+
+ find "${pkgdir}/usr/lib/gcc/${_target}/" "${pkgdir}/usr/${_target}/lib" \
+ -not -name 'libgcc_s.so' -name \*.so -type f \
+ -exec ${_target}-strip $STRIP_SHARED '{}' + 2>/dev/null
+
+ # strip host binaries
+ find "${pkgdir}/usr/bin/" "${pkgdir}/usr/lib/gcc/${_target}/" \
+ -type f -executable -exec strip $STRIP_BINARIES '{}' + 2>/dev/null
+
+ # many packages expect this symlink
+ ln -s "${_target}-gcc" "${pkgdir}/usr/bin/${_target}-cc"
+
+ # POSIX conformance launcher scripts for c89 and c99
+ cat > "${pkgdir}/usr/bin/${_target}-c89" <<"EOF"
+#!/bin/sh
+fl="-std=c89"
+for opt; do
+ case "$opt" in
+ -ansi|-std=c89|-std=iso9899:1990) fl="";;
+ -std=*) echo "`basename $0` called with non ANSI/ISO C option $opt" >&2
+ exit 1;;
+ esac
+done
+exec gcc $fl ${1+"$@"}
+EOF
+sed -i "s|exec gcc|exec ${_target}-gcc|" "${pkgdir}/usr/bin/${_target}-c89"
+
+ cat > "${pkgdir}/usr/bin/${_target}-c99" <<"EOF"
+#!/bin/sh
+fl="-std=c99"
+for opt; do
+ case "$opt" in
+ -std=c99|-std=iso9899:1999) fl="";;
+ -std=*) echo "`basename $0` called with non ISO C99 option $opt" >&2
+ exit 1;;
+ esac
+done
+exec gcc $fl ${1+"$@"}
+EOF
+sed -i "s|exec gcc|exec ${_target}-gcc|" "${pkgdir}/usr/bin/${_target}-c99"
+
+ chmod 755 "${pkgdir}/usr/bin/${_target}"-c{8,9}9
+
+ # Remove man documents that conflict with host version
+ rm -rf ${pkgdir}/usr/share/man/man7
+
+ # Remove unused dirs
+ rm -rf ${pkgdir}/usr/share/{info,gcc-${pkgver}}
+
+ # Add licenses
+ install -m755 -d "${pkgdir}/usr/share/licenses/${_target}-gcc"
+ install -m644 "${srcdir}/gcc-${pkgver}"/COPYING{3{,.LIB},.RUNTIME} "${srcdir}/COPYING.DOC" \
+ "${pkgdir}/usr/share/licenses/${_target}-gcc"
+}
+
diff --git a/arm-linux-gnueabi-glibc/PKGBUILD b/arm-linux-gnueabi-glibc/PKGBUILD
new file mode 100755
index 0000000..10f4f07
--- /dev/null
+++ b/arm-linux-gnueabi-glibc/PKGBUILD
@@ -0,0 +1,163 @@
+# Contributor: Wojtek Kosior <kwojtus@protonmail.com>
+
+# TODO tools from ${_target}-binutils package could be used instead
+# of building temporary binutils. I couldn't get them to work easily,
+# however. If You can (and have time), fix it.
+
+# TODO There should be some switch to disable building of docs.
+# It'd speed up the build + enable us to remove doxygen from depends
+
+_target=arm-linux-gnueabi
+pkgname=${_target}-glibc
+pkgver=2.25
+pkgrel=1
+pkgdesc="The GNU C Library ARM GNU/Linux EABI target"
+arch=(any)
+license=('GPL-3' 'LGPL-3')
+url="https://gcc.gnu.org"
+groups=('cross-devel')
+depends=("glibc-source=$pkgver" 'gcc-source' 'binutils-source')
+makedepends=('gcc-ada' 'doxygen')
+# The following are checkdepends of gcc. They should only get
+# uncommented if we decide to check the temporary compiler.
+# checkdepends=('dejagnu' 'inetutils')
+options=('!strip' 'staticlibs')
+
+prepare() {
+ cd "${srcdir}"
+ prepare-gcc-source .
+ prepare-glibc-source .
+ prepare-binutils-source .
+
+ # hack! - some configure tests for header files using "$CPP $CPPFLAGS"
+ sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" \
+ gcc-*/{libiberty,gcc}/configure binutils-*/libiberty/configure
+
+ mkdir -p {gcc,glibc,binutils}_build cross_tools
+}
+
+build() {
+ # Build primitive binutils and gcc for building glibc
+ cd "${srcdir}/binutils_build"
+
+ ../binutils-*/configure \
+ --prefix="${srcdir}/cross_tools" \
+ --with-sysroot="${srcdir}/cross_tools" \
+ --with-lib-path="${srcdir}/cross_tools/lib" \
+ --target=${_target} \
+ --disable-gdb \
+ --disable-nls \
+ --disable-werror \
+ --disable-multilib \
+ --disable-threads \
+ --disable-gold # or could we enable it and use gold for glibc later?
+
+ make configure-host
+ make
+ make install
+
+ cd "${srcdir}/gcc_build"
+
+ # using -pipe causes spurious test-suite failures
+ # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48565
+ # But for now we're not testing this temporary compiler,
+ # so the next 2 lines stay commented-out :)
+ # CFLAGS=${CFLAGS/-pipe/}
+ # CXXFLAGS=${CXXFLAGS/-pipe/}
+
+ ../gcc-*/configure \
+ --target=${_target} \
+ --prefix="${srcdir}/cross_tools" \
+ --with-newlib \
+ --without-headers \
+ --disable-nls \
+ --disable-shared \
+ --disable-multilib \
+ --disable-decimal-float \
+ --disable-threads \
+ --disable-libatomic \
+ --disable-libgomp \
+ --disable-libquadmath \
+ --disable-libssp \
+ --disable-libvtv \
+ --disable-libstdcxx \
+ --enable-languages=c,c++ \
+ --with-bugurl=https://issues.hyperbola.info/ \
+ --with-system-zlib \
+ --with-glibc-version=2.11
+
+ # Perhaps `make all-gcc target-libgcc` would be the right thing?
+ make
+ make install
+
+ cd "${srcdir}/glibc_build"
+
+ # If (for example) we're building glibc for arm and CFLAGS contains
+ # -march=x86_64, it shall break configure. That's why we remove -march= flag.
+ # -mtune=generic is also not supported on some arches.
+ # Warning: extglob option in bash must be enabled for this
+ # pattern matching to work (can be done using shopt builtin).
+ CFLAGS=${CFLAGS/-march=+([^[:space:]])/}
+ CFLAGS=${CFLAGS/-mtune=+([^[:space:]])/}
+
+ # remove fortify for building libraries
+ CPPFLAGS=${CPPFLAGS/-D_FORTIFY_SOURCE=[[:digit:]]/}
+
+ echo "slibdir=/lib" > configparms
+ echo "rtlddir=/lib" >> configparms
+ echo "sbindir=/usr/sbin" >> configparms
+ echo "rootsbindir=/sbin" >> configparms
+ echo "vardbdir=/var/lib/misc" >> configparms
+
+ ../glibc-*/configure \
+ --prefix=/usr \
+ --includedir=/include \
+ --libdir=/lib \
+ --libexecdir=/libexec \
+ --with-bugurl=https://issues.hyperbola.info/ \
+ --enable-add-ons \
+ --enable-obsolete-rpc \
+ --enable-kernel=2.6.32 \
+ --enable-bind-now \
+ --disable-profile \
+ --enable-stackguard-randomization \
+ --enable-stack-protector=strong \
+ --enable-lock-elision \
+ --enable-multi-arch \
+ --disable-werror \
+ --host=${_target} \
+ --with-headers=/usr/${_target}/include \
+ --with-binutils="${srcdir}/cross_tools/bin/" \
+ CC="${srcdir}/cross_tools/bin/${_target}-gcc"
+
+ echo "build-programs=no" >> configparms
+ make
+}
+
+package() {
+ cd "${srcdir}/glibc_build"
+
+ make install_root="${pkgdir}/usr/${_target}" install
+
+ rm -r "${pkgdir}/usr/${_target}/"{etc,var,usr}
+
+ STRIP="${srcdir}/cross_tools/bin/${_target}-strip"
+
+ # Aside from using different strip tool, we do all the stripping the same, as it
+ # is done for native glibc. Perhaps it is wrong. If You know better, change it.
+
+ if check_option 'debug' n; then
+ find "${pkgdir}/usr/${_target}/bin" -type f -executable -exec \
+ "$STRIP" $STRIP_BINARIES {} + 2> /dev/null || true
+ find "${pkgdir}/usr/${_target}/lib" -name '*.a' -type f -exec \
+ "$STRIP" $STRIP_STATIC {} + 2> /dev/null || true
+
+ # Do not strip these for gdb and valgrind functionality, but strip the rest.
+ find "$pkgdir"/usr/${_target}/lib \
+ -not -name 'ld-*.so' \
+ -not -name 'libc-*.so' \
+ -not -name 'libpthread-*.so' \
+ -not -name 'libthread_db-*.so' \
+ -name '*-*.so' -type f -exec "$STRIP" $STRIP_SHARED {} + 2> /dev/null || true
+ fi
+}
diff --git a/arm-linux-gnueabi-linux-libre-lts-api-headers/PKGBUILD b/arm-linux-gnueabi-linux-libre-lts-api-headers/PKGBUILD
new file mode 100644
index 0000000..83fcb99
--- /dev/null
+++ b/arm-linux-gnueabi-linux-libre-lts-api-headers/PKGBUILD
@@ -0,0 +1,43 @@
+# Maintainer: André Silva <emulatorman@hyperbola.info>
+# Contributor: Wojtek Kosior <kwojtus@protonmail.com>
+# Maintainer (Arch): Anatol Pomozov <anatol.pomozov@gmail.com>
+
+# Based on aarch64-linux-gnu-linux-libre-lts-api-headers package
+
+_target_arch=arm
+_target=arm-linux-gnueabi
+pkgname=$_target-linux-libre-lts-api-headers
+_pkgbasever=4.9-gnu
+_pkgver=${_pkgbasever%-*}.176-gnu
+
+_srcname=linux-${_pkgbasever%-*}
+pkgver=${_pkgver//-/_}
+pkgrel=2
+pkgdesc="Kernel headers sanitized for use in userspace ($_target) - Long Term Support (LTS)"
+arch=(any)
+url='https://www.gnu.org/software/libc'
+license=(GPL2)
+provides=($_target-linux-api-headers)
+conflicts=($_target-linux-api-headers)
+replaces=($_target-linux-api-headers)
+makedepends=(linux-libre-lts-source=$pkgver)
+
+prepare() {
+ prepare-linux-libre-lts-source "${srcdir}"
+}
+
+build() {
+ cd "${srcdir}/${_srcname}"
+
+ make ARCH=$_target_arch mrproper
+ make ARCH=$_target_arch headers_check
+}
+
+package() {
+ cd "${srcdir}/${_srcname}"
+
+ make INSTALL_HDR_PATH="$pkgdir/usr/$_target/" ARCH=$_target_arch V=0 headers_install
+
+ # clean-up unnecessary files generated during install
+ find "$pkgdir" \( -name .install -or -name ..install.cmd \) -delete
+}
diff --git a/binutils-source/PKGBUILD b/binutils-source/PKGBUILD
new file mode 100644
index 0000000..6e38917
--- /dev/null
+++ b/binutils-source/PKGBUILD
@@ -0,0 +1,93 @@
+# Contributor: Wojtek Kosior <kwojtus@protonmail.com>
+
+# Loosely based on Hyperbola's binutils package
+
+pkgname=binutils-source
+_pkgver=2.28
+pkgver=${_pkgver}.0
+_debrel=5
+pkgrel=1
+pkgdesc="Source of a set of programs to assemble and manipulate binary and object files"
+arch=('any')
+url="https://www.gnu.org/software/binutils/"
+license=('GPL-3' 'LGPL-3')
+depends=('quilt')
+source=(https://ftp.gnu.org/gnu/binutils/binutils-$_pkgver.tar.bz2{,.sig}
+ https://deb.debian.org/debian/pool/main/b/binutils/binutils_$_pkgver-$_debrel.diff.gz)
+validpgpkeys=('EAF1C276A747E9ED86210CBAC3126D3B4AE55E93') # Tristan Gingold <gingold@adacore.com>
+sha512sums=('ede2e4e59a800260eea8c14eafbaee94e30abadafd5c419a3370f9f62213cf027d6400a1d4970b6958bd4d220e675dcd483a708107016e7abd5c99d7392ba8fd'
+ 'SKIP'
+ '77933ab9543db3ad9640f737d4cd688ddc9da7b91d72fe0f18f9f3457a499e31ca9b27674790e00b5e7c29c85a5ec4fd09ed58de92ca0a8622422886d20a6add')
+
+noextract=(binutils-$_pkgver.tar.bz2)
+
+# Many patches fail to apply. These are the files that work. We'll only use them.
+_desired_patch_files=(001_ld_makefile_patch.patch
+ 006_better_file_error.patch
+ 012_check_ldrunpath_length.patch
+ 013_bash_in_ld_testsuite.patch
+ 128_build_id.patch
+ 130_gold_disable_testsuite_build.patch
+ 131_ld_bootstrap_testsuite.patch
+ 157_ar_scripts_with_tilde.patch
+ i18n-fr.diff
+ pr21074-revert.diff
+ pr21135.diff
+ pr21137.diff
+ pr21139.diff
+ pr21156.diff
+ pr21157.diff
+ pr21342.diff
+ pr21412.diff
+ pr21414.diff
+ pr21431.diff
+ pr21432.diff
+ pr21434.diff
+ pr21438.diff
+ pr21440.diff
+ pr70909.diff
+ pr-ld-16428.diff
+ series)
+
+prepare() {
+ cd "${srcdir}"
+
+ # this command creates, among all, the directory debian/patches and fills it
+ patch -p1 -i binutils_$_pkgver-$_debrel.diff
+
+ # Patches and 'series' file will go to /usr/src/binutils/debian_patches.
+ # We're not interested in rest of the stuff in debian/.
+
+ # here we create script to be used for unpacking binutils sources we'll install
+
+ echo "\
+#!/bin/sh
+
+mkdir -p \"\$1\" && cd \"\$1\"
+
+bsdtar -xf /usr/src/binutils/binutils-$_pkgver.tar.bz2
+
+export QUILT_PATCHES=/usr/src/binutils/debian_patches
+export QUILT_REFRESH_ARGS='-p ab --no-timestamps --no-index'
+export QUILT_DIFF_ARGS='--no-timestamps'
+
+cd binutils-${_pkgver}
+
+quilt push -av
+rm -r .pc/" > prepare-binutils-source
+}
+
+package () {
+ install -m755 -d "${pkgdir}/usr/src/binutils/debian_patches/"
+
+ # install patches
+ cd "${srcdir}/debian/patches"
+ install -m644 ${_desired_patch_files[@]} "${pkgdir}/usr/src/binutils/debian_patches"
+
+ # install tarballs
+ install -m644 "${srcdir}/binutils-$_pkgver.tar.bz2" "${pkgdir}/usr/src/binutils"
+
+ # install our script
+ install -m755 -d "${pkgdir}/usr/bin"
+ install -m755 "${srcdir}/prepare-binutils-source" "${pkgdir}/usr/bin"
+}
diff --git a/gcc-source/PKGBUILD b/gcc-source/PKGBUILD
new file mode 100644
index 0000000..ed2e9aa
--- /dev/null
+++ b/gcc-source/PKGBUILD
@@ -0,0 +1,100 @@
+# Contributor: Wojtek Kosior <kwojtus@protonmail.com>
+
+pkgname=gcc-source
+pkgver=6.3.0
+_debrel=18+deb9u1
+_islver=0.16.1
+pkgrel=1
+pkgdesc="Source of the GNU Compiler Collection"
+arch=(any)
+license=('GPL-3' 'LGPL-3' 'custom:GCC-Exception-3.1' 'FDL-1.3')
+url="https://gcc.gnu.org"
+depends=('quilt')
+source=(https://ftp.gnu.org/gnu/gcc/gcc-$pkgver/gcc-$pkgver.tar.bz2{,.sig}
+ https://deb.debian.org/debian/pool/main/g/gcc-6/gcc-6_$pkgver-$_debrel.diff.gz
+ http://isl.gforge.inria.fr/isl-${_islver}.tar.bz2)
+
+validpgpkeys=('33C235A34C46AA3FFB293709A328C3A2C3C45C06') # Jakub Jelinek <jakub@redhat.com> (Weak DSA) :/
+sha512sums=('234dd9b1bdc9a9c6e352216a7ef4ccadc6c07f156006a59759c5e0e6a69f0abcdc14630eff11e3826dd6ba5933a8faa43043f3d1d62df6bd5ab1e82862f9bf78'
+ 'SKIP'
+ '171ad340013f87d671141f6f8e7e349a7858aaf34c15fd692c9412e012beeb5d29e966228cc24f10afcce2ca677c04449cad09e96f9d8bcb3bdbf320ea190c7d'
+ 'c188667a84dc5bdddb4ab7c35f89c91bf15a8171f4fcaf41301cf285fb7328846d9a367c096012fec4cc69d244f0bc9e95d84c09ec097394cd4093076f2a041b')
+
+noextract=(gcc-$pkgver.tar.bz2 isl-${_islver}.tar.bz2)
+
+# Most patches from debian fail to apply. These are the ones that work.
+_desired_patches=(0001-i386-Move-struct-ix86_frame-to-machine_function.diff
+ 0002-i386-Use-reference-of-struct-ix86_frame-to-avoid-copy.diff
+ 0003-i386-Use-const-reference-of-struct-ix86_frame-to-avoi.diff
+ 0004-x86-Add-mindirect-branch.diff
+ 0005-x86-Add-mfunction-return.diff
+ 0006-x86-Add-mindirect-branch-register.diff
+ 0007-x86-Add-V-register-operand-modifier.diff
+ 0008-x86-Disallow-mindirect-branch-mfunction-return-with-m.diff
+ 0009-Use-INVALID_REGNUM-in-indirect-thunk-processing.diff
+ ada-749574.diff
+ ada-revert-pr63225.diff
+ CVE-2016-9840.diff
+ CVE-2016-9841.diff
+ CVE-2016-9842.diff
+ CVE-2016-9843.diff
+ pr47818.diff
+ pr60818.diff
+ pr64735.diff
+ pr64735-headers.diff
+ pr65618.diff
+ pr66368.diff
+ pr67590.diff
+ pr67899.diff
+ pr72813.diff
+ pr77267.diff
+ pr77857.diff
+ pr78774.diff
+ pr80533.diff)
+
+prepare () {
+ cd ${srcdir}
+
+ # this command creates, among all, the directory debian/patches and fills it
+ patch -p1 -i gcc-6_$pkgver-$_debrel.diff
+
+ # quilt expects a properly formatted 'series' file with list of patches
+ echo ${_desired_patches[@]} | sed 's/ /\n/g' | sed 's/$/ -p2/' > series
+
+ # Patches and 'series' will go to /usr/src/gcc/debian_patches.
+ # We're not interested in rest of the stuff in debian/.
+
+ # here we create script to be used for unpacking gcc sources we'll install
+ echo "\
+#!/bin/sh
+
+mkdir -p \"\$1\" && cd \"\$1\"
+
+bsdtar -xf /usr/src/gcc/gcc-${pkgver}.tar.bz2
+bsdtar -xf /usr/src/gcc/isl-${_islver}.tar.bz2
+ln -s ../isl-${_islver} gcc-${pkgver}/isl
+
+export QUILT_PATCHES=/usr/src/gcc/debian_patches
+export QUILT_REFRESH_ARGS='-p ab --no-timestamps --no-index'
+export QUILT_DIFF_ARGS='--no-timestamps'
+
+cd gcc-${pkgver}
+
+quilt push -av
+rm -r .pc/" > prepare-gcc-source
+}
+
+package () {
+ install -m755 -d ${pkgdir}/usr/src/gcc/debian_patches
+
+ # install patches
+ cd ${srcdir}/debian/patches
+ install -m644 ${_desired_patches[@]} ${srcdir}/series ${pkgdir}/usr/src/gcc/debian_patches
+
+ # install tarballs
+ install -m644 ${srcdir}/{gcc-$pkgver.tar.bz2,isl-${_islver}.tar.bz2} ${pkgdir}/usr/src/gcc
+
+ # install our script
+ install -m755 -d ${pkgdir}/usr/bin
+ install -m755 ${srcdir}/prepare-gcc-source ${pkgdir}/usr/bin
+}
diff --git a/glibc-source/PKGBUILD b/glibc-source/PKGBUILD
new file mode 100644
index 0000000..db7bb78
--- /dev/null
+++ b/glibc-source/PKGBUILD
@@ -0,0 +1,95 @@
+# Contributor: Wojtek Kosior <kwojtus@protonmail.com>
+
+# Loosely based on Hyperbola's glibc package
+
+pkgname=glibc-source
+pkgver=2.25
+_debrel=3
+pkgrel=1
+pkgdesc="Source of the GNU C Library"
+arch=('any')
+url="https://www.gnu.org/software/libc"
+license=('GPL-2' 'LGPL-2.1')
+depends=('quilt')
+source=(https://ftp.gnu.org/gnu/glibc/glibc-$pkgver.tar.bz2{,.sig}
+ #https://deb.debian.org/debian/pool/main/g/glibc/glibc_$pkgver-$_debrel.debian.tar.xz # got removed from there
+ https://launchpad.net/debian/+archive/primary/+sourcefiles/glibc/${pkgver}-${_debrel}/glibc_${pkgver}-${_debrel}.debian.tar.xz)
+validpgpkeys=('BC7C7372637EC10C57D7AA6579C43DFBF1CF2187') # Siddhesh Poyarekar <siddhesh@gotplt.org>
+sha512sums=('bb6c1b2deaf9c117ef5c19efdef587c5c9d4da9380066eaa85917b20cf1cb4df1406f612bb7f9482410275676916613d05a52a573eb14758eeea152e64fcdbe2'
+ 'SKIP'
+ '7815c2adfa3751d8c95f09158ee486021f24d7c943d0c4388009cc3519c997b4a9ec1600b6c525372ae7a1e01787fb4c8faf90e1e525aa4aa2c099796c577ff9')
+
+noextract=(glibc-$pkgver.tar.bz2)
+
+# Many patches fail to apply and there're also unneeded files (e.g. README)
+_undesired_patch_files=(debian/patches/all/local-remove-manual.diff
+ debian/patches/any/local-bindresvport_blacklist.diff
+ debian/patches/any/local-bits-sigstack.diff
+ debian/patches/any/local-bootstrap-headers.diff
+ debian/patches/any/local-disable-libnss-db.diff
+ debian/patches/any/local-dynamic-resolvconf.diff
+ debian/patches/any/local-ld-multiarch.diff
+ debian/patches/any/local-ldconfig-fsync.diff
+ debian/patches/any/local-ldconfig-ignore-ld.so.diff
+ debian/patches/any/local-ldconfig-multiarch.diff
+ debian/patches/any/local-ldconfig.diff
+ debian/patches/any/local-ldso-disable-hwcap.diff
+ debian/patches/any/local-libgcc-compat-abilists.diff
+ debian/patches/any/local-libgcc-compat-main.diff
+ debian/patches/any/local-libgcc-compat-ports.diff
+ debian/patches/any/local-libpic.diff
+ debian/patches/any/local-nss-upgrade.diff
+ debian/patches/any/local-rtlddir-cross.diff
+ debian/patches/any/local-tcsetaddr.diff
+ debian/patches/any/submitted-bits-fcntl_h-at.diff
+ debian/patches/any/submitted-intl-tstgettext.diff
+ debian/patches/any/submitted-ldconfig-c-collation.diff
+ debian/patches/any/unsubmitted-ldso-machine-mismatch.diff
+ debian/patches/README
+ debian/patches/series.hurd-i386
+ debian/patches/series.kfreebsd-i386
+ debian/patches/series.kfreebsd-amd64)
+
+prepare() {
+ cd "${srcdir}"
+
+ rm -v ${_undesired_patch_files[@]}
+ # some hurd and kfreebsd changes cause problems, remove whole directories
+ rm -rv debian/patches/{hurd-i386,kfreebsd}/
+
+ # Patches and 'series' file will go to /usr/src/glibc/debian_patches.
+ # We're not interested in rest of the stuff in debian/.
+
+ # here we create script to be used for unpacking glibc sources we'll install
+
+ echo "\
+#!/bin/sh
+
+mkdir -p \"\$1\" && cd \"\$1\"
+
+bsdtar -xf /usr/src/glibc/glibc-${pkgver}.tar.bz2
+
+export QUILT_PATCHES=/usr/src/glibc/debian_patches
+export QUILT_REFRESH_ARGS='-p ab --no-timestamps --no-index'
+export QUILT_DIFF_ARGS='--no-timestamps'
+
+cd glibc-${pkgver}
+
+quilt push -av
+rm -r .pc/" > prepare-glibc-source
+}
+
+package() {
+ install -m755 -d "${pkgdir}/usr/src/glibc/debian_patches"
+
+ # install patches
+ # I should have probably used install instead of cp, but don't know how to do that concisely. Don't want to bother reading find manual, either.
+ cp -R "${srcdir}/debian/patches/"* "${pkgdir}/usr/src/glibc/debian_patches/"
+
+ # install tarballs
+ install -m644 "${srcdir}/glibc-$pkgver.tar.bz2" "${pkgdir}/usr/src/glibc"
+
+ # install our script
+ install -m755 -d "${pkgdir}/usr/bin"
+ install -m755 "${srcdir}/prepare-glibc-source" "${pkgdir}/usr/bin"
+}
diff --git a/linux-libre-lts-source/0001-usb-serial-gadget-no-TTY-hangup-on-USB-disconnect-WI.patch b/linux-libre-lts-source/0001-usb-serial-gadget-no-TTY-hangup-on-USB-disconnect-WI.patch
new file mode 100644
index 0000000..e9de435
--- /dev/null
+++ b/linux-libre-lts-source/0001-usb-serial-gadget-no-TTY-hangup-on-USB-disconnect-WI.patch
@@ -0,0 +1,39 @@
+From 716120e8010a7f400c6bed7384000e95e1465c94 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= <kyosti.malkki@gmail.com>
+Date: Mon, 26 Aug 2013 19:19:44 +0300
+Subject: [PATCH 1/2] usb serial gadget: no TTY hangup on USB disconnect [WIP]
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+We may want to maintain the TTY over USB disconnects.
+
+This is useful when we have a terminal console to a host which
+power-cycles or for other reasons resets the USB host controller.
+
+Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
+---
+ drivers/usb/gadget/function/u_serial.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/drivers/usb/gadget/function/u_serial.c b/drivers/usb/gadget/function/u_serial.c
+index b369292..d156a28 100644
+--- a/drivers/usb/gadget/function/u_serial.c
++++ b/drivers/usb/gadget/function/u_serial.c
+@@ -1258,8 +1258,13 @@ void gserial_disconnect(struct gserial *gser)
+ gser->ioport = NULL;
+ if (port->port.count > 0 || port->openclose) {
+ wake_up_interruptible(&port->drain_wait);
++#if 0
+ if (port->port.tty)
+ tty_hangup(port->port.tty);
++#else
++ if (port->port.tty)
++ stop_tty(port->port.tty);
++#endif
+ }
+ spin_unlock_irqrestore(&port->port_lock, flags);
+
+--
+1.8.1.1
+
diff --git a/linux-libre-lts-source/0002-fix-Atmel-maXTouch-touchscreen-support.patch b/linux-libre-lts-source/0002-fix-Atmel-maXTouch-touchscreen-support.patch
new file mode 100644
index 0000000..5ad26fc
--- /dev/null
+++ b/linux-libre-lts-source/0002-fix-Atmel-maXTouch-touchscreen-support.patch
@@ -0,0 +1,37 @@
+From ab8cc1b2dc1b716d5c08f72dacbe1eded269f304 Mon Sep 17 00:00:00 2001
+From: André Silva <emulatorman@parabola.nu>
+Date: Tue, 22 Mar 2016 17:58:59 -0300
+Subject: [PATCH 2/2] fix Atmel maXTouch touchscreen support
+
+The Atmel maXTouch touchscreen works with Linux-libre 3.13-gnu,
+but not with the current longterm and mainline kernels in
+Parabola.
+
+Now it needs to load nonfree firmware in mxt_initialize(),
+which is in drivers/input/touchscreen/atmel_mxt_ts.c, and the
+atmel_mxt_ts driver fails to work.
+
+This driver works if changing reject_firmware_nowait to
+request_firmware_nowait in atmel_mxt_ts.c. This line is
+requesting the file named MXT_CFG_NAME, and it's a config file,
+not the firmware blob.
+
+Signed-off-by: André Silva <emulatorman@parabola.nu>
+Signed-off-by: mytbk <mytbk920423@gmail.com>
+---
+ drivers/input/touchscreen/atmel_mxt_ts.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
+index 726a83e..d818834 100644
+--- a/drivers/input/touchscreen/atmel_mxt_ts.c
++++ b/drivers/input/touchscreen/atmel_mxt_ts.c
+@@ -1989,7 +1989,7 @@ static int mxt_initialize(struct mxt_data *data)
+ if (error)
+ goto err_free_object_table;
+
+- error = reject_firmware_nowait(THIS_MODULE, true, MXT_CFG_NAME,
++ error = request_firmware_nowait(THIS_MODULE, true, MXT_CFG_NAME,
+ &client->dev, GFP_KERNEL, data,
+ mxt_config_cb);
+ if (error) {
diff --git a/linux-libre-lts-source/PKGBUILD b/linux-libre-lts-source/PKGBUILD
new file mode 100644
index 0000000..c1a757b
--- /dev/null
+++ b/linux-libre-lts-source/PKGBUILD
@@ -0,0 +1,91 @@
+# Contributor: Wojtek Kosior <kwojtus@protonmail.com>
+
+# Loosely based on Hyperbola's linux-libre-lts package
+
+_kernelname=linux-libre-lts
+pkgname=${_kernelname}-source
+_pkgbasever=4.9-gnu
+_pkgver=${_pkgbasever%-*}.176-gnu
+
+
+_srcname=linux-${_pkgbasever%-*}
+pkgver=${_pkgver//-/_}
+pkgrel=1
+pkgdesc="Source of the Linux-libre kernel - Long Term Support (LTS)"
+arch=('any')
+url="https://linux-libre.fsfla.org/"
+license=('GPL-2')
+source=("https://linux-libre.fsfla.org/pub/linux-libre/releases/${_pkgbasever}/linux-libre-${_pkgbasever}.tar.xz"{,.sign}
+ "https://linux-libre.fsfla.org/pub/linux-libre/releases/${_pkgver}/patch-${_pkgbasever}-${_pkgver}.xz"{,.sign}
+ 'change-default-console-loglevel.patch'
+ 'radeon_hack.patch'
+ '0001-usb-serial-gadget-no-TTY-hangup-on-USB-disconnect-WI.patch'
+ '0002-fix-Atmel-maXTouch-touchscreen-support.patch')
+sha512sums=('885eb0a7fab45dc749acb4329b4330a43b704df2d5f2f5aac1811503c132ca53ca49452f9b1cc80b0826c7a4962dbe4937aecb697aa823b2543ba2cabc704816'
+ 'SKIP'
+ '2c92d52f33ecb1d5c6aa26a0b14b022f6908c4fa69d8ab52475fb11405fcbc890bb4d7f688936f8458c35d596e3b818e4632b7669e177f527247117c1934d47e'
+ 'SKIP'
+ 'd9d28e02e964704ea96645a5107f8b65cae5f4fb4f537e224e5e3d087fd296cb770c29ac76e0ce95d173bc420ea87fb8f187d616672a60a0cae618b0ef15b8c8'
+ 'f4c6deb6f3f7467ba4de303542d9c786287caeab7ef7bbd976056fc9c4fae3469884cae0f44533c6d86022d9887176b90e654ffd5b68dbe10ce465d303712357'
+ '02af4dd2a007e41db0c63822c8ab3b80b5d25646af1906dc85d0ad9bb8bbf5236f8e381d7f91cf99ed4b0978c50aee37cb9567cdeef65b7ec3d91b882852b1af'
+ 'b8fe56e14006ab866970ddbd501c054ae37186ddc065bb869cf7d18db8c0d455118d5bda3255fb66a0dde38b544655cfe9040ffe46e41d19830b47959b2fb168')
+validpgpkeys=('474402C8C582DAFBE389C427BCB7CF877E7D47A7') # Alexandre Oliva
+
+noextract=("linux-libre-${_pkgbasever}.tar.xz" "patch-${_pkgbasever}-${_pkgver}.xz")
+
+prepare() {
+ cd "${srcdir}/"
+
+ # Here we create script to be used for unpacking the sources we'll install.
+ # This scripts assumes patches went to /usr/src/${_kernelname}/patches
+ echo -n "\
+#!/bin/sh
+
+mkdir -p \"\$1\" && cd \"\$1\"
+
+bsdtar -xf /usr/src/${_kernelname}/linux-libre-${_pkgbasever}.tar.xz
+
+cd ${_srcname}
+
+# add upstream patch
+xzcat /usr/src/${_kernelname}/patches/patch-${_pkgbasever}-${_pkgver}.xz | patch -p1
+
+# Hyperbola's PKGBUILD mentions possibility of adding latest fixes from stable queue.
+# Idk how this works, so I just leave the link:
+# http://git.kernel.org/?p=linux/kernel/git/stable/stable-queue.git
+
+# set DEFAULT_CONSOLE_LOGLEVEL to 4 (same value as the 'quiet' kernel param)
+# remove this when a Kconfig knob is made available by upstream
+# (relevant patch sent upstream: https://lkml.org/lkml/2011/7/26/227)
+patch -p1 -i /usr/src/${_kernelname}/patches/change-default-console-loglevel.patch
+
+# hack to enable Radeon R600 evergreen GPUs
+# https://www.fsfla.org/pipermail/linux-libre/2016-July/003224.html
+patch -p1 -i /usr/src/${_kernelname}/patches/radeon_hack.patch
+
+# maintain the TTY over USB disconnects
+# http://www.coreboot.org/EHCI_Gadget_Debug
+patch -p1 -i /usr/src/${_kernelname}/patches/0001-usb-serial-gadget-no-TTY-hangup-on-USB-disconnect-WI.patch
+
+# fix Atmel maXTouch touchscreen support
+# https://labs.parabola.nu/issues/877
+# http://www.fsfla.org/pipermail/linux-libre/2015-November/003202.html
+patch -p1 -i /usr/src/${_kernelname}/patches/0002-fix-Atmel-maXTouch-touchscreen-support.patch
+" > prepare-linux-libre-lts-source
+}
+
+package() {
+ install -m755 -d ${pkgdir}/usr/src/${_kernelname}/patches
+
+ # install patches
+ cd ${srcdir}
+ install -m644 *.patch patch-${_pkgbasever}-${_pkgver}.xz \
+ ${pkgdir}/usr/src/${_kernelname}/patches/
+
+ #install tarball
+ install -m644 linux-libre-${_pkgbasever}.tar.xz ${pkgdir}/usr/src/${_kernelname}/
+
+ # install our script
+ install -m755 -d ${pkgdir}/usr/bin
+ install -m755 ${srcdir}/prepare-linux-libre-lts-source ${pkgdir}/usr/bin
+}
diff --git a/linux-libre-lts-source/change-default-console-loglevel.patch b/linux-libre-lts-source/change-default-console-loglevel.patch
new file mode 100644
index 0000000..11da2a9
--- /dev/null
+++ b/linux-libre-lts-source/change-default-console-loglevel.patch
@@ -0,0 +1,11 @@
+--- linux-3.16/include/linux/printk.h.old 2014-08-04 18:48:30.686043266 +0200
++++ linux-3.16/include/linux/printk.h 2014-08-04 18:48:47.706218528 +0200
+@@ -37,7 +37,7 @@
+ #define CONSOLE_LOGLEVEL_SILENT 0 /* Mum's the word */
+ #define CONSOLE_LOGLEVEL_MIN 1 /* Minimum loglevel we let people use */
+ #define CONSOLE_LOGLEVEL_QUIET 4 /* Shhh ..., when booted with "quiet" */
+-#define CONSOLE_LOGLEVEL_DEFAULT 7 /* anything MORE serious than KERN_DEBUG */
++#define CONSOLE_LOGLEVEL_DEFAULT 4 /* anything MORE serious than KERN_DEBUG */
+ #define CONSOLE_LOGLEVEL_DEBUG 10 /* issue debug messages */
+ #define CONSOLE_LOGLEVEL_MOTORMOUTH 15 /* You can't shut this one up */
+
diff --git a/linux-libre-lts-source/radeon_hack.patch b/linux-libre-lts-source/radeon_hack.patch
new file mode 100644
index 0000000..48f28c2
--- /dev/null
+++ b/linux-libre-lts-source/radeon_hack.patch
@@ -0,0 +1,53 @@
+diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c
+index e5e26e8..cf6e4f1 100644
+--- a/drivers/gpu/drm/radeon/evergreen.c
++++ b/drivers/gpu/drm/radeon/evergreen.c
+@@ -5831,7 +5831,7 @@ int evergreen_init(struct radeon_device *rdev)
+ r = ni_init_microcode(rdev);
+ if (r) {
+ DRM_ERROR("Failed to load firmware!\n");
+- return r;
++ /*(DEBLOBBED)*/
+ }
+ }
+ } else {
+@@ -5885,7 +5885,7 @@ int evergreen_init(struct radeon_device *rdev)
+ if (ASIC_IS_DCE5(rdev)) {
+ if (!rdev->mc_fw && !(rdev->flags & RADEON_IS_IGP)) {
+ DRM_ERROR("radeon: MC ucode required for NI+.\n");
+- return -EINVAL;
++ /*(DEBLOBBED)*/
+ }
+ }
+
+diff --git a/drivers/gpu/drm/radeon/ni.c b/drivers/gpu/drm/radeon/ni.c
+index c2ed7fd..cfef588 100644
+--- a/drivers/gpu/drm/radeon/ni.c
++++ b/drivers/gpu/drm/radeon/ni.c
+@@ -2389,7 +2389,7 @@ int cayman_init(struct radeon_device *rdev)
+ r = ni_init_microcode(rdev);
+ if (r) {
+ DRM_ERROR("Failed to load firmware!\n");
+- return r;
++ /*(DEBLOBBED)*/
+ }
+ }
+ } else {
+@@ -2397,7 +2397,7 @@ int cayman_init(struct radeon_device *rdev)
+ r = ni_init_microcode(rdev);
+ if (r) {
+ DRM_ERROR("Failed to load firmware!\n");
+- return r;
++ /*(DEBLOBBED)*/
+ }
+ }
+ }
+@@ -2452,7 +2452,7 @@ int cayman_init(struct radeon_device *rdev)
+ */
+ if (!rdev->mc_fw && !(rdev->flags & RADEON_IS_IGP)) {
+ DRM_ERROR("radeon: MC ucode required for NI+.\n");
+- return -EINVAL;
++ /*(DEBLOBBED)*/
+ }
+
+ return 0;