Compare commits

...
320 Commits
Author SHA1 Message Date
Oliver Smith 54d94a28ad pmaports.cfg: stable -> v20.05
Related: https://gitlab.com/postmarketOS/pmbootstrap/-/issues/2015
2021-06-06 16:07:58 +02:00
Alexey Minnekhanov 2f58606447 cross/busybox-static-*: upgrade to 1.31.1-r20 2021-04-03 02:29:24 +03:00
Bart Ribbers 93ad6d91d6 main/postmarketos-ui-phosh: depend on postmarketos-upgrade-gtk3 (MR 2080) 2021-03-31 16:50:02 +02:00
Bart Ribbers a6491c6261 main/postmarketos-upgrade-gtk3: new aport (MR 2080) 2021-03-31 16:42:03 +02:00
Martijn Braam 083d9dd5bf temp/megapixels: upgrade to 0.15.0 (MR 1979)
This fixes the imagemagick issue on stable by no longer depending on
imagemagick
2021-02-23 23:33:52 -08:00
Oliver Smith 2e302b27ce temp/modemmanager: set arch=all (MR 1886)
In v20.05, the modemmanager version from pmaports is further away from
the one in Alpine, therefore use the pmaports version for all arches.
[ci:skip-vercheck]: use same versions as edge
2021-01-24 17:37:01 +01:00
Dylan Van Assche a8daefb6f7 temp/modemmanager: Fix missing text messages in deep sleep and reduce probing time (MR 1886)
(cherry picked from commit 42e857ab79)
2021-01-24 17:37:01 +01:00
Dylan Van Assche 227e75a584 temp/modemmanager: Upgrade to 1.14.8 (MR 1886)
(cherry picked from commit a7b8e0289b)
2021-01-24 17:37:01 +01:00
Maarten van Gompel d1bb34d5ea temp/modemmanager: Fix sending SMS with UTF-16 characters (MR 1714) (MR 1886)
Upstream: no

Patch recommended by Aleksander Morgado in upstream issue, until a proper
fix is developed:
https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/274#note_671679

(cherry picked from commit 68ef03efbc)
2021-01-24 17:37:01 +01:00
Minecrell 4091828042 temp/modemmanager: build with a single thread only (MR 1607) (MR 1886)
For some reason, the ModemManager build tends to freeze when built
with QEMU user emulation for arm*. Changing the build to use a single
thread only (-j1) avoids that, although the build is slower of course.

Also limit building to "armhf armv7 aarch64" since the forks are not
needed on any other architectures, to reduce build times a bit. The
other architectures can just use the upstream packages from Alpine.

(cherry picked from commit fca4ec8c01)
2021-01-24 17:37:01 +01:00
Minecrell f2a7a469f0 temp/modemmanager: fork from Alpine (MR 1607) (MR 1886)
Most older Qualcomm SoCs (e.g. MSM8916, MSM8974, ...) communicate
with the modem through shared memory. On mainline kernels these
shared memory channels are exposed through the RPMSG subsystem.

This is different from communication through USB or serial interfaces
that are currently supported by ModemManager.

This commit forks the "modemmanager" package from Alpine and adds
a patch that allows ModemManager to talk to modems through the RPMSG
subsystem.

Working functionality: Calls, SMS, Mobile Data

The same patch has also been submitted upstream:
https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/merge_requests/363

(cherry picked from commit 0062418e39)
2021-01-24 17:37:01 +01:00
Oliver Smith 18a927063d temp/libqmi: fork from alpine edge (MR 1886) 2021-01-24 17:36:57 +01:00
Oliver Smith 94c26cc1da temp/libmbim: fork from alpine edge (MR 1886)
Add current version from Alpine edge (1.24.4), as the newer modemmanager
version we are about to package refuses to build with < 1.24.0.
2021-01-24 17:36:11 +01:00
Martijn Braam 2a168992db postmarketos-base: bump release to v20.05.1 (MR 1813)
[ci:ignore-count]
[ci:skip-vercheck]
2021-01-16 14:09:52 +01:00
Clayton Craft 500c2c2a3f device-pine64-pinephone: enable eg25-manager in post-upgrade (MR 1867) (MR 1813)
On existing installs of pmOS, the service should also be enabled...
2021-01-16 14:09:51 +01:00
Martijn Braam b1c9480b5d temp/eg25-manager: fork from Alpine (MR 1813) 2021-01-16 14:09:50 +01:00
clayton craft 77142727d5 device-pine64-pinephone: do not rely on modem-power from kernel (MR 1815) (MR 1813)
This adds eg25-manager for managing modem power in userspace instead of
relying on the modem-power stuff in the kernel. The userspace
eg25-manager has proven to be more reliable than using modem-power.

An older setup-modem script is installed for ofono, since eg25-manager
cannot interface with ofono (yet).

The eg25 init script was removed since it only dealt with configuring
the modem-power driver in the kernel

[ci:skip-build]: already built successfully in CI
2021-01-16 14:09:49 +01:00
clayton craft cb095c1009 linux-postmarketos-allwinner: disable modem-power driver (MR 1815) (MR 1813)
Disabling in favor of controlling modem in userspace (e.g., eg25-manager)

[ci:skip-build]: already built successfully in CI
2021-01-16 14:09:49 +01:00
Martijn Braam af927b2bd5 main/linux-postmarketos-allwinner: Fix mmc numbering for the PineTab (MR 1856) (MR 1813)
[ci:skip-build] already built on CI twice and locally
2021-01-16 14:09:48 +01:00
clayton craft 92edc1bcce postmarketos-mkinitfs: fallback to directfb if osk-sdl fails w/ mesa (1625) (MR 1625) (MR 1813)
[ci:ignore-count]
[ci:skip-vercheck]
2021-01-16 14:09:47 +01:00
clayton craft bc0c95b0ba main/postmarketos-mkinitfs: set no_supertile for osk with mesa (MR 1625) (MR 1813)
This is needed by the librem 5, else the graphics are
distorted/unusable.
2021-01-16 14:09:46 +01:00
Luca Weiss c292d7e023 main/postmarketos-mkinitfs: use kmsdrm sdl backend for osk-sdl (MR 1625) (MR 1813) 2021-01-16 14:09:46 +01:00
clayton craft ba39be1cbb main/osk-sdl: upgrade to 0.60 (MR 1781) (MR 1813) 2021-01-16 14:09:45 +01:00
Martijn Braam 6c49176686 temp/sdl2: backport from alpine (MR 1813)
Backport needed for udev support to fix the touchscreen in osk-sdl
2021-01-16 14:09:44 +01:00
Martijn Braam 5c5735a0e8 temp/{phosh,phoc,libhandy1}: backport from edge (MR 1813)
This new release of phosh with it dependencies brings the swipe to
close feature
2021-01-16 14:09:43 +01:00
Timothee LF 2031f7056a temp/gnome-software: backport Appstream from Alpine and add our own (MR 1688) (MR 1813) 2021-01-16 14:09:39 +01:00
Dylan Van Assche 0c7501844f temp/gnome-control-center: upgrade to 9999_git20201203 (MR 1777) (MR 1813)
[ci:skip-build]: already built successfully in CI
2021-01-08 16:10:33 +01:00
Martijn Braam b25d9ec485 temp/chatty: upgrade to 0.2.0 (MR 1813)
Upgrade to match the latest version from Alpine edge

[ci:ignore-count]
2021-01-08 16:10:33 +01:00
Martijn Braam cd6a3bb2e1 temp/geary: backport to stable (MR 1813)
Taken from 7b8b0ede43
2021-01-08 16:10:32 +01:00
Martijn Braam cd5239778b temp/megapixels: upgrade to 0.13.1 (MR 1813)
Sync with Alpine edge
2021-01-08 16:10:31 +01:00
Bart Ribbers 63fd2bb579 pine64-pinephone: clean setup-modem.sh script (MR 1701) (MR 1813)
Since we now use the in-kernel modem driver of Megi's 5.9 kernel, the
majority of the setup script has become unnecessary. Remove all the now
unnecessary commands and keep it just for enabling VoLTE auto profile
selecting

https://megous.com/git/linux/tree/drivers/misc/modem-power.c?h=orange-pi-5.10#n531
https://megous.com/git/linux/tree/drivers/misc/modem-power.c?h=orange-pi-5.10#n580
https://megous.com/git/linux/tree/drivers/misc/modem-power.c?h=orange-pi-5.10#n610
2021-01-08 16:10:30 +01:00
Luca Weiss 65e01ae411 pine64-pinephone: set deviceinfo_mesa_driver to get fast osk-sdl (MR 1625) (MR 1813) 2021-01-08 16:10:24 +01:00
Martijn Braam d4b6e60e0c device-pine64-pinephone: add autofocus firmware (MR 1656) (MR 1813)
[ci:skip-build]: already built successfully in CI
2021-01-08 14:37:40 +01:00
Martijn Braam db4b216343 main/linux-postmarketos-allwinner: upgrade to 5.10.4_git20210102 (megi's tree) (MR 1813)
Upgrade to the newest 5.10 kernel from megi.

Major changes:
* The RTL8723CS staging wifi driver is switched out to a new one which
  supports monitor mode and more power management features.
* The ANX7688 type-c driver for the PinePhone now communicates with the
  PMIC to actually apply the usb current limit that has been negotiated
  for usb-pd
* The PinePhone panel now runs at 60Hz instead of the ~38Hz it ran at
  before
* The PinePhone modem powermanagement driver has been updated.

Changelog: https://megous.com/git/linux/tag/?h=orange-pi-5.10-20210102-0145
2021-01-08 14:37:39 +01:00
Oliver Smith 93c8f4129b pmaports.cfg: require pmbootstrap 1.28.0 (MR 1522) (MR 1521)
This version doesn't write /etc/os-release anymore in 'pmbootstrap
install'.

(cherry picked from commit 0a9ac24560)
2021-01-07 23:47:37 +01:00
Martijn Braam 46a8a23b9e main/postmarketos-base: ship os-release (MR 1521)
Ship the /etc/os-release file from the postmarketos-base package instead
of having it generated by pmbootstrap.
2021-01-07 23:46:43 +01:00
Bart Ribbers f4b9ea4cde kde/plasma-dialer: add missing oxygen dep for ringtones 2021-01-07 20:15:43 +01:00
Alexey Min 9ccfcbcfd9 cross/musl-*: upgrade to 1.1.24-r10
Upstream commit https://gitlab.alpinelinux.org/alpine/aports/-/commit/908046ad5f96c4c1df5541ff4b0251767e110c85
2020-11-20 12:26:57 +03:00
Dylan Van Assche 7842b44979 Set voice call playback rate to 8000 Hz, closes #864 (MR 1711) (MR 1718)
(cherry picked from commit 9d0c1b48d8)
2020-11-16 17:16:21 +01:00
Pedro Moreno 7c1771b29a Pinephone: Fix excessive mic noise on call (MR 1652) (MR 1706)
Fix ucm2 settings to lower mic boost and increase mic volume.

Fixes: #720
(cherry picked from commit e4366d5f8a)
2020-11-12 07:48:48 +01:00
Oliver Smith f0cca1b32e temp/phosh: upgrade to 0.5.0 (MR 1656)
Co-Authored-By: Martijn Braam <martijn@brixit.nl>
(cherry picked from commit 4247902156)
2020-11-04 22:59:06 +01:00
clayton craft 800d4ca064 temp/phoc: upgrade to 0.4.4 (MR 1681) 2020-11-04 22:58:53 +01:00
clayton craft 8352814a05 temp/wlroots: add head state change patch (MR 1681) 2020-11-04 22:58:34 +01:00
clayton craft bc275e47b1 device-pine64-pinephone: fix suspend with elogind (MR 1636) (MR 1647)
- re-enable console suspend, which seems to be broken with elogind when
  suspending (kernel gets hung up indefinitely in vt_waitactive)

Based on my testing, this option seems to prevent suspending via
elogind (using `loginctl suspend`). When console suspend is disabled,
the kernel gets hung up in the call to vt_waitactive, and elogind times
out trying to suspend.

(cherry picked from commit f7d743a213)
Cherry pick note: the original patch added
elogind-system-sleep_musb-hdrc-quirk.hook, but this isn't needed
anymore, since we have a better fix in the kernel.
[ci:skip-build]: ollieparanoid made sure it builds, and also verified
that it works on the pinephone.
2020-11-02 10:20:58 +01:00
Bhushan Shah fb3ab8e7cb main/linux-postmarketos-allwinner: add patch for suspend hang (MR 1651) (MR 1647)
See thread at: https://lore.kernel.org/linux-usb/20201027045519.GA947883@aquila.localdomain/

Fixes: #839
(cherry picked from commit fe766c43d7)
2020-11-02 10:17:36 +01:00
Oliver Smith a41c671b4b main/postmarketos-welcome-gtk3: upgrade to 0.2.1 (MR 1564)
(cherry picked from commit d9157e1adb)
2020-10-26 09:12:09 +01:00
Oliver Smith c60e00f1f0 main/postmarketos-ui-phosh: add megapixels to _pmb_recommends (MR 1610) (MR 1641)
[ci:skip-vercheck]: doesn't need a rebuild

(cherry picked from commit 757edbd304)
2020-10-25 18:32:17 +01:00
Oliver Smith 98d485f738 temp/megapixels: upgrade to 0.11.1 (MR 1641)
Sync with Alpine edge
2020-10-25 18:32:07 +01:00
Oliver Smith d7e5388396 temp/upower: fork from alpine to apply torch patch (MR 1623) (MR 1641)
Required to make the torch button work in Phosh.

[ci:skip-build]: already built successfully in CI

(cherry picked from commit 80fec94eb8)
2020-10-25 18:31:58 +01:00
Luca Weiss bfd5e53eba temp/phosh: upgrade to 0.4.5 (MR 1623) (MR 1641)
re-fork from Alpine to get upstream packaging changes as well

(cherry picked from commit 65983235e7)
2020-10-25 18:31:40 +01:00
Oliver Smith 45be343e07 temp/libhandy1: new aport (MR 1641)
Fork from Alpine edge, phosh needs this now.
2020-10-25 18:31:32 +01:00
Oliver Smith 70caeac647 temp/phoc: upgrade to 0.4.3 (MR 1641)
Sync with Alpine edge
2020-10-25 18:31:25 +01:00
Oliver Smith 4c3e2d264c temp/wlroots: fork from Alpine edge (MR 1641)
Before upgrading phoc, we need the latest wlroots. Otherwise, the build
fails:

../src/text_input.c:104:11: error: 'struct wlr_text_input_v3' has no member named 'active_features'
  104 |  if (input->active_features & WLR_TEXT_INPUT_V3_FEATURE_SURROUNDING_TEXT) {
2020-10-25 18:31:15 +01:00
Oliver Smith e2d345b624 pine64-pinephone: update devicepkg for 5.9 kernel (MR 1614) (MR 1642)
* update modem init for modem_power
* adjust alsa configs
* remove obsolete megapixels config file

Related: https://xnux.eu/log/#020
Co-Authored-By: Martijn Braam <martijn@brixit.nl>
(cherry picked from commit 517f905b84)
[ci:skip-build]: already built successfully in CI
2020-10-23 18:15:12 +02:00
Oliver Smith c9349f0605 main/linux-postmarketos-allwinner: upgrade to 5.9.1_git20201019 (megi's tree) (MR 1614) (MR 1642)
Switch from the 5.8.x kernel with allwinner specific patches to megi's
5.9 based tree. He drives the PinePhone related kernel development
forward like no other, his tree and changes are well documented on
xnux.eu, and he frequently publishes tested "build this one" commits with
the latest improvements. It makes a faster and less time consuming
workflow to simply package these versions (after a smoke test) into
postmarketOS edge, and after some time to catch possible regressions
ship the same version in postmarketOS stable.

This kernel should make HDMI work for most people, and improve call
quality (thanks to smaeul's patches, which are integrated into megi's
tree).

Kernel config changes:
* Enable MODEM_POWER in the kernel config, among other improvements this
  allows us to get rid of the 30s delay on power off.
* Enable CONFIG_DRM_PANEL_ILITEK_ILI9881C (new PineTab panel)
* Enable CONFIG_ZRAM
* Enable CONFIG_HID_MULTITOUCH

Related: https://xnux.eu/devices/feature/modem-pp.html#toc-modem-power-driver
Changelog: https://megous.com/git/linux/tag/?h=orange-pi-5.9-20201019-1553
Co-Authored-By: Martijn Braam <martijn@brixit.nl>
Co-Authored-By: Clayton Craft <clayton@craftyguy.net>
(cherry picked from commit dcc0a8c855)
2020-10-23 16:17:53 +02:00
Oliver Smith 146aa73de5 temp/chatty: upgrade to 0.1.16 (MR 1618)
Sync with Alpine's aport again.

Related: https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/13307
2020-10-23 14:18:00 +02:00
Oliver Smith 9a8cc6836a Revert "main/postmarketos-ui-phosh: remove nemo from _pmb_recommends as workaround (MR 1638)" (MR 1639)
Nemo won't pull in mesa-dev anymore, so get rid of the workaround.
This reverts commit 58e951a1bb.
[ci:skip-vercheck]: _pmb_recommends change doesn't need version change
2020-10-23 13:43:47 +02:00
Oliver Smith 162ac55019 temp/nemo: add -dev subpackage (MR 1639)
Like in Alpine edge:
https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/13891

This fixes mesa-dev getting pulled in by installing nemo (which
currently conflicts with mesa-git-dev and causes an apk error, this is a
different issue and will also be resolved soon).
2020-10-23 13:35:16 +02:00
Oliver Smith 58e951a1bb main/postmarketos-ui-phosh: remove nemo from _pmb_recommends as workaround (MR 1638)
Remove nemo temporarily, until #834 is fixed.

[ci:skip-vercheck]: _pmb_recommends change doesn't need version change
2020-10-22 21:59:39 +02:00
clayton craft ce57516757 main/postmarketos-hidden-desktop-entries: add org.gnome.eog (MR 1583)
This application doesn't work 100% when launched from the 'desktop', but
it is still useful as a handler for opening image files from a file
browser, so the icon is hidden.

(cherry picked from commit 6ed62696c9)

[ci:skip-vercheck]: nemo has -r1, even though it's a new package in
                    pmaports. This is on purpose, because it's forked
		    from Alpine's aports and we want to keep it in sync
		    with their version.
2020-10-21 15:55:42 -07:00
Clayton Craft 2cbde0daf2 main/postmarketos-ui-phosh: add eog and Nemo to default apps (MR 1583)
eog is a nice image viewer that works pretty well on a
touchscreen/mobile display.

Nemo is a file manager from the Cinnamon desktop project, which forked
from Nautilus some time ago. It is much more usable than Nautilus on a
touchscreen/mobile display.

Set eog as default app in mimeapps.list, so it even works when hiding
the launcher with postmarketos-hidden-desktop-entries (we'll hide it,
because it doesn't work when opened directly; no image is shown and
opening a file does not work either). The list of associated mimetypes
is taken from here:
https://gitlab.gnome.org/GNOME/eog/-/blob/master/data/org.gnome.eog.desktop.in.in

(cherry picked from commit 0289b633f9)
2020-10-21 15:55:42 -07:00
Oliver Smith 4670cae1dd temp/nemo: fork from Alpine testing 2020-10-21 15:55:42 -07:00
Oliver Smith f48e2709b4 temp/cinnamon-desktop: fork from Alpine testing 2020-10-21 15:55:42 -07:00
Oliver Smith cc76e044a4 temp/xapp: fork from Alpine testing 2020-10-21 15:55:42 -07:00
Luca Weiss c227d28173 temp/feedbackd: fork from Alpine to provide newer version (MR 1616)
The new version has support for the PinePhone notification LED and more.
2020-10-05 17:13:45 +03:00
Oliver Smith 4622b5ec6b temp/megapixels: upgrade to 0.9.0 (MR 1612)
Set arch to all, as it builds for more than just ARM and the author
(Martijn) doesn't plan to make it ARM specific forever. We'd like to
ship this as default in postmarketos-ui-phosh, which is easier with
arch=all as well.

Related: https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/13006
2020-10-01 12:08:36 +02:00
Bart Ribbers 8e7853c14d firmware-pine64-rtl8723bt: upgrade to 0_git20200705 (MR 1588)
(cherry picked from commit f88001e233)
2020-09-22 16:40:58 +02:00
Martijn Braam 2ac5e8f90a device/pine64-pinephone: remove megapixels config (MR 1587) 2020-09-21 16:54:36 +02:00
Martijn Braam 4a6bb34e86 temp/megapixels: upgrade to 0.7.0 (MR 1587) 2020-09-21 16:54:31 +02:00
Bart Ribbers c7a80bf667 main/postmarketos-mkinitfs: add new trigger for osk-sdl (MR 1563)
We now trigger on files in /usr/share/postmarketos-mkinitfs-triggers.
This can be used by other packages like osk-sdl for which an updated
version would otherwise never be used in the initramfs

(cherry picked from commit 01019884fb)

(fixed conflict wrt pkgver/pkgrel while cherry-picking)
2020-09-19 23:22:44 +03:00
Bart Ribbers 631a37a814 main/osk-sdl: add empty file to mkinitfs triggers directory (MR 1563)
(cherry picked from commit 4f6bec666c)
2020-09-19 23:18:38 +03:00
Bart Ribbers e28e6c1270 temp/megapixels: new aport (MR 1580) 2020-09-15 16:59:19 +02:00
Oliver Smith 7c1bf8f52b pine64-pinephone: add megapixels config (MR 1537) (MR 1580)
Copy of https://git.sr.ht/~martijnbraam/megapixels/tree/master/pinephone.ini
Let's do it like with other device specific configs, and put them into
the device package. It's a short file and it looks like it won't change
often.

(cherry picked from commit 1acf66c8bf)
2020-09-15 16:59:19 +02:00
Oliver Smith 9e9700e8a9 main/linux-postmarketos-allwinner: enable camera related kconfig options (MR 1569) (MR 1580)
(cherry picked from commit 05332c1e0b)
2020-09-15 16:59:19 +02:00
Serge Hallyn 3e5779b378 main/linux-postmarketos-allwinner: enable CONFIG_CGROUP_FREEZER (MR 1569) (MR 1580)
Enable the freezer cgroup. This allows a user to start a large application like
firefox, freeze it to save some power, and unfreeze it to continue using it,
without having to restart the application completely. Stopping and restarting
the application completely results in more battery usage as well as lost state.

Signed-off-by: Serge Hallyn <serge@hallyn.com>
(cherry picked from commit fdd0dfebba)
2020-09-15 16:59:19 +02:00
Clayton Craft a506883463 main/linux-postmarketos-allwinner: enable LED for notifications (MR 1569) (MR 1580)
This config change is necessary for feedbackd to trigger LED
notifications.

fixes #776

(cherry picked from commit 0dc8eb9cce)
2020-09-15 16:59:19 +02:00
Bart Ribbers a23b660620 main/linux-postmarketos-allwinner: upgrade to 5.8 (MR 1569) (MR 1580)
(cherry picked from commit 37f9441e60)
2020-09-15 16:59:19 +02:00
Oliver Smith df16808825 [v20.05] CI: disable build-x86, build-armhf (MR 1581) 2020-09-15 15:54:12 +02:00
Miles Alan 02b422296e Add sxmo/ as an expected directory for gitlab CI directory structure testcase (MR 1472) (MR 1581)
(cherry picked from commit 5aff6dfaa4)
2020-09-15 15:54:08 +02:00
Oliver Smith 6ab8903bef CI: rename stages "first, second" to "lint, build" (MR 802) (MR 1581)
Make it more descriptive and match Alpine's gitlab-ci.yml.

(cherry picked from commit 816616c9de)
2020-09-15 15:54:08 +02:00
Oliver Smith 0b1dc55ab5 CI: build packages on all arches (MR 802) (MR 1581)
Split the aports-build job into arch-specific build-x86_64,
build-aarch64, ... jobs. Extend build_changed_aports.py to accept the
architecture as argument, and to build all packages for that arch where
possible.

Import and use pmbootstrap code for APKBUILD parsing etc, as we do this
already in various testcases running in this repository.

Co-Authored-By: Bart Ribbers <bribbers@disroot.org>
(cherry picked from commit e5b8b8631f)
2020-09-15 15:52:29 +02:00
Oliver Smith 1cf4803c60 CI: remove unused common.check_build() (MR 802) (MR 1581)
The function is also present in build_changed_aports.py, and it is only
used there.

(cherry picked from commit a5b75f3072)
2020-09-15 15:52:29 +02:00
Oliver Smith 86a34811d4 CI: add_pmbootstrap_to_import_path: add import (MR 802) (MR 1581)
Fix error on my machine:
	AttributeError: module 'importlib' has no attribute 'util'

(cherry picked from commit 67c0e167d2)
2020-09-15 15:52:29 +02:00
Oliver Smith d4bd9b9c15 CI: add distfile-check (MR 1388) (MR 1581)
Verify that each distfile has the same hash in a directory full of APKBUILDs.

I've considered merging the new job with aports-static, but since there
are quite a few setup steps, it would make the .gitlab-ci.yml less
readable.

Related: https://gitlab.com/postmarketOS/ci-common/-/blob/master/distfile-check/README.md
(cherry picked from commit 204a56c095)
2020-09-15 15:52:22 +02:00
Oliver Smith e65318f7dd CI: aports-static: remove redundant apk add git (MR 1388) (MR 1581)
install_pmbootstrap.sh is already installing git, and that line can be
used to install additional dependencies (as done currently with pytest).

(cherry picked from commit 76b3512a1c)
2020-09-15 15:52:13 +02:00
Oliver Smith 1a9fc14b52 CI: test_aports_ui: don't take arches from binary (MR 1508) (MR 1529)
Verify _pmb_recommends for architectures listed in the APKBUILD of
postmarketos-ui-* packages, not from their binary packages. Otherwise
disabling an architecture in a merge request will not be respected, as
the binary package still has the arch enabled.

(cherry picked from commit cedd5331e5)
2020-09-10 13:53:53 +02:00
Oliver Smith 0520275b7c hybris: remove (MR 1529)
Libhybris is failing to build for armhf too. Instead of adding !armhf
everywhere, let's just remove it: as it became clear in #703, nobody is
willing to put in the effort to maintain this properly.

If you would like to continue with libhybris on postmarketOS, please
create your own aports repository and put the aports there.

Related: https://wiki.postmarketos.org/wiki/Hybris
Closes: #703, #700, #678
(cherry picked from commit e1a3324e5a)
2020-09-10 13:53:53 +02:00
Antoine Fontaine 4cbc71ca7a ci: check for executable files (MR 1257) (MR 1529)
fix https://gitlab.com/postmarketOS/pmaports/-/issues/593.

(cherry picked from commit 11b60e838b)
2020-09-10 13:53:53 +02:00
Antoine Fontaine 264ab9e638 ci: check that kernels have pmb:cross-native enabled (MR 1247) (MR 1529)
follow up to
https://gitlab.com/postmarketOS/pmbootstrap/-/issues/1910,
https://gitlab.com/postmarketOS/pmaports/-/merge_requests/1169 and
https://gitlab.com/postmarketOS/pmaports/-/merge_requests/1187.

Fixing the repo is good, but keeping it clean is better. Ensuring it
before merge will avoid yet another fixup commit.

(cherry picked from commit 307f4f19e6)
2020-09-10 13:53:53 +02:00
Daniele Debernardi 3d7ef2e389 CI: return output of common.run_pmbootstrap (MR 1132) (MR 1529)
(cherry picked from commit 233ec0d21c)
2020-09-10 13:53:43 +02:00
Oliver Smith f2cd5f3db4 main/osk-sdl: upgrade to 0.57 (MR 1486)
Also add myself as maintainer, since I've been reviewing quite a few
osk-sdl MRs lately, tagging new versions and upgrading this pmaport.

Related: https://gitlab.com/postmarketOS/osk-sdl/-/tags/0.57
(cherry picked from commit 372f1f8add)
2020-09-10 11:12:48 +02:00
Bart Ribbers ad53487a79 main/ofonoctl: re-add (MR 1544)
This was removed in ad9e8af2a2 due to a
missing dependency (it was only available in testing). However, an user
expressed interest in it so let's just fork the dep to us and re-add
ofonoctl
2020-09-10 10:41:36 +02:00
Bart Ribbers fd3e56bbf4 temp/py3-tabulate: fork from Alpine 2020-09-10 10:41:28 +02:00
Luca Weiss 1f47e97574 pine64-pinephone: add anx7688 module to initramfs for usb keyboards (MR 1555)
The anx7688 module is needed for any USB devices to probe which we want
in the initramfs for unlocking osk-sdl using a USB-connected keyboard.

(cherry picked from commit 3720293639)
2020-09-07 21:33:23 +02:00
Oliver Smith f62c768c84 temp/calls: fork from Alpine edge (MR 1516)
Upgrade from 0.1.5 (current version on Alpine 3.12) to 0.1.7.
2020-09-03 14:36:14 -07:00
Bart Ribbers d08764999c temp/u-boot-pinephone: set RAM block back to 552 (MR 1562)
We were using a frequency of 624 which froze my device and in the past
other units too. Set it back to 552 as before so this doesn't happen
anymore

The patch is being upstreamed, https://gitlab.com/pine64-org/u-boot/-/merge_requests/3
2020-09-03 01:46:29 -07:00
Oliver Smith 0ba7df11ad temp/gnome-software-plugin-apk: upgrade to 0.7.0 (fixup) (MR 1531)
Fix missing pkgrel bump and checksum update.

Fixes: 18b33877 ("temp/gnome-software-plugin-apk: upgrade to 0.7.0")
2020-09-03 01:12:59 -07:00
Oliver Smith 71deb1c26f temp/chatty: upgrade to 0.1.15 (MR 1515) 2020-09-03 00:57:46 -07:00
Oliver Smith 275f8694af Revert "temp/postmarketos-config-firefox: add transition pkg"
This reverts commit 1d1895c0e8.

Causes a segfault (seen by me and PureTryOut), let's revert it for now.

fetch http://postmarketos1.brixit.nl/postmarketos/v20.05/aarch64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/aarch64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/aarch64/APKINDEX.tar.gz
2020-09-01T18:56:32.655 [trace] DbusServer.d:382:updateRepositories Successfully updated repositories.
2020-09-01T18:56:33.858 [trace] DbusServer.d:583:methodHandler Handling method listUpgradablePackages from sender :1.71
2020-09-01T18:56:33.872 [info] Polkit.d:68:queryPolkitAuth Polkit authorized operation dev.Cogitri.apkPolkit.Helper.listUpgradablePackages
2020-09-01T18:56:33.873 [trace] DbusServer.d:331:listUpgradablePackages Trying to list upgradable packages

(process:3403): GLib-CRITICAL **: 18:56:35.137: g_variant_get_child_value: assertion 'index_ < g_variant_n_children (value)' failed
Segmentation fault
2020-09-01 19:00:23 +02:00
Oliver Smith 1d1895c0e8 temp/postmarketos-config-firefox: add transition pkg
Workaround for a bug in apk-polkit, which prevents the renamed package
mobile-config-firefox to replace postmarketos-config-firefox. In the
factory image of the PinePhone we shipped the old package, so add this
transition package so the update works with GNOME software.

Related: https://gitlab.alpinelinux.org/Cogitri/apk-polkit/-/issues/18
2020-09-01 18:37:48 +02:00
Martijn Braam b394879408 main/linux-postmarketos-allwinner: hotfix for hdmi output (MR 1524)
Sloppy patch that makes the displayport alt-mode output signal work on
the PinePhone convergence edition. Proper fix is in the 5.8 tree

[ci:skip-build]: Martijn made sure that it builds and works. This is
		 time critical, so skip the CI build.

(cherry picked from commit 1039f705fb)
2020-09-01 17:02:06 +02:00
Oliver Smith c39d814103 temp/gnome-contacts: fork with purism patches (MR 1514)
Use fork, so we have the call and SMS buttons in the contacts list.

[ci:skip-build]: already built successfully in CI
2020-09-01 15:23:35 +02:00
Oliver Smith 8e2a6e3a3f temp/evolution-data-server: fork to enable libphonenumber (MR 1517)
Follow Alpine edge and enable libphonenumber. This makes the call and
SMS buttons in gnome-contacts work, and fixes selecting contacts in
chatty to start new SMS conversations.
2020-09-01 14:09:37 +02:00
Oliver Smith 4227ad38a6 main/mobile-config-firefox: set maintainer
(cherry picked from commit 5056fcb576)
2020-08-31 10:56:18 +02:00
Bart Ribbers 6ba9532d0b temp/purple-mm-sms: upgrade to 0.1.7 (MR 1471) 2020-08-30 19:05:34 +02:00
Oliver Smith d06adbe1f3 main/mobile-config-firefox: add pkgver to provides (MR 1507)
Fix mobile-config-firefox not replacing postmarketos-config-firefox on
upgrade. Without the pkgver in provides, apk only considers
mobile-config-firefox as virtual package name, not as replacement.

Verified with the CE factory image:

	$ sudo apk upgrade
	...
	(20/29) Purging postmarketos-config-firefox (1-r0)
	(21/29) Installing mobile-config-firefox (1.0.1-r1)
	...

(cherry picked from commit 838d5609ca)
2020-08-28 12:37:14 +02:00
Bart Ribbers 4d74ad1f51 main/postmarketos-base: depend on dnsmasq (MR 1438)
dnsmasq is required by NetworkManager for WiFi Hotspot to work.

(cherry picked from commit aced152afc)
2020-08-23 17:05:13 +02:00
Bart Ribbers c937dcc06d main/postmarketos-base: stop the power key from shutting down devices (MR 1499)
Pressing power button should not power off a device. Although it is
expected on desktops and laptops, it isn't expected on phones and
tablets. Instead it should just turn off the screen or go into a deep
sleep, but that isn't handled by elogind. So let elogind just ignore the
button altogether.

Also re-order the dependencies alphabetically while we're touching the
package anyway

(cherry picked from commit 7b58ed7fce)
2020-08-22 22:45:16 +02:00
Danct12 36f32032e2 temp/u-boot-pinephone: switch to pine64-org/u-boot (MR 1495)
Signed-off-by: Danct12 <danct12@disroot.org>
(cherry picked from commit 5a29944d10)
2020-08-22 10:35:46 +02:00
Oliver Smith 74d586b0f4 temp/gtk+3.0: prevent unexpected downgrade (MR 1500)
Override the library version, so apk does not downgrade the package if
Alpine's package has a higher library version:

	$ sudo apk upgrade
	...
	(15/80) Downgrading gtk+3.0 (9999_git20191223-r0 -> 3.24.22-r0)
	...

[ci:skip-build]: already built successfully in CI
2020-08-22 08:39:27 +02:00
Oliver Smith 836a44ca6d temp/gtk+3.0: rebase on Alpine's APKBUILD (MR 1500)
Use meson instead of autotools and disable building manuals, man pages
and tests. This reduces the cross compile time for aarch64 (which had
forced -j1 before) from ~80 min to ~17 min (!). Most importantly, it
seems to pass every time now (whereas before it would get stuck in
~2 of 3 tries).
2020-08-22 08:39:10 +02:00
Oliver Smith 7feb46f8ab main/mobile-config-firefox: upgrade to 1.0.1 (MR 1501)
(cherry picked from commit c9987d2e30)
2020-08-21 13:10:30 +02:00
Danct12 72f2362a31 community/firmware-analogix: add new firmware (MR 1421)
Signed-off-by: Danct12 <danct12@disroot.org>
(cherry picked from commit da565bb838)
2020-08-19 16:04:09 +02:00
Dolphin von Chips a313b703bb CI: allow running testcases with pmbootstrap from pip (MR 1467)
(cherry picked from commit 178558cb3d)
2020-08-15 21:06:05 +02:00
Dolphin von Chips d99387032f CI: check if packages in _pmb_recommends exist (MR 1467)
(cherry picked from commit 2bfb1417f7)
2020-08-15 21:06:05 +02:00
Antoine Fontaine dcc35c49e1 main/postmarketos-ui-plasma-desktop: fix dependency name (MR 1466)
(cherry picked from commit 5aa6d12268)
2020-08-15 21:06:00 +02:00
Oliver Smith d0ee389e77 main/postmarketos-ui-plasma-mobile: update _pmb_recommends (MR 1492)
[ci:skip-vercheck]: _pmb_recommends change doesn't need pkgrel bump

(cherry picked from commit af2f2e23a4)
2020-08-15 18:57:16 +02:00
Oliver Smith d2a855dd85 main/postmarketos-ui-phosh: no scaling for firefox (MR 1492)
With the new mobile-config-firefox, the window width is small enough
that the window does not need to be scaled. This looks better overall,
and avoids scaling glitches.

(cherry picked from commit fef3af0d75)
2020-08-15 18:57:16 +02:00
Oliver Smith fb494c88c4 main/postmarketos-ui-phosh: update _pmb_recommends (MR 1492)
(cherry picked from commit 4024d9a770)
2020-08-15 18:57:16 +02:00
Oliver Smith ac0ee64c31 main/{postmarketos => mobile}-config-firefox: replace (MR 1492)
New version does not just support Firefox 68 (firefox-esr in Alpine 3.12),
which is going to be EOL soon. It also supports the new ESR 78
(firefox-esr in Alpine edge, soon also in 3.12, supported until ~2021-04)
and 79 (current stable "rapid release" version; firefox in Alpine edge).

The source was moved to a dedicated git repo, so other distributions can
also use it. Keep the distro-specific links here in a separate HTML
file, so they can be modified without changing
mobile-config-firefox.git.

Related: https://gitlab.com/postmarketOS/mobile-config-firefox
(cherry picked from commit 56b9ddc27e)
2020-08-15 18:57:11 +02:00
Oliver Smith 194d9c0010 temp/phosh: fix build for armv7
Apply patch from upstream to fix the build. While at it, rename the pmOS
specific patch from 0002-* to 0001-*.
2020-08-12 18:14:50 +02:00
Bart Ribbers 75c430cf9b temp/phoc: upgrade to 0.4.2 (MR 1476) 2020-08-12 15:51:32 +02:00
Bart Ribbers ebea7af6c4 temp/phosh: upgrade to 0.4.3 (MR 1476) 2020-08-12 15:51:32 +02:00
Martijn Braam 468bc8a84e main/postmarketos-mkinitfs: fix error on missing dtb (MR 1491)
(cherry picked from commit 87a009a9b8)
2020-08-11 10:58:11 +02:00
Oliver Smith 6b6bd979ea treewide: avoid "More than one maintainer" error (MR 1480)
Alpine's abuild is soon going to complain if an APKBUILD has more than
one "Maintainer:" listed. Work around it by renaming the additional
maintainers to "Co-Maintainer:". While at it, move the devicepkg reference
link to the top in device-xiaomi-santoni for consistency.

In postmarketOS, we require at least two maintainers for devices in
main, therefore it does not make sense to drop additional maintainers
from the file.

In Alpine, this change was made because pkgs.alpinelinux.org apparently
can't handle more than one maintainer. I looked into it, and it would
require a database change to add it there, so it does not seem worth the
effort. I also thought about extending abuild to add an environment
variable to skip the check, but then the package would not build with
plain abuild without using the env var.

Related: https://gitlab.alpinelinux.org/alpine/abuild/-/commit/dd4cd9d606f5e28f382414e258af562e346c6ab5
[ci:skip-build] [ci:skip-vercheck]

(cherry picked from commit dbf4d13907)
2020-08-08 22:16:15 +02:00
Bart Ribbers 17fa587815 temp/gtk+3.0: upgrade to 9999_git20200616 (MR 1477) 2020-08-05 11:43:59 +02:00
Bart Ribbers 0dab1e636d pine64-pinephone: enable VoLTE (MR 1434)
Also fix configuring device sleep wakeup when modem receives a call

(cherry picked from commit 15acd86d60)
2020-08-04 12:27:07 +02:00
Oliver Smith ca70996603 Revert "temp/newlib-stage1: enable on aarch64 (MR 1464)"
This reverts commit ae413af003.
[ci:skip-vercheck] [ci:skip-build]
2020-08-04 09:52:08 +02:00
Oliver Smith 23989c3a5b Revert "temp/gcc-cross-embedded: enable on aarch64 (MR 1464)"
This reverts commit 66a3ceacb9.
2020-08-04 09:51:58 +02:00
Oliver Smith 8d95279325 Revert "temp/gcc-cross-embedded-stage1: enable on aarch64 (MR 1464)"
This reverts commit cf8ad3bdf5.
2020-08-04 09:51:49 +02:00
Oliver Smith 8d659ba0d9 Revert "temp/binutils-cross-embedded: enable on aarch64 (MR 1464)"
This reverts commit 57fdbda072.
2020-08-04 09:51:31 +02:00
Tilman Lacko ae413af003 temp/newlib-stage1: enable on aarch64 (MR 1464)
[ci:skip-vercheck]: only arch modified
[ci:skip-build]: already built successfully in CI
2020-08-03 15:29:54 +02:00
Tilman Lacko 66a3ceacb9 temp/gcc-cross-embedded: enable on aarch64 (MR 1464) 2020-08-03 15:29:23 +02:00
Tilman Lacko cf8ad3bdf5 temp/gcc-cross-embedded-stage1: enable on aarch64 (MR 1464) 2020-08-03 15:29:18 +02:00
Tilman Lacko 57fdbda072 temp/binutils-cross-embedded: enable on aarch64 (MR 1464) 2020-08-03 15:29:11 +02:00
Oliver Smith 2f6530a6f1 temp/android-tools: fork from Alpine
Use "make -j1", because cross compiling gets stuck otherwise. I have
verified, that this builds for x86_64, aarch64, armv7.
2020-08-03 14:40:04 +02:00
Bart Ribbers 18b33877a9 temp/gnome-software-plugin-apk: upgrade to 0.7.0
Make sure we have a higher and newer package then Alpine stable
2020-08-02 11:17:59 +02:00
Danct12 084f024c4c device-pine64-pinephone: make the proximity sensor usable within iio-sensor-proxy (MR 1416)
Signed-off-by: Danct12 <danct12@disroot.org>
(cherry picked from commit 76cade06e1)
2020-07-31 18:08:45 +02:00
Luca Weiss f337ef4e1c temp/phosh: add patches for volume button support (MR 1451)
Nr 3 & 4 are technically not needed (nice anyways) but without them the
other patches don't apply cleanly.
2020-07-28 15:23:27 +02:00
Luca Weiss 254c4ad434 temp/phoc: add patch for volume button support (MR 1451) 2020-07-28 15:23:22 +02:00
Oliver Smith ec23a657b5 main/postmarketos-ui-phosh: open links in firefox (MR 1455)
Add mimeapps.list, so links clicked in postmarketos-welcome and other
applications properly open in firefox. Without this patch, they just
don't open at all.

Bump the pkgver instead of the pkgrel, so the APKBUILD is in sync again
on both master and v20.05 (right now, the pkgrel on v20.05 is ahead by
one, otherwise the file is the same).

Related: https://help.gnome.org/admin/system-admin-guide/stable/mime-types-application.html.en
(cherry picked from commit f1680651ea)
2020-07-26 10:46:09 +02:00
Oliver Smith d42286c08d main/postmarketos-ui-phosh: no gnome-software first run dialog (MR 1453)
Disable the first run screen in GNOME software, which invites the user
to browse and install apps. We do not want people to use GNOME software to
do that when they open it for the first time in postmarketOS after
installing, we want them to do updates. So this dialog is misleading for
our users, and will lead to a bad experience for those who follow what
it suggests.

I think there's more wrong with that dialog (in context of postmarketOS),
more detailed reasoning and screenshot in:
https://gitlab.com/postmarketOS/pmaports/-/merge_requests/1449#note_385456592

(cherry picked from commit 9bc80e151f)
2020-07-26 09:07:55 +02:00
Luca Weiss ecbe3abfaa temp/gnome-calculator: new aport (MR 1450)
Use version from Purism with mobile patches
2020-07-25 15:30:10 +02:00
Oliver Smith f89f5cebd4 main/postmarketos-hidden-desktop-entries: add FF-ESR safe mode (MR 1448)
Firefox ESR Safe Mode has another name for the .desktop file, hide it as
well.

(cherry picked from commit f6cdacfe53)
2020-07-24 18:43:40 +02:00
Martijn Braam 9fc14d21aa main/postmarketos-ui-plasma-mobile: add firefox config (MR 1445)
While at it, sort _pmb_recommends alphabetically.

[ci:skip-vercheck]: only _pmb_recommends changed

(cherry picked from commit 81eb346b87)
2020-07-24 17:34:07 +02:00
Martijn Braam b59c638d5a main/postmarketos-ui-phosh: add firefox config (MR 1445)
Replace firefox with firefox-esr, remove epiphany. With the current
version of epiphany, the postmarketOS wiki doesn't even load every time,
so that's not something we want to ship.

(cherry picked from commit 6279468f78)
2020-07-24 17:33:57 +02:00
Oliver Smith a6eae55e82 main/postmarketos-config-firefox: new aport (MR 1445)
Add policies.json and prefs.js to configure Firefox (yes, you need both
to be able to control all this):

Mobile improvements:
* Enable zooming with fingers
* Mobile user agent (from tor browser for android)

Privacy improvements:
* Disable search suggestions, so URLs do not get sent to search engines
  as they are getting typed.
* Disable Firefox studies
* Disable Telemetry
* Set DuckDuckGo as default search engine, not Google

Uncluttering (screen space, remove broken features, less distractions):
* Move all buttons to the overflow menu and remove spacers around the
  address bar
* Empty "new tab" page (loads faster, no annoying "top sites" etc.)
* Disable developer tools, so the hamburger menu fits the screen of the
  pinephone. These aren't really useful on phones anyway.
* Disable "Firefox Screenshots": the feature did not work with the mobile
  resolution in Phosh.
* No default bookmarks from Firefox
* Disable First Run Page
* Disable Post Update Page
* Disable "User Messaging" (What's new, Extension/Feature
  Recommendations, Urlbar Interventions)

Add a local html file that serves as lightweight default homepage. It
links to the postmarketOS blog and wiki, explains that this is desktop
firefox with mobile configuration and explains how to change settings
and install addons (with a direct link to ublock origin). Users can
override the homepage, new tab page, search engine, search suggestions
pre-configured by this package directly in the UI.

I chose Firefox ESR, because:
* It fits the screen better: the "new tab" button is bigger, the menu
  opening when you click the top-right button actually fits the screen,
  with all its submenus. There are zoom controls in the same menu, which
  make the preferences pages very usable.
* It's possible to override the default search engine with a policy
  file; that's not possible in non-ESR firefox (we'd probably need to
  change it in the sources).

Related: https://github.com/mozilla/policy-templates
Co-authored-by: Martijn Braam <martijn@brixit.nl>
(cherry picked from commit 9b2a0a796d)
2020-07-24 17:33:43 +02:00
Luca Weiss a6da8fb2db temp/phosh: hide logout action, add reboot action (MR 1443) 2020-07-24 14:06:34 +02:00
Oliver Smith d8ce78b462 main/postmarketos-ui-{phosh,plasma-mobile}: hide desktop icons (MR 1437)
[ci:skip-vercheck]: _pmb_recommends changes don't need a rebuild

(cherry picked from commit 24b7576bbb)
2020-07-24 14:03:45 +02:00
Oliver Smith aaa3c4c6c6 main/postmarketos-hidden-desktop-entries: new aport (MR 1437)
In phosh, we have broken Cheese (Camera) and Extensions (from GNOME shell)
icons in the launcher. They get dragged in via dependencies, so the
easiest way to disable them is just overruling the .desktop icon. We can
make Cheese visible again in a post-install script (just check if it
points to nodisplay.desktop and delete the link) once we have it working.

Hide icons for terminal programs (htop, nvim, vim) as well as "Firefox
Safe Mode" too. If somebody really wants to use the FF safe mode, they
can do so via terminal.

Have a simple initial version, maybe make it more sophisticated with
UI-specific hidden icons later (right now, it doesn't make sense to
install this in normal GNOME, because there you would need
org.gnome.Extensions). (There is "NotShowIn=phosh" (untested), but using
this would mean that we need to keep all the information of the original
desktop file for the UIs that will display them; we can't just use the
symlink trick. I'm not sure if we want that at all, but it's
definitively over-engineered for now.)

(cherry picked from commit 2cd60bfddf)
2020-07-24 14:02:56 +02:00
Oliver Smith 3506c41032 main/postmarketos-ui-phosh: add first run screen (MR 1441)
[ci:skip-vercheck]: only modified _pmb_recommends

(cherry picked from commit 8a3f6a5a46)
2020-07-24 13:46:10 +02:00
Oliver Smith 142d79d889 main/postmarketos-welcome-gtk3: upgrade to 0.2.0 (MR 1441)
Run automatically on first login, update text, put proper title and icon
in desktop launcher.

(cherry picked from commit 03abcef25b)
2020-07-24 13:46:06 +02:00
Bart Ribbers 97d5041cea temp/phosh: upgrade to 0.4.1 (MR 1417)
[ci:skip-build]: already built successfully in CI
2020-07-23 20:33:48 +02:00
Bart Ribbers 190877d6cb temp/phoc: upgrade to 0.4.1 (MR 1417) 2020-07-23 20:33:48 +02:00
Antoine Fontaine dec474dc97 main/postmarketos-ui-phosh: enable bluetooth support (MR 1352) (MR 1417)
Fixes https://gitlab.com/postmarketOS/pmaports/-/issues/529.

(cherry picked from commit e2d1438815)
2020-07-23 20:33:38 +02:00
Oliver Smith 066f19ac21 temp/xdg-user-dirs: fork from Alpine
postmarketos-ui-{phosh,plasma-mobile} have it in their _pmb_recommends
now.
2020-07-22 13:07:02 +02:00
Bart Ribbers aaf133ab15 main/postmarketos-ui-phosh: use xdg-user-dirs (MR 1432)
(cherry picked from commit aacc7ca8a4)
2020-07-22 12:02:03 +02:00
Bart Ribbers 7b18e24238 main/postmarketos-ui-plasma-mobile: use xdg-user-dirs (MR 1432)
(cherry picked from commit ad734ac4f9)
2020-07-22 12:01:55 +02:00
Oliver Smith f03d7a6948 device/*/device-*: bump pkgrel for machine-info
Generate /etc/machine-info with the new devicepkg-dev package, that has
just been cherry-picked to v20.05.
2020-07-22 11:03:52 +02:00
Luca Weiss 772ae5dda5 main/devicepkg-dev: generate /etc/machine-info (MR 1246)
(cherry picked from commit 7fc1292b9b)
2020-07-22 11:03:47 +02:00
Oliver Smith 677b2900b2 main/postmarketos-mkinitfs: fix device sed regex (MR 1436)
The p? is not redundant. Without it, the p in mmcblk0p2 for example does
not get cut off, meaning the resulting device is not "mmcblk0" but
"mmcblk0p". My bad, sorry for the breakage.

Fixes: 9f6600ba ("main/postmarketos-mkinitfs: rm pmOS_deleteme")
Fixes: 9d86f6fe ("main/postmarketos-mkinitfs: resize: unallocated space check, even if forced")
(cherry picked from commit bfa705b745)
2020-07-22 09:28:41 +02:00
Oliver Smith c6913666ae pine64-pinephone: use PMOS_FORCE_PARTITION_RESIZE (MR 1428)
Automatically resize the root partition, if it is followed by
unallocated space.

(cherry picked from commit 802add79d4)
2020-07-21 23:19:00 +02:00
Oliver Smith 05bd81cf9b main/postmarketos-mkinitfs: rm pmOS_deleteme (MR 1428)
Remove the "pmOS_deleteme" partition left behind by the on-device
installer, if it exists. Let the existing resize_root_partition() extend
the root partition over the newly gained space (and rest of the storage
device) right afterwards.

(cherry picked from commit 9f6600ba18)
2020-07-21 23:18:51 +02:00
Oliver Smith aab032e6aa main/postmarketos-mkinitfs: resize_root_partition: update comment (cosmetic) (MR 1428)
(cherry picked from commit b55d95f3a9)
2020-07-21 23:18:42 +02:00
Oliver Smith 3fe62bfa34 main/postmarketos-mkinitfs: resize: unallocated space check, even if forced (MR 1428)
In resize_root_partition(), put the unallocated space check into an
extra function has_unallocated_space(). Run it even if
PMOS_FORCE_PARTITION_RESIZE is used, so we don't attempt to resize the
partition if there is no free space.

While at it, change "sed 's/p?2$//'" to "sed 's/2$//' in an already
modified line, because it means the same thing and is less confusing
(? in regex means: 0 or 1 time).

(cherry picked from commit 9d86f6fe92)
2020-07-21 23:18:27 +02:00
Matej Ľach ae7abe75ab temp/phoc: install the scale-to-fit helper (MR 1431) 2020-07-21 11:09:13 +02:00
Oliver Smith 8ace569db0 pine64-pinephone: fix setup-modem.initd (MR 1427)
The OpenRC service failed with the following error, as shown on serial:
	command_background option used but no pidfile specified

(cherry picked from commit c19d5dfc26)
2020-07-20 20:22:50 +02:00
Bart Ribbers bb40afc0dd main/postmarketos-ui-xfce4: use _pmb_recommends (MR 1426)
(cherry picked from commit f343c6b011)
2020-07-20 19:19:32 +02:00
Bart Ribbers 1e6bdb3ef6 main/postmarketos-ui-weston: use _pmb_recommends (MR 1426)
(cherry picked from commit c759f7168e)
2020-07-20 19:19:32 +02:00
Bart Ribbers 8b821594fa main/postmarketos-ui-sway: use _pmb_recommends (MR 1426)
(cherry picked from commit 56abe23715)
2020-07-20 19:19:32 +02:00
Bart Ribbers 0d53ad9328 main/postmarketos-ui-plasma-mobile: use _pmb_recommends (MR 1426)
Also remove trojita as requested by Bhushan Shah

(cherry picked from commit d9d439a9ff)
2020-07-20 19:19:32 +02:00
Bart Ribbers 402355e51e main/postmarketos-ui-plasma-desktop: use _pmb_recommends (MR 1426)
(cherry picked from commit 83e97bd4fe)
2020-07-20 19:19:32 +02:00
Bart Ribbers 44124b3cab main/postmarketos-ui-phosh: use _pmb_recommends (MR 1426)
(cherry picked from commit dba56461f2)
2020-07-20 19:19:32 +02:00
Oliver Smith b66064edaf main/postmarketos-ondev: upgrade to 0.2.1 (MR 1423)
Most importantly, this makes the on-screen keyboard work reliably.

Related: https://gitlab.com/postmarketOS/postmarketos-ondev/-/tags/0.2.1
(cherry picked from commit 63226cf9b5)
2020-07-20 16:32:57 +02:00
Oliver Smith b9c874774f pmaports.cfg: require pmbootstrap 1.22.0
Require new version, which supports _pmb_recommends.

Related: pmbootstrap#1933
(cherry picked from commit 2a1fa1cf20)
2020-07-20 15:00:25 +02:00
Luca Weiss 164efeb854 temp/u-boot-pinephone: apply patch for 3GB RAM support (MR 1420)
(cherry picked from commit 9a878ee7ee)
2020-07-18 22:06:28 +02:00
Bart Ribbers 332f855a93 temp/gnome-control-center: fork from Alpine to apply mobile patches (MR 1419) 2020-07-18 15:38:43 +02:00
Martijn Braam 163a42effc pine64-pinephone: add multiple dtbs (MR 1163)
(cherry picked from commit 957dc9356a)
2020-07-16 23:59:20 +02:00
Martijn Braam cf3153eb5b main/postmarketos-mkinitfs: allow multiple dtbs (MR 1163)
Allow setting multiple dtb filenames in the deviceinfo seperated
by spaces

(cherry picked from commit 2fb6d11f91)
2020-07-16 23:59:20 +02:00
Bart Ribbers 6823479b18 pine64-pinephone: setup modem to wake device (MR 1163)
(cherry picked from commit dff419cf10)
2020-07-16 23:59:19 +02:00
Bart Ribbers c5f26eeb65 temp/u-boot-pinephone: add crust firmware (MR 1163)
(cherry picked from commit a1aae9ff47)
2020-07-16 23:59:19 +02:00
Martijn Braam 3c868bc254 main/crust: new aport (MR 1163)
(cherry picked from commit 5ac381fc46)
2020-07-16 23:59:15 +02:00
Oliver Smith a09d92d8c2 main/postmarketos-ui-{gnome,phosh}: less revealing epiphany user-agent (MR 1402)
Make it less trivial to fingerprint users of the epiphany browser on
postmarketOS, by replacing the postmarketOS specific user-agent with an
user-agent from a current pixel device.

Old:
	Mozilla/5.0 (postmarketOS device, like iPhone; X11; Linux x86_64) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0 Safari/605.1.15 Epiphany/605.1.15

New:
	Mozilla/5.0 (Linux; Android 10; Pixel) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.96 Mobile Safari/537.36

Taken from the following page. Note that this seems to be one of the few
cases, where not a full android build ID is included. Which makes it a
bit harder to fingerprint. Not as good as the tor browser one, but with
that one we'd have to pretend that a webkit browser is firefox.

https://developers.whatismybrowser.com/useragents/explore/operating_platform/pixel/2

Related: https://blog.torproject.org/browser-fingerprinting-introduction-and-challenges-ahead
Related: https://developer.chrome.com/multidevice/user-agent
Related: https://webaim.org/blog/user-agent-string-history/
(cherry picked from commit 2722f6cac5)
2020-07-15 13:43:34 +02:00
Bart Ribbers 5ad58ff0be temp/gnome-software-plugin-apk: add missing dep on alpinelinux-appstream-data (MR 1414) 2020-07-14 14:37:40 +02:00
Bart Ribbers 28365e0978 main/postmarketos-ui-phosh: add gnome-contacts to depends (MR 1415)
(cherry picked from commit e3e4b01add)
Signed-off-by: Bart Ribbers <bribbers@disroot.org>
2020-07-14 14:29:37 +02:00
Bart Ribbers 6ad46e30ed temp/chatty: fork from Alpine to upgrade to a newer release (MR 1413) 2020-07-14 14:25:49 +02:00
Bart Ribbers 2491984432 temp/purple-mm-sms: fork from Alpine to upgrade to a new release 2020-07-14 14:25:49 +02:00
Martijn Braam f3c6247f43 device/pine64-pinephone: use the correct ucm path for older pulseaudio (MR 1412) 2020-07-14 14:23:26 +02:00
Oliver Smith 00f73eeff4 temp/newlib-stage1: fix depends
Make the newlib-stage1 meta-package depend on newlib-or1k-elf-stage1
instead of newlib-or1k-elf. Otherwise, the meta-package could not be
installed in postmarketOS, v20.05 branch, because we have only forked
newlib-stage1 and not newlib. This is a bug in the upstream aport too.

Related: https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/10318
2020-07-14 10:25:10 +02:00
Oliver Smith 59a374f6f9 temp: add or1k-elf cross-embedded toolchain
Fork gcc-cross-embedded and dependencies from Alpine edge. Limit it to
only build or1k-elf from x86_64, because that's what we need to build the
crust firmware for the pinephone. More architectures could be enabled on
demand. I've verified that this builds before pushing, and that it's
possible to build crust from the open merge request with this toolchain.
2020-07-14 00:54:16 +02:00
Oliver Smith b917f76531 main/postmarketos-base: keep /etc/fstab (MR 1398)
Only add a comment, do not try to mount the root or boot partitions
anymore. The initramfs is doing this already.

Related: https://postmarketos.org/fstab
(cherry picked from commit 784782f543)
2020-07-14 00:45:41 +02:00
Oliver Smith 11da9f51f9 main/postmarketos-mkinitfs: mount /sysroot/boot (MR 1398)
Mount the boot partition at /sysroot/boot and keep it mounted, when
running the switch_root command. This way, OpenRC doesn't need to mount
it and possibly use the wrong partition. The OpenRC service does not use
the same logic to find the boot partition, in particular it does not
support the pmos_boot kernel parameter.

While at it, print the mountpoint and read-only/read-write arguments in
the mounting log message for both root and boot.

Fixes: #664
(cherry picked from commit 863ec713ba)
2020-07-14 00:45:32 +02:00
Oliver Smith cc95140b96 main/postmarketos-base: rm write_unless_modified (MR 1398)
Get rid of the "write_unless_modified" code, which was supposed to only
change /etc/fstab, /etc/issue, /etc/motd if the user did not modify it.

This is nice in theory, but we have a bug report where the code did not
do what it should (apk audit possibly failed due to a qemu bug?), and
then it lead to strange bugs related to not having the expected
/etc/fstab installed.

Fixes: #661, #258
(cherry picked from commit 58ae4df2ef)
2020-07-14 00:45:25 +02:00
Federico Amedeo Izzo acc021adcd {nokia-n900,samsung-i9070}: move swclock initial timestamp back to postmaketos-base.post-install (MR 1166)
(cherry picked from commit b6ea0ba1de)
2020-07-14 00:45:03 +02:00
Federico Amedeo Izzo 472ab0b435 */*: add missing exit 0 in post-install scripts (MR 1166)
(cherry picked from commit 859772a915)
2020-07-14 00:44:17 +02:00
Federico Amedeo Izzo b25292607a postmarketos-base: disable swclock for all devices, enable it for nokia-n900 and samsung-i9070 (MR 1166)
(cherry picked from commit 0e502a5139)
2020-07-14 00:43:30 +02:00
Luca Weiss 47849bdca4 treewide: chmod -x files (MR 1237)
We don't want executable APKBUILDs, deviceinfo files, etc in pmaports.
Remove the executable bit from those files.

[ci:skip-build]
[ci:skip-vercheck]

(cherry picked from commit e350b00b9b)
2020-07-14 00:39:39 +02:00
Bart Ribbers e446bb9741 temp/evince: fork from Alpine to apply Purism's mobile patches (MR 1390) 2020-07-12 13:54:39 +02:00
Oliver Smith 2e71c343cb main/postmarketos-welcome-gtk3: new aport (MR 1381)
Add a simple welcome screen app, that we should eventually display when
starting Phosh for the first time (needs to be done in a different
patch).

(cherry picked from commit cb3f7f22ea)
2020-07-12 02:29:46 +02:00
Oliver Smith 4753cf3540 */linux-*: enable CONFIG_CRYPTO_XTS (MR 1405)
Enable CONFIG_CRYPTO_XTS for each kernel, so we can switch to using
aes-xts-plain64 as default cipher for cryptsetup (override with
"pmbootstrap --cipher"), instead of aes-cbc-plain64 (pmbootstrap#1940).

I have executed "pmbootstrap kconfig edit" on each kernel, and manually
toggled the option. The diff is not always clean, because for some
kernels it is apparently the first time, that menuconfig was executed on
the configs like that. In a few instances, it turned out that
CONFIG_ANDROID_PARANOID_NETWORK needed to be disabled too (this is
already a requirement, but as the config was incomplete, it was not
visible that this option was enabled). Very few times, I had to enable
CONFIG_EXPERIMENTAL in order to see and enable CONFIG_CRYPTO_XTS.

It would be great if we could automate such mass kconfig edits in the
future, see pmbootstrap#1942.

[skip ci]: I have verified, that every single one of these kernels builds.
           CI will likely run out of time while downloading source tarballs.

(cherry picked from commit 0cfcc52e0d)
2020-07-11 15:57:03 +02:00
Minecrell 3f932b85ae main/linux-postmarketos-stericsson: upgrade to 5.8-rc2 (MR 1360)
- Update to Linux 5.8-rc2
- samsung-golden: Add magnetometer/proximity sensor, touchkeys

(cherry picked from commit 51e97f026b)
2020-07-11 15:56:26 +02:00
Minecrell a8336387d6 main/linux-postmarketos-stericsson: rename from -novathor (MR 1360)
In the Linux kernel, the ST-Ericsson NovaThor U8500 SoC is barely
ever mentioned under the "NovaThor" name, more common are names like
U8500, Ux500, ST-Ericsson, STE, ...

Let's rename the kernel package to linux-postmarketos-stericsson
to make that more clear. Also cleanup the APKBUILD a bit while we're
at it, HOSTCC is unneeded, remove unnecessary depends, ...

(cherry picked from commit caa2018bce)
2020-07-11 15:56:12 +02:00
Pellegrino Prevete 7452c1afa9 linux-postmarketos-qcom-msm8974: enable CONFIG_USER_NS (MR 1282)
This fixes GNOME Web on the hammerhead and other devices using this
kernel

(cherry picked from commit fc98518f40)
2020-07-11 15:52:16 +02:00
ben clark b99636ef97 main/linux-postmarketos-qcom-msm8974: enable CONFIG_SECCOMP (!1218)
fixes an "Invalid argument" when running a flatpak

(cherry picked from commit cca40c66bf)
2020-07-11 15:52:07 +02:00
Luca Weiss 29ddfe49a5 main/linux-postmarketos-qcom-msm8974: updates for various devices (MR 1140)
* Support for sharp ls052t3sx02 video mode panel and max1187x
  touchscreen used in Sony Xperia Z2 (sirius)
* Support for display in OnePlus One (bacon)
* Support for touchscreen, touchkeys and notification led in Samsung
  Galaxy S5 (klte)

(cherry picked from commit b07717d564)
2020-07-11 15:51:58 +02:00
Martijn Braam e98f7ed18a main/linux-postmarketos-allwinner: upgrade to 5.7.0_git20200705 (MR 1397)
This adds panel stability patches and enables more resolutions on
the hdmi port of the A64.

(cherry picked from commit 4cff95a5bb)
2020-07-11 15:47:47 +02:00
Minecrell 1780b0c755 main/linux-postmarketos-qcom-msm8916: enable CONFIG_CRYPTO_XTS (MR 1405)
Seems like "pmbootstrap kconfig edit" causes unrelated kernel config
changes for some reason (probably because pmbootstrap does not install
a cross compiler for it). For now let's just edit the config manually
with the new options so everything else stays as-is.

(cherry picked from commit 2a8897b079)
2020-07-11 15:43:32 +02:00
Minecrell 1016a2c137 main/linux-postmarketos-qcom-msm8916: upgrade to 5.7.1 (MR 1295)
We are in the midst of the Linux 5.8 merge window so there is no new
-rc version to rebase on. -rc1 next week is also not the perfect choice
for a release (first rc is usually still a bit unstable).

On the other hand the changes that landed the last few days are quite
nice and ready to go, so I decided to rebase on a stable kernel release
(5.7.1). Not sure if I'm ever going to do this again :)

Changes:
- Update to Linux 5.7.1
- bq-paella: Add sound and modem
- Enable some new kernel options for DB410c

(cherry picked from commit 140a04816f)
2020-07-11 15:43:23 +02:00
Minecrell 8c5e5f0089 main/linux-postmarketos-qcom-msm8916: upgrade to 5.7 (MR 1284)
- Update to Linux 5.7
- motorola-harpia: Add battery reporting
- bq-paella: Add accelerometer/magnetometer/gyroscope
- bq-paella: Expose touch key backlight as LED

(cherry picked from commit 768ae7c1ee)
2020-07-11 15:43:15 +02:00
Minecrell 5199c9f337 main/linux-postmarketos-qcom-msm8916: upgrade to 5.7_rc5 (MR 1228)
- Update to Linux 5.7-rc5
- Add voice call audio
- samsung-a3u/a5u: add speaker
- wileyfox-crackling: add notification LED
- bq-paella: add display, touchscreen, buttons
- Initial support for Samsung Galaxy J5 (2015) (SM-J500FN)
- Initial support for Samsung Galaxy J3 (2016) (SM-J320P)

(cherry picked from commit e950f1215c)
2020-07-11 15:43:02 +02:00
Minecrell cb0a04988e *: remove quotes around pkgname (MR 1186)
TP:[AL3]:APKBUILD:5:pkgname must not be quoted

[skip ci]: won't finish within 3 hours

(cherry picked from commit c3dcc196ea)

cherry-picking notes: ollieparanoid is picking this commit, so there are
no conflicts when applying CONFIG_CRYPTO_XTS (MR 1405) related patches.
2020-07-11 15:41:41 +02:00
Minecrell 2766f8b3f3 main/linux-postmarketos-qcom-msm8916: upgrade to 5.7-rc2 (!1167)
- Update to Linux 5.7-rc2
- Initial support for BQ Aquaris X5 (bq-paella/picmt)
- Add speaker for samsung-gt510wifi/matissevewifi
- Add flash LED for wileyfox-crackling

(cherry picked from commit bfe15c5c85)
2020-07-11 15:37:54 +02:00
Martijn Braam 916f5df5b1 pine64-pinephone: use wys-pinephone (MR 1406)
(cherry picked from commit 7743b4a25d)
2020-07-11 13:33:11 +02:00
Martijn Braam 6e9a8456b2 temp/wys-pinephone: new aport (MR 1406)
(cherry picked from commit c6afbf8942)
2020-07-11 13:32:46 +02:00
Dolphin von Chips 378db3273a device/community/firmware-pine64-rtl8723bt: add missing "replaces=" (MR 1400)
Package got renamed and "provides" wasn't added, so right now
`apk upgrade -a` with firmware-rtl8723bt installed results in
`ERROR: firmware-pine64-rtl8723bt-0_git20181104-r0: trying to overwrite lib/firmware/rtl_bt/rtl8723bs_config-pine64.bin owned by firmware-rtl8723bt-0_git20181104-r0.`
Add `replaces="firmware-rtl8723bt"` so `apk` prefers this package.

[ci:skip-build]: already built successfully in CI

(cherry picked from commit f15f71c36f)
2020-07-07 20:25:27 +02:00
Oliver Smith fe3a8d8303 device/community/firmware-samsung-a5lte: remove
Upstream tarball disappeared. Remove for now, so it does not block bpo.
2020-07-07 17:36:55 +02:00
Oliver Smith 45a9f64691 CI: test_directory_structure: mention firmware mv (MR 1362)
Instead of encouraging the user to add the directory to
test_directory_structure.py, mention that we just moved the firmware to
device/{main,community,testing}/. This will be more helpful for users
who get the message after rebasing on master.

In the rare case that we need to change the directory structure, we will
figure out which file to edit.

[ci skip]: various firmware packages fail when built at the same time
           (they use generic source files like "bcmdhd.cal" with different checksums)

(cherry picked from commit 3e012e3714)
2020-07-07 16:19:03 +02:00
Minecrell df1224a7b1 firmware/*: move rest of firmware packages to device/testing (MR 1362)
After moving the firmware packages used by devices in community to
device/community, move the rest of the firmware packages to device/testing.

(cherry picked from commit c590ed74cf)

cherry picking note: the only change applied from this commit is the
removal of "firmware" in gitlab-ci/testcases/test_directory_structure.py.
2020-07-07 16:18:46 +02:00
Minecrell 0a950e8a0a firmware/*: move community firmware packages to device/community (MR 1362)
Right now we have all firmware packages under firmware/*.
This is problematic for mainly two reasons:

  - It's not immediately clear which firmware packages we need to keep
    when forking a new stable branch. (Where we delete testing devices
    at the moment...) We might end up deleting firmware packages that
    are actually used by one of the devices in community.

  - When backporting devices to the stable we cannot just cherry-pick
    the commit that moved the device to community (since it does not
    contain the firmware package). Instead we need to cherry-pick
    earlier commits as well, which may touch a lot of deleted files
    in the testing directory.

Let's make this consistent by also placing the firmware packages in
the device/* directory. We already have the common firmware- prefix
to distinguish them from device/kernel packages, which are already
both under the device/* directory.

(cherry picked from commit 4724b0f9c1)
2020-07-07 16:16:37 +02:00
Minecrell bc1e8288d2 firmware/firmware-pine64-rtl8723bt: add -pine64-, cleanup, install license (MR 1362)
For most firmware packages we use a vendor- prefix to make it clear
who has provided the firmware. The firmware-rtl8723bt package is only
used for Pine64 devices and actually contains configs that are specific
to Pine64 hardware (e.g. rtl8723bs_config-pine64.bin).

Let's rename it to firmware-pine64-rtl8723bt to make this more clear.
Also cleanup the APKBUILD a bit and provide the LICENSE file in a -doc
subpackage so we can legally redistribute that firmware.

(cherry picked from commit 1eff900dcb)
2020-07-07 16:15:40 +02:00
Martijn Braam 8f3fd3a5f4 main/postmarketos-ui-phosh: add scaling overrides (MR 1396)
(cherry picked from commit baa69a57f7)
2020-07-07 10:39:31 +02:00
PureTryOut 95093eb1d7 temp/epiphany: fork from Alpine to apply Purism's mobile patches (MR 1371) 2020-07-07 09:46:28 +02:00
Martijn Braam acf2331c95 main/linux-postmarketos-allwinner: upgrade to 5.7.0_git20200704 (MR 1393)
This enables mult-sensor support in sun6i-csi, support for the
gc2145 front camera, the new panel driver from mainline linux
and a small fix for the anx7688 that prevents it spamming the
kernel log when no cable is plugged in on 1.2a hardware.

(cherry picked from commit 0b00e23280)
2020-07-06 12:06:38 +02:00
Oliver Smith cbe0a0bef2 main/linux-postmarketos-allwinner: *** sync with master ***
Cherry-picking has gone wrong before, it was done in the wrong order,
and while commit 1e9d04 ("enable xt_owner and xt_time kernel modules (MR 1343)")
was picked, the changes in the kernel config from that commit are
missing on current v20.05 HEAD.

This patch copies the current kernel config from master to the v20.05
branch and thereby makes the v20.05 version equal with master. The only
difference is now the pkgrel, but this will also go away with the next
upgrade in the kernel version.

When cherry-picking patches, we should always cherry-pick all patches
from linux-postmarketos-allwinner from master to v20.05 and in the right
order. Then we don't have complicated diffs to resolve and errors like
this one happening, and we can be sure that the version on v20.05 is the
same that was tested on master.
2020-07-02 14:55:41 +02:00
Bradley 333bca33d5 linux-postmarketos-allwinner: enable f2fs module and fs compression (MR 1353)
[ci:skip-build] builds locally

(cherry picked from commit 1cf42e6db8)

cherry-picking notes: picked in wrong order, see note in previous commit
message.
2020-07-02 14:55:41 +02:00
Alexey Min 1df4264d19 main/linux-postmarketos-allwinner: add patch descriptions (MR 1372)
Fixes linter warnings

(cherry picked from commit 8217bbc3c2)

cherry-picking notes: picked in wrong order from master. let's pick all
of the linux-postmarketos-allwinner patches from master to v20.05, so
future cherry-picked commits apply cleanly and we have exactly the same
tested kernel as in master in the stable branch (at some point we will
do this with a delay to have a testing time - but still, it should be
the same commits after the testing time is over).
2020-07-02 14:55:41 +02:00
Martijn Braam 4ffe52b874 main/linux-postmarketos-allwinner: upgrade to 5.7.0_git20200629 (MR 1377)
[ci:skip-build]: already built successfully in CI

(cherry picked from commit d4c55e8712)
2020-07-02 14:05:33 +02:00
Bart Ribbers 4bfb9c049d temp/phosh: fork from Alpine to upgrade to newer release (MR 1365)
[ci:skip-build]: already built successfully in CI
2020-07-01 19:26:11 +02:00
Bart Ribbers 87d96df264 temp/phoc: upgrade to 0.4.0 (MR 1365) 2020-07-01 19:25:31 +02:00
Oliver Smith daf57f7e9e main/osk-sdl: upgrade to 0.56 (MR 1379)
(cherry picked from commit 2a83ff4ac0)
2020-07-01 00:35:11 +02:00
Oliver Smith f577bfbcff main/postmarketos-ondev: upgrade to 0.2.0 (MR 1378)
(cherry picked from commit c606d92296)
2020-07-01 00:28:58 +02:00
Danct12 47957f223d main/linux-postmarketos-allwinner: upgrade to 0_git20200528 (MR 1267)
Signed-off-by: Danct12 <danct12@disroot.org>
(cherry picked from commit ea0fd7cb7f)
2020-06-25 15:23:40 +02:00
Alexey Min 3d600b0210 main/postmarketos-ondev: rebuild against new libcalamares
(cherry picked from commit df57eaf100)
2020-06-25 16:11:41 +03:00
Oliver Smith 6d0f6f8c7a temp/calamares: upgrade to 3.2.26.1 (MR 1366)
Upgrade to latest bugfix release, and add a patch to fix weird looking
borders on mobile.

(cherry picked from commit 2f05e21d67)
2020-06-25 07:23:18 +02:00
Oliver Smith c095935351 temp/plasma-phone-components: split vkbd style (MR 1363)
Put virtual keyboard style into a subpackage, and let the main package
depend on it. That way, it can be used in postmarketos-ondev, without
pulling in all of plasma-phone-components.

(cherry picked from commit 166e702da7)
2020-06-24 08:52:00 +02:00
Oliver Smith 7f72ef9c3f Revert "bq-paella: move to community (MR 1319)"
This reverts commit e8ba30763f.

Build fails because of missing dependencies, this blocks bpo.
2020-06-23 20:26:44 +02:00
Oliver Smith 9ffe49be97 temp/unclutter-xfixes: fork from Alpine edge
Fork it for postmarketos-ondev#13.
2020-06-23 17:26:17 +02:00
Bart Ribbers 045fc69f74 main/postmarketos-ui-phosh: install gnome-software by default (MR 1346) 2020-06-23 15:27:12 +02:00
Bart Ribbers df33857021 temp/gnome-software-plugin-apk: fork from Alpine
It needs rebuilding against our custom gnome-software
2020-06-23 15:27:08 +02:00
Bart Ribbers 5eab0792bd temp/gnome-software: fork from Alpine to apply Purism's mobile patches 2020-06-23 15:27:08 +02:00
Bart Ribbers 18ba5a8cdb temp/gtk+3.0: fork from Alpine to apply Purism mobile patches (MR 1312)
Purism has some patches to make GTK apps behave better on mobile screens
and dimensions. These break desktop usage so will not be applied to the
edge branch for now, but we should have these when shipping pmOS on the
PinePhone with the stable branch.

Please test applications known to be sized wrongly before, they should
look a lot better now.

The build hangs if -j > 1, so this package disables parallel make jobs when
building on these architectures. Everything else uses the default # of
parallel jobs for the CPU/system.
2020-06-23 15:08:44 +02:00
jonathan e8ba30763f bq-paella: move to community (MR 1319)
(cherry picked from commit 02aaf4620f)
2020-06-23 10:45:46 +02:00
Oliver Smith 09eee6b115 cross/musl-*: upgrade to 1.1.24-r9
Done with pmbootstrap channels-aportgen branch, which is being
upstreamed (see open MRs, reviews welcome).
2020-06-23 08:53:59 +02:00
Danct12 f75d0c9b71 main/linux-postmarketos-allwinner: only RTL8723CS_NEW (MR 1322)
We cannot have two of them at the same time, most compiler would fail here
but for some reason our didn't.

However, it's better to just use one (the new one, or the old one). Enable
CONFIG_RTL8723CS_NEW, which is the new driver that made it to pine64
kernel since 5.5.

Signed-off-by: Danct12 <danct12@disroot.org>

[ci:skip-build]: already built successfully in CI

(cherry picked from commit df5eec9de6)
2020-06-21 11:28:10 +02:00
Danct12 f33935a033 main/postmarketos-ui-phosh: disable auto-brightness by default (MR 1348)
We should disable it by default and let the user to enable it
when they want it.

And currently it's causing problems where the backlight would
go very dark with it enabled on PinePhone.

Signed-off-by: Danct12 <danct12@disroot.org>
(cherry picked from commit f7ed67b1b7)
2020-06-20 18:07:24 +02:00
Martijn Braam 3105f126f2 main/postmarketos-ui-phosh: enable iio-sensor-proxy (MR 1229)
(cherry picked from commit 05969fc3bc)
2020-06-20 18:07:11 +02:00
Antoine Fontaine 1765dac445 temp/u-boot-pinephone: disable too fast fast dram clock speed (MR 1351)
Fixes https://gitlab.com/postmarketOS/pmaports/-/issues/547 and
https://gitlab.com/postmarketOS/pmaports/-/issues/606. See also
https://forum.pine64.org/showthread.php?tid=9832.

(cherry picked from commit d7d0a4b5aa)
2020-06-20 14:50:18 +02:00
Danct12 e97b944b1a temp/u-boot-pinephone: bump pkgrel to build for ARM TF 2.3 (MR 1286)
Signed-off-by: Danct12 <danct12@disroot.org>
(cherry picked from commit a67a00f038)

Cherry-picking note from ollieparanoid:
The commit message is misleading. This does not bump the pkgrel, but
instead package another git commit and change the pkgver from
2020.04_git20200228 to 2020.04_git20200421. I'm cherry-picking it to
v20.05, so the u-boot-pinephone version is in sync with master; the
version on master has seen the most testing currently, so there is no
benefit in holding this back. Also this makes the follow-up patch apply
cleanly.
2020-06-20 14:49:28 +02:00
Miles Alan 48056a0ebf main/linux-postmarketos-allwiner: add CONFIG_SND_ALOOP=m to allow loopback dev (MR 1309) (MR 1340)
This makes recording system audio very simple and feasible in a cross-device
manner since application-logic can always rely / forward ALSA audio to the
loopback device instead of a device-specific audio interface.

(cherry picked from commit b89fc77d7c)

Cherry picking notes from ollieparanoid:
The patch from MR 1343 "enable xt_owner and xt_time kernel modules" has
been cherry-picked to v20.05 before MR 1340. We should avoid this in the
future. I've rebased all other patches in this MR on top, and the
end-result is the APKBUILD being the same as in master again.
[ci:ignore-count]: many packages changed
[ci:skip-vercheck]: the pmb:cross-native commit doesn't bump versions
[ci:skip-build]: does not finish within 3h
2020-06-20 12:10:44 +02:00
Antoine Fontaine 72d1ecf880 pine64-pinephone: unbreak audio (MR 1323) (MR 1340)
Fixes #633.

(cherry picked from commit 1d2b62a109)
2020-06-20 12:10:31 +02:00
Antoine Fontaine b078a67f78 Support Anbox explicitly in some kernels: (MR 1232) (MR 1340)
* linux-postmarketos-allwinner
* linux-postmarketos-qcom-msm8916
* linux-asus-me176c

They support anbox already.

It will make CI catch errors such as the removal of anbox support in
https://gitlab.com/postmarketOS/pmaports/-/merge_requests/1205 when
https://gitlab.com/postmarketOS/pmbootstrap/-/merge_requests/1916 will
be merged.

[ci:skip-vercheck] and [ci:skip-build]: no need to rebuild the package.

(cherry picked from commit 6041d4eed0)
2020-06-20 12:10:31 +02:00
Antoine Fontaine b91f81712b main/linux-postmarketos-allwinner: add anbox support again (MR 1222) (MR 1340)
fix regression caused by
https://gitlab.com/postmarketOS/pmaports/-/merge_requests/1205
and closes
https://gitlab.com/postmarketOS/pmaports/-/issues/583.

(cherry picked from commit b6d8b5893f)
2020-06-20 12:10:30 +02:00
Martijn Braam 3006ac5a0d main/linux-postmarketos-allwinner: cleanup modules (MR 1205) (MR 1340)
Disable modules for hardware that's impossible to connect to the
allwinner devices or older than the 90's this shrinks the size from 380
to 250MB.

Then it enables module compression so it shrinks from 250MB to 57MB.

Then the module stripping was enabled, shrinking it to 20MB

[ci:skip-build]: already built successfully in CI

(cherry picked from commit dca8043c33)
2020-06-20 12:10:30 +02:00
Antoine Fontaine c80b2791ff cross/arch-bin-masquerade, main/anbox-image, linux-*: use pmb:cross-native (MR 1169) (MR 1340)
https://gitlab.com/postmarketOS/pmbootstrap/-/issues/1910

[skip ci]: CI fails because it can't download every release tarball to
           check checksums in 3h.

(cherry picked from commit c1628ecdce)
2020-06-20 12:10:30 +02:00
Martijn Braam 3da51fe777 main/linux-postmarketos-allwinner: update to 5.6.0_git20200410 (MR 1143) (MR 1340)
(cherry picked from commit e5ae9d8e2d)
2020-06-20 12:10:30 +02:00
Luca Weiss 2e2a12d14e pine-a64lts: add wifi and bluetooth firmware (MR 153) (MR 1340)
Add firmware-rtl8723bt package and Pine wifi and bluetooth firmware
subpackage.

(cherry picked from commit 8c1ebc31a8)
2020-06-20 12:10:25 +02:00
Bart Ribbers b88df955bd temp/phoc: fork from Alpine to upgrade to newer version (MR 1313)
Has important fix to handle phosh crash gracefully.

[ci:skip-build]: already built successfully in CI
2020-06-20 11:01:52 +02:00
Luca Weiss 78d4e4b895 main/postmarketos-ondev: upgrade to 0.1.5 (MR 1342)
This release gets rid of the hacks needed for out-of-tree modules in the
previous version of calamares.

[ci:skip-build]: already built successfully in CI

(cherry picked from commit eb30e7b8a8)
2020-06-20 10:45:30 +02:00
Luca Weiss 5e4fa95d1e temp/calamares: upgrade to 3.2.26 (MR 1342)
(cherry picked from commit bf452101bd)
2020-06-20 10:45:24 +02:00
Wazup b5fcc3afb8 enable xt_owner and xt_time kernel modules (MR 1343)
(cherry picked from commit 1e9d04e60c)
2020-06-19 09:21:15 +02:00
Oliver Smith f3c1570dd3 main/postmarketos-ondev: new aport (MR 1296)
(cherry picked from commit bb5c0cdc7f)
2020-06-18 22:11:17 +02:00
Oliver Smith 8cfa41c971 temp/calamares: new aport (MR 1296)
Based on PureTryOut's testing/calamares branch. Thanks!

(cherry picked from commit b6a7d80e45)
2020-06-18 22:11:09 +02:00
Oliver Smith 19f075664b temp/os-prober: new aport (MR 1296)
Taken from PureTryOut's testing/calamares repository, thanks!

(cherry picked from commit 2f3f0bf333)
2020-06-18 22:11:02 +02:00
Oliver Smith 9f0ca81da6 main/postmarketos-mkinitfs: support pmOS_install (MR 1296)
Prefer booting from a pmOS_install partition if it exists, but do not
resize it.

Related: https://wiki.postmarketos.org/wiki/On-device_installer
(cherry picked from commit 9be8b59a00)
2020-06-18 22:10:55 +02:00
Antoine Fontaine 470101358c main/postmarketos-mkinitfs: add mkinitfs to replaces (MR 1300)
fixes pmbootstrap#1851.

(cherry picked from commit 41c2e1a307)
2020-06-18 22:09:36 +02:00
Oliver Smith e8bd4e4d1e CI: use check_mr_settings.py from ci-common.git (MR 1320) 2020-06-17 16:32:13 +02:00
Oliver Smith f092bb64ed CI: support release channels (v20.05 branch) (MR 1321)
Add common.get_upstream_branch() and use it instead of assuming "master"
as upstream branch.

Example: user forks v20.05 to v20.05_some-fix, then creates a merge
request. CI must use v20.05 as upstream branch, when comparing for
modified files etc.
2020-06-17 16:29:06 +02:00
Oliver Smith 1c64dfe120 CI: common.py: add cache (MR 1321)
Don't query the pmaports dir more than once. This cache will also be
used to store the upstream branch in the next commit.
2020-06-17 16:29:06 +02:00
Anjandev Momi dc09126241 CI: check for pkgrel=0 in new aports (MR 1211)
(cherry picked from commit bcfdb0f914)
2020-06-16 20:47:44 +02:00
Antoine Fontaine efd71386d3 temp/anbox, main/anbox-image: disable on armv7 (MR 1305)
Anbox is half-broken on 32bits, it probably doesn't qualify for stable.
2020-06-16 20:20:26 +03:00
Oliver Smith d9fea2af81 main/osk-sdl: upgrade to 0.55 (MR 1316)
Improved keyboard with bigger buttons and layout change from 4 rows
(+ space row) to 3 rows for easier typing.

(cherry picked from commit 1807426f67)
2020-06-16 17:31:58 +03:00
Raatty 3c5789200a CI: store built apks as artifacts (MR 1264)
(cherry picked from commit 86c6ce9ad0)
2020-06-16 16:01:58 +02:00
Daniele Debernardi 284b02c3ba CI: use pmbootstrap lint for checking packages (MR 1132)
(cherry picked from commit 5ead73e86c)
2020-06-16 16:00:59 +02:00
Oliver Smith 3db21d5852 gitlab-ci.yml: adjust to v20.05 branch 2020-06-16 15:51:32 +02:00
Oliver Smith 5d10a2d66b cross/busybox-static-*: fix checksums
For some reason, the Alpine mirrors (or at least most of them?) give a
file with a different checksum now.
2020-06-16 15:43:32 +02:00
Oliver Smith 9013626904 cross/busybox-static-*: upgrade to 1.31.1-r19
Done with pmbootstrap branch channels-aportgen (integrating that to
master is planned, see pmbootstrap#1917).
2020-06-16 15:28:12 +02:00
Oliver Smith a07e273007 cross/binutils-*: set arch="x86_64"
Don't build for other arches. These are currently failing on
build.postmarketos.org, and they are not useful.

Related: https://gitlab.com/postmarketOS/pmbootstrap/-/issues/1917#note_356558508

[ci:skip-vercheck]
2020-06-06 10:19:34 +02:00
Oliver Smith c7c52d89bb cross/binutils-*: upgrade to 2.34-r1
Done with pmbootstrap branch channels-aportgen.
2020-06-05 15:26:02 +02:00
Oliver Smith 528d62883e temp/atinout: fork from Alpine edge
Needed by device-pine64-pinephone.
2020-05-25 20:14:23 +02:00
Oliver Smith 3b6f950e3d pine64-pinephone: add deviceinfo_chassis 2020-05-25 20:14:23 +02:00
Bart Ribbers 1df6f9d3d0 pine64-pinephone: move to community (MR 1175)
[ci:skip-build]: already built successfully in CI
2020-05-25 20:14:18 +02:00
Oliver Smith 8ec2760445 device/*: Add deviceinfo_chassis variable (MR 1246)
Apply to v20.05 branch as well, because we require this variable in
pmbootstrap from now on. This caused all v20.05 builds to fail in
"pmbootstrap init". We should think of that in the future :p
2020-05-25 19:45:45 +02:00
Oliver Smith dbd4670271 temp/u-boot-librem5: remove
Depends on newlib-arm-none-eabi from Alpine testing, which in turn
depends on gcc-arm-none-eabi from Alpine testing, which is part of
gcc-cross-embedded and depends on gcc-arm-none-eabi itself. Yay,
resolving cross compiler dependencies.

Related: https://gitlab.com/postmarketOS/pmaports/-/issues/598
2020-05-24 03:35:43 +02:00
Oliver Smith 9d5d8167f4 hybris: remove
glamor-hybris does not build anymore:

In file included from glamor_egl.c:38:
/usr/include/xf86drm.h:40:10: fatal error: drm.h: No such file or directory
   40 | #include <drm.h>
      |          ^~~~~~~
compilation terminated.

hybris-base indirectly depends on this, so remove all of hybris for the
v20.05 branch. If somebody wants to work on adding it again, we can
discuss it; but right now it is too broken.

Related: https://builds.sr.ht/~postmarketos/job/216229#task-pmbootstrap_build-698
2020-05-24 03:17:57 +02:00
Oliver Smith aac67acb87 kde/voicememo: bump pkgrel
Failed with similar qt related error:

  Could not find a configuration file for package "Qt5Quick" that is
  compatible with requested version "5.14.2".
2020-05-24 03:01:00 +02:00
Oliver Smith 09490e3fef kde/*, main/*: bump pkgrel of various qt programs
Now that our outdated qt forks are gone from the v20.05 branch, try to
build programs again that failed with:

CMake Error at /usr/lib/cmake/Qt5Qml/Qt5QmlConfig.cmake:112 (find_package):
  Could not find a configuration file for package "Qt5Network" that is
  compatible with requested version "5.14.2".

  The following configuration files were considered but not accepted:

    /usr/lib/cmake/Qt5Network/Qt5NetworkConfig.cmake, version: 5.14.1
2020-05-24 02:58:08 +02:00
Oliver Smith e8e0c2a550 temp/*qt5*: drop
All changes were upstreamed to Alpine, and landed in the upcoming 3.12
release. Awesome!
2020-05-24 02:58:04 +02:00
Oliver Smith b65c71f2ea cross/musl-*: upgrade to 1.1.24-r8 2020-05-24 02:46:04 +02:00
Oliver Smith 443ba0d367 cross/busybox-static-*: upgrade to 1.31.1-r16 2020-05-24 02:45:59 +02:00
Oliver Smith 93440ecb1f trigger bpo: aarch64, armv7 enabled 2020-05-22 21:50:12 +02:00
Oliver Smith 65c5863827 temp/anbox: bump pkgrel
Rebuild it, now that depends are available.
2020-05-22 21:28:33 +02:00
Oliver Smith e0e1f2b395 temp/properties-cpp: fork from Alpine edge
Needed for anbox.
2020-05-22 21:27:03 +02:00
Oliver Smith c975a3d3e3 temp/cmake-extras: fork from Alpine edge
Needed for anbox.
2020-05-22 21:26:58 +02:00
Oliver Smith 8e2ccf9594 main/postmarketos-ui-plasma-mobile-extras: remove dep trojita
Only available in Alpine edge. We can fork it to postmarketOS on demand.
2020-05-22 21:19:28 +02:00
Oliver Smith 80cd5dcdbc cross/musl-*: upgrade to 1.1.24-r7 2020-05-19 22:59:42 +02:00
Oliver Smith da704ea809 temp/anbox: fork from Alpine edge 2020-05-19 22:44:39 +02:00
Oliver Smith 7a0583e80e temp/kgx: fork from Alpine edge
Also add a patch to make it build.
2020-05-19 22:33:13 +02:00
Oliver Smith df75f6f234 temp/xfce4-pulseaudio-plugin: fork from Alpine edge 2020-05-19 22:13:58 +02:00
Oliver Smith 84fd68c6c8 temp/lcov: fork from Alpine edge 2020-05-19 22:13:49 +02:00
Oliver Smith a43f3bbfdd kde/qrca: remove
Does not build and nothing depends on it.

src/QrCodeDecoder.cpp:58:14: error: 'class ZXing::DecodeHints' has no member named 'setShouldTryRotate'; did you mean 'setTryRotate'?

Related: https://builds.sr.ht/~postmarketos/job/213157#task-pmbootstrap_build-709
2020-05-19 21:55:13 +02:00
Oliver Smith ad9e8af2a2 main/ofonoctl: remove
Depends on py3-tabulate, which is not available in Alpine 3.12. I don't
mind if we add it back, together with the dependency, to v20.05, but
right now let's rather unbreak the repo. Nothing depends on it.
2020-05-19 21:54:57 +02:00
Oliver Smith 856008e1c2 modem/libsamsung-ipc: remove
Source is gone, and this is not used by any devices outside of testing.

Related: https://gitlab.com/postmarketOS/pmaports/-/issues/595
2020-05-19 21:34:18 +02:00
Ruby Iris Juric b920ec64f2 cross/gcc-*: upgrade to 9.3.0-r2 (MR 1253)
Bring the GCC packages up to date with upstream.
Fixes libstdc++ unsatisfiable constrains related error messages.

Upstream commits:
- https://gitlab.alpinelinux.org/alpine/aports/-/commit/1069d8331c7125eb84994d624d45579a660acc41
- https://gitlab.alpinelinux.org/alpine/aports/-/commit/e296f565dbf916871242d0551922984f4e2e8b8c

[ci:skip-build]
2020-05-19 21:29:35 +02:00
Oliver Smith 487ac41ed8 firmware: remove firmware from testing devices
For future reference, the script to do this is here:
https://wiki.postmarketos.org/wiki/Create_release_branch
2020-05-19 21:20:47 +02:00
Oliver Smith 50604efc0b cross/*-x86: remove 2020-05-19 21:00:39 +02:00
Oliver Smith ebb3022898 cross/*-armhf: remove
We will not enable the armhf repository for v20.05, as we won't have
armhf devices outside of testing. So no need for the cross/*-armhf
packages. Same with x86. Follow up commits will delete more packages.
2020-05-19 20:59:33 +02:00
Oliver Smith 2bd016c459 trigger bpo 2020-05-17 15:55:18 +02:00
Martijn Braam 67101ee5d0 trigger bpo
the last time, I promise
2020-05-17 13:13:35 +02:00
Oliver Smith b9a7135807 trigger bpo 2020-05-17 12:38:42 +02:00
Oliver Smith 535c350e55 trigger bpo
The push hook on gitlab had the master branch hardcoded. There's no
button to test the push hook with a branch other than master, so here's
an empty commit that should do the job.
2020-05-17 08:58:41 +02:00
Minecrell 8ecce307b4 asus-me176c: move to community (MR 1185) 2020-05-17 08:40:39 +02:00
Oliver Smith 52257709fb device/testing: remove
We only want to build these for the master branch.
2020-05-17 08:23:33 +02:00
Oliver Smith 8982f37a88 cross/musl-*: upgrade to 1.1.24-r6
Generated with pmbootstrap channels-aportgen branch.
2020-05-17 08:20:36 +02:00
Oliver Smith fc390510bc cross/grub-efi-x86: upgrade to 2.04-r1
Generated with pmbootstrap channels-aportgen branch.
2020-05-17 08:20:36 +02:00
Oliver Smith 8785de1747 cross/busybox-static-*: upgrade to 1.31.1-r15
Generated with pmbootstrap channels-aportgen branch.
2020-05-17 08:20:31 +02:00
Oliver Smith 7adc4e1893 CI: use install-pmbootstrap.sh from ci-common repo (MR 1147)
This script is used by multiple repositories by now, let's make sure we
only have one place where we need to maintain it. The version in
ci-common is shellchecked and displays less output for 'pmbootstrap
init' again (unless it fails, then it shows the whole log).
2020-04-15 20:58:25 +02:00
Oliver Smith ae0a051f01 .bpo/install_pmbootstrap.sh: remove (MR 1147)
This file is not used anymore by the bpo code, so remove it.
2020-04-15 20:58:17 +02:00
Niklas Cathor b341c1d2f6 main/postmarketos-mkinitfs: fix mkbootimg call for devices w/o dtb (MR 1148)
Don't pass empty arguments to mkbootimg, when _second or _dt are not set.
2020-04-15 20:57:41 +02:00
Oliver Smith 0be9aa2cad channels.cfg: remove
Channels.cfg should only be on matrix branch, as explained here:
https://postmarketos.org/channels.cfg ("Location" section)
2020-04-15 20:53:55 +02:00
Oliver Smith d2f4a4eeec pmaports.cfg: set channel=stable 2020-04-12 15:36:26 +02:00
2317 changed files with 14610 additions and 795916 deletions

No files matched your search

@@ -1,31 +0,0 @@
#!/bin/sh -e
# Copyright 2019 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
# Config: pmbootstrap tag (or branch)
if [ "$1" != "" ]; then
tag="$1"
else
tag="master"
fi
# Get download URL and pmaports path
url="https://gitlab.com/postmarketOS/pmbootstrap/-/archive/$tag/pmbootstrap-$tag.tar.bz2"
pmaports="$(cd $(dirname $0)/..; pwd -P)"
# Set up binfmt_misc
echo "Setting-up binfmt_misc"
sudo mount -t binfmt_misc none /proc/sys/fs/binfmt_misc
# Download pmbootstrap (to /tmp/pmbootstrap)
echo "Downloading pmbootstrap ($tag): $url"
cd /tmp
wget -q -O "pmb.tar.bz2" "$url"
tar -xf "pmb.tar.bz2"
mv pmbootstrap-* pmbootstrap
# Install to $PATH and init
sudo ln -s /tmp/pmbootstrap/pmbootstrap.py /usr/bin/pmbootstrap
echo "Initializing pmbootstrap with aports at '$pmaports'"
yes '' | pmbootstrap -q --aports "$pmaports" init
+59 -21
View File
@@ -5,8 +5,8 @@ image: alpine:latest
after_script:
- .gitlab-ci/move_logs.sh $CI_PROJECT_DIR
stages:
- first
- second
- lint
- build
# defaults for "only"
# We need to run the CI jobs in a "merge request specific context", if CI is
@@ -18,13 +18,13 @@ stages:
# https://docs.gitlab.com/ee/ci/merge_request_pipelines/index.html#excluding-certain-jobs
.only-default: &only-default
only:
- master
- v20.05
- merge_requests
- tags
# device documentation
wiki:
stage: first
stage: lint
<<: *only-default
only:
refs:
@@ -38,7 +38,7 @@ wiki:
# testcases linting
testcases-linting:
stage: first
stage: lint
<<: *only-default
only:
refs:
@@ -53,7 +53,7 @@ testcases-linting:
# shellcheck
shellcheck:
stage: first
stage: lint
<<: *only-default
image: alpine:edge
before_script:
@@ -64,12 +64,12 @@ shellcheck:
# aports checks (generic)
aports-static:
stage: first
stage: lint
<<: *only-default
before_script:
- .gitlab-ci/install_pmbootstrap.sh pytest
- wget "https://gitlab.com/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
- sh ./install_pmbootstrap.sh pytest
script:
- apk -q add git
- su pmos -c ".gitlab-ci/run_testcases.sh"
- su pmos -c ".gitlab-ci/check_changed_aports_versions.py"
artifacts:
@@ -80,48 +80,86 @@ aports-static:
- pmbootstrap.cfg
expire_in: 1 week
distfile-check:
stage: lint
<<: *only-default
before_script:
- apk -q add make findutils
- wget "https://gitlab.com/postmarketOS/ci-common/-/archive/master/ci-common-master.tar.bz2"
- tar -xf ci-common-master.tar.bz2
- mv ci-common-master/distfile-check/*.sh ci-common-master/distfile-check/Makefile .
- rm -r ci-common-master ci-common-master.tar.bz2
script:
- make -j999
# APKBUILD linting
aport-lint:
stage: first
stage: lint
before_script:
- apk -q add git atools python3
- wget "https://gitlab.com/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
- sh ./install_pmbootstrap.sh
script:
- .gitlab-ci/apkbuild-linting.py
- su pmos -c ".gitlab-ci/apkbuild-linting.py"
only:
- merge_requests
allow_failure: true
# kernel kconfig check
kernel-kconfig:
stage: first
stage: lint
only:
refs:
- master
- v20.05
- merge_requests
changes:
- device/*/linux-*/config-*
- main/linux-*/config-*
before_script:
- .gitlab-ci/install_pmbootstrap.sh pytest
- wget "https://gitlab.com/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
- sh ./install_pmbootstrap.sh pytest
script:
- su pmos -c "pmbootstrap kconfig check"
# MR settings
# (Checks for "Allow commits from members who can merge to the target branch")
mr-settings:
stage: first
stage: lint
only:
- merge_requests
before_script:
- apk -q add python3
script:
- .gitlab-ci/check_mr_settings.py
- wget -q "https://gitlab.com/postmarketOS/ci-common/-/raw/master/check_mr_settings.py"
- python3 ./check_mr_settings.py
# build changed aports
aports-build:
stage: second
.build:
stage: build
<<: *only-default
before_script:
- .gitlab-ci/install_pmbootstrap.sh git
- wget "https://gitlab.com/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
- sh ./install_pmbootstrap.sh
script:
- PYTHONUNBUFFERED=1 su pmos -c ".gitlab-ci/build_changed_aports.py"
- .gitlab-ci/build.sh
- cp -r /home/pmos/.local/var/pmbootstrap/packages/ packages/ || true
artifacts:
expire_in: 1 week
paths:
- packages/
build-x86_64:
extends: .build
# disabled on v20.05
# build-x86:
# extends: .build
build-aarch64:
extends: .build
build-armv7:
extends: .build
# disabled on v20.05
# build-armhf:
# extends: .build
+4 -4
View File
@@ -3,7 +3,6 @@
import common
import os.path
import subprocess
import sys
if __name__ == "__main__":
@@ -20,9 +19,10 @@ if __name__ == "__main__":
print(f"NOTE: Skipping linting of {apkbuild}")
continue
result = subprocess.run(["apkbuild-lint", apkbuild], capture_output=True)
if len(result.stdout) > 0:
issues.append([apkbuild, result.stdout.decode("utf-8")])
package = os.path.basename(os.path.dirname(apkbuild))
result = common.run_pmbootstrap(["-q", "lint", package], output_return=True)
if len(result) > 0:
issues.append([apkbuild, result])
if len(issues) > 0:
print("Linting issues found:")
+8
View File
@@ -0,0 +1,8 @@
#!/bin/sh -e
# Convenience wrapper for short arch-specific build jobs in .gitlab-ci.yml
export PYTHONUNBUFFERED=1
JOB_ARCH="${CI_JOB_NAME#build-}"
set -x
su pmos -c ".gitlab-ci/build_changed_aports.py $JOB_ARCH"
+60 -18
View File
@@ -1,37 +1,79 @@
#!/usr/bin/env python3
# Copyright 2020 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
import sys
# Same dir
import common
# pmbootstrap
import testcases.add_pmbootstrap_to_import_path
import pmb.parse
import pmb.parse._apkbuild
import pmb.helpers.pmaports
def check_build(packages, verify_only=False):
# Initialize build environment with less logging
def build_strict(packages, arch):
common.run_pmbootstrap(["build_init"])
common.run_pmbootstrap(["--details-to-stdout", "build", "--strict",
"--force", "--arch", arch] + list(packages))
if verify_only:
common.run_pmbootstrap(["--details-to-stdout", "checksum",
"--verify"] + list(packages))
else:
common.run_pmbootstrap(["--details-to-stdout", "build", "--strict",
"--force"] + list(packages))
def verify_checksums(packages, arch):
# Only do this with one build-{arch} job
arch_verify = "x86_64"
if arch != arch_verify:
print(f"NOTE: doing checksum verification in build-{arch_verify} job,"
" not here.")
return
common.run_pmbootstrap(["build_init"])
common.run_pmbootstrap(["--details-to-stdout", "checksum", "--verify"] +
list(packages))
if __name__ == "__main__":
# Architecture to build for (as in build-{arch})
if len(sys.argv) != 2:
print("usage: build_changed_aports.py ARCH")
sys.exit(1)
arch = sys.argv[1]
# Get and print modified packages
common.add_upstream_git_remote()
packages = common.get_changed_packages()
# Build changed packages
# Package count sanity check
common.get_changed_packages_sanity_check(len(packages))
# [ci:skip-build]: verify checksums and stop
verify_only = common.commit_message_has_string("[ci:skip-build]")
if verify_only:
print("WARNING: not building changed packages ([ci:skip-build])!")
print("verifying checksums: " + ", ".join(packages))
verify_checksums(packages, arch)
sys.exit(0)
# Prepare "args" to use pmbootstrap code
sys.argv = ["pmbootstrap", "chroot"]
args = pmb.parse.arguments()
# Filter out packages that can't be built for given arch
# (Iterate over copy of packages, because we modify it in this loop)
for package in packages.copy():
apkbuild_path = pmb.helpers.pmaports.find(args, package)
apkbuild = pmb.parse._apkbuild.apkbuild(args,
f"{apkbuild_path}/APKBUILD")
if not pmb.helpers.pmaports.check_arches(apkbuild["arch"], arch):
print(f"{package}: not enabled for {arch}, skipping")
packages.remove(package)
# No packages: skip build
if len(packages) == 0:
print("no aports changed in this branch")
else:
verify_only = common.commit_message_has_string("[ci:skip-build]")
if verify_only:
print("WARNING: not building changed packages ([ci:skip-build])!")
print("verifying checksums: " + ", ".join(packages))
else:
print("building in strict mode: " + ", ".join(packages))
check_build(packages, verify_only)
print(f"no packages changed, which can be built for {arch}")
sys.exit(0)
# Build packages
print(f"building in strict mode for {arch}: {', '.join(packages)}")
build_strict(packages, arch)
+26 -18
View File
@@ -19,7 +19,7 @@ import pmb.helpers.logging
def get_package_version(args, package, revision, check=True):
# Redirect stderr to /dev/null, so git doesn't complain about files not
# existing in master for new packages
# existing in upstream branch for new packages
stderr = None
if not check:
stderr = subprocess.DEVNULL
@@ -56,20 +56,23 @@ def version_compare_operator(result):
def exit_with_error_message():
branch = common.get_upstream_branch()
print()
print("ERROR: Modified package(s) don't have an increased version!")
print("ERROR: Modified package(s) don't have an increased version or a")
print("new package has a nonzero pkgrel!")
print()
print("This can either happen if you did not change the pkgver/pkgrel")
print("This can happen if you added a new package with a nonzero")
print("pkgrel, or if you did not change the pkgver/pkgrel")
print("variables in the APKBUILDs. Or you did change them, but the")
print("packages have been updated in the official master branch, and now")
print("your versions are not higher anymore.")
print(f"packages have been updated in the official '{branch}' branch, and")
print("now your versions are not higher anymore.")
print()
print("Your options:")
print("a) If you made changes to the packages, and did not increase the")
print(" pkgrel/pkgver: increase them now, and force push your branch.")
print(" => https://postmarketos.org/howto-bump-pkgrel-pkgver")
print("b) If you had already increased the package versions, rebase on")
print(" master, increase the versions again and then force push:")
print(f" '{branch}', increase the versions again and then force push:")
print(" => https://postmarketos.org/rebase")
print("c) If you made a change, that does not require rebuilding the")
print(" packages, such as only changing the arch=... line: you can")
@@ -83,29 +86,34 @@ def exit_with_error_message():
def check_versions(args, packages):
error = False
# Get relevant commits: compare HEAD against upstream/master or HEAD~1
# (the latter if this CI check is running on upstream/master). Note that
# Get relevant commits: compare HEAD against upstream branch or HEAD~1
# (the latter if this CI check is running on upstream branch). Note that
# for the common.get_changed_files() code, we don't check against
# upstream/master, but against the latest common ancestor. This is not
# upstream branch HEAD, but against the latest common ancestor. This is not
# desired here, since we already know what packages changed, and really
# want to check if the version was increased towards *current* master.
commit = "upstream/master"
# want to check if the version was increased towards *current* upstream
# branch HEAD.
commit = f"upstream/{common.get_upstream_branch()}"
if common.run_git(["rev-parse", "HEAD"]) == common.run_git(["rev-parse",
commit]):
print("NOTE: upstream/master is on same commit as HEAD, comparing"
print(f"NOTE: {commit} is on same commit as HEAD, comparing"
" HEAD against HEAD~1.")
commit = "HEAD~1"
for package in packages:
# Get versions, skip new packages
head = get_package_version(args, package, "HEAD")
master = get_package_version(args, package, commit, False)
if not master:
print("- {}: {} (HEAD) (new package)".format(package, head))
upstream = get_package_version(args, package, commit, False)
if not upstream:
if head.rpartition('r')[2] != "0":
print(f"- {package}: {head} (HEAD) (new package) [ERROR]")
error = True
else:
print(f"- {package}: {head} (HEAD) (new package)")
continue
# Compare head and master versions
result = pmb.parse.version.compare(head, master)
# Compare head and upstream versions
result = pmb.parse.version.compare(head, upstream)
if result != 1:
error = True
@@ -114,7 +122,7 @@ def check_versions(args, packages):
if result != 1:
formatstr += " [ERROR]"
operator = version_compare_operator(result)
print(formatstr.format(package, head, operator, master, commit))
print(formatstr.format(package, head, operator, upstream, commit))
if error:
exit_with_error_message()
-156
View File
@@ -1,156 +0,0 @@
#!/usr/bin/env python3
# Copyright 2020 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
import argparse
import json
import os
import sys
import urllib.parse
import urllib.request
def check_environment_variables():
""" Make sure that all environment variables from GitLab CI are present,
and exit right here when a variable is missing. """
keys = ["CI_MERGE_REQUEST_IID",
"CI_MERGE_REQUEST_PROJECT_PATH",
"CI_MERGE_REQUEST_SOURCE_PROJECT_URL"]
for key in keys:
if key in os.environ:
continue
print("ERROR: missing environment variable: " + key)
print("Reference: https://docs.gitlab.com/ee/ci/variables/")
exit(1)
def get_url_api():
""" :returns: single merge request API URL, as documented here:
https://docs.gitlab.com/ee/api/merge_requests.html#get-single-mr """
project_path = os.environ["CI_MERGE_REQUEST_PROJECT_PATH"]
project_path = urllib.parse.quote_plus(project_path)
mr_id = os.environ["CI_MERGE_REQUEST_IID"]
url = "https://gitlab.com/api/v4/projects/{}/merge_requests/{}"
return url.format(project_path, mr_id)
def get_url_mr_edit():
""" :returns: the link where the user can edit their own MR """
url = "https://gitlab.com/{}/merge_requests/{}/edit"
return url.format(os.environ["CI_MERGE_REQUEST_PROJECT_PATH"],
os.environ["CI_MERGE_REQUEST_IID"])
def get_url_repo_settings():
""" :returns: link to the user's forked pmaports project's settings """
prefix = os.environ["CI_MERGE_REQUEST_SOURCE_PROJECT_URL"]
return prefix + "/settings/repository"
def get_mr_settings(path):
""" Get the merge request API data and parse it as JSON. Print the whole
thing on failure.
:param path: to a local file with the saved API data (will download a
fresh copy when set to None)
:returns: dict of settings data (see GitLab API reference) """
content = ""
if path:
# Read file
with open(path, encoding="utf-8") as handle:
content = handle.read()
else:
# Download from GitLab API
url = get_url_api()
print("Download " + url)
content = urllib.request.urlopen(url).read().decode("utf-8")
# Parse JSON
try:
return json.loads(content)
except:
print("ERROR: failed to decode JSON. Here's the whole content for"
" debugging:")
print("---")
print(content)
exit(1)
def settings_read(settings, key):
if key not in settings:
print("ERROR: missing '" + key + "' key in settings!")
print("Here are the whole settings for debugging:")
print("---")
print(settings)
exit(1)
return settings[key]
def check_allow_push(settings):
""" :returns: True when maintainers are allowed to push to the branch
(what we want!), False otherwise """
# Check if source branch is in same repository
source = settings_read(settings, "source_project_id")
target = settings_read(settings, "target_project_id")
if source == target:
return True
return settings_read(settings, "allow_maintainer_to_push")
def main():
# Parse arguments
parser = argparse.ArgumentParser()
parser.add_argument("--path", help="use a local file instead of querying"
" the GitLab API", default=None)
args = parser.parse_args()
# Check the merge request
check_environment_variables()
settings = get_mr_settings(args.path)
# Make sure that squashing is disabled
if settings_read(settings, "squash"):
print("*** MR settings check failed!")
print('ERROR: Please turn off the "Squash commits when merge request'
' is accepted." option in the merge request settings.')
return 1
if check_allow_push(settings):
print("*** MR settings check successful!")
else:
print("*** MR settings check failed!")
print()
print("We need to be able to push changes to your merge request.")
print("So we can rebase it on master right before merging, add the")
print("MR-ID to the commit messages, etc.")
print()
print("How to fix it:")
print("1) Open the 'edit' page of your merge request:")
print(" " + get_url_mr_edit())
print("2) Enable this option and save:")
print(" 'Allow commits from members who can merge to the target"
" branch'")
print("3) Run these tests again with an empty commit in your MR:")
print(" $ git commit --allow-empty -m 'run mr-settings test again'")
print()
print("If that setting is disabled, then you have created the MR from")
print("a protected branch. When you had forked the repository from")
print("postmarketOS, the protected branch settings were copied to")
print("your fork.")
print()
print("Resolve this with:")
print("1) Open your repository settings:")
print(" " + get_url_repo_settings())
print("2) Scroll down to 'Protected Branches' and expand it")
print("3) Click 'unprotect' next to the branch from your MR")
print("4) Follow steps 1-3 from the first list again, the option")
print(" should not be disabled anymore.")
print()
print("Thank you and sorry for the inconvenience.")
return 1
return 0
sys.exit(main())
+55 -25
View File
@@ -4,13 +4,22 @@
# Various functions used in CI scripts
import configparser
import os
import subprocess
import sys
cache = {}
def get_pmaports_dir():
return os.path.realpath(os.path.join(os.path.dirname(__file__) + "/.."))
global cache
if "pmaports_dir" in cache:
return cache["pmaports_dir"]
ret = os.path.realpath(os.path.join(os.path.dirname(__file__) + "/.."))
cache["pmaports_dir"] = ret
return ret
def run_git(parameters, check=True, stderr=None):
@@ -35,14 +44,45 @@ def commit_message_has_string(needle):
return needle in run_git(["show", "-s", "--format=full", "HEAD"])
def run_pmbootstrap(parameters):
def run_pmbootstrap(parameters, output_return=False):
""" Run pmbootstrap with the pmaports dir as --aports """
cmd = ["pmbootstrap", "--aports", get_pmaports_dir()] + parameters
process = subprocess.Popen(cmd)
process.communicate()
if process.returncode != 0:
print("** Test failed")
exit(1)
stdout = subprocess.PIPE if output_return else None
result = subprocess.run(cmd, stdout=stdout, universal_newlines=True)
result.check_returncode()
if output_return:
return result.stdout
def get_upstream_branch():
""" Use pmaports.cfg from current branch (e.g. "v20.05_fix-ci") and
channels.cfg from master to retrieve the upstream branch.
:returns: branch name, e.g. "v20.05" """
global cache
if "upstream_branch" in cache:
return cache["upstream_branch"]
# Get channel (e.g. "stable") from pmaports.cfg
# https://postmarketos.org/pmaports.cfg
pmaports_dir = get_pmaports_dir()
pmaports_cfg = configparser.ConfigParser()
pmaports_cfg.read(f"{pmaports_dir}/pmaports.cfg")
channel = pmaports_cfg["pmaports"]["channel"]
# Get branch_pmaports (e.g. "v20.05") from channels.cfg
# https://postmarketos.org/channels.cfg
channels_cfg_str = run_git(["show", "upstream/master:channels.cfg"])
channels_cfg = configparser.ConfigParser()
channels_cfg.read_string(channels_cfg_str)
assert channel in channels_cfg, \
f"Channel '{channel}' from pmaports.cfg in your branch is unknown." \
" This appears to be an old branch, consider recreating your change" \
" on top of master."
ret = channels_cfg[channel]["branch_pmaports"]
cache["upstream_branch"] = ret
return ret
def get_changed_files(removed=True):
@@ -51,18 +91,19 @@ def get_changed_files(removed=True):
:param removed: also return removed files (default: True)
:returns: set of changed files
"""
branch_upstream = f"upstream/{get_upstream_branch()}"
commit_head = run_git(["rev-parse", "HEAD"])[:-1]
commit_upstream_master = run_git(["rev-parse", "upstream/master"])[:-1]
commit_upstream = run_git(["rev-parse", branch_upstream])[:-1]
print("commit HEAD: " + commit_head)
print("commit upstream/master: " + commit_upstream_master)
print(f"commit {branch_upstream}: f{commit_upstream}")
# Check if we are latest upstream/master
if commit_head == commit_upstream_master:
# Check if we are HEAD on the upstream branch
if commit_head == commit_upstream:
# then compare with previous commit
commit = "HEAD~1"
else:
# otherwise compare with latest common ancestor
commit = run_git(["merge-base", "upstream/master", "HEAD"])[:-1]
commit = run_git(["merge-base", branch_upstream, "HEAD"])[:-1]
print("comparing HEAD with: " + commit)
# Changed files
@@ -88,6 +129,7 @@ def get_changed_packages_sanity_check(count):
if count <= 10:
return
branch = get_upstream_branch()
print()
print("ERROR: Too many packages have changed!")
print()
@@ -97,7 +139,7 @@ def get_changed_packages_sanity_check(count):
print()
print("Your options:")
print("a) If you *did not* modify everything listed above, then rebase")
print(" your branch on the official postmarketOS/pmaports.git master")
print(f" your branch on the official postmarketOS/pmaports.git {branch}")
print(" branch. Feel free to ask in the chat for help if you need any.")
print("b) If you *did* modify all these packages, and you assume that")
print(" they will build within one hour: skip this sanity check by")
@@ -148,15 +190,3 @@ def get_changed_packages():
ret.add(os.path.basename(dirname))
return ret
def check_build(packages, verify_only=False):
# Initialize build environment with less logging
run_pmbootstrap(["build_init"])
if verify_only:
run_pmbootstrap(["--details-to-stdout", "checksum", "--verify"] +
list(packages))
else:
run_pmbootstrap(["--details-to-stdout", "build", "--strict",
"--force"] + list(packages))
-48
View File
@@ -1,48 +0,0 @@
#!/bin/sh -e
# Copyright 2020 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
# usage: install_pmbootstrap.sh [ADDITIONAL_PACKAGE, ...]
# Config: pmbootstrap tag (or branch)
tag="master"
# Get download URL and pmaports path
url="https://gitlab.com/postmarketOS/pmbootstrap.git"
pmaports="$(cd $(dirname $0)/..; pwd -P)"
# Set up depends and binfmt_misc
depends="coreutils openssl python3 sudo git $@"
echo "Installing dependencies: $depends"
apk -q add $depends
mount -t binfmt_misc none /proc/sys/fs/binfmt_misc
# Create pmos user
echo "Creating pmos user"
adduser -D pmos
chown -R pmos:pmos .
echo 'pmos ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
# Download pmbootstrap (to /tmp/pmbootstrap)
echo "Downloading pmbootstrap ($tag): $url"
cd /tmp
git clone -q "$url"
git -C pmbootstrap checkout -q "$tag"
# Install to $PATH and init
ln -s /tmp/pmbootstrap/pmbootstrap.py /usr/local/bin/pmbootstrap
echo "Initializing pmbootstrap"
if ! su pmos -c "yes '' | pmbootstrap -q --aports '$pmaports' --details-to-stdout init"; then
echo "ERROR: pmbootstrap init failed!"
echo
echo "Most likely, this means that pmbootstrap requires a newer"
echo "pmaports version. Please rebase on the official pmaports.git"
echo "master branch and try again."
echo
echo "Let us know in the chat or issues if you have trouble with that"
echo "and we will be happy to help. Sorry for the inconvenience."
echo
echo "(If that does not help, click on 'Browse' in the 'Job artifacts'"
echo "next to this log output, and have a look at log.txt.)"
exit 1
fi
echo ""
@@ -5,6 +5,8 @@
import shutil
import sys
import os
import importlib
import importlib.util
from distutils.sysconfig import get_python_lib
@@ -33,5 +35,7 @@ def path_pmbootstrap():
sys.exit(1)
# Add pmbootstrap dir to import path
sys.path.append(os.path.realpath(path_pmbootstrap()))
# Check if pmb module can be imported
if importlib.util.find_spec("pmb") is None:
# Add pmbootstrap dir to import path
sys.path.append(os.path.realpath(path_pmbootstrap()))
+44 -1
View File
@@ -10,6 +10,8 @@ import os
import add_pmbootstrap_to_import_path
import pmb.parse
import pmb.parse._apkbuild
import pmb.parse.apkindex
import pmb.helpers.repo
@pytest.fixture
@@ -96,11 +98,23 @@ def device_dependency_check(apkbuild, path):
" <https://postmarketos.org/devicepkg>.")
def test_aports_kernel(args):
"""
Various tests performed on the /**/linux-* aports.
"""
for path in glob.iglob(args.aports + "**/linux-*/APKBUILD", recursive=True):
apkbuild = pmb.parse.apkbuild(args, path)
if "pmb:cross-native" not in apkbuild["options"]:
raise RuntimeError("\"pmb:cross-native\" missing in"
f" options= line: {path}")
def test_aports_device(args):
"""
Various tests performed on the /device/*/device-* aports.
"""
for path in glob.glob(args.aports + "/device/*/device-*/APKBUILD"):
for path in glob.iglob(args.aports + "/device/*/device-*/APKBUILD"):
apkbuild = pmb.parse.apkbuild(args, path)
# Depends: Require "postmarketos-base"
@@ -160,3 +174,32 @@ def test_aports_device_kernel(args):
" multiple kernels in depends (see"
" <https://postmarketos.org/devicepkg>): " +
path)
def test_aports_ui(args):
"""
Raise an error if package in _pmb_recommends is not found
"""
for arch in pmb.config.build_device_architectures:
for path in glob.iglob(args.aports + "/main/postmarketos-ui-*/APKBUILD"):
apkbuild = pmb.parse.apkbuild(args, path)
# Skip if arch isn't enabled
if not pmb.helpers.package.check_arch(args, apkbuild["pkgname"], arch, False):
continue
for package in apkbuild["_pmb_recommends"]:
depend = pmb.helpers.package.get(args, package,
arch, must_exist=False)
if depend is None or not pmb.helpers.package.check_arch(args, package, arch):
raise RuntimeError(f"{path}: package '{package}' from"
f" _pmb_recommends not found for arch '{arch}'")
# Check packages from "_pmb_recommends" of -extras subpackage if one exists
if f"{apkbuild['pkgname']}-extras" in apkbuild["subpackages"]:
apkbuild = apkbuild["subpackages"][f"{apkbuild['pkgname']}-extras"]
for package in apkbuild["_pmb_recommends"]:
depend = pmb.helpers.package.get(args, package,
arch, must_exist=False)
if depend is None or not pmb.helpers.package.check_arch(args, package, arch):
raise RuntimeError(f"{path}: package '{package}' from _pmb_recommends "
f"of -extras subpackage is not found for arch '{arch}'")
@@ -2,6 +2,7 @@
# SPDX-License-Identifier: GPL-3.0-or-later
import glob
import os
import stat
expected_directories = [
"console",
@@ -9,12 +10,11 @@ expected_directories = [
"device/community",
"device/main",
"device/testing",
"firmware",
"hybris",
"kde",
"maemo",
"main",
"modem",
"sxmo",
"temp",
]
@@ -25,7 +25,24 @@ def test_directories():
apkbuilds = set(glob.iglob("**/APKBUILD", recursive=True))
expected = set(f for d in expected_directories for f in glob.iglob(d + "/*/APKBUILD"))
assert apkbuilds == expected, "Found APKBUILD in unexpected directory. " \
"Consider adding it to test_directory_structure.py!"
"Note that we moved firmware/* to device/{main,community,testing}/*."
# Ensure no file in pmaports are executable.
# see https://gitlab.com/postmarketOS/pmaports/-/issues/593.
def test_executable_files():
for file in glob.iglob("**/*", recursive=True):
if os.path.isdir(file) or os.path.islink(file):
continue
# still check other less common inode types
permissions = os.stat(file).st_mode
executable_bits = stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH
if permissions & executable_bits != 0:
raise RuntimeError(f"\"{file}\" is executable. Files in pmaports" +
" should not be executables. post-* files" +
" don't need to be executable and executables" +
" should be installed using `install -D" +
"m0755` or a variation thereof.")
# Make sure files are either:
-17
View File
@@ -1,17 +0,0 @@
# Reference: https://postmarketos.org/channels.cfg
[channels.cfg]
recommended=edge
[edge]
description=Rolling release channel
branch_pmaports=master
branch_aports=master
mirrordir_pmos=master
mirrordir_alpine=edge
[stable]
description=Upcoming beta release (WIP, DO NOT USE!)
branch_pmaports=release/20.04
branch_aports=3.11-stable
mirrordir_pmos=v20.04
mirrordir_alpine=v3.11
+1 -1
View File
@@ -1,6 +1,6 @@
# Contributor: Danct12 <danct12@disroot.org>
# Maintainer: Danct12 <danct12@disroot.org>
pkgname="console-keyboard-basic"
pkgname=console-keyboard-basic
pkgver=0_git20200104
pkgrel=0
pkgdesc="A basic console keyboard"
@@ -1,6 +1,6 @@
# Contributor: Danct12 <danct12@disroot.org>
# Maintainer: Danct12 <danct12@disroot.org>
pkgname="console-keyboard-multiplexer"
pkgname=console-keyboard-multiplexer
pkgver=0_git20200104
pkgrel=0
pkgdesc="An on screen keyboard for terminals"
View File
File mode changed.
File mode changed.
+1 -1
View File
@@ -1,6 +1,6 @@
# Contributor: Danct12 <danct12@disroot.org>
# Maintainer: Danct12 <danct12@disroot.org>
pkgname="libconsolekeyboard"
pkgname=libconsolekeyboard
pkgver=1.0.0_git20191011
pkgrel=0
pkgdesc="A terminal multiplexer library"
+1 -1
View File
@@ -1,6 +1,6 @@
# Contributor: Danct12 <danct12@disroot.org>
# Maintainer: Danct12 <danct12@disroot.org>
pkgname="libttymultiplex"
pkgname=libttymultiplex
pkgver=0.0.1_git20200204
pkgrel=0
pkgdesc="A terminal multiplexer library"
+1 -1
View File
@@ -12,7 +12,7 @@ pkgdesc="Wrappers for ccache + distcc (native and foreign chroots)"
url="https://postmarketOS.org"
arch="all"
license="MIT"
options="!check !tracedeps"
options="!check !tracedeps pmb:cross-native"
package() {
# Architectures and binaries
+13 -16
View File
@@ -2,23 +2,22 @@
# Generator: pmbootstrap aportgen binutils-aarch64
# Based on: main/binutils
pkgname="binutils-aarch64"
builddir="$srcdir/binutils-2.34"
pkgname=binutils-aarch64
pkgver=2.34
pkgrel=0
pkgrel=1
pkgdesc="Tools necessary to build programs for aarch64 targets"
url="https://www.gnu.org/software/binutils/"
makedepends_build=""
makedepends_host=""
makedepends="gettext libtool autoconf automake bison texinfo"
arch="armhf armv7 x86_64 x86"
arch="x86_64"
license="GPL-2.0 GPL-3.0-or-later LGPL-2.0 BSD"
subpackages=""
source="https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.bz2
source="https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.xz
binutils-ld-fix-static-linking.patch
gold-mips.patch
ld-bfd-mips.patch
"
builddir="$srcdir/binutils-$pkgver"
if [ "$CHOST" != "$CTARGET" ]; then
pkgname="binutils-$CTARGET_ARCH"
@@ -28,16 +27,15 @@ fi
# secfixes:
# 2.32-r0:
# - CVE-2018-19931
# - CVE-2018-19932
# - CVE-2018-20002
# - CVE-2018-20712
# - CVE-2018-19931
# - CVE-2018-19932
# - CVE-2018-20002
# - CVE-2018-20712
# 2.28-r1:
# - CVE-2017-7614
# - CVE-2017-7614
build() {
_target="$(arch_to_hostspec aarch64)"
cd "$builddir"
"$builddir"/configure \
--build="$CBUILD" \
--target=$_target \
@@ -55,7 +53,6 @@ build() {
}
package() {
cd "$builddir"
make install DESTDIR="$pkgdir"
# remove man, info folders
@@ -64,7 +61,7 @@ package() {
sha512sums="f47e7304e102c7bbc97958a08093e27796b9051d1567ce4fbb723d39ef3e29efa325ee14a1bdcc462a925a7f9bbbc9aee28294c6dc23850f371030f3835a8067 binutils-2.34.tar.bz2
sha512sums="2c7976939dcf5e8c5b7374cccd39bfe803b1bec73c6abfa0eb17c24e1942574c6bdb874c66a092a82adc443182eacd8a5a8001c19a76101f0c7ba40c27de0bbd binutils-2.34.tar.xz
ecee33b0e435aa704af1c334e560f201638ff79e199aa11ed78a72f7c9b46f85fbb227af5748e735fd681d1965fcc42ac81b0c8824e540430ce0c706c81e8b49 binutils-ld-fix-static-linking.patch
f55cf2e0bf82f97583a1abe10710e4013ecf7d64f1da2ef8659a44a06d0dd8beaf58dab98a183488ea137f03e32d62efc878d95f018f836f8cec870bc448556f gold-mips.patch
314d2ef9071c89940aa6c8118e8a1e2f191a5d0a4bf596da1ad9cc84f884d8bc7dea8bd7b9fc3f8f1bddd3fd41c6eb017e1e804044b3bf084df1ed9e6e095e2d ld-bfd-mips.patch"
-70
View File
@@ -1,70 +0,0 @@
# Automatically generated aport, do not edit!
# Generator: pmbootstrap aportgen binutils-armhf
# Based on: main/binutils
pkgname="binutils-armhf"
pkgver=2.34
pkgrel=0
pkgdesc="Tools necessary to build programs for armhf targets"
url="https://www.gnu.org/software/binutils/"
makedepends_build=""
makedepends_host=""
makedepends="gettext libtool autoconf automake bison texinfo"
arch="armv7 aarch64 x86_64 x86"
license="GPL-2.0 GPL-3.0-or-later LGPL-2.0 BSD"
subpackages=""
source="https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.bz2
binutils-ld-fix-static-linking.patch
gold-mips.patch
ld-bfd-mips.patch
"
builddir="$srcdir/binutils-$pkgver"
if [ "$CHOST" != "$CTARGET" ]; then
pkgname="binutils-$CTARGET_ARCH"
subpackages=""
sonameprefix="binutils:"
fi
# secfixes:
# 2.32-r0:
# - CVE-2018-19931
# - CVE-2018-19932
# - CVE-2018-20002
# - CVE-2018-20712
# 2.28-r1:
# - CVE-2017-7614
build() {
_target="$(arch_to_hostspec armhf)"
cd "$builddir"
"$builddir"/configure \
--build="$CBUILD" \
--target=$_target \
--with-lib-path=/usr/lib \
--prefix=/usr \
--with-sysroot=/usr/$_target \
--enable-ld=default \
--enable-gold=yes \
--enable-plugins \
--enable-deterministic-archives \
--disable-multilib \
--disable-werror \
--disable-nls
make
}
package() {
cd "$builddir"
make install DESTDIR="$pkgdir"
# remove man, info folders
rm -rf "$pkgdir"/usr/share
}
sha512sums="f47e7304e102c7bbc97958a08093e27796b9051d1567ce4fbb723d39ef3e29efa325ee14a1bdcc462a925a7f9bbbc9aee28294c6dc23850f371030f3835a8067 binutils-2.34.tar.bz2
ecee33b0e435aa704af1c334e560f201638ff79e199aa11ed78a72f7c9b46f85fbb227af5748e735fd681d1965fcc42ac81b0c8824e540430ce0c706c81e8b49 binutils-ld-fix-static-linking.patch
f55cf2e0bf82f97583a1abe10710e4013ecf7d64f1da2ef8659a44a06d0dd8beaf58dab98a183488ea137f03e32d62efc878d95f018f836f8cec870bc448556f gold-mips.patch
314d2ef9071c89940aa6c8118e8a1e2f191a5d0a4bf596da1ad9cc84f884d8bc7dea8bd7b9fc3f8f1bddd3fd41c6eb017e1e804044b3bf084df1ed9e6e095e2d ld-bfd-mips.patch"
@@ -1,46 +0,0 @@
This fixes static linking for our hardened toolchain
diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc
index e8126cb..9532bfb 100644
--- a/ld/scripttempl/elf.sc
+++ b/ld/scripttempl/elf.sc
@@ -235,8 +235,8 @@ test "${LARGE_SECTIONS}" = "yes" && LARGE_SECTIONS="
if test "${ENABLE_INITFINI_ARRAY}" = "yes"; then
SORT_INIT_ARRAY="KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))"
SORT_FINI_ARRAY="KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))"
- CTORS_IN_INIT_ARRAY="EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .ctors"
- DTORS_IN_FINI_ARRAY="EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .dtors"
+ CTORS_IN_INIT_ARRAY="EXCLUDE_FILE (*crtbegin*.o *crtend*.o $OTHER_EXCLUDE_FILES) .ctors"
+ DTORS_IN_FINI_ARRAY="EXCLUDE_FILE (*crtbegin*.o *crtend*.o $OTHER_EXCLUDE_FILES) .dtors"
else
SORT_INIT_ARRAY="KEEP (*(SORT(.init_array.*)))"
SORT_FINI_ARRAY="KEEP (*(SORT(.fini_array.*)))"
@@ -270,15 +270,14 @@ CTOR=".ctors ${CONSTRUCTING-0} :
doesn't matter which directory crtbegin.o
is in. */
- KEEP (*crtbegin.o(.ctors))
- KEEP (*crtbegin?.o(.ctors))
+ KEEP (*crtbegin*.o(.ctors))
/* We don't want to include the .ctor section from
the crtend.o file until after the sorted ctors.
The .ctor section from the crtend file contains the
end of ctors marker and it must be last */
- KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .ctors))
+ KEEP (*(EXCLUDE_FILE (*crtend*.o $OTHER_EXCLUDE_FILES) .ctors))
KEEP (*(SORT(.ctors.*)))
KEEP (*(.ctors))
${CONSTRUCTING+${CTOR_END}}
@@ -286,9 +285,8 @@ CTOR=".ctors ${CONSTRUCTING-0} :
DTOR=".dtors ${CONSTRUCTING-0} :
{
${CONSTRUCTING+${DTOR_START}}
- KEEP (*crtbegin.o(.dtors))
- KEEP (*crtbegin?.o(.dtors))
- KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .dtors))
+ KEEP (*crtbegin*.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend*.o $OTHER_EXCLUDE_FILES) .dtors))
KEEP (*(SORT(.dtors.*)))
KEEP (*(.dtors))
${CONSTRUCTING+${DTOR_END}}
-39
View File
@@ -1,39 +0,0 @@
# DP: Fix gold on mips64 targets.
gold/
2016-08-09 Aurelien Jarno <aurelien@aurel32.net>
* configure.tgt: Add mips64el*-*-*|mips64le*-*-* and mips64*-*-*.
--- a/gold/configure.tgt
+++ b/gold/configure.tgt
@@ -153,6 +153,13 @@ aarch64*-*)
targ_big_endian=false
targ_extra_big_endian=true
;;
+mips*64*el*-*-*|mips*64*le*-*-*)
+ targ_obj=mips
+ targ_machine=EM_MIPS_RS3_LE
+ targ_size=64
+ targ_big_endian=false
+ targ_extra_big_endian=true
+ ;;
mips*el*-*-*|mips*le*-*-*)
targ_obj=mips
targ_machine=EM_MIPS_RS3_LE
@@ -160,6 +167,13 @@ mips*el*-*-*|mips*le*-*-*)
targ_big_endian=false
targ_extra_big_endian=true
;;
+mips*64*-*-*)
+ targ_obj=mips
+ targ_machine=EM_MIPS
+ targ_size=64
+ targ_big_endian=true
+ targ_extra_big_endian=false
+ ;;
mips*-*-*)
targ_obj=mips
targ_machine=EM_MIPS
-19
View File
@@ -1,19 +0,0 @@
--- ./ld/configure.tgt.orig
+++ ./ld/configure.tgt
@@ -541,12 +541,12 @@
;;
mips*-*-windiss) targ_emul=elf32mipswindiss
;;
-mips64*el-*-linux-*) targ_emul=elf32ltsmipn32
- targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip"
+mips64*el-*-linux-*) targ_emul=elf64ltsmip
+ targ_extra_emuls="elf32ltsmipn32 elf32btsmipn32 elf32ltsmip elf32btsmip elf64btsmip"
targ_extra_libpath=$targ_extra_emuls
;;
-mips64*-*-linux-*) targ_emul=elf32btsmipn32
- targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip"
+mips64*-*-linux-*) targ_emul=elf64btsmip
+ targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32btsmip elf32ltsmip elf64ltsmip"
targ_extra_libpath=$targ_extra_emuls
;;
mips*el-*-linux-*) targ_emul=elf32ltsmip
+13 -16
View File
@@ -2,23 +2,22 @@
# Generator: pmbootstrap aportgen binutils-armv7
# Based on: main/binutils
pkgname="binutils-armv7"
builddir="$srcdir/binutils-2.34"
pkgname=binutils-armv7
pkgver=2.34
pkgrel=0
pkgrel=1
pkgdesc="Tools necessary to build programs for armv7 targets"
url="https://www.gnu.org/software/binutils/"
makedepends_build=""
makedepends_host=""
makedepends="gettext libtool autoconf automake bison texinfo"
arch="armhf aarch64 x86_64 x86"
arch="x86_64"
license="GPL-2.0 GPL-3.0-or-later LGPL-2.0 BSD"
subpackages=""
source="https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.bz2
source="https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.xz
binutils-ld-fix-static-linking.patch
gold-mips.patch
ld-bfd-mips.patch
"
builddir="$srcdir/binutils-$pkgver"
if [ "$CHOST" != "$CTARGET" ]; then
pkgname="binutils-$CTARGET_ARCH"
@@ -28,16 +27,15 @@ fi
# secfixes:
# 2.32-r0:
# - CVE-2018-19931
# - CVE-2018-19932
# - CVE-2018-20002
# - CVE-2018-20712
# - CVE-2018-19931
# - CVE-2018-19932
# - CVE-2018-20002
# - CVE-2018-20712
# 2.28-r1:
# - CVE-2017-7614
# - CVE-2017-7614
build() {
_target="$(arch_to_hostspec armv7)"
cd "$builddir"
"$builddir"/configure \
--build="$CBUILD" \
--target=$_target \
@@ -55,7 +53,6 @@ build() {
}
package() {
cd "$builddir"
make install DESTDIR="$pkgdir"
# remove man, info folders
@@ -64,7 +61,7 @@ package() {
sha512sums="f47e7304e102c7bbc97958a08093e27796b9051d1567ce4fbb723d39ef3e29efa325ee14a1bdcc462a925a7f9bbbc9aee28294c6dc23850f371030f3835a8067 binutils-2.34.tar.bz2
sha512sums="2c7976939dcf5e8c5b7374cccd39bfe803b1bec73c6abfa0eb17c24e1942574c6bdb874c66a092a82adc443182eacd8a5a8001c19a76101f0c7ba40c27de0bbd binutils-2.34.tar.xz
ecee33b0e435aa704af1c334e560f201638ff79e199aa11ed78a72f7c9b46f85fbb227af5748e735fd681d1965fcc42ac81b0c8824e540430ce0c706c81e8b49 binutils-ld-fix-static-linking.patch
f55cf2e0bf82f97583a1abe10710e4013ecf7d64f1da2ef8659a44a06d0dd8beaf58dab98a183488ea137f03e32d62efc878d95f018f836f8cec870bc448556f gold-mips.patch
314d2ef9071c89940aa6c8118e8a1e2f191a5d0a4bf596da1ad9cc84f884d8bc7dea8bd7b9fc3f8f1bddd3fd41c6eb017e1e804044b3bf084df1ed9e6e095e2d ld-bfd-mips.patch"
+12 -7
View File
@@ -1,9 +1,14 @@
# Automatically generated aport, do not edit!
# Generator: pmbootstrap aportgen busybox-static-aarch64
# Stub for apkbuild-lint
if [ -z "$(type -t arch_to_hostspec)" ]; then
arch_to_hostspec() { :; }
fi
pkgname=busybox-static-aarch64
pkgver=1.31.1
pkgrel=14
pkgrel=20
_arch="aarch64"
_mirror="http://dl-cdn.alpinelinux.org/alpine/"
@@ -16,14 +21,14 @@ pkgdesc="Statically linked Busybox for $_arch"
_target="$(arch_to_hostspec $_arch)"
source="
busybox-static-$pkgver-r$pkgrel-$_arch.apk::$_mirror/edge/main/$_arch/busybox-static-$pkgver-r$pkgrel.apk
busybox-static-$pkgver-r$pkgrel-$_arch.apk::$_mirror/v3.12/main/$_arch/busybox-static-$pkgver-r$pkgrel.apk
"
package() {
mkdir -p "$pkgdir/usr/$_target"
cd "$pkgdir/usr/$_target"
tar -xf $srcdir/busybox-static-$pkgver-r$pkgrel-$_arch.apk
rm .PKGINFO .SIGN.*
mkdir -p "$pkgdir/usr/$_target"
cd "$pkgdir/usr/$_target"
tar -xf $srcdir/busybox-static-$pkgver-r$pkgrel-$_arch.apk
rm .PKGINFO .SIGN.*
}
sha512sums="d8b821b9f03837fde107cd6b4260b339c57c532d0c643d4bdf142c2cc33248029023238240a863117deed1ea3cb4531f51cbad0de4767f44801ce18cef4b3475 busybox-static-1.31.1-r14-aarch64.apk"
sha512sums="4d95fbfa910840ba5b36a5c343b62167245999d37e7f3a5598ef1870dcfaa3a15445269651431701d7f6e020fbe21ce1b06561ade6ee20899b8692de9f649114 busybox-static-1.31.1-r20-aarch64.apk"
-29
View File
@@ -1,29 +0,0 @@
# Automatically generated aport, do not edit!
# Generator: pmbootstrap aportgen busybox-static-armhf
pkgname=busybox-static-armhf
pkgver=1.31.1
pkgrel=14
_arch="armhf"
_mirror="http://dl-cdn.alpinelinux.org/alpine/"
url="http://busybox.net"
license="GPL2"
arch="all"
options="!check !strip"
pkgdesc="Statically linked Busybox for $_arch"
_target="$(arch_to_hostspec $_arch)"
source="
busybox-static-$pkgver-r$pkgrel-$_arch.apk::$_mirror/edge/main/$_arch/busybox-static-$pkgver-r$pkgrel.apk
"
package() {
mkdir -p "$pkgdir/usr/$_target"
cd "$pkgdir/usr/$_target"
tar -xf $srcdir/busybox-static-$pkgver-r$pkgrel-$_arch.apk
rm .PKGINFO .SIGN.*
}
sha512sums="ceeb5786a2ca8a904dece9b9b3132e883c03eeb216b9343def3faa2a0d64a4744ee359f991730c531859ed7e82baa88a9f95349265735ac6e1c539f28adf668e busybox-static-1.31.1-r14-armhf.apk"
+12 -7
View File
@@ -1,9 +1,14 @@
# Automatically generated aport, do not edit!
# Generator: pmbootstrap aportgen busybox-static-armv7
# Stub for apkbuild-lint
if [ -z "$(type -t arch_to_hostspec)" ]; then
arch_to_hostspec() { :; }
fi
pkgname=busybox-static-armv7
pkgver=1.31.1
pkgrel=14
pkgrel=20
_arch="armv7"
_mirror="http://dl-cdn.alpinelinux.org/alpine/"
@@ -16,14 +21,14 @@ pkgdesc="Statically linked Busybox for $_arch"
_target="$(arch_to_hostspec $_arch)"
source="
busybox-static-$pkgver-r$pkgrel-$_arch.apk::$_mirror/edge/main/$_arch/busybox-static-$pkgver-r$pkgrel.apk
busybox-static-$pkgver-r$pkgrel-$_arch.apk::$_mirror/v3.12/main/$_arch/busybox-static-$pkgver-r$pkgrel.apk
"
package() {
mkdir -p "$pkgdir/usr/$_target"
cd "$pkgdir/usr/$_target"
tar -xf $srcdir/busybox-static-$pkgver-r$pkgrel-$_arch.apk
rm .PKGINFO .SIGN.*
mkdir -p "$pkgdir/usr/$_target"
cd "$pkgdir/usr/$_target"
tar -xf $srcdir/busybox-static-$pkgver-r$pkgrel-$_arch.apk
rm .PKGINFO .SIGN.*
}
sha512sums="7c5053f6eb683917708b36fc255630386e9b6e6deb265ee44bdcb7fdd272a54a0b9d0d589355f454bacdd6be75ebe5eeec9e0650d90e403c81c080204d422a59 busybox-static-1.31.1-r14-armv7.apk"
sha512sums="170964dcd726c3bd05420d2a46663e75037f2f25391db5a63647ab9e2969e0ef1262f6f02833e7af4861ca26f997952f3c47eadf5938237eeaa1f585343ff869 busybox-static-1.31.1-r20-armv7.apk"
@@ -0,0 +1,22 @@
Upstream: Yes, https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92216 and
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95184
Reason: GDC produced errors about duplicate symbols when the same interface
was implemented by two classes in the same project.
diff --git a/gcc/d/decl.cc b/gcc/d/decl.cc
index 3824060..7afb1aa 100644 (file)
--- a/gcc/d/decl.cc
+++ b/gcc/d/decl.cc
@@ -1803,8 +1803,11 @@ make_thunk (FuncDeclaration *decl, int offset)
DECL_CONTEXT (thunk) = d_decl_context (decl);
- /* Thunks inherit the public access of the function they are targetting. */
- TREE_PUBLIC (thunk) = TREE_PUBLIC (function);
+ /* Thunks inherit the public access of the function they are targetting.
+ When the function is outside the current compilation unit however, then the
+ thunk must be kept private to not conflict. */
+ TREE_PUBLIC (thunk) = TREE_PUBLIC (function) && !DECL_EXTERNAL (function);
+
DECL_EXTERNAL (thunk) = 0;
/* Thunks are always addressable. */
+8 -2
View File
@@ -30,7 +30,7 @@ pkgver=9.3.0
[ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target=""
pkgname="gcc-aarch64"
pkgrel=1
pkgrel=2
pkgdesc="Stage2 cross-compiler for aarch64"
url="https://gcc.gnu.org"
arch="x86_64"
@@ -214,6 +214,7 @@ source="https://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$pkgver}/gcc-${_pkg
403-dlang-ibmz.patch
404-dlang-zlib.patch
405-dlang-mips.patch
406-dlang-fix-interface-visibility.patch
"
# gcc-4.8-build-args.patch
@@ -438,6 +439,10 @@ done
exec gcc $_flavor ${1+"$@"}
EOF
chmod 755 "$pkgdir"/usr/bin/c?9
# install lto plugin so regular binutils may use it
mkdir -p "$pkgdir"/usr/lib/bfd-plugins
ln -s /$_gcclibexec/liblto_plugin.so "$pkgdir/usr/lib/bfd-plugins/"
fi
}
@@ -660,4 +665,5 @@ f4ef08454e28c8732db69115e4998ec153399e8d229dd27f923dbdcf57b68128a65640d026cc7f45
9d73f21eaa2458d28a144dd0e5478ed52763a4d8bbf62084b607db52bce1e2242f773c853fc34e6aae2d53c4124948139954627064e850e9dabaddaef5cb9d69 402-dlang-stat.patch
fd056014d0c6f627108d7387bfe46b5fb66786a16fa964da55b0442658b1c8e9e903c641a9e3233000ef37691e32ea4fef22029ab5eba217ccbc8bd5941e81ae 403-dlang-ibmz.patch
ddb3ca26b5e55f6d376036c2ed87959770bfb72d1175d0dba332f705edf6817806d53765c838ff670472a16ab175bd1ce88946c19d83f9d5e53ff2b4d3558dfb 404-dlang-zlib.patch
3f40f796f50d49ea0a185d3454c79606fb5f90ed48c030fe25c1df8c4a72ba7cae37dccdb260cf737beb3e921dc2ddad68effbe446dbf220a07d0158b9b9ca8d 405-dlang-mips.patch"
3f40f796f50d49ea0a185d3454c79606fb5f90ed48c030fe25c1df8c4a72ba7cae37dccdb260cf737beb3e921dc2ddad68effbe446dbf220a07d0158b9b9ca8d 405-dlang-mips.patch
c226bb5c60ae5071549e5ec3ab44dc87b244615ba520973b1d4c50a2b6d3fd941c4e5e8e1f85cad28093ee8627d20415114524b593ad3a9b24998328d3f3ea72 406-dlang-fix-interface-visibility.patch"
-42
View File
@@ -1,42 +0,0 @@
From 65eb86f3e110998d30489df009d44b4bc1043adc Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <nsz@port70.net>
Date: Fri, 26 Jan 2018 20:32:50 +0000
Subject: [PATCH 02/12] posix_memalign
---
gcc/config/i386/pmm_malloc.h | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/gcc/config/i386/pmm_malloc.h b/gcc/config/i386/pmm_malloc.h
index ffbb7f82cf5..b0b890d2403 100644
--- a/gcc/config/i386/pmm_malloc.h
+++ b/gcc/config/i386/pmm_malloc.h
@@ -27,12 +27,13 @@
#include <stdlib.h>
/* We can't depend on <stdlib.h> since the prototype of posix_memalign
- may not be visible. */
+ may not be visible and we can't pollute the namespace either. */
#ifndef __cplusplus
-extern int posix_memalign (void **, size_t, size_t);
+extern int _mm_posix_memalign (void **, size_t, size_t)
#else
-extern "C" int posix_memalign (void **, size_t, size_t) throw ();
+extern "C" int _mm_posix_memalign (void **, size_t, size_t) throw ()
#endif
+__asm__("posix_memalign");
static __inline void *
_mm_malloc (size_t __size, size_t __alignment)
@@ -42,7 +43,7 @@ _mm_malloc (size_t __size, size_t __alignment)
return malloc (__size);
if (__alignment == 2 || (sizeof (void *) == 8 && __alignment == 4))
__alignment = sizeof (void *);
- if (posix_memalign (&__ptr, __alignment, __size) == 0)
+ if (_mm_posix_memalign (&__ptr, __alignment, __size) == 0)
return __ptr;
else
return NULL;
--
2.17.1
@@ -1,194 +0,0 @@
From 48c670d2678e0323d88eb72205e039f393cabe05 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 29 Mar 2013 08:59:00 +0400
Subject: [PATCH 03/39] gcc: poison-system-directories
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Upstream-Status: Inappropriate [distribution: codesourcery]
---
gcc/common.opt | 4 ++++
gcc/config.in | 6 ++++++
gcc/configure | 16 ++++++++++++++++
gcc/configure.ac | 10 ++++++++++
gcc/doc/invoke.texi | 9 +++++++++
gcc/gcc.c | 2 ++
gcc/incpath.c | 19 +++++++++++++++++++
7 files changed, 66 insertions(+)
diff --git a/gcc/common.opt b/gcc/common.opt
index d6ef85928f3..7b29efe3882 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -679,6 +679,10 @@ Wreturn-local-addr
Common Var(warn_return_local_addr) Init(1) Warning
Warn about returning a pointer/reference to a local or temporary variable.
+Wpoison-system-directories
+Common Var(flag_poison_system_directories) Init(1) Warning
+Warn for -I and -L options using system directories if cross compiling
+
Wshadow
Common Var(warn_shadow) Warning
Warn when one variable shadows another. Same as -Wshadow=global.
diff --git a/gcc/config.in b/gcc/config.in
index 5bccb408016..1c784a8276b 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -194,6 +194,12 @@
#endif
+/* Define to warn for use of native system header directories */
+#ifndef USED_FOR_TARGET
+#undef ENABLE_POISON_SYSTEM_DIRECTORIES
+#endif
+
+
/* Define if you want all operations on RTL (the basic data structure of the
optimizer and back end) to be checked for dynamic type safety at runtime.
This is quite expensive. */
diff --git a/gcc/configure b/gcc/configure
index 5c345ce0fd7..cafd05fd150 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -953,6 +953,7 @@ with_system_zlib
enable_maintainer_mode
enable_link_mutex
enable_version_specific_runtime_libs
+enable_poison_system_directories
enable_plugin
enable_host_shared
enable_libquadmath_support
@@ -1696,6 +1697,8 @@ Optional Features:
--enable-version-specific-runtime-libs
specify that runtime libraries should be installed
in a compiler-specific directory
+ --enable-poison-system-directories
+ warn for use of native system header directories
--enable-plugin enable plugin support
--enable-host-shared build host code as shared libraries
--disable-libquadmath-support
@@ -29715,6 +29718,19 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then :
fi
+# Check whether --enable-poison-system-directories was given.
+if test "${enable_poison_system_directories+set}" = set; then :
+ enableval=$enable_poison_system_directories;
+else
+ enable_poison_system_directories=no
+fi
+
+if test "x${enable_poison_system_directories}" = "xyes"; then
+
+$as_echo "#define ENABLE_POISON_SYSTEM_DIRECTORIES 1" >>confdefs.h
+
+fi
+
# Substitute configuration variables
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 65dbf1f2f80..dd5b38195ce 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -6341,6 +6341,16 @@ AC_ARG_ENABLE(version-specific-runtime-libs,
[specify that runtime libraries should be
installed in a compiler-specific directory])])
+AC_ARG_ENABLE([poison-system-directories],
+ AS_HELP_STRING([--enable-poison-system-directories],
+ [warn for use of native system header directories]),,
+ [enable_poison_system_directories=no])
+if test "x${enable_poison_system_directories}" = "xyes"; then
+ AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES],
+ [1],
+ [Define to warn for use of native system header directories])
+fi
+
# Substitute configuration variables
AC_SUBST(subdirs)
AC_SUBST(srcdir)
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 255149fcfb8..cb71b60fe3c 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -303,6 +303,7 @@ Objective-C and Objective-C++ Dialects}.
-Wpacked -Wpacked-bitfield-compat -Wpacked-not-aligned -Wpadded @gol
-Wparentheses -Wno-pedantic-ms-format @gol
-Wplacement-new -Wplacement-new=@var{n} @gol
+-Wno-poison-system-directories @gol
-Wpointer-arith -Wpointer-compare -Wno-pointer-to-int-cast @gol
-Wno-pragmas -Wredundant-decls -Wrestrict -Wno-return-local-addr @gol
-Wreturn-type -Wsequence-point -Wshadow -Wno-shadow-ivar @gol
@@ -5712,6 +5713,14 @@ made up of data only and thus requires no special treatment. But, for
most targets, it is made up of code and thus requires the stack to be
made executable in order for the program to work properly.
+@item -Wno-poison-system-directories
+@opindex Wno-poison-system-directories
+Do not warn for @option{-I} or @option{-L} options using system
+directories such as @file{/usr/include} when cross compiling. This
+option is intended for use in chroot environments when such
+directories contain the correct headers and libraries for the target
+system rather than the host.
+
@item -Wfloat-equal
@opindex Wfloat-equal
@opindex Wno-float-equal
diff --git a/gcc/gcc.c b/gcc/gcc.c
index a716f708259..02b3cd39fc2 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -1061,6 +1060,8 @@
"-z relro -z now " \
"%X %{o*} %{e*} %{N} %{n} %{r}\
%{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!r:%{!nostartfiles:%S}}} \
+ %{Wno-poison-system-directories:--no-poison-system-directories} \
+ %{Werror=poison-system-directories:--error-poison-system-directories} \
%{static|no-pie|static-pie:} %@{L*} %(mfwrap) %(link_libgcc) " \
VTABLE_VERIFICATION_SPEC " " SANITIZER_EARLY_SPEC " %o "" \
%{fopenacc|fopenmp|%:gt(%{ftree-parallelize-loops=*:%*} 1):\
diff --git a/gcc/incpath.c b/gcc/incpath.c
index b11c6a57939..e3b7a21966f 100644
--- a/gcc/incpath.c
+++ b/gcc/incpath.c
@@ -26,6 +26,7 @@
#include "intl.h"
#include "incpath.h"
#include "cppdefault.h"
+#include "diagnostic-core.h"
/* Microsoft Windows does not natively support inodes.
VMS has non-numeric inodes. */
@@ -393,6 +394,26 @@ merge_include_chains (const char *sysroot, cpp_reader *pfile, int verbose)
}
fprintf (stderr, _("End of search list.\n"));
}
+
+#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES
+ if (flag_poison_system_directories)
+ {
+ struct cpp_dir *p;
+
+ for (p = heads[INC_QUOTE]; p; p = p->next)
+ {
+ if ((!strncmp (p->name, "/usr/include", 12))
+ || (!strncmp (p->name, "/usr/local/include", 18))
+ || (!strncmp (p->name, "/usr/X11R6/include", 18))
+ || (!strncmp (p->name, "/sw/include", 11))
+ || (!strncmp (p->name, "/opt/include", 12)))
+ warning (OPT_Wpoison_system_directories,
+ "include location \"%s\" is unsafe for "
+ "cross-compilation",
+ p->name);
+ }
+ }
+#endif
}
/* Use given -I paths for #include "..." but not #include <...>, and
--
2.17.0
-26
View File
@@ -1,26 +0,0 @@
From b693804c8dba92fea7beee98f0aa520853a0532b Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <nsz@port70.net>
Date: Thu, 22 Dec 2016 11:22:28 +0000
Subject: [PATCH 08/12] s390x muslldso
---
gcc/config/s390/linux.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/gcc/config/s390/linux.h b/gcc/config/s390/linux.h
index 525c17c2c9f..2d4f4a0654e 100644
--- a/gcc/config/s390/linux.h
+++ b/gcc/config/s390/linux.h
@@ -76,6 +76,9 @@ along with GCC; see the file COPYING3. If not see
#define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1"
#define GLIBC_DYNAMIC_LINKER64 "/lib/ld64.so.1"
+#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-s390.so.1"
+#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-s390x.so.1"
+
#undef LINK_SPEC
#define LINK_SPEC \
"%{m31:-m elf_s390}%{m64:-m elf64_s390} \
--
2.17.1
-76
View File
@@ -1,76 +0,0 @@
From 47467f3ab0fb2f2fcede81060fe8bb339d0909eb Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <nsz@port70.net>
Date: Wed, 28 Feb 2018 00:54:05 +0000
Subject: [PATCH 10/12] ldbl128 config
---
gcc/configure | 13 +++++++++++++
gcc/configure.ac | 16 ++++++++++++++--
2 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/gcc/configure b/gcc/configure
index 6121e163259..07ff8597d48 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -29309,6 +29309,15 @@ if test "${with_long_double_128+set}" = set; then :
withval=$with_long_double_128; gcc_cv_target_ldbl128="$with_long_double_128"
else
+ case "$target" in
+ s390*-*-linux-musl*)
+ gcc_cv_target_ldbl128=yes
+ ;;
+ powerpc*-*-linux-musl*)
+ gcc_cv_target_ldbl128=no
+ ;;
+ *)
+
if test $glibc_version_major -gt 2 \
|| ( test $glibc_version_major -eq 2 && test $glibc_version_minor -ge 4 ); then :
gcc_cv_target_ldbl128=yes
@@ -29320,6 +29329,10 @@ else
&& gcc_cv_target_ldbl128=yes
fi
+
+ ;;
+ esac
+
fi
;;
diff --git a/gcc/configure.ac b/gcc/configure.ac
index b066cc609e1..6c15ed898c0 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -5971,13 +5971,25 @@ case "$target" in
AC_ARG_WITH(long-double-128,
[AS_HELP_STRING([--with-long-double-128],
[use 128-bit long double by default])],
- gcc_cv_target_ldbl128="$with_long_double_128",
+ gcc_cv_target_ldbl128="$with_long_double_128", [
+ case "$target" in
+ s390*-*-linux-musl*)
+ gcc_cv_target_ldbl128=yes
+ ;;
+ powerpc*-*-linux-musl*)
+ gcc_cv_target_ldbl128=no
+ ;;
+ *)]
[GCC_GLIBC_VERSION_GTE_IFELSE([2], [4], [gcc_cv_target_ldbl128=yes], [
[gcc_cv_target_ldbl128=no
grep '^[ ]*#[ ]*define[ ][ ]*__LONG_DOUBLE_MATH_OPTIONAL' \
$target_header_dir/bits/wordsize.h > /dev/null 2>&1 \
&& gcc_cv_target_ldbl128=yes
- ]])])
+ ]])]
+ [
+ ;;
+ esac
+ ])
;;
esac
if test x$gcc_cv_target_ldbl128 = xyes; then
--
2.17.1
-107
View File
@@ -1,107 +0,0 @@
From a4aa319f7c19e564dced3daeb7222c9315af936c Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <nsz@port70.net>
Date: Sat, 18 Aug 2018 23:58:45 +0000
Subject: [PATCH 12/12] static-pie
in gcc-8 -static means static non-pie, even if -pie or -static-pie
are specified, -static-pie can be used to build static pie.
in musl toolchains -static -pie always meant static pie, so this
patch fixes the link specs accordingly, the new -static-pie is just
an alias to -static -pie.
---
gcc/common.opt | 4 ++--
gcc/config/gnu-user.h | 12 +++++-------
gcc/config/rs6000/sysv4.h | 11 +++++------
gcc/gcc.c | 6 +++---
4 files changed, 15 insertions(+), 18 deletions(-)
diff --git a/gcc/common.opt b/gcc/common.opt
index b52ef0b38c8..0ce5857e01d 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -3197,11 +3197,11 @@ Driver
no-pie
Driver RejectNegative Negative(shared)
-Don't create a dynamically linked position independent executable.
+Don't create a position independent executable.
pie
Driver RejectNegative Negative(no-pie)
-Create a dynamically linked position independent executable.
+Create a position independent executable.
static-pie
Driver RejectNegative Negative(pie)
diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h
index 8620de3e42d..235328a2642 100644
--- a/gcc/config/gnu-user.h
+++ b/gcc/config/gnu-user.h
@@ -51,13 +51,12 @@
#define GNU_USER_TARGET_STARTFILE_SPEC \
"%{shared:; \
pg|p|profile:%{static-pie:grcrt1.o%s;:gcrt1.o%s}; \
- static:crt1.o%s; \
- static-pie:rcrt1.o%s; \
+ static|static-pie:%{" PIE_SPEC ":rcrt1.o%s;:crt1.o%s}; \
" PIE_SPEC ":Scrt1.o%s; \
:crt1.o%s} " \
GNU_USER_TARGET_CRTI " \
- %{static:crtbeginT.o%s; \
- shared|static-pie|" PIE_SPEC ":crtbeginS.o%s; \
+ %{shared|" PIE_SPEC ":crtbeginS.o%s; \
+ static:crtbeginT.o%s; \
:crtbegin.o%s} \
%{fvtable-verify=none:%s; \
fvtable-verify=preinit:vtv_start_preinit.o%s; \
@@ -76,8 +75,7 @@
"%{fvtable-verify=none:%s; \
fvtable-verify=preinit:vtv_end_preinit.o%s; \
fvtable-verify=std:vtv_end.o%s} \
- %{static:crtend.o%s; \
- shared|static-pie|" PIE_SPEC ":crtendS.o%s; \
+ %{shared|" PIE_SPEC ":crtendS.o%s; \
:crtend.o%s} " \
GNU_USER_TARGET_CRTN " " \
CRTOFFLOADEND
@@ -133,7 +131,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#define LIB_SPEC GNU_USER_TARGET_LIB_SPEC
#if defined(HAVE_LD_EH_FRAME_HDR)
-#define LINK_EH_SPEC "%{!static|static-pie:--eh-frame-hdr} "
+#define LINK_EH_SPEC "%{!static|" PIE_SPEC ":--eh-frame-hdr} "
#endif
#undef LINK_GCC_C_SEQUENCE_SPEC
diff --git a/gcc/gcc.c b/gcc/gcc.c
index eb1610ba8b0..87560afb03c 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -900,7 +900,7 @@ proper position among the other output files. */
#define NO_FPIE_AND_FPIC_SPEC NO_FPIE_SPEC "|" NO_FPIC_SPEC
#define FPIE_OR_FPIC_SPEC NO_FPIE_AND_FPIC_SPEC ":;"
#else
-#define PIE_SPEC "pie"
+#define PIE_SPEC "pie|static-pie"
#define FPIE1_SPEC "fpie"
#define NO_FPIE1_SPEC FPIE1_SPEC ":;"
#define FPIE2_SPEC "fPIE"
@@ -924,12 +924,12 @@ proper position among the other output files. */
#ifndef LINK_PIE_SPEC
#ifdef HAVE_LD_PIE
#ifndef LD_PIE_SPEC
-#define LD_PIE_SPEC "-pie"
+#define LD_PIE_SPEC "-pie %{static|static-pie:--no-dynamic-linker -z text -Bsymbolic}"
#endif
#else
#define LD_PIE_SPEC ""
#endif
-#define LINK_PIE_SPEC "%{static|shared|r:;" PIE_SPEC ":" LD_PIE_SPEC "} "
+#define LINK_PIE_SPEC "%{shared|r:;" PIE_SPEC ":" LD_PIE_SPEC "} "
#endif
#ifndef LINK_BUILDID_SPEC
--
2.17.1
@@ -1,29 +0,0 @@
Fixes errors such as:
GEGL-Message: 16:04:13.794: Module '/usr/lib/gegl-0.4/raw-load.so' load error: Error relocating /usr/lib/libgomp.so.1: __cxa_finalize: initial-exec TLS resolves to dynamic definition in /usr/lib/libgomp.so.1
--- a/libgomp/configure.tgt 2018-11-08 18:13:04.000000000 +0100
+++ b/libgomp/configure.tgt 2019-06-29 20:06:31.972950350 +0200
@@ -10,23 +10,6 @@
# XCFLAGS Add extra compile flags to use.
# XLDFLAGS Add extra link flags to use.
-# Optimize TLS usage by avoiding the overhead of dynamic allocation.
-if test $gcc_cv_have_tls = yes ; then
- case "${target}" in
-
- *-*-k*bsd*-gnu*)
- ;;
-
- *-*-linux* | *-*-gnu*)
- XCFLAGS="${XCFLAGS} -ftls-model=initial-exec -DUSING_INITIAL_EXEC_TLS"
- ;;
-
- *-*-rtems*)
- XCFLAGS="${XCFLAGS} -ftls-model=local-exec"
- ;;
- esac
-fi
-
# Since we require POSIX threads, assume a POSIX system by default.
config_path="posix"
@@ -1,33 +0,0 @@
# Turn on -Wl,-z,relro,-z,now by default.
---
gcc/doc/invoke.texi | 3 +++
gcc/gcc.c | 1 +
2 files changed, 4 insertions(+), 0 deletions(-)
Index: b/gcc/doc/invoke.texi
===================================================================
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -11424,6 +11424,9 @@ For example, @option{-Wl,-Map,output.map
linker. When using the GNU linker, you can also get the same effect with
@option{-Wl,-Map=output.map}.
+NOTE: In Alpine Linux, for LDFLAGS, the option
+@option{-Wl,-z,relro,now} is used. To disable, use @option{-Wl,-z,norelro}.
+
@item -u @var{symbol}
@opindex u
Pretend the symbol @var{symbol} is undefined, to force linking of
Index: b/gcc/gcc.c
===================================================================
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -890,6 +890,7 @@ proper position among the other output f
"%{flto|flto=*:%<fcompare-debug*} \
%{flto} %{fno-lto} %{flto=*} %l " LINK_PIE_SPEC \
"%{fuse-ld=*:-fuse-ld=%*} " LINK_COMPRESS_DEBUG_SPEC \
+ "-z relro -z now " \
"%X %{o*} %{e*} %{N} %{n} %{r}\
%{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!nostartfiles:%S}} " VTABLE_VERIFICATION_SPEC " \
%{static:} %{L*} %(mfwrap) %(link_libgcc) " SANITIZER_EARLY_SPEC " %o\
@@ -1,40 +0,0 @@
# DP: Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, ObjC, ObjC++,
# DP: if the optimization level is > 0
---
gcc/doc/invoke.texi | 6 ++++++
gcc/c-family/c-cppbuiltin.c | 3 +
2 files changed, 9 insertions(+), 0 deletions(-)
Index: b/gcc/doc/invoke.texi
===================================================================
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -7840,6 +7840,12 @@ also turns on the following optimization
Please note the warning under @option{-fgcse} about
invoking @option{-O2} on programs that use computed gotos.
+NOTE: In Alpine Linux, @option{-D_FORTIFY_SOURCE=2} is
+set by default, and is activated when @option{-O} is set to 2 or higher.
+This enables additional compile-time and run-time checks for several libc
+functions. To disable, specify either @option{-U_FORTIFY_SOURCE} or
+@option{-D_FORTIFY_SOURCE=0}.
+
@item -O3
@opindex O3
Optimize yet more. @option{-O3} turns on all optimizations specified
Index: b/gcc/c-family/c-cppbuiltin.c
===================================================================
--- a/gcc/c-family/c-cppbuiltin.c
+++ b/gcc/c-family/c-cppbuiltin.c
@@ -1176,6 +1176,10 @@ c_cpp_builtins (cpp_reader *pfile)
builtin_define_with_value ("__REGISTER_PREFIX__", REGISTER_PREFIX, 0);
builtin_define_with_value ("__USER_LABEL_PREFIX__", user_label_prefix, 0);
+ /* Fortify Source enabled by default for optimization levels > 0 */
+ if (optimize)
+ builtin_define_with_int_value ("_FORTIFY_SOURCE", 2);
+
/* Misc. */
if (flag_gnu89_inline)
cpp_define (pfile, "__GNUC_GNU_INLINE__");
@@ -1,244 +0,0 @@
# DP: On linux targets pass --as-needed by default to the linker, but always
# DP: link the sanitizer libraries with --no-as-needed.
Index: b/gcc/gcc.c
===================================================================
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -692,8 +692,11 @@ proper position among the other output f
#ifdef LIBASAN_EARLY_SPEC
#define LIBASAN_SPEC STATIC_LIBASAN_LIBS
#elif defined(HAVE_LD_STATIC_DYNAMIC)
-#define LIBASAN_SPEC "%{static-libasan:" LD_STATIC_OPTION \
- "} -lasan %{static-libasan:" LD_DYNAMIC_OPTION "}" \
+#define LIBASAN_SPEC "%{static-libasan:" LD_STATIC_OPTION "}" \
+ " %{!static-libasan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \
+ " -lasan " \
+ " %{static-libasan:" LD_DYNAMIC_OPTION "}" \
+ " %{!static-libasan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
STATIC_LIBASAN_LIBS
#else
#define LIBASAN_SPEC "-lasan" STATIC_LIBASAN_LIBS
@@ -710,8 +713,11 @@ proper position among the other output f
#ifdef LIBTSAN_EARLY_SPEC
#define LIBTSAN_SPEC STATIC_LIBTSAN_LIBS
#elif defined(HAVE_LD_STATIC_DYNAMIC)
-#define LIBTSAN_SPEC "%{static-libtsan:" LD_STATIC_OPTION \
- "} -ltsan %{static-libtsan:" LD_DYNAMIC_OPTION "}" \
+#define LIBTSAN_SPEC "%{static-libtsan:" LD_STATIC_OPTION "}" \
+ " %{!static-libtsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \
+ " -ltsan " \
+ " %{static-libtsan:" LD_DYNAMIC_OPTION "}" \
+ " %{!static-libtsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
STATIC_LIBTSAN_LIBS
#else
#define LIBTSAN_SPEC "-ltsan" STATIC_LIBTSAN_LIBS
@@ -728,8 +734,11 @@ proper position among the other output f
#ifdef LIBLSAN_EARLY_SPEC
#define LIBLSAN_SPEC STATIC_LIBLSAN_LIBS
#elif defined(HAVE_LD_STATIC_DYNAMIC)
-#define LIBLSAN_SPEC "%{static-liblsan:" LD_STATIC_OPTION \
- "} -llsan %{static-liblsan:" LD_DYNAMIC_OPTION "}" \
+#define LIBLSAN_SPEC "%{static-liblsan:" LD_STATIC_OPTION "}" \
+ " %{!static-liblsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \
+ " -llsan " \
+ " %{static-liblsan:" LD_DYNAMIC_OPTION "}" \
+ " %{!static-liblsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
STATIC_LIBLSAN_LIBS
#else
#define LIBLSAN_SPEC "-llsan" STATIC_LIBLSAN_LIBS
@@ -744,8 +753,11 @@ proper position among the other output f
#define STATIC_LIBUBSAN_LIBS \
" %{static-libubsan|static:%:include(libsanitizer.spec)%(link_libubsan)}"
#ifdef HAVE_LD_STATIC_DYNAMIC
-#define LIBUBSAN_SPEC "%{static-libubsan:" LD_STATIC_OPTION \
- "} -lubsan %{static-libubsan:" LD_DYNAMIC_OPTION "}" \
+#define LIBUBSAN_SPEC "%{static-libubsan:" LD_STATIC_OPTION "}" \
+ " %{!static-libubsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \
+ " -lubsan " \
+ " %{static-libubsan:" LD_DYNAMIC_OPTION "}" \
+ " %{!static-libubsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
STATIC_LIBUBSAN_LIBS
#else
#define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS
Index: b/gcc/config/gnu-user.h
===================================================================
--- a/gcc/config/gnu-user.h
+++ b/gcc/config/gnu-user.h
@@ -161,15 +161,15 @@ see the files COPYING3 and COPYING.RUNTI
#define LIBASAN_EARLY_SPEC "%{!shared:libasan_preinit%O%s} " \
"%{static-libasan:%{!shared:" \
LD_STATIC_OPTION " --whole-archive -lasan --no-whole-archive " \
- LD_DYNAMIC_OPTION "}}%{!static-libasan:-lasan}"
+ LD_DYNAMIC_OPTION "}}%{!static-libasan:%{!fuse-ld=gold:--push-state} --no-as-needed -lasan %{fuse-ld=gold:--as-needed;:--pop-state}}"
#undef LIBTSAN_EARLY_SPEC
#define LIBTSAN_EARLY_SPEC "%{!shared:libtsan_preinit%O%s} " \
"%{static-libtsan:%{!shared:" \
LD_STATIC_OPTION " --whole-archive -ltsan --no-whole-archive " \
- LD_DYNAMIC_OPTION "}}%{!static-libtsan:-ltsan}"
+ LD_DYNAMIC_OPTION "}}%{!static-libtsan:%{!fuse-ld=gold:--push-state} --no-as-needed -ltsan %{fuse-ld=gold:--as-needed;:--pop-state}}"
#undef LIBLSAN_EARLY_SPEC
#define LIBLSAN_EARLY_SPEC "%{!shared:liblsan_preinit%O%s} " \
"%{static-liblsan:%{!shared:" \
LD_STATIC_OPTION " --whole-archive -llsan --no-whole-archive " \
- LD_DYNAMIC_OPTION "}}%{!static-liblsan:-llsan}"
+ LD_DYNAMIC_OPTION "}}%{!static-liblsan:%{!fuse-ld=gold:--push-state} --no-as-needed -llsan %{fuse-ld=gold:--as-needed;:--pop-state}}"
#endif
Index: b/gcc/config/aarch64/aarch64-linux.h
===================================================================
--- a/gcc/config/aarch64/aarch64-linux.h
+++ b/gcc/config/aarch64/aarch64-linux.h
@@ -35,6 +35,7 @@
#define CPP_SPEC "%{pthread:-D_REENTRANT}"
#define LINUX_TARGET_LINK_SPEC "%{h*} \
+ --as-needed \
%{static:-Bstatic} \
%{shared:-shared} \
%{symbolic:-Bsymbolic} \
Index: b/gcc/config/ia64/linux.h
===================================================================
--- a/gcc/config/ia64/linux.h
+++ b/gcc/config/ia64/linux.h
@@ -58,7 +58,7 @@ do { \
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-ia64.so.2"
#undef LINK_SPEC
-#define LINK_SPEC "\
+#define LINK_SPEC " --as-needed \
%{shared:-shared} \
%{!shared: \
%{!static: \
Index: b/gcc/config/sparc/linux.h
===================================================================
--- a/gcc/config/sparc/linux.h
+++ b/gcc/config/sparc/linux.h
@@ -86,7 +86,7 @@ extern const char *host_detect_local_cpu
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
#undef LINK_SPEC
-#define LINK_SPEC "-m elf32_sparc %{shared:-shared} \
+#define LINK_SPEC "-m elf32_sparc --as-needed %{shared:-shared} \
%{!mno-relax:%{!r:-relax}} \
%{!shared: \
%{!static: \
Index: b/gcc/config/s390/linux.h
===================================================================
--- a/gcc/config/s390/linux.h
+++ b/gcc/config/s390/linux.h
@@ -78,7 +78,7 @@ along with GCC; see the file COPYING3.
#undef LINK_SPEC
#define LINK_SPEC \
- "%{m31:-m elf_s390}%{m64:-m elf64_s390} \
+ "%{m31:-m elf_s390}%{m64:-m elf64_s390} --as-needed \
%{shared:-shared} \
%{!shared: \
%{static:-static} \
Index: b/gcc/config/rs6000/linux64.h
===================================================================
--- a/gcc/config/rs6000/linux64.h
+++ b/gcc/config/rs6000/linux64.h
@@ -490,13 +490,13 @@ extern int dot_symbols;
" -m elf64ppc")
#endif
-#define LINK_OS_LINUX_SPEC32 LINK_OS_LINUX_EMUL32 " %{!shared: %{!static: \
+#define LINK_OS_LINUX_SPEC32 LINK_OS_LINUX_EMUL32 " --as-needed %{!shared: %{!static: \
%{!static-pie: \
%{rdynamic:-export-dynamic} \
-dynamic-linker " GNU_USER_DYNAMIC_LINKER32 "}}} \
%(link_os_extra_spec32)"
-#define LINK_OS_LINUX_SPEC64 LINK_OS_LINUX_EMUL64 " %{!shared: %{!static: \
+#define LINK_OS_LINUX_SPEC64 LINK_OS_LINUX_EMUL64 " --as-needed %{!shared: %{!static: \
%{!static-pie: \
%{rdynamic:-export-dynamic} \
-dynamic-linker " GNU_USER_DYNAMIC_LINKER64 "}}} \
Index: b/gcc/config/rs6000/sysv4.h
===================================================================
--- a/gcc/config/rs6000/sysv4.h
+++ b/gcc/config/rs6000/sysv4.h
@@ -811,7 +811,7 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEF
CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, \
MUSL_DYNAMIC_LINKER)
-#define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \
+#define LINK_OS_LINUX_SPEC "-m elf32ppclinux --as-needed %{!shared: %{!static: \
%{rdynamic:-export-dynamic} \
-dynamic-linker " GNU_USER_DYNAMIC_LINKER "}}"
Index: b/gcc/config/i386/gnu-user64.h
===================================================================
--- a/gcc/config/i386/gnu-user64.h
+++ b/gcc/config/i386/gnu-user64.h
@@ -56,6 +56,7 @@
"%{" SPEC_64 ":-m " GNU_USER_LINK_EMULATION64 "} \
%{" SPEC_32 ":-m " GNU_USER_LINK_EMULATION32 "} \
%{" SPEC_X32 ":-m " GNU_USER_LINK_EMULATIONX32 "} \
+ --as-needed \
%{shared:-shared} \
%{!shared: \
%{!static: \
Index: b/gcc/config/i386/gnu-user.h
===================================================================
--- a/gcc/config/i386/gnu-user.h
+++ b/gcc/config/i386/gnu-user.h
@@ -74,7 +74,7 @@ along with GCC; see the file COPYING3.
{ "link_emulation", GNU_USER_LINK_EMULATION },\
{ "dynamic_linker", GNU_USER_DYNAMIC_LINKER }
-#define GNU_USER_TARGET_LINK_SPEC "-m %(link_emulation) %{shared:-shared} \
+#define GNU_USER_TARGET_LINK_SPEC "-m %(link_emulation) --as-needed %{shared:-shared} \
%{!shared: \
%{!static: \
%{!static-pie: \
Index: b/gcc/config/alpha/linux-elf.h
===================================================================
--- a/gcc/config/alpha/linux-elf.h
+++ b/gcc/config/alpha/linux-elf.h
@@ -37,7 +37,7 @@ along with GCC; see the file COPYING3.
#define ELF_DYNAMIC_LINKER GNU_USER_DYNAMIC_LINKER
-#define LINK_SPEC "-m elf64alpha %{G*} %{relax:-relax} \
+#define LINK_SPEC "-m elf64alpha --as-needed %{G*} %{relax:-relax} \
%{O*:-O3} %{!O*:-O1} \
%{shared:-shared} \
%{!shared: \
Index: b/gcc/config/arm/linux-elf.h
===================================================================
--- a/gcc/config/arm/linux-elf.h
+++ b/gcc/config/arm/linux-elf.h
@@ -70,6 +70,7 @@
%{rdynamic:-export-dynamic} \
%{!shared:-dynamic-linker " GNU_USER_DYNAMIC_LINKER "}} \
-X \
+ --as-needed \
%{mbig-endian:-EB} %{mlittle-endian:-EL}" \
SUBTARGET_EXTRA_LINK_SPEC
Index: b/gcc/config/mips/gnu-user.h
===================================================================
--- a/gcc/config/mips/gnu-user.h
+++ b/gcc/config/mips/gnu-user.h
@@ -55,6 +55,7 @@ along with GCC; see the file COPYING3.
#undef GNU_USER_TARGET_LINK_SPEC
#define GNU_USER_TARGET_LINK_SPEC "\
%{G*} %{EB} %{EL} %{mips*} %{shared} \
+ -as-needed \
%{!shared: \
%{!static: \
%{rdynamic:-export-dynamic} \
Index: b/gcc/config/riscv/linux.h
===================================================================
--- a/gcc/config/riscv/linux.h
+++ b/gcc/config/riscv/linux.h
@@ -58,6 +58,7 @@
"%{mabi=ilp32:_ilp32}"
#define LINK_SPEC "\
+-as-needed \
-melf" XLEN_SPEC "lriscv" LD_EMUL_SUFFIX " \
%{mno-relax:--no-relax} \
%{shared} \
@@ -1,22 +0,0 @@
Enable -Wformat and -Wformat-security by default.
--- a/gcc/c-family/c.opt 2016-03-23 18:51:56.000000000 +0100
+++ b/gcc/c-family/c.opt 2016-04-28 23:45:54.063351272 +0200
@@ -459,7 +459,7 @@ C ObjC C++ ObjC++ Var(warn_format_nonlit
Warn about format strings that are not literals.
Wformat-security
-C ObjC C++ ObjC++ Var(warn_format_security) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 2, 0)
+C ObjC C++ ObjC++ Var(warn_format_security) Init(1) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 2, 0)
Warn about possible security problems with format functions.
Wformat-signedness
@@ -475,7 +475,7 @@ C ObjC C++ ObjC++ Var(warn_format_zero_l
Warn about zero-length formats.
Wformat=
-C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_format) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall, 1, 0) IntegerRange(0, 2)
+C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_format) Init(1) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall, 1, 0) IntegerRange(0, 2)
Warn about printf/scanf/strftime/strfmon format string anomalies.
Wignored-qualifiers
@@ -1,13 +0,0 @@
Enable -Wtrampolines by default.
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -712,7 +712,7 @@ Common Var(warn_system_headers) Warning
Do not suppress warnings from system headers.
Wtrampolines
-Common Var(warn_trampolines) Warning
+Common Var(warn_trampolines) Init(1) Warning
Warn whenever a trampoline is generated.
Wtype-limits
@@ -1,38 +0,0 @@
Disable ssp on -nostdlib, -nodefaultlibs and -ffreestanding
Change the buffer size.
--- a/gcc/gcc.c 2017-07-04 09:15:57.740793000 +0200
+++ b/gcc/gcc.c 2018-03-02 13:58:44.387741114 +0100
@@ -857,6 +857,12 @@ proper position among the other output f
#define LINK_GCC_C_SEQUENCE_SPEC "%G %L %G"
#endif
+#ifdef ENABLE_DEFAULT_SSP
+#define NO_SSP_SPEC "%{nostdlib|nodefaultlibs|ffreestanding:-fno-stack-protector} "
+#else
+#define NO_SSP_SPEC ""
+#endif
+
#ifndef LINK_SSP_SPEC
#ifdef TARGET_LIBC_PROVIDES_SSP
#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
@@ -1131,7 +1148,7 @@ static const char *cc1_options =
%{-version:--version}\
%{-help=*:--help=%*}\
%{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
- %{fsyntax-only:-o %j} %{-param*}\
+ %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
%{coverage:-fprofile-arcs -ftest-coverage}\
%{fprofile-arcs|fprofile-generate*|coverage:\
%{!fprofile-update=singel:\
--- a/gcc/params.def 2016-03-30 09:47:40.000000000 +0200
+++ b/gcc/params.def 2016-09-19 12:56:58.443179039 +0200
@@ -673,7 +673,7 @@ DEFPARAM (PARAM_INTEGER_SHARE_LIMIT,
DEFPARAM (PARAM_SSP_BUFFER_SIZE,
"ssp-buffer-size",
"The lower bound for a buffer to be considered for stack smashing protection.",
- 8, 1, 0)
+ 4, 1, 0)
DEFPARAM (PARAM_MIN_SIZE_FOR_STACK_SHARING,
"min-size-for-stack-sharing",
@@ -1,39 +0,0 @@
Ensure that msgfmt doesn't encounter problems during gcc bootstrapping.
Solves error messages like the following:
msgfmt: /var/tmp/portage/sys-devel/gcc-4.1.2/work/build/./gcc/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/libstdc++.so.6)
The libgcc_s.so used during build doesn't satisfy the needs of the
libstdc++.so that msgfmt is linked against. On the other hand, msgfmt
is used as a stand-alone application here, and what library it uses
behind the scenes is of no concern to the gcc build process.
Therefore, simply invoking it "as usual", i.e. without any special
library path, will make it work as expected here.
2011-09-19 Martin von Gagern
References:
https://bugs.gentoo.org/372377
https://bugs.gentoo.org/295480
--- gcc-4.1.2.orig/libstdc++-v3/po/Makefile.am
+++ gcc-4.1.2/libstdc++-v3/po/Makefile.am
@@ -39,6 +39,7 @@ MSGFMT = msgfmt
EXTRA_DIST = string_literals.cc POTFILES.in $(PACKAGE).pot $(LOCALE_IN)
.po.mo:
+ env --unset=LD_LIBRARY_PATH \
$(MSGFMT) -o $@ $<
all-local: all-local-$(USE_NLS)
--- gcc-4.1.2.orig/libstdc++-v3/po/Makefile.in
+++ gcc-4.1.2/libstdc++-v3/po/Makefile.in
@@ -419,6 +419,7 @@ uninstall-am: uninstall-info-am
.po.mo:
+ env --unset=LD_LIBRARY_PATH \
$(MSGFMT) -o $@ $<
all-local: all-local-$(USE_NLS)
@@ -1,18 +0,0 @@
2008-07-25 Magnus Granberg <zorry@ume.nu>
* include/libiberty.h (asprintf): Don't declare if defined as a macro
--- a/include/libiberty.h
+++ b/include/libiberty.h
@@ -609,8 +609,11 @@ extern int pwait (int, int *, int);
/* Like sprintf but provides a pointer to malloc'd storage, which must
be freed by the caller. */
+/* asprintf may be declared as a macro by glibc with __USE_FORTIFY_LEVEL. */
+#ifndef asprintf
extern int asprintf (char **, const char *, ...) ATTRIBUTE_PRINTF_2;
#endif
+#endif
#if !HAVE_DECL_VASPRINTF
/* Like vsprintf but provides a pointer to malloc'd storage, which
@@ -1,10 +0,0 @@
--- a/libiberty/Makefile.in
+++ b/libiberty/Makefile.in
@@ -246,6 +246,7 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS)
$(AR) $(AR_FLAGS) $(TARGETLIB) \
$(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \
$(RANLIB) $(TARGETLIB); \
+ cp $(TARGETLIB) ../ ; \
cd ..; \
else true; fi
@@ -1,27 +0,0 @@
https://bugs.gentoo.org/508852
https://gcc.gnu.org/PR61164
2014-04-27 Magnus Granberg <zorry@gentoo.org>
#508852
* libitm/configure.tgt: Disable FORTIFY
--- a/libitm/configure.tgt
+++ b/libitm/configure.tgt
@@ -43,6 +43,16 @@ if test "$gcc_cv_have_tls" = yes ; then
esac
fi
+# FIXME: error: inlining failed in call to always_inline
+# ‘int vfprintf(FILE*, const char*, __va_list_tag*)’
+# : function body can be overwritten at link time
+# Disable Fortify in libitm for now. #508852
+case "${target}" in
+ *-*-linux*)
+ XCFLAGS="${XCFLAGS} -U_FORTIFY_SOURCE"
+ ;;
+esac
+
# Map the target cpu to an ARCH sub-directory. At the same time,
# work out any special compilation flags as necessary.
case "${target_cpu}" in
@@ -1,18 +0,0 @@
libatomic build failure if configured with --disable-dependency-tracking
load_n.c:115:1: fatal error: opening dependency file .deps/load_1_.lo.Ppo: No such file or directory
https://bugs.gentoo.org/463463
http://gcc.gnu.org/PR55930
--- a/libatomic/Makefile.in
+++ b/libatomic/Makefile.in
@@ -298,7 +298,8 @@ PAT_N = $(word 2,$(PAT_SPLIT))
PAT_S = $(word 3,$(PAT_SPLIT))
IFUNC_DEF = -DIFUNC_ALT=$(PAT_S)
IFUNC_OPT = $(word $(PAT_S),$(IFUNC_OPTIONS))
-M_DEPS = -MT $@ -MD -MP -MF $(DEPDIR)/$(@F).Ppo
+@AMDEP_TRUE@M_DEPS = -MT $@ -MD -MP -MF $(DEPDIR)/$(@F).Ppo
+@AMDEP_FALSE@M_DEPS =
M_SIZE = -DN=$(PAT_N)
M_IFUNC = $(if $(PAT_S),$(IFUNC_DEF) $(IFUNC_OPT))
M_FILE = $(PAT_BASE)_n.c
-57
View File
@@ -1,57 +0,0 @@
From 9e3eab51e518018d9d99b3123598b1e2322a6af3 Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <nsz@port70.net>
Date: Sat, 24 Oct 2015 20:09:53 +0000
Subject: [PATCH 3/6] libgcc_s
---
gcc/config/i386/i386.c | 4 ++--
libgcc/config/i386/cpuinfo.c | 6 +++---
libgcc/config/i386/t-linux | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 3d044e8..82523e1 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -40269,10 +40269,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget,
{
case IX86_BUILTIN_CPU_INIT:
{
- /* Make it call __cpu_indicator_init in libgcc. */
+ /* Make it call __cpu_indicator_init_local in libgcc.a. */
tree call_expr, fndecl, type;
type = build_function_type_list (integer_type_node, NULL_TREE);
- fndecl = build_fn_decl ("__cpu_indicator_init", type);
+ fndecl = build_fn_decl ("__cpu_indicator_init_local", type);
call_expr = build_call_expr (fndecl, 0);
return expand_expr (call_expr, target, mode, EXPAND_NORMAL);
}
diff --git a/libgcc/config/i386/cpuinfo.c b/libgcc/config/i386/cpuinfo.c
index 8c2248d..6c82f15 100644
--- a/libgcc/config/i386/cpuinfo.c
+++ b/libgcc/config/i386/cpuinfo.c
@@ -485,7 +485,7 @@ __cpu_indicator_init (void)
return 0;
}
-#if defined SHARED && defined USE_ELF_SYMVER
-__asm__ (".symver __cpu_indicator_init, __cpu_indicator_init@GCC_4.8.0");
-__asm__ (".symver __cpu_model, __cpu_model@GCC_4.8.0");
+#ifndef SHARED
+int __cpu_indicator_init_local (void)
+ __attribute__ ((weak, alias ("__cpu_indicator_init")));
#endif
diff --git a/libgcc/config/i386/t-linux b/libgcc/config/i386/t-linux
index 11bb46e..4f47f7b 100644
--- a/libgcc/config/i386/t-linux
+++ b/libgcc/config/i386/t-linux
@@ -3,5 +3,5 @@
# t-slibgcc-elf-ver and t-linux
SHLIB_MAPFILES = libgcc-std.ver $(srcdir)/config/i386/libgcc-glibc.ver
-HOST_LIBGCC2_CFLAGS += -mlong-double-80 -DUSE_ELF_SYMVER $(CET_FLAGS)
+HOST_LIBGCC2_CFLAGS += -mlong-double-80 $(CET_FLAGS)
CRTSTUFF_T_CFLAGS += $(CET_FLAGS)
--
2.8.1
-75
View File
@@ -1,75 +0,0 @@
From b6015aca9c9cc83739fd0ed637a835119b2c4e34 Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <nsz@port70.net>
Date: Sat, 7 Nov 2015 02:08:05 +0000
Subject: [PATCH 5/6] nopie
---
gcc/configure | 27 +++++++++++++++++++++++++++
gcc/configure.ac | 13 +++++++++++++
2 files changed, 40 insertions(+)
diff --git a/gcc/configure b/gcc/configure
index 1c6e340..7e8b5d6 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -29390,6 +29390,33 @@ fi
$as_echo "$gcc_cv_no_pie" >&6; }
if test "$gcc_cv_no_pie" = "yes"; then
NO_PIE_FLAG="-no-pie"
+else
+ # Check if -nopie works.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -nopie option" >&5
+$as_echo_n "checking for -nopie option... " >&6; }
+if test "${gcc_cv_nopie+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ saved_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -nopie"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int main(void) {return 0;}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+ gcc_cv_nopie=yes
+else
+ gcc_cv_nopie=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS="$saved_LDFLAGS"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_nopie" >&5
+$as_echo "$gcc_cv_nopie" >&6; }
+ if test "$gcc_cv_nopie" = "yes"; then
+ NO_PIE_FLAG="-nopie"
+ fi
fi
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 6c1dcd9..0ca7647 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -6098,6 +6098,19 @@ AC_CACHE_CHECK([for -no-pie option],
LDFLAGS="$saved_LDFLAGS"])
if test "$gcc_cv_no_pie" = "yes"; then
NO_PIE_FLAG="-no-pie"
+else
+ # Check if -nopie works.
+ AC_CACHE_CHECK([for -nopie option],
+ [gcc_cv_nopie],
+ [saved_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -nopie"
+ AC_LINK_IFELSE([int main(void) {return 0;}],
+ [gcc_cv_nopie=yes],
+ [gcc_cv_nopie=no])
+ LDFLAGS="$saved_LDFLAGS"])
+ if test "$gcc_cv_nopie" = "yes"; then
+ NO_PIE_FLAG="-nopie"
+ fi
fi
AC_SUBST([NO_PIE_FLAG])
--
2.8.1
-13
View File
@@ -1,13 +0,0 @@
diff --git a/libffi/closures.c.orig b/libffi/closures.c
index 721ff00..22a699c 100644
--- a/libffi/src/closures.c.orig
+++ b/libffi/src/closures.c
@@ -34,7 +34,7 @@
#include <ffi_common.h>
#if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
-# if __gnu_linux__ && !defined(__ANDROID__)
+# if __linux__ && !defined(__ANDROID__)
/* This macro indicates it may be forbidden to map anonymous memory
with both write and execute permission. Code compiled when this
option is defined will attempt to map such pages once, but if it
File diff suppressed because it is too large. Load diff
-25
View File
@@ -1,25 +0,0 @@
--- a/libphobos/libdruntime/core/sys/posix/config.d 2019-10-29 15:54:05.000000000 +0900
+++ b/libphobos/libdruntime/core/sys/posix/config.d 2019-10-29 15:54:08.000000000 +0900
@@ -67,15 +67,21 @@ version (CRuntime_Glibc)
}
else version (CRuntime_Musl)
{
+ // off_t is always 64 bits on Musl
enum _FILE_OFFSET_BITS = 64;
+ // Not present in Musl sources
enum __REDIRECT = false;
+ // Those three are irrelevant for Musl as it always uses 64 bits off_t
enum __USE_FILE_OFFSET64 = _FILE_OFFSET_BITS == 64;
enum __USE_LARGEFILE = __USE_FILE_OFFSET64 && !__REDIRECT;
enum __USE_LARGEFILE64 = __USE_FILE_OFFSET64 && !__REDIRECT;
- enum __WORDSIZE=64;
+ version (D_LP64)
+ enum __WORDSIZE = 64;
+ else
+ enum __WORDSIZE = 32;
}
else version (CRuntime_UClibc)
{
-448
View File
@@ -1,448 +0,0 @@
diff -Nurp a/libphobos/libdruntime/core/sys/posix/fcntl.d b/libphobos/libdruntime/core/sys/posix/fcntl.d
--- a/libphobos/libdruntime/core/sys/posix/fcntl.d 2020-01-01 00:00:00.000000000 +0900
+++ b/libphobos/libdruntime/core/sys/posix/fcntl.d 2020-01-01 00:00:00.000000000 +0900
@@ -779,7 +779,102 @@ else version (CRuntime_Bionic)
}
else version (CRuntime_Musl)
{
- enum {
+ version (X86_64)
+ {
+ enum
+ {
+ O_DIRECTORY = 0x010000, // octal 0200000
+ O_NOFOLLOW = 0x020000, // octal 0400000
+ O_DIRECT = 0x004000, // octal 040000
+ O_LARGEFILE = 0,
+ O_TMPFILE = 0x410000, // octal 020200000
+
+ F_GETLK = 5,
+ F_SETLK = 6,
+ F_SETLKW = 7,
+ }
+ }
+ // Note: Definitions for i386 are in arch/generic/bits/fcntl.h
+ else version (X86)
+ {
+ enum
+ {
+ O_DIRECTORY = 0x010000, // octal 0200000
+ O_NOFOLLOW = 0x020000, // octal 0400000
+ O_DIRECT = 0x004000, // octal 040000
+ O_LARGEFILE = 0x008000, // octal 0100000
+ O_TMPFILE = 0x410000, // octal 020200000
+
+ F_GETLK = 12,
+ F_SETLK = 13,
+ F_SETLKW = 14,
+ }
+ }
+ else version (ARM)
+ {
+ enum
+ {
+ O_DIRECTORY = 0x004000, // octal 040000
+ O_NOFOLLOW = 0x008000, // octal 0100000
+ O_DIRECT = 0x010000, // octal 0200000
+ O_LARGEFILE = 0x020000, // octal 0400000
+ O_TMPFILE = 0x404000, // octal 020040000
+
+ F_GETLK = 12,
+ F_SETLK = 13,
+ F_SETLKW = 14,
+ }
+ }
+ else version (AArch64)
+ {
+ enum
+ {
+ O_DIRECTORY = 0x004000, // octal 040000
+ O_NOFOLLOW = 0x008000, // octal 0100000
+ O_DIRECT = 0x010000, // octal 0200000
+ O_LARGEFILE = 0x020000, // octal 0400000
+ O_TMPFILE = 0x404000, // octal 020040000
+
+ F_GETLK = 5,
+ F_SETLK = 6,
+ F_SETLKW = 7,
+ }
+ }
+ else version (SystemZ)
+ {
+ enum
+ {
+ O_DIRECTORY = 0x010000, // octal 0200000
+ O_NOFOLLOW = 0x020000, // octal 0400000
+ O_DIRECT = 0x004000, // octal 040000
+ O_LARGEFILE = 0x008000, // octal 0100000
+ O_TMPFILE = 0x410000, // octal 020200000
+
+ F_GETLK = 5,
+ F_SETLK = 6,
+ F_SETLKW = 7,
+ }
+ }
+ else version (PPC64)
+ {
+ enum
+ {
+ O_DIRECTORY = 0x004000, // octal 040000
+ O_NOFOLLOW = 0x008000, // octal 0100000
+ O_DIRECT = 0x020000, // octal 0400000
+ O_LARGEFILE = 0x010000, // octal 0200000
+ O_TMPFILE = 0x410000, // octal 020200000
+
+ F_GETLK = 5,
+ F_SETLK = 6,
+ F_SETLKW = 7,
+ }
+ }
+ else
+ static assert(0, "Platform not supported");
+
+ enum
+ {
O_CREAT = 0x40, // octal 0100
O_EXCL = 0x80, // octal 0200
O_NOCTTY = 0x100, // octal 0400
@@ -790,16 +885,11 @@ else version (CRuntime_Musl)
O_DSYNC = 0x1000, // octal 010000
O_SYNC = 0x101000, // octal 04010000
O_RSYNC = O_SYNC,
- O_DIRECTORY = 0x10000,
- O_NOFOLLOW = 0x20000,
O_CLOEXEC = 0x80000,
O_ASYNC = 0x2000,
- O_DIRECT = 0x4000,
- O_LARGEFILE = 0,
O_NOATIME = 0x40000,
O_PATH = 0x200000,
- O_TMPFILE = 0x410000,
O_NDELAY = O_NONBLOCK,
O_SEARCH = O_PATH,
O_EXEC = O_PATH,
@@ -809,19 +899,19 @@ else version (CRuntime_Musl)
O_WRONLY = 01,
O_RDWR = 02,
}
- enum {
+ enum
+ {
F_DUPFD = 0,
F_GETFD = 1,
F_SETFD = 2,
F_GETFL = 3,
F_SETFL = 4,
- F_GETLK = 5,
- F_SETLK = 6,
- F_SETLKW = 7,
+ // F_GETLK, F_SETLK, F_SETLKW are arch-specific
F_SETOWN = 8,
F_GETOWN = 9,
}
- enum {
+ enum
+ {
F_RDLCK = 0,
F_WRLCK = 1,
F_UNLCK = 2,
diff -Nurp a/libphobos/libdruntime/core/sys/posix/semaphore.d b/libphobos/libdruntime/core/sys/posix/semaphore.d
--- a/libphobos/libdruntime/core/sys/posix/semaphore.d 2020-01-01 00:00:00.000000000 +0900
+++ b/libphobos/libdruntime/core/sys/posix/semaphore.d 2020-01-01 00:00:00.000000000 +0900
@@ -143,8 +143,10 @@ else version (CRuntime_Bionic)
else version (CRuntime_Musl)
{
struct sem_t {
- int[4*long.sizeof/int.sizeof] __val;
+ int[4*c_long.sizeof/int.sizeof] __val;
}
+
+ enum SEM_FAILED = (sem_t*).init;
}
else version (CRuntime_UClibc)
{
diff -Nurp a/libphobos/libdruntime/core/sys/posix/sys/stat.d b/libphobos/libdruntime/core/sys/posix/sys/stat.d
--- a/libphobos/libdruntime/core/sys/posix/sys/stat.d 2020-01-01 00:00:00.000000000 +0900
+++ b/libphobos/libdruntime/core/sys/posix/sys/stat.d 2020-01-01 00:00:00.000000000 +0900
@@ -1587,31 +1587,225 @@ else version (CRuntime_Musl)
S_ISGID = 0x400, // octal 02000
S_ISVTX = 0x200, // octal 01000
}
- struct stat_t {
- dev_t st_dev;
- ino_t st_ino;
- nlink_t st_nlink;
-
- mode_t st_mode;
- uid_t st_uid;
- gid_t st_gid;
- uint __pad0;
- dev_t st_rdev;
- off_t st_size;
- blksize_t st_blksize;
- blkcnt_t st_blocks;
-
- timespec st_atim;
- timespec st_mtim;
- timespec st_ctim;
- extern(D) @safe @property inout pure nothrow
- {
- ref inout(time_t) st_atime() return { return st_atim.tv_sec; }
- ref inout(time_t) st_mtime() return { return st_mtim.tv_sec; }
- ref inout(time_t) st_ctime() return { return st_ctim.tv_sec; }
+ version (ARM)
+ {
+ struct stat_t
+ {
+ dev_t st_dev;
+ int __st_dev_padding;
+ c_long __st_ino_truncated;
+ mode_t st_mode;
+ nlink_t st_nlink;
+
+ uid_t st_uid;
+ gid_t st_gid;
+ dev_t st_rdev;
+ int __st_rdev_padding;
+ off_t st_size;
+ blksize_t st_blksize;
+ blkcnt_t st_blocks;
+
+ timespec st_atim;
+ timespec st_mtim;
+ timespec st_ctim;
+ ino_t st_ino;
+
+ extern(D) @safe @property inout pure nothrow
+ {
+ ref inout(time_t) st_atime() return { return st_atim.tv_sec; }
+ ref inout(time_t) st_mtime() return { return st_mtim.tv_sec; }
+ ref inout(time_t) st_ctime() return { return st_ctim.tv_sec; }
+ }
+ }
+ }
+ else version (AArch64)
+ {
+ struct stat_t
+ {
+ dev_t st_dev;
+ ino_t st_ino;
+ mode_t st_mode;
+ nlink_t st_nlink;
+
+ uid_t st_uid;
+ gid_t st_gid;
+ dev_t st_rdev;
+ c_ulong __pad;
+ off_t st_size;
+ blksize_t st_blksize;
+ int __pad2;
+ blkcnt_t st_blocks;
+
+ timespec st_atim;
+ timespec st_mtim;
+ timespec st_ctim;
+ uint[2] __unused;
+
+ extern(D) @safe @property inout pure nothrow
+ {
+ ref inout(time_t) st_atime() return { return st_atim.tv_sec; }
+ ref inout(time_t) st_mtime() return { return st_mtim.tv_sec; }
+ ref inout(time_t) st_ctime() return { return st_ctim.tv_sec; }
+ }
+ }
+ }
+ else version (X86_64)
+ {
+ struct stat_t
+ {
+ dev_t st_dev;
+ ino_t st_ino;
+ nlink_t st_nlink;
+
+ mode_t st_mode;
+ uid_t st_uid;
+ gid_t st_gid;
+ uint __pad0;
+ dev_t st_rdev;
+ off_t st_size;
+ blksize_t st_blksize;
+ blkcnt_t st_blocks;
+
+ timespec st_atim;
+ timespec st_mtim;
+ timespec st_ctim;
+
+ c_long[3] __unused;
+
+ extern(D) @safe @property inout pure nothrow
+ {
+ ref inout(time_t) st_atime() return { return st_atim.tv_sec; }
+ ref inout(time_t) st_mtime() return { return st_mtim.tv_sec; }
+ ref inout(time_t) st_ctime() return { return st_ctim.tv_sec; }
+ }
+ }
+ }
+ else version (X86)
+ {
+ struct stat_t
+ {
+ dev_t st_dev;
+ int __st_dev_padding;
+ c_long __st_ino_truncated;
+ mode_t st_mode;
+ nlink_t st_nlink;
+
+ uid_t st_uid;
+ gid_t st_gid;
+ dev_t st_rdev;
+ int __st_rdev_padding;
+ off_t st_size;
+ blksize_t st_blksize;
+ blkcnt_t st_blocks;
+
+ timespec st_atim;
+ timespec st_mtim;
+ timespec st_ctim;
+ ino_t st_ino;
+
+ extern(D) @safe @property inout pure nothrow
+ {
+ ref inout(time_t) st_atime() return { return st_atim.tv_sec; }
+ ref inout(time_t) st_mtime() return { return st_mtim.tv_sec; }
+ ref inout(time_t) st_ctime() return { return st_ctim.tv_sec; }
+ }
}
- long[3] __unused;
}
+ else version (MIPS64)
+ {
+ struct stat_t
+ {
+ dev_t st_dev;
+ int[3] __pad1;
+ ino_t st_ino;
+ mode_t st_mode;
+ nlink_t st_nlink;
+
+ uid_t st_uid;
+ gid_t st_gid;
+ dev_t st_rdev;
+ uint[2] __pad2;
+ off_t st_size;
+ int __pad3;
+
+ timespec st_atim;
+ timespec st_mtim;
+ timespec st_ctim;
+ blksize_t st_blksize;
+ uint __pad4;
+ blkcnt_t st_blocks;
+ int[14] __pad5;
+
+ extern(D) @safe @property inout pure nothrow
+ {
+ ref inout(time_t) st_atime() return { return st_atim.tv_sec; }
+ ref inout(time_t) st_mtime() return { return st_mtim.tv_sec; }
+ ref inout(time_t) st_ctime() return { return st_ctim.tv_sec; }
+ }
+ }
+ }
+ else version (PPC64)
+ {
+ struct stat_t
+ {
+ dev_t st_dev;
+ ino_t st_ino;
+ nlink_t st_nlink;
+ mode_t st_mode;
+
+ uid_t st_uid;
+ gid_t st_gid;
+ dev_t st_rdev;
+ off_t st_size;
+ blksize_t st_blksize;
+ blkcnt_t st_blocks;
+
+ timespec st_atim;
+ timespec st_mtim;
+ timespec st_ctim;
+ c_ulong[3] __unused;
+
+ extern(D) @safe @property inout pure nothrow
+ {
+ ref inout(time_t) st_atime() return { return st_atim.tv_sec; }
+ ref inout(time_t) st_mtime() return { return st_mtim.tv_sec; }
+ ref inout(time_t) st_ctime() return { return st_ctim.tv_sec; }
+ }
+ }
+ }
+ else version (SystemZ)
+ {
+ struct stat_t
+ {
+ dev_t st_dev;
+ ino_t st_ino;
+ nlink_t st_nlink;
+ mode_t st_mode;
+
+ uid_t st_uid;
+ gid_t st_gid;
+ dev_t st_rdev;
+ off_t st_size;
+
+ timespec st_atim;
+ timespec st_mtim;
+ timespec st_ctim;
+
+ blksize_t st_blksize;
+ blkcnt_t st_blocks;
+ c_ulong[3] __unused;
+
+ extern(D) @safe @property inout pure nothrow
+ {
+ ref inout(time_t) st_atime() return { return st_atim.tv_sec; }
+ ref inout(time_t) st_mtime() return { return st_mtim.tv_sec; }
+ ref inout(time_t) st_ctime() return { return st_ctim.tv_sec; }
+ }
+ }
+ }
+ else
+ static assert("Unsupported platform");
+
private
{
extern (D) bool S_ISTYPE( mode_t mode, uint mask )
diff -Nurp a/libphobos/libdruntime/core/sys/posix/sys/types.d b/libphobos/libdruntime/core/sys/posix/sys/types.d
--- a/libphobos/libdruntime/core/sys/posix/sys/types.d 2020-01-08 00:00:00.000000000 +0900
+++ b/libphobos/libdruntime/core/sys/posix/sys/types.d 2020-01-08 00:00:00.000000000 +0900
@@ -112,8 +112,26 @@ version (CRuntime_Glibc)
}
else version (CRuntime_Musl)
{
- alias c_long blksize_t;
- alias c_ulong nlink_t;
+ version (AArch64)
+ {
+ alias int blksize_t;
+ alias uint nlink_t;
+ }
+ else version (MIPS64)
+ {
+ alias c_long blksize_t;
+ alias uint nlink_t;
+ }
+ else version (RISCV64)
+ {
+ alias int blksize_t;
+ alias uint nlink_t;
+ }
+ else
+ {
+ alias c_long blksize_t;
+ alias c_ulong nlink_t;
+ }
alias long dev_t;
alias long blkcnt_t;
alias ulong ino_t;
-137
View File
@@ -1,137 +0,0 @@
diff -Nurp a/libphobos/libdruntime/gcc/sections/elf_shared.d b/libphobos/libdruntime/gcc/sections/elf_shared.d
--- a/libphobos/libdruntime/gcc/sections/elf_shared.d 2020-01-01 00:00:00.000000000 +0900
+++ b/libphobos/libdruntime/gcc/sections/elf_shared.d 2020-01-01 00:00:00.000000000 +0900
@@ -1084,7 +1084,9 @@ void[] getTLSRange(size_t mod, size_t sz) nothrow @nogc
// base offset
auto ti = tls_index(mod, 0);
- version (IBMZ_Any)
+ version (CRuntime_Musl)
+ return (__tls_get_addr(&ti)-TLS_DTV_OFFSET)[0 .. sz];
+ else version (IBMZ_Any)
{
auto idx = cast(void *)__tls_get_addr_internal(&ti)
+ cast(ulong)__builtin_thread_pointer();
diff -Nurp a/libphobos/configure.ac b/libphobos/configure.ac
--- a/libphobos/configure.ac 2020-01-01 00:00:00.000000000 +0900
+++ b/libphobos/configure.ac 2020-01-01 00:00:00.000000000 +0900
@@ -140,6 +140,14 @@ case ${host} in
esac
AC_MSG_RESULT($LIBPHOBOS_SUPPORTED)
+AC_MSG_CHECKING([if target needs to link in swapcontext])
+AC_MSG_RESULT($LIBDRUNTIME_NEEDS_UCONTEXT)
+AS_IF([test "x$LIBDRUNTIME_NEEDS_UCONTEXT" = xyes], [
+ AC_SEARCH_LIBS([swapcontext], [c ucontext], [], [
+ AC_MSG_ERROR([[can't find library providing swapcontext]])
+ ])
+])
+
# Decide if it's usable.
case $LIBPHOBOS_SUPPORTED:$enable_libphobos in
*:no) use_libphobos=no ;;
diff -Nurp a/libphobos/configure.tgt b/libphobos/configure.tgt
--- a/libphobos/configure.tgt 2020-01-01 00:00:00.000000000 +0900
+++ b/libphobos/configure.tgt 2020-01-01 00:00:00.000000000 +0900
@@ -22,6 +22,13 @@
# Disable the libphobos or libdruntime components on untested or known
# broken systems. More targets shall be added after testing.
LIBPHOBOS_SUPPORTED=no
+
+# Check if we require 'ucontext' or if we have a custom solution.
+# Most platform uses a custom assembly solution for context switches,
+# see `core.thread` and grep for `AsmExternal`.
+# Definitions are in config/ARCH/
+LIBPHOBOS_NEEDS_UCONTEXT=no
+
case "${target}" in
aarch64*-*-linux*)
LIBPHOBOS_SUPPORTED=yes
@@ -37,6 +44,7 @@ case "${target}" in
;;
s390*-linux*)
LIBPHOBOS_SUPPORTED=yes
+ LIBDRUNTIME_NEEDS_UCONTEXT=yes
;;
x86_64-*-kfreebsd*-gnu | i?86-*-kfreebsd*-gnu)
LIBPHOBOS_SUPPORTED=yes
diff -Nurp a/libphobos/configure b/libphobos/configure
--- a/libphobos/configure 2020-01-01 00:00:00.000000000 +0900
+++ b/libphobos/configure 2020-01-01 00:00:00.000000000 +0900
@@ -13955,6 +13955,76 @@ esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBPHOBOS_SUPPORTED" >&5
$as_echo "$LIBPHOBOS_SUPPORTED" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if target needs to link in swapcontext" >&5
+$as_echo_n "checking if target needs to link in swapcontext... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBDRUNTIME_NEEDS_UCONTEXT" >&5
+$as_echo "$LIBDRUNTIME_NEEDS_UCONTEXT" >&6; }
+if test "x$LIBDRUNTIME_NEEDS_UCONTEXT" = xyes; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing swapcontext" >&5
+$as_echo_n "checking for library containing swapcontext... " >&6; }
+if ${ac_cv_search_swapcontext+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char swapcontext ();
+int
+main ()
+{
+return swapcontext ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' c ucontext; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_swapcontext=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_swapcontext+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_swapcontext+:} false; then :
+
+else
+ ac_cv_search_swapcontext=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_swapcontext" >&5
+$as_echo "$ac_cv_search_swapcontext" >&6; }
+ac_res=$ac_cv_search_swapcontext
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+else
+
+ as_fn_error $? "can't find library providing swapcontext" "$LINENO" 5
+
+fi
+
+
+fi
+
+
# Decide if it's usable.
case $LIBPHOBOS_SUPPORTED:$enable_libphobos in
*:no) use_libphobos=no ;;
-411
View File
@@ -1,411 +0,0 @@
diff -Nurp a/libphobos/src/std/zlib.d b/libphobos/src/std/zlib.d
--- a/libphobos/src/std/zlib.d 2020-01-01 00:00:00.000000000 +0900
+++ b/libphobos/src/std/zlib.d 2020-01-01 00:00:00.000000000 +0900
@@ -1,7 +1,7 @@
// Written in the D programming language.
/**
- * Compress/decompress data using the $(HTTP www._zlib.net, _zlib library).
+ * Compress/decompress data using the $(HTTP www.zlib.net, zlib library).
*
* Examples:
*
@@ -43,12 +43,12 @@
* References:
* $(HTTP en.wikipedia.org/wiki/Zlib, Wikipedia)
*
- * Copyright: Copyright Digital Mars 2000 - 2011.
+ * Copyright: Copyright The D Language Foundation 2000 - 2011.
* License: $(HTTP www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
* Authors: $(HTTP digitalmars.com, Walter Bright)
- * Source: $(PHOBOSSRC std/_zlib.d)
+ * Source: $(PHOBOSSRC std/zlib.d)
*/
-/* Copyright Digital Mars 2000 - 2011.
+/* Copyright The D Language Foundation 2000 - 2011.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
@@ -75,9 +75,9 @@ enum
class ZlibException : Exception
{
- this(int errnum)
- { string msg;
-
+ private static string getmsg(int errnum) nothrow @nogc pure @safe
+ {
+ string msg;
switch (errnum)
{
case Z_STREAM_END: msg = "stream end"; break;
@@ -90,7 +90,12 @@ class ZlibException : Exception
case Z_VERSION_ERROR: msg = "version error"; break;
default: msg = "unknown error"; break;
}
- super(msg);
+ return msg;
+ }
+
+ this(int errnum)
+ {
+ super(getmsg(errnum));
}
}
@@ -104,7 +109,7 @@ class ZlibException : Exception
* buf = buffer containing input data
*
* Returns:
- * A $(D uint) checksum for the provided input data and starting checksum
+ * A `uint` checksum for the provided input data and starting checksum
*
* See_Also:
* $(LINK http://en.wikipedia.org/wiki/Adler-32)
@@ -147,7 +152,7 @@ uint adler32(uint adler, const(void)[] b
* buf = buffer containing input data
*
* Returns:
- * A $(D uint) checksum for the provided input data and starting checksum
+ * A `uint` checksum for the provided input data and starting checksum
*
* See_Also:
* $(LINK http://en.wikipedia.org/wiki/Cyclic_redundancy_check)
@@ -191,13 +196,14 @@ uint crc32(uint crc, const(void)[] buf)
ubyte[] compress(const(void)[] srcbuf, int level)
in
{
- assert(-1 <= level && level <= 9);
+ assert(-1 <= level && level <= 9, "Compression level needs to be within [-1, 9].");
}
-body
+do
{
import core.memory : GC;
+ import std.array : uninitializedArray;
auto destlen = srcbuf.length + ((srcbuf.length + 1023) / 1024) + 12;
- auto destbuf = new ubyte[destlen];
+ auto destbuf = uninitializedArray!(ubyte[])(destlen);
auto err = etc.c.zlib.compress2(destbuf.ptr, &destlen, cast(ubyte *) srcbuf.ptr, srcbuf.length, level);
if (err)
{
@@ -276,7 +282,7 @@ void[] uncompress(const(void)[] srcbuf,
throw new ZlibException(err);
}
}
- assert(0);
+ assert(0, "Unreachable code");
}
@system unittest
@@ -370,9 +376,9 @@ class Compress
this(int level, HeaderFormat header = HeaderFormat.deflate)
in
{
- assert(1 <= level && level <= 9);
+ assert(1 <= level && level <= 9, "Legal compression level are in [1, 9].");
}
- body
+ do
{
this.level = level;
this.gzip = header == HeaderFormat.gzip;
@@ -406,6 +412,7 @@ class Compress
const(void)[] compress(const(void)[] buf)
{
import core.memory : GC;
+ import std.array : uninitializedArray;
int err;
ubyte[] destbuf;
@@ -420,7 +427,7 @@ class Compress
inited = 1;
}
- destbuf = new ubyte[zs.avail_in + buf.length];
+ destbuf = uninitializedArray!(ubyte[])(zs.avail_in + buf.length);
zs.next_out = destbuf.ptr;
zs.avail_out = to!uint(destbuf.length);
@@ -461,9 +468,10 @@ class Compress
void[] flush(int mode = Z_FINISH)
in
{
- assert(mode == Z_FINISH || mode == Z_SYNC_FLUSH || mode == Z_FULL_FLUSH);
+ assert(mode == Z_FINISH || mode == Z_SYNC_FLUSH || mode == Z_FULL_FLUSH,
+ "Mode must be either Z_FINISH, Z_SYNC_FLUSH or Z_FULL_FLUSH.");
}
- body
+ do
{
import core.memory : GC;
ubyte[] destbuf;
@@ -523,6 +531,7 @@ class UnCompress
z_stream zs;
int inited;
int done;
+ bool inputEnded;
size_t destbufsize;
HeaderFormat format;
@@ -571,16 +580,16 @@ class UnCompress
const(void)[] uncompress(const(void)[] buf)
in
{
- assert(!done);
+ assert(!done, "Buffer has been flushed.");
}
- body
+ do
{
+ if (inputEnded || !buf.length)
+ return null;
+
import core.memory : GC;
+ import std.array : uninitializedArray;
int err;
- ubyte[] destbuf;
-
- if (buf.length == 0)
- return null;
if (!inited)
{
@@ -598,26 +607,152 @@ class UnCompress
if (!destbufsize)
destbufsize = to!uint(buf.length) * 2;
- destbuf = new ubyte[zs.avail_in * 2 + destbufsize];
- zs.next_out = destbuf.ptr;
- zs.avail_out = to!uint(destbuf.length);
-
- if (zs.avail_in)
- buf = zs.next_in[0 .. zs.avail_in] ~ cast(ubyte[]) buf;
+ auto destbuf = uninitializedArray!(ubyte[])(destbufsize);
+ size_t destFill;
zs.next_in = cast(ubyte*) buf.ptr;
zs.avail_in = to!uint(buf.length);
- err = inflate(&zs, Z_NO_FLUSH);
- if (err != Z_STREAM_END && err != Z_OK)
+ while (true)
{
- GC.free(destbuf.ptr);
- error(err);
+ auto oldAvailIn = zs.avail_in;
+
+ zs.next_out = destbuf[destFill .. $].ptr;
+ zs.avail_out = to!uint(destbuf.length - destFill);
+
+ err = inflate(&zs, Z_NO_FLUSH);
+ if (err == Z_STREAM_END)
+ {
+ inputEnded = true;
+ break;
+ }
+ else if (err != Z_OK)
+ {
+ GC.free(destbuf.ptr);
+ error(err);
+ }
+ else if (!zs.avail_in)
+ break;
+
+ /*
+ According to the zlib manual inflate() stops when either there's
+ no more data to uncompress or the output buffer is full
+ So at this point, the output buffer is too full
+ */
+
+ destFill = destbuf.length;
+
+ if (destbuf.capacity)
+ {
+ if (destbuf.length < destbuf.capacity)
+ destbuf.length = destbuf.capacity;
+ else
+ {
+ auto newLength = GC.extend(destbuf.ptr, destbufsize, destbufsize);
+
+ if (newLength && destbuf.length < destbuf.capacity)
+ destbuf.length = destbuf.capacity;
+ else
+ destbuf.length += destbufsize;
+ }
+ }
+ else
+ destbuf.length += destbufsize;
}
+
destbuf.length = destbuf.length - zs.avail_out;
return destbuf;
}
+ // Test for issues 3191 and 9505
+ @system unittest
+ {
+ import std.algorithm.comparison;
+ import std.array;
+ import std.file;
+ import std.zlib;
+
+ // Data that can be easily compressed
+ ubyte[1024] originalData;
+
+ // This should yield a compression ratio of at least 1/2
+ auto compressedData = compress(originalData, 9);
+ assert(compressedData.length < originalData.length / 2,
+ "The compression ratio is too low to accurately test this situation");
+
+ auto chunkSize = compressedData.length / 4;
+ assert(chunkSize < compressedData.length,
+ "The length of the compressed data is too small to accurately test this situation");
+
+ auto decompressor = new UnCompress();
+ ubyte[originalData.length] uncompressedData;
+ ubyte[] reusedBuf;
+ int progress;
+
+ reusedBuf.length = chunkSize;
+
+ for (int i = 0; i < compressedData.length; i += chunkSize)
+ {
+ auto len = min(chunkSize, compressedData.length - i);
+ // simulate reading from a stream in small chunks
+ reusedBuf[0 .. len] = compressedData[i .. i + len];
+
+ // decompress using same input buffer
+ auto chunk = decompressor.uncompress(reusedBuf);
+ assert(progress + chunk.length <= originalData.length,
+ "The uncompressed result is bigger than the original data");
+
+ uncompressedData[progress .. progress + chunk.length] = cast(const ubyte[]) chunk[];
+ progress += chunk.length;
+ }
+
+ auto chunk = decompressor.flush();
+ assert(progress + chunk.length <= originalData.length,
+ "The uncompressed result is bigger than the original data");
+
+ uncompressedData[progress .. progress + chunk.length] = cast(const ubyte[]) chunk[];
+ progress += chunk.length;
+
+ assert(progress == originalData.length,
+ "The uncompressed and the original data sizes differ");
+ assert(originalData[] == uncompressedData[],
+ "The uncompressed and the original data differ");
+ }
+
+ @system unittest
+ {
+ ubyte[1024] invalidData;
+ auto decompressor = new UnCompress();
+
+ try
+ {
+ auto uncompressedData = decompressor.uncompress(invalidData);
+ }
+ catch (ZlibException e)
+ {
+ assert(e.msg == "data error");
+ return;
+ }
+
+ assert(false, "Corrupted data didn't result in an error");
+ }
+
+ @system unittest
+ {
+ ubyte[2014] originalData = void;
+ auto compressedData = compress(originalData, 9);
+
+ auto decompressor = new UnCompress();
+ auto uncompressedData = decompressor.uncompress(compressedData ~ cast(ubyte[]) "whatever");
+
+ assert(originalData.length == uncompressedData.length,
+ "The uncompressed and the original data sizes differ");
+ assert(originalData[] == uncompressedData[],
+ "The uncompressed and the original data differ");
+ assert(!decompressor.uncompress("whatever").length,
+ "Compression continued after the end");
+ }
+
/**
* Decompress and return any remaining data.
* The returned data should be appended to that returned by uncompress().
@@ -626,48 +761,39 @@ class UnCompress
void[] flush()
in
{
- assert(!done);
+ assert(!done, "Buffer has been flushed before.");
}
out
{
- assert(done);
+ assert(done, "Flushing failed.");
}
- body
+ do
{
- import core.memory : GC;
- ubyte[] extra;
- ubyte[] destbuf;
- int err;
-
done = 1;
- if (!inited)
- return null;
+ return null;
+ }
- L1:
- destbuf = new ubyte[zs.avail_in * 2 + 100];
- zs.next_out = destbuf.ptr;
- zs.avail_out = to!uint(destbuf.length);
+ /// Returns true if all input data has been decompressed and no further data
+ /// can be decompressed (inflate() returned Z_STREAM_END)
+ @property bool empty() const
+ {
+ return inputEnded;
+ }
- err = etc.c.zlib.inflate(&zs, Z_NO_FLUSH);
- if (err == Z_OK && zs.avail_out == 0)
- {
- extra ~= destbuf;
- goto L1;
- }
- if (err != Z_STREAM_END)
- {
- GC.free(destbuf.ptr);
- if (err == Z_OK)
- err = Z_BUF_ERROR;
- error(err);
- }
- destbuf = destbuf.ptr[0 .. zs.next_out - destbuf.ptr];
- err = etc.c.zlib.inflateEnd(&zs);
- inited = 0;
- if (err)
- error(err);
- if (extra.length)
- destbuf = extra ~ destbuf;
- return destbuf;
+ ///
+ @system unittest
+ {
+ // some random data
+ ubyte[1024] originalData = void;
+
+ // append garbage data (or don't, this works in both cases)
+ auto compressedData = cast(ubyte[]) compress(originalData) ~ cast(ubyte[]) "whatever";
+
+ auto decompressor = new UnCompress();
+ auto uncompressedData = decompressor.uncompress(compressedData);
+
+ assert(uncompressedData[] == originalData[],
+ "The uncompressed and the original data differ");
+ assert(decompressor.empty, "The UnCompressor reports not being done");
}
}
-34
View File
@@ -1,34 +0,0 @@
--- gcc-9.3.0.orig/libphobos/libdruntime/core/sys/posix/fcntl.d
+++ gcc-9.3.0/libphobos/libdruntime/core/sys/posix/fcntl.d
@@ -870,6 +870,21 @@
F_SETLKW = 7,
}
}
+ else version (MIPS_Any)
+ {
+ enum
+ {
+ O_DIRECTORY = 0x010000, // octal 0200000
+ O_NOFOLLOW = 0x020000, // octal 0400000
+ O_DIRECT = 0x008000, // octal 0100000
+ O_LARGEFILE = 0x002000, // octal 0020000
+ O_TMPFILE = 0x410000, // octal 020200000
+
+ F_GETLK = 33,
+ F_SETLK = 34,
+ F_SETLKW = 35,
+ }
+ }
else
static assert(0, "Platform not supported");
--- gcc-9.3.0.orig/libphobos/configure.tgt
+++ gcc-9.3.0/libphobos/configure.tgt
@@ -38,6 +38,7 @@
;;
mips*-*-linux*)
LIBPHOBOS_SUPPORTED=yes
+ LIBDRUNTIME_NEEDS_UCONTEXT=yes
;;
riscv*-*-linux*)
LIBPHOBOS_SUPPORTED=yes
-663
View File
@@ -1,663 +0,0 @@
# Automatically generated aport, do not edit!
# Generator: pmbootstrap aportgen gcc-armhf
# Based on: main/gcc (from Alpine)
CTARGET_ARCH=armhf
CTARGET="$(arch_to_hostspec ${CTARGET_ARCH})"
LANG_D=false
LANG_OBJC=false
LANG_JAVA=false
LANG_GO=false
LANG_FORTRAN=false
LANG_ADA=false
options="!strip !tracedeps"
# abuild doesn't try to tries to install "build-base-$CTARGET_ARCH"
# when this variable matches "no*"
BOOTSTRAP="nobuildbase"
# abuild will only cross compile when this variable is set, but it
# needs to find a valid package database in there for dependency
# resolving, so we set it to /.
CBUILDROOT="/"
_cross_configure="--disable-bootstrap --with-sysroot=/usr/$CTARGET"
pkgname="gcc-armhf"
pkgver=9.3.0
[ "$BOOTSTRAP" = "nolibc" ] && pkgname="gcc-pass2"
[ "$CBUILD" != "$CHOST" ] && _cross="-$CARCH" || _cross=""
[ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target=""
pkgname="gcc-armhf"
pkgrel=1
pkgdesc="Stage2 cross-compiler for armhf"
url="https://gcc.gnu.org"
arch="x86_64"
license="GPL-2.0-or-later LGPL-2.1-or-later"
_gccrel=$pkgver-r$pkgrel
depends="isl binutils-armhf mpc1"
makedepends_build="gcc g++ paxmark bison flex texinfo gawk zip gmp-dev mpfr-dev mpc1-dev zlib-dev"
makedepends_host="linux-headers gmp-dev mpfr-dev mpc1-dev isl-dev zlib-dev musl-dev-armhf binutils-armhf"
subpackages="g++-armhf:gpp"
[ "$CHOST" = "$CTARGET" ] && subpackages="gcc-doc$_target"
replaces="libstdc++ binutils"
: "${LANG_CXX:=true}"
: "${LANG_D:=true}"
: "${LANG_OBJC:=true}"
: "${LANG_GO:=true}"
: "${LANG_FORTRAN:=true}"
: "${LANG_ADA:=true}"
_libgomp=true
_libgcc=true
_libatomic=true
_libitm=true
if [ "$CHOST" != "$CTARGET" ]; then
if [ "$BOOTSTRAP" = nolibc ]; then
LANG_CXX=false
LANG_ADA=false
_libgcc=false
_builddir="$srcdir/build-cross-pass2"
else
_builddir="$srcdir/build-cross-final"
fi
LANG_OBJC=false
LANG_GO=false
LANG_FORTRAN=false
LANG_D=false
_libgomp=false
_libatomic=false
_libitm=false
# reset target flags (should be set in crosscreate abuild)
# fixup flags. seems gcc treats CPPFLAGS as global without
# _FOR_xxx variants. wrap it in CFLAGS and CXXFLAGS.
export CFLAGS="$CPPFLAGS $CFLAGS"
export CXXFLAGS="$CPPFLAGS $CXXFLAGS"
unset CPPFLAGS
export CFLAGS_FOR_TARGET=" "
export CXXFLAGS_FOR_TARGET=" "
export LDFLAGS_FOR_TARGET=" "
STRIP_FOR_TARGET="$CTARGET-strip"
elif [ "$CBUILD" != "$CHOST" ]; then
# fixup flags. seems gcc treats CPPFLAGS as global without
# _FOR_xxx variants. wrap it in CFLAGS and CXXFLAGS.
export CFLAGS="$CPPFLAGS $CFLAGS"
export CXXFLAGS="$CPPFLAGS $CXXFLAGS"
unset CPPFLAGS
# reset flags and cc for build
export CC_FOR_BUILD="gcc"
export CXX_FOR_BUILD="g++"
export CFLAGS_FOR_BUILD=" "
export CXXFLAGS_FOR_BUILD=" "
export LDFLAGS_FOR_BUILD=" "
export CFLAGS_FOR_TARGET=" "
export CXXFLAGS_FOR_TARGET=" "
export LDFLAGS_FOR_TARGET=" "
# Languages that do not need bootstrapping
LANG_OBJC=false
LANG_GO=false
LANG_FORTRAN=false
LANG_D=false
STRIP_FOR_TARGET=${CROSS_COMPILE}strip
_builddir="$srcdir/build-cross-native"
else
STRIP_FOR_TARGET=${CROSS_COMPILE}strip
_builddir="$srcdir/build"
fi
# GDC hasn't been ported to PowerPC
# See libphobos/configure.tgt in GCC sources for supported targets
[ "$CARCH" = ppc64le ] && LANG_D=false
# Go needs {set,make,swap}context, unimplemented in musl
[ "$CTARGET_LIBC" = musl ] && LANG_GO=false
# libitm has TEXTRELs in ARM build, so disable for now
case "$CTARGET_ARCH" in
arm*) _libitm=false ;;
mips*) _libitm=false ;;
esac
# Fortran uses libquadmath if toolchain has __float128
# currently on x86, x86_64 and ia64
_libquadmath=$LANG_FORTRAN
case "$CTARGET_ARCH" in
x86 | x86_64) _libquadmath=$LANG_FORTRAN ;;
*) _libquadmath=false ;;
esac
# libatomic is a dependency for openvswitch
$_libatomic && subpackages="$subpackages libatomic::$CTARGET_ARCH"
$_libgcc && subpackages="$subpackages libgcc::$CTARGET_ARCH"
$_libquadmath && subpackages="$subpackages libquadmath::$CTARGET_ARCH"
if $_libgomp; then
depends="$depends libgomp=$_gccrel"
subpackages="$subpackages libgomp::$CTARGET_ARCH"
fi
_languages=c
if $LANG_CXX; then
_languages="$_languages,c++"
fi
if $LANG_D; then
subpackages="$subpackages libgphobos::$CTARGET_ARCH gcc-gdc$_target:gdc"
_languages="$_languages,d"
makedepends_build="$makedepends_build libucontext-dev"
fi
if $LANG_OBJC; then
subpackages="$subpackages libobjc::$CTARGET_ARCH gcc-objc$_target:objc"
_languages="$_languages,objc"
fi
if $LANG_GO; then
subpackages="$subpackages libgo::$CTARGET_ARCH gcc-go$_target:go"
_languages="$_languages,go"
fi
if $LANG_FORTRAN; then
subpackages="$subpackages libgfortran::$CTARGET_ARCH gfortran$_target:gfortran"
_languages="$_languages,fortran"
fi
if $LANG_ADA; then
subpackages="$subpackages libgnat::$CTARGET_ARCH gcc-gnat$_target:gnat"
_languages="$_languages,ada"
makedepends_build="$makedepends_build gcc-gnat gcc-gnat$_cross"
fi
makedepends="$makedepends_build $makedepends_host"
source="https://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$pkgver}/gcc-${_pkgbase:-$pkgver}.tar.xz
002_all_default-relro.patch
003_all_default-fortify-source.patch
005_all_default-as-needed.patch
gcc-as-needed-gold.patch
011_all_default-warn-format-security.patch
012_all_default-warn-trampolines.patch
013_all_default-ssp-fix.patch
020_all_msgfmt-libstdc++-link.patch
050_all_libiberty-asprintf.patch
051_all_libiberty-pic.patch
053_all_libitm-no-fortify-source.patch
090_all_pr55930-dependency-tracking.patch
0003-gcc-poison-system-directories.patch
203-libgcc_s.patch
205-nopie.patch
0002-posix_memalign.patch
0008-s390x-muslldso.patch
0010-ldbl128-config.patch
0012-static-pie.patch
libgcc-always-build-gcceh.a.patch
gcc-4.9-musl-fortify.patch
gcc-6.1-musl-libssp.patch
gcc-pure64.patch
fix-cxxflags-passing.patch
ada-shared.patch
ada-musl.patch
libgnarl-musl.patch
320-libffi-gnulinux.patch
gcc-pure64-mips.patch
0016-invalid_tls_model.patch
400-dlang-phobos.patch
401-dlang-32bits.patch
402-dlang-stat.patch
403-dlang-ibmz.patch
404-dlang-zlib.patch
405-dlang-mips.patch
"
# gcc-4.8-build-args.patch
# we build out-of-tree
_gccdir="$srcdir"/gcc-${_pkgbase:-$pkgver}
_gcclibdir="/usr/lib/gcc/$CTARGET/$pkgver"
_gcclibexec="/usr/libexec/gcc/$CTARGET/$pkgver"
prepare() {
cd "$_gccdir"
_err=
for i in $source; do
case "$i" in
*.patch)
msg "Applying $i"
patch -p1 -i "$srcdir"/$i || _err="$_err $i"
;;
esac
done
if [ -n "$_err" ]; then
error "The following patches failed:"
for i in $_err; do
echo " $i"
done
return 1
fi
echo ${pkgver} > gcc/BASE-VER
}
build() {
local _arch_configure=
local _libc_configure=
local _bootstrap_configure=
local _symvers=
cd "$_gccdir"
case "$CTARGET" in
aarch64-*-*-*) _arch_configure="--with-arch=armv8-a --with-abi=lp64";;
armv5-*-*-*eabi) _arch_configure="--with-arch=armv5te --with-tune=arm926ej-s --with-float=soft --with-abi=aapcs-linux";;
armv6-*-*-*eabihf) _arch_configure="--with-arch=armv6zk --with-tune=arm1176jzf-s --with-fpu=vfp --with-float=hard --with-abi=aapcs-linux";;
armv7-*-*-*eabihf) _arch_configure="--with-arch=armv7-a --with-tune=generic-armv7-a --with-fpu=vfpv3-d16 --with-float=hard --with-abi=aapcs-linux --with-mode=thumb";;
mips-*-*-*) _arch_configure="--with-arch=mips32 --with-mips-plt --with-float=soft --with-abi=32";;
mips64-*-*-*) _arch_configure="--with-arch=mips3 --with-tune=mips64 --with-mips-plt --with-float=soft --with-abi=64";;
mips64el-*-*-*) _arch_configure="--with-arch=mips3 --with-tune=mips64 --with-mips-plt --with-float=soft --with-abi=64";;
mipsel-*-*-*) _arch_configure="--with-arch=mips32 --with-mips-plt --with-float=soft --with-abi=32";;
powerpc-*-*-*) _arch_configure="--enable-secureplt --enable-decimal-float=no";;
powerpc64*-*-*-*) _arch_configure="--with-abi=elfv2 --enable-secureplt --enable-decimal-float=no --enable-targets=powerpcle-linux";;
i486-*-*-*) _arch_configure="--with-arch=i486 --with-tune=generic --enable-cld";;
i586-*-*-*) _arch_configure="--with-arch=i586 --with-tune=generic --enable-cld";;
s390x-*-*-*) _arch_configure="--with-arch=z196 --with-tune=zEC12 --with-zarch --with-long-double-128 --enable-decimal-float";;
esac
case "$CTARGET_ARCH" in
mips*) _hash_style_configure="--with-linker-hash-style=sysv" ;;
*) _hash_style_configure="--with-linker-hash-style=gnu" ;;
esac
case "$CTARGET_LIBC" in
musl)
# musl does not support mudflap, or libsanitizer
# libmpx uses secure_getenv and struct _libc_fpstate not present in musl
# alpine musl provides libssp_nonshared.a, so we don't need libssp either
_libc_configure="--disable-libssp --disable-libmpx --disable-libmudflap --disable-libsanitizer"
_symvers="--disable-symvers"
export libat_cv_have_ifunc=no
;;
esac
case "$BOOTSTRAP" in
nolibc) _bootstrap_configure="--with-newlib --disable-shared --enable-threads=no" ;;
*) _bootstrap_configure="--enable-shared --enable-threads --enable-tls" ;;
esac
$_libgomp || _bootstrap_configure="$_bootstrap_configure --disable-libgomp"
$_libatomic || _bootstrap_configure="$_bootstrap_configure --disable-libatomic"
$_libitm || _bootstrap_configure="$_bootstrap_configure --disable-libitm"
$_libquadmath || _arch_configure="$_arch_configure --disable-libquadmath"
msg "Building the following:"
echo ""
echo " CBUILD=$CBUILD"
echo " CHOST=$CHOST"
echo " CTARGET=$CTARGET"
echo " CTARGET_ARCH=$CTARGET_ARCH"
echo " CTARGET_LIBC=$CTARGET_LIBC"
echo " languages=$_languages"
echo " arch_configure=$_arch_configure"
echo " libc_configure=$_libc_configure"
echo " cross_configure=$_cross_configure"
echo " bootstrap_configure=$_bootstrap_configure"
echo " hash_style_configure=$_hash_style_configure"
echo ""
mkdir -p "$_builddir"
cd "$_builddir"
"$_gccdir"/configure --prefix=/usr \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--build=${CBUILD} \
--host=${CHOST} \
--target=${CTARGET} \
--with-pkgversion="Alpine $pkgver" \
--enable-checking=release \
--disable-fixed-point \
--disable-libstdcxx-pch \
--disable-multilib \
--disable-nls \
--disable-werror \
$_symvers \
--enable-__cxa_atexit \
--enable-default-pie \
--enable-default-ssp \
--enable-cloog-backend \
--enable-languages=$_languages \
$_arch_configure \
$_libc_configure \
$_cross_configure \
$_bootstrap_configure \
--with-system-zlib \
$_hash_style_configure
make
}
package() {
cd "$_builddir"
make -j1 DESTDIR="$pkgdir" install
ln -s gcc "$pkgdir"/usr/bin/cc
# we dont support gcj -static
# and saving 35MB is not bad.
find "$pkgdir" \( -name libgtkpeer.a \
-o -name libgjsmalsa.a \
-o -name libgij.a \) \
-delete
# strip debug info from some static libs
find "$pkgdir" \( -name libgfortran.a -o -name libobjc.a -o -name libgomp.a \
-o -name libgphobos.a -o -name libgdruntime.a \
-o -name libmudflap.a -o -name libmudflapth.a \
-o -name libgcc.a -o -name libgcov.a -o -name libquadmath.a \
-o -name libitm.a -o -name libgo.a -o -name libcaf\*.a \
-o -name libatomic.a -o -name libasan.a -o -name libtsan.a \) \
-a -type f \
-exec ${STRIP_FOR_TARGET} -g {} +
if $_libgomp; then
mv "$pkgdir"/usr/lib/libgomp.spec "$pkgdir"/$_gcclibdir
fi
if $_libitm; then
mv "$pkgdir"/usr/lib/libitm.spec "$pkgdir"/$_gcclibdir
fi
# remove ffi
rm -f "$pkgdir"/usr/lib/libffi* "$pkgdir"/usr/share/man/man3/ffi*
find "$pkgdir" -name 'ffi*.h' -delete
local gdblib=${_target:+$CTARGET/}lib
if [ -d "$pkgdir"/usr/$gdblib/ ]; then
for i in $(find "$pkgdir"/usr/$gdblib/ -type f -maxdepth 1 -name "*-gdb.py"); do
mkdir -p "$pkgdir"/usr/share/gdb/python/auto-load/usr/$gdblib
mv "$i" "$pkgdir"/usr/share/gdb/python/auto-load/usr/$gdblib/
done
fi
paxmark -pmrs "$pkgdir"/$_gcclibexec/cc1
# move ada runtime libs
if $LANG_ADA; then
for i in $(find "$pkgdir"/$_gcclibdir/adalib/ -type f -maxdepth 1 -name "libgna*.so"); do
mv "$i" "$pkgdir"/usr/lib/
ln -s ../../../../${i##*/} $i
done
fi
if [ "$CHOST" != "$CTARGET" ]; then
# cross-gcc: remove any files that would conflict with the
# native gcc package
rm -rf "$pkgdir"/usr/bin/cc "$pkgdir"/usr/include "${pkgdir:?}"/usr/share
# libcc1 does not depend on target, don't ship it
rm -rf "$pkgdir"/usr/lib/libcc1.so*
# fixup gcc library symlinks to be linker scripts so
# linker finds the libs from relocated sysroot
for so in "$pkgdir"/usr/"$CTARGET"/lib/*.so; do
if [ -h "$so" ]; then
local _real=$(basename "$(readlink "$so")")
rm -f "$so"
echo "GROUP ($_real)" > "$so"
fi
done
else
# add c89/c99 wrapper scripts
cat >"$pkgdir"/usr/bin/c89 <<'EOF'
#!/bin/sh
_flavor="-std=c89"
for opt; do
case "$opt" in
-ansi|-std=c89|-std=iso9899:1990) _flavor="";;
-std=*) echo "$(basename $0) called with non ANSI/ISO C option $opt" >&2
exit 1;;
esac
done
exec gcc $_flavor ${1+"$@"}
EOF
cat >"$pkgdir"/usr/bin/c99 <<'EOF'
#!/bin/sh
_flavor="-std=c99"
for opt; do
case "$opt" in
-std=c99|-std=iso9899:1999) _flavor="";;
-std=*) echo "$(basename $0) called with non ISO C99 option $opt" >&2
exit 1;;
esac
done
exec gcc $_flavor ${1+"$@"}
EOF
chmod 755 "$pkgdir"/usr/bin/c?9
fi
}
libatomic() {
pkgdesc="GCC Atomic library"
depends=
replaces="gcc"
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libatomic.so.* "$subpkgdir"/usr/lib/
}
libcxx() {
pkgdesc="GNU C++ standard runtime library"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libstdc++.so.* "$subpkgdir"/usr/lib/
}
gpp() {
pkgdesc="GNU C++ standard library and compiler"
depends="libstdc++=$_gccrel gcc=$_gccrel libc-dev"
mkdir -p "$subpkgdir/$_gcclibexec" \
"$subpkgdir"/usr/bin \
"$subpkgdir"/usr/${_target:+$CTARGET/}include \
"$subpkgdir"/usr/${_target:+$CTARGET/}lib \
mv "$pkgdir/$_gcclibexec/cc1plus" "$subpkgdir/$_gcclibexec/"
paxmark -pmrs "$subpkgdir/$_gcclibexec/cc1plus"
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/*++* "$subpkgdir"/usr/${_target:+$CTARGET/}lib/
mv "$pkgdir"/usr/${_target:+$CTARGET/}include/c++ "$subpkgdir"/usr/${_target:+$CTARGET/}include/
mv "$pkgdir"/usr/bin/*++ "$subpkgdir"/usr/bin/
}
libobjc() {
pkgdesc="GNU Objective-C runtime"
replaces="objc"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libobjc.so.* "$subpkgdir"/usr/lib/
}
objc() {
pkgdesc="GNU Objective-C"
replaces="gcc"
depends="libc-dev gcc=$_gccrel libobjc=$_gccrel"
mkdir -p "$subpkgdir"/$_gcclibdir/include \
"$subpkgdir"/usr/lib
mv "$pkgdir"/$_gcclibdir/include/objc "$subpkgdir"/$_gcclibdir/include/
mv "$pkgdir"/usr/lib/libobjc.so "$pkgdir"/usr/lib/libobjc.a \
"$subpkgdir"/usr/lib/
}
libgcc() {
pkgdesc="GNU C compiler runtime libraries"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libgcc_s.so.* "$subpkgdir"/usr/lib/
}
libgomp() {
pkgdesc="GCC shared-memory parallel programming API library"
depends=
replaces="gcc"
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libgomp.so.* "$subpkgdir"/usr/lib/
}
libgphobos() {
pkgdesc="D programming language standard library for GCC"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libgdruntime.so.* "$subpkgdir"/usr/lib/
mv "$pkgdir"/usr/lib/libgphobos.so.* "$subpkgdir"/usr/lib/
}
gdc() {
pkgdesc="GCC-based D language compiler"
depends="gcc=$_gccrel libgphobos=$_gccrel musl-dev"
depends="$depends libucontext-dev"
mkdir -p "$subpkgdir"/$_gcclibdir/include/d/ \
"$subpkgdir"/usr/lib \
"$subpkgdir"/usr/bin
# Copy: The installed '.d' files, the static lib, the binary itself
# The shared libs are part of 'libgphobos' so one can run program
# without installing the compiler
mv "$pkgdir"/$_gcclibdir/include/d/* "$subpkgdir"/$_gcclibdir/include/d/
mv "$pkgdir"/usr/lib/libgdruntime.a "$subpkgdir"/usr/lib/
mv "$pkgdir"/usr/lib/libgphobos.a "$subpkgdir"/usr/lib/
mv "$pkgdir"/usr/bin/gdc "$subpkgdir"/usr/bin/
}
libgo() {
pkgdesc="Go runtime library for GCC"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libgo.so.* "$subpkgdir"/usr/lib/
}
go() {
pkgdesc="Go support for GCC"
depends="gcc=$_gccrel libgo=$_gccrel"
mkdir -p "$subpkgdir"/$_gcclibexec \
"$subpkgdir"/usr/lib \
"$subpkgdir"/usr/bin
mv "$pkgdir"/usr/lib/go "$subpkgdir"/usr/lib/
mv "$pkgdir"/usr/bin/*gccgo "$subpkgdir"/usr/bin/
mv "$pkgdir"/$_gcclibexec/go1 "$subpkgdir"/$_gcclibexec/
mv "$pkgdir"/usr/lib/libgo.a \
"$pkgdir"/usr/lib/libgo.so \
"$pkgdir"/usr/lib/libgobegin.a \
"$subpkgdir"/usr/lib/
}
libgfortran() {
pkgdesc="Fortran runtime library for GCC"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libgfortran.so.* "$subpkgdir"/usr/lib/
}
libquadmath() {
replaces="gcc"
pkgdesc="128-bit math library for GCC"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libquadmath.so.* "$subpkgdir"/usr/lib/
}
gfortran() {
pkgdesc="GNU Fortran Compiler"
depends="gcc=$_gccrel libgfortran=$_gccrel"
$_libquadmath && depends="$depends libquadmath=$_gccrel"
replaces="gcc"
mkdir -p "$subpkgdir"/$_gcclibexec \
"$subpkgdir"/$_gcclibdir \
"$subpkgdir"/usr/lib \
"$subpkgdir"/usr/bin
mv "$pkgdir"/usr/bin/*gfortran "$subpkgdir"/usr/bin/
mv "$pkgdir"/usr/lib/libgfortran.a \
"$pkgdir"/usr/lib/libgfortran.so \
"$subpkgdir"/usr/lib/
if $_libquadmath; then
mv "$pkgdir"/usr/lib/libquadmath.a \
"$pkgdir"/usr/lib/libquadmath.so \
"$subpkgdir"/usr/lib/
fi
mv "$pkgdir"/$_gcclibexec/f951 "$subpkgdir"/$_gcclibexec
mv "$pkgdir"/usr/lib/libgfortran.spec "$subpkgdir"/$_gcclibdir
}
libgnat() {
pkgdesc="GNU Ada runtime shared libraries"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libgna*.so "$subpkgdir"/usr/lib/
}
gnat() {
pkgdesc="Ada support for GCC"
depends="gcc=$_gccrel"
provides="$pkgname-gnat-bootstrap"
[ "$CHOST" = "$CTARGET" ] && depends="$depends libgnat=$_gccrel"
mkdir -p "$subpkgdir"/$_gcclibexec \
"$subpkgdir"/$_gcclibdir \
"$subpkgdir"/usr/bin
mv "$pkgdir"/$_gcclibexec/*gnat* "$subpkgdir"/$_gcclibexec/
mv "$pkgdir"/$_gcclibdir/*ada* "$subpkgdir"/$_gcclibdir/
mv "$pkgdir"/usr/bin/*gnat* "$subpkgdir"/usr/bin/
}
sha512sums="4b9e3639eef6e623747a22c37a904b4750c93b6da77cf3958d5047e9b5ebddb7eebe091cc16ca0a227c0ecbd2bf3b984b221130f269a97ee4cc18f9cf6c444de gcc-9.3.0.tar.xz
e36e95b81489163abd6fe9d58f7867bdca43e61143afacbfb17f4698c0b16ec5fd0061d8fab7b2ae615540bebd721c2e2227f80401b4e7fc253da9da62e6b513 002_all_default-relro.patch
f86466c62b8291fac46f9c250c7ad8fa5ab7b1cce2504442fd07ddc4543665b317ae28951f244e39aba29aeaf3fff252ec4f6a147aa16adb2b7aed747dd89188 003_all_default-fortify-source.patch
5e4794d1caddb1050d8935ae5a53ba275b653ad2c9954df89a8c47ac694e6139011829f440eb7e5b24fd57ea25daf25ac83f317871841a78ffb74d167d6f8bf9 005_all_default-as-needed.patch
6c9a5068f6eea8a85d297a3555b1d2333ffd4b9ddbfb7560a3e643f8577603871ca123373ef7f96e894225291d88f7bf575c7f8386bcfdd1dabcd7ba12598b65 gcc-as-needed-gold.patch
e026bf9f73ee254528423c6cabdfd7794960c567161581b7d4b7c61c45027e12a6efef79662d4288b9cbaecb4798f01af6a5b4a13b766c2d501444ac1846fd43 011_all_default-warn-format-security.patch
37de4cc9061bfe1963e6e6570e1a6bbfd58204bf90e0eef819882599a9a80ea28f3eb815c20c1f173dc25d4bd9971b7c7f7f9512d6f8f91f04de1e1175114d4d 012_all_default-warn-trampolines.patch
38a0fedeac3eebe4a6a957792ba520225cf42663c96a171cd168fdb6c91ffa9a56b80351f8238c5d03b78d3ae2a6539a54481fe4848b4a395e2c87f2ff7adc08 013_all_default-ssp-fix.patch
d35a3ac7e13a4446921a90e1ff3eec1079840c845f9d523c868e24ae21f94cf69ba041de5341ebef96432a6f57598e223381d4286e8fb8baaa25906707f29fbd 020_all_msgfmt-libstdc++-link.patch
840070a3c423e6206aaa6e63e1d9a0fcd6efd53626cd1240a193f0b60aa5d84216acc4a2a4fa8bce74549b07e6a316b01d638f20cea13dc62473491a302fb3d6 050_all_libiberty-asprintf.patch
0a0bc72b9366158f5d23fff1928e756fdd212433bac6ab1f00d632f241382820db8db5d475ddf11ea020eaf7e2e71b12fb9b1c3c870cf84adf6c2b16f15aabca 051_all_libiberty-pic.patch
e7a2eb1b1870e199d6fd753d065781575656fa12baa264f96c5d179689d88c31b8a3f92a5dae96088c05e96aa2bda138364ad7dbcc79e1819a102f192cbb7bab 053_all_libitm-no-fortify-source.patch
4a328d1e1a56c20166307edcfa322068915784d9c08025b7f81cf69714da48fc266b6d34f77b9135c2f10da830d9df408276a1b78d1fd218637c2823506593c2 090_all_pr55930-dependency-tracking.patch
707b30c141778fbcb1e37ebb42873cd7971de232a1298f78bbd834fa74d411b7b49cecfe4f247316d7c785da792f95f26ea6d824cd322a8f87b29537af3f77f3 0003-gcc-poison-system-directories.patch
d1c2d7ff7f673375dc7cd84ae9d8515853b5af6390c70bb763412c012101344e4ee1ce155151ce3fb6ba2b80af7ed42d697dbe1bf6fd6e7b2b9087a378c47c37 203-libgcc_s.patch
98473bcaa77903a223ca9b0d2087c0921b287a2816d308cc32c8fe009e6cbf5dd1ae7fba27794ab8d9c09e117fe534413d91a464d1218474fc123ce0adfdc2c1 205-nopie.patch
6d84354e6df96d5ea244eb3bb5f044781796b88040b11c78fb6ee509e5aac19d46e0e92ca836e98e6495d9751f52439833b748efc419e4f5d5301fb549c4dcc9 0002-posix_memalign.patch
7f434a7350c9b06d0ae7cc18a569d813238483afa34b0801d112844a0dfe6164ae36b0416955fd4da7a8caa54672247f319a8ec7ce4b6a97a5f4e17ec083112a 0008-s390x-muslldso.patch
66085c5555e6b91b6874d1782d5a1dc0ab1792889f9400f48cde9483f82b51b9e3a5de1efbba21a19fc5e664334f2188d0c2bc988d42335efa26118b3c85cc7f 0010-ldbl128-config.patch
d91c5eba37166cf34ca38e03808e3960c091b3627008a0c68c127cdf52e3827f8cfbe478ababe64c3cbb4d5eb8ed6230a21a74b6908549e05e08646de09df37c 0012-static-pie.patch
d08d7ead2de0429e5c9055d5b029ec2be9a8c821d22cecaf9b51f633652c493333f98963d9267fa2fa63850c50ae5eefd5f59e5910ec10d20044dac082182a8b libgcc-always-build-gcceh.a.patch
600fe5098dc54edaa9808fd5717af9dec058953f9ad37d49cfba1db4f7e9a7a8f02019342f75157fc575946fa693259422184de27b7ecc8386d9f3ecc0f7cc5d gcc-4.9-musl-fortify.patch
dbe0ee917fc7668571722364ab7c806731e3a31e8bfa30b4941b28b16b877d2a32b4a3897ef533399a28f82d43cac9b28e92de0493f0e779046db56584e07fa4 gcc-6.1-musl-libssp.patch
fa62556719449caec6b2b434355bfbcaa5ae55ffe017b3e1f827f66a2aae21b79c571ee7a4ce723ea69169bc3a6447e73650991a200cc372adf2f102677518d7 gcc-pure64.patch
35d6d59f0b7b968f282f56767c9e0823a7bdc5aa0d450aca50fbd802649a7ca608b47671244a3faa208a9b0d6832cabb5a22724157dc817b2c0ad63d09f93282 fix-cxxflags-passing.patch
3f5bc334d9f73d06f5f7c876738d02356acdd08958bea0e4d2095ebf15c2c2ec4e411abdae0297505ae9a1699ca01b17338e853184e84663203b192b0d35fc19 ada-shared.patch
cceeac95f47ea8664e1c16c5ebecb472b5aaa56040e943c1b97c7873b50e3a2bf972d9f743d342a2444a3bb711a0720d2446fded43892c5e05bdeefd478b0cd1 ada-musl.patch
a1f7750bc7b8b7d916a5dee34fcc736bd4fb249c96538b547d495794e6cfd49356aa3974506a15074b4cb58edd5d7e2868607c902dd003e8c464d5066fd4a575 libgnarl-musl.patch
f4ef08454e28c8732db69115e4998ec153399e8d229dd27f923dbdcf57b68128a65640d026cc7f45b58ba8764ab1eb575d4eb6d6dfc550a87a183f8b94e76181 320-libffi-gnulinux.patch
86be3338cc9c33089608bc4c5e3b7918c4e500a345c338f361b18c342119a6ed69af5495d72950de7106d760f003528b46ad14795e805f8a3331e206dcb234e3 gcc-pure64-mips.patch
17e0faeef742d32d57a070d983480367dd28cd28d47a8966ce327afdff3a38ea76803a833c90aff7d3a93aa66dae76c9be47b2408500913b40571af25b85aca7 0016-invalid_tls_model.patch
38772c5b0905455a44c43d6ef7e5f140530006e2bde9f5ffd6b569c7cf9633992515f666b486d7a78c30ab8da99b92b2775c90fde47821ae542ef1c49dc405df 400-dlang-phobos.patch
84bdbdfcb972161765b81220ea2e80e83c32f3ab27596b77eb451d8cac4bd6312210df468581c2b0e1363f5e3b31654e369c47ae84c907f3b54a1786d7c17830 401-dlang-32bits.patch
9d73f21eaa2458d28a144dd0e5478ed52763a4d8bbf62084b607db52bce1e2242f773c853fc34e6aae2d53c4124948139954627064e850e9dabaddaef5cb9d69 402-dlang-stat.patch
fd056014d0c6f627108d7387bfe46b5fb66786a16fa964da55b0442658b1c8e9e903c641a9e3233000ef37691e32ea4fef22029ab5eba217ccbc8bd5941e81ae 403-dlang-ibmz.patch
ddb3ca26b5e55f6d376036c2ed87959770bfb72d1175d0dba332f705edf6817806d53765c838ff670472a16ab175bd1ce88946c19d83f9d5e53ff2b4d3558dfb 404-dlang-zlib.patch
3f40f796f50d49ea0a185d3454c79606fb5f90ed48c030fe25c1df8c4a72ba7cae37dccdb260cf737beb3e921dc2ddad68effbe446dbf220a07d0158b9b9ca8d 405-dlang-mips.patch"
-204
View File
@@ -1,204 +0,0 @@
diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c
index 3b0aea9..ee0bb69 100644
--- a/gcc/ada/adaint.c
+++ b/gcc/ada/adaint.c
@@ -76,6 +76,11 @@
#include <sys/param.h>
#include <sys/pstat.h>
#endif
+
+#if defined (linux)
+#define _GNU_SOURCE 1
+#include <sched.h>
+#endif
#ifdef __PikeOS__
#define __BSD_VISIBLE 1
@@ -3255,7 +3260,6 @@ __gnat_lwp_self (void)
#endif
#if defined (__linux__)
-#include <sched.h>
/* glibc versions earlier than 2.7 do not define the routines to handle
dynamically allocated CPU sets. For these targets, we use the static
@@ -3265,7 +3269,7 @@ __gnat_lwp_self (void)
/* Dynamic cpu sets */
-cpu_set_t *
+void *
__gnat_cpu_alloc (size_t count)
{
return CPU_ALLOC (count);
@@ -3278,33 +3282,33 @@ __gnat_cpu_alloc_size (size_t count)
}
void
-__gnat_cpu_free (cpu_set_t *set)
+__gnat_cpu_free (void *set)
{
- CPU_FREE (set);
+ CPU_FREE ((cpu_set_t *) set);
}
void
-__gnat_cpu_zero (size_t count, cpu_set_t *set)
+__gnat_cpu_zero (size_t count, void *set)
{
- CPU_ZERO_S (count, set);
+ CPU_ZERO_S (count, (cpu_set_t *) set);
}
void
-__gnat_cpu_set (int cpu, size_t count, cpu_set_t *set)
+__gnat_cpu_set (int cpu, size_t count, void *set)
{
/* Ada handles CPU numbers starting from 1, while C identifies the first
CPU by a 0, so we need to adjust. */
- CPU_SET_S (cpu - 1, count, set);
+ CPU_SET_S (cpu - 1, count, (cpu_set_t *) set);
}
#else /* !CPU_ALLOC */
/* Static cpu sets */
-cpu_set_t *
+void *
__gnat_cpu_alloc (size_t count ATTRIBUTE_UNUSED)
{
- return (cpu_set_t *) xmalloc (sizeof (cpu_set_t));
+ return xmalloc (sizeof (cpu_set_t));
}
size_t
@@ -3314,23 +3318,23 @@ __gnat_cpu_alloc_size (size_t count ATTRIBUTE_UNUSED)
}
void
-__gnat_cpu_free (cpu_set_t *set)
+__gnat_cpu_free (void *set)
{
free (set);
}
void
-__gnat_cpu_zero (size_t count ATTRIBUTE_UNUSED, cpu_set_t *set)
+__gnat_cpu_zero (size_t count ATTRIBUTE_UNUSED, void *set)
{
- CPU_ZERO (set);
+ CPU_ZERO ((cpu_set_t *) set);
}
void
-__gnat_cpu_set (int cpu, size_t count ATTRIBUTE_UNUSED, cpu_set_t *set)
+__gnat_cpu_set (int cpu, size_t count ATTRIBUTE_UNUSED, void *set)
{
/* Ada handles CPU numbers starting from 1, while C identifies the first
CPU by a 0, so we need to adjust. */
- CPU_SET (cpu - 1, set);
+ CPU_SET (cpu - 1, (cpu_set_t *) set);
}
#endif /* !CPU_ALLOC */
#endif /* __linux__ */
diff --git a/gcc/ada/adaint.h b/gcc/ada/adaint.h
index 0d12f7e..a063b47 100644
--- a/gcc/ada/adaint.h
+++ b/gcc/ada/adaint.h
@@ -316,13 +316,11 @@ extern void *__gnat_lwp_self (void);
/* Routines for interface to required CPU set primitives */
-#include <sched.h>
-
-extern cpu_set_t *__gnat_cpu_alloc (size_t);
+extern void * __gnat_cpu_alloc (size_t);
extern size_t __gnat_cpu_alloc_size (size_t);
-extern void __gnat_cpu_free (cpu_set_t *);
-extern void __gnat_cpu_zero (size_t, cpu_set_t *);
-extern void __gnat_cpu_set (int, size_t, cpu_set_t *);
+extern void __gnat_cpu_free (void *);
+extern void __gnat_cpu_zero (size_t, void *);
+extern void __gnat_cpu_set (int, size_t, void *);
#endif
#if defined (_WIN32)
--- a/gcc/ada/Makefile.rtl 2019-05-14 21:18:45.217455681 +0200
+++ b/gcc/ada/Makefile.rtl 2019-05-14 21:21:30.686464218 +0200
@@ -1521,7 +1521,7 @@
s-tpopsp.adb<libgnarl/s-tpopsp__tls.adb \
$(TRASYM_DWARF_UNIX_PAIRS) \
g-sercom.adb<libgnat/g-sercom__linux.adb \
- s-tsmona.adb<libgnat/s-tsmona__linux.adb \
+ s-tsmona.adb<libgnat/s-tsmona.adb \
a-exetim.adb<libgnarl/a-exetim__posix.adb \
a-exetim.ads<libgnarl/a-exetim__default.ads \
s-linux.ads<libgnarl/s-linux.ads \
@@ -2073,7 +2073,7 @@
s-tpopsp.adb<libgnarl/s-tpopsp__tls.adb \
g-sercom.adb<libgnat/g-sercom__linux.adb \
$(TRASYM_DWARF_UNIX_PAIRS) \
- s-tsmona.adb<libgnat/s-tsmona__linux.adb \
+ s-tsmona.adb<libgnat/s-tsmona.adb \
$(ATOMICS_TARGET_PAIRS) \
$(ATOMICS_BUILTINS_TARGET_PAIRS) \
system.ads<libgnat/system-linux-ppc.ads
@@ -2102,7 +2102,7 @@
endif
# ARM linux, GNU eabi
-ifeq ($(strip $(filter-out arm% linux-gnueabi%,$(target_cpu) $(target_os))),)
+ifeq ($(strip $(filter-out arm% linux-gnueabi% linux-musleabi% linux-muslgnueabi%,$(target_cpu) $(target_os))),)
LIBGNAT_TARGET_PAIRS = \
a-intnam.ads<libgnarl/a-intnam__linux.ads \
s-inmaop.adb<libgnarl/s-inmaop__posix.adb \
@@ -2297,7 +2297,7 @@
s-taspri.ads<libgnarl/s-taspri__posix-noaltstack.ads \
g-sercom.adb<libgnat/g-sercom__linux.adb \
$(TRASYM_DWARF_UNIX_PAIRS) \
- s-tsmona.adb<libgnat/s-tsmona__linux.adb \
+ s-tsmona.adb<libgnat/s-tsmona.adb \
$(ATOMICS_TARGET_PAIRS) \
$(ATOMICS_BUILTINS_TARGET_PAIRS) \
system.ads<libgnat/system-linux-ia64.ads
@@ -2394,7 +2394,7 @@
s-taspri.ads<libgnarl/s-taspri__posix.ads \
g-sercom.adb<libgnat/g-sercom__linux.adb \
$(TRASYM_DWARF_UNIX_PAIRS) \
- s-tsmona.adb<libgnat/s-tsmona__linux.adb \
+ s-tsmona.adb<libgnat/s-tsmona.adb \
$(ATOMICS_TARGET_PAIRS) \
$(X86_64_TARGET_PAIRS) \
system.ads<libgnat/system-linux-x86.ads
--- a/gcc/ada/terminals.c 2019-01-08 10:54:04.000000000 +0100
+++ b/gcc/ada/terminals.c 2019-05-15 13:14:09.935742526 +0200
@@ -1136,7 +1136,7 @@
/* POSIX does not specify how to open the master side of a terminal.Several
methods are available (system specific):
1- using a cloning device (USE_CLONE_DEVICE)
- 2- getpt (USE_GETPT)
+ 2- posix_openpt (USE_POSIX_OPENPT)
3- openpty (USE_OPENPTY)
When using the cloning device method, the macro USE_CLONE_DEVICE should
@@ -1150,7 +1150,7 @@
#if defined (__APPLE__) || defined (BSD)
#define USE_OPENPTY
#elif defined (__linux__)
-#define USE_GETPT
+#define USE_POSIX_OPENPT
#elif defined (__sun__)
#define USE_CLONE_DEVICE "/dev/ptmx"
#elif defined (_AIX)
@@ -1199,8 +1199,8 @@
int master_fd = -1;
char *slave_name = NULL;
-#ifdef USE_GETPT
- master_fd = getpt ();
+#if defined(USE_POSIX_OPENPT)
+ master_fd = posix_openpt(O_RDWR | O_NOCTTY);
#elif defined (USE_OPENPTY)
status = openpty (&master_fd, &slave_fd, NULL, NULL, NULL);
#elif defined (USE_CLONE_DEVICE)
-30
View File
@@ -1,30 +0,0 @@
Index: b/gcc/ada/link.c
===================================================================
--- a/gcc/ada/link.c
+++ b/gcc/ada/link.c
@@ -105,9 +105,9 @@
#elif defined (__FreeBSD__)
const char *__gnat_object_file_option = "-Wl,@";
-const char *__gnat_run_path_option = "-Wl,-rpath,";
-char __gnat_shared_libgnat_default = STATIC;
-char __gnat_shared_libgcc_default = STATIC;
+const char *__gnat_run_path_option = "";
+char __gnat_shared_libgnat_default = SHARED;
+char __gnat_shared_libgcc_default = SHARED;
int __gnat_link_max = 8192;
unsigned char __gnat_objlist_file_supported = 1;
const char *__gnat_object_library_extension = ".a";
@@ -127,9 +127,9 @@
#elif defined (linux) || defined(__GLIBC__)
const char *__gnat_object_file_option = "-Wl,@";
-const char *__gnat_run_path_option = "-Wl,-rpath,";
-char __gnat_shared_libgnat_default = STATIC;
-char __gnat_shared_libgcc_default = STATIC;
+const char *__gnat_run_path_option = "";
+char __gnat_shared_libgnat_default = SHARED;
+char __gnat_shared_libgcc_default = SHARED;
int __gnat_link_max = 8192;
unsigned char __gnat_objlist_file_supported = 1;
const char *__gnat_object_library_extension = ".a";
@@ -1,10 +0,0 @@
--- gcc-4.8.1/Makefile.in.orig
+++ gcc-4.8.1/Makefile.in
@@ -169,6 +169,7 @@
# built for the build system to override those in BASE_FLAGS_TO_PASSS.
EXTRA_BUILD_FLAGS = \
CFLAGS="$(CFLAGS_FOR_BUILD)" \
+ CXXFLAGS="$(CXXFLAGS_FOR_BUILD)" \
LDFLAGS="$(LDFLAGS_FOR_BUILD)"
# This is the list of directories to built for the host system.
@@ -1,11 +0,0 @@
--- gcc-4.9.2/gcc/config/linux.h.orig 2015-03-09 13:27:13.289736710 +0000
+++ gcc-4.9.2/gcc/config/linux.h 2015-03-09 13:29:32.295625046 +0000
@@ -146,6 +146,8 @@
#ifdef NATIVE_SYSTEM_HEADER_DIR
#define INCLUDE_DEFAULTS_MUSL_NATIVE \
+ { NATIVE_SYSTEM_HEADER_DIR "/fortify", 0, 0, 0, 1, 2 }, \
+ { NATIVE_SYSTEM_HEADER_DIR "/fortify", 0, 0, 0, 1, 0 }, \
{ NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \
{ NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 },
#else
-20
View File
@@ -1,20 +0,0 @@
Author: Timo Teräs <timo.teras@iki.fi>
Alpine musl package provides libssp_nonshared.a. We link to it unconditionally,
as otherwise we get link failures if some objects are -fstack-protector built
and final link happens with -fno-stack-protector. This seems to be the common
case when bootstrapping gcc, the piepatches do not seem to fully fix the
crosstoolchain and bootstrap sequence wrt. stack-protector flag usage.
--- gcc-6.1.0/gcc/gcc.c.orig
+++ gcc-6.1.0/gcc/gcc.c
@@ -870,8 +870,7 @@
#ifndef LINK_SSP_SPEC
#ifdef TARGET_LIBC_PROVIDES_SSP
-#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
- "|fstack-protector-strong|fstack-protector-explicit:}"
+#define LINK_SSP_SPEC "-lssp_nonshared"
#else
#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
"|fstack-protector-strong|fstack-protector-explicit" \
-58
View File
@@ -1,58 +0,0 @@
# DP: Use --push-state/--pop-state for gold as well when linking libtsan.
Index: b/gcc/gcc.c
===================================================================
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -693,10 +693,10 @@ proper position among the other output f
#define LIBASAN_SPEC STATIC_LIBASAN_LIBS
#elif defined(HAVE_LD_STATIC_DYNAMIC)
#define LIBASAN_SPEC "%{static-libasan:" LD_STATIC_OPTION "}" \
- " %{!static-libasan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \
+ " %{!static-libasan:--push-state --no-as-needed}" \
" -lasan " \
" %{static-libasan:" LD_DYNAMIC_OPTION "}" \
- " %{!static-libasan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
+ " %{!static-libasan:--pop-state}" \
STATIC_LIBASAN_LIBS
#else
#define LIBASAN_SPEC "-lasan" STATIC_LIBASAN_LIBS
@@ -714,10 +714,10 @@ proper position among the other output f
#define LIBTSAN_SPEC STATIC_LIBTSAN_LIBS
#elif defined(HAVE_LD_STATIC_DYNAMIC)
#define LIBTSAN_SPEC "%{static-libtsan:" LD_STATIC_OPTION "}" \
- " %{!static-libtsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \
+ " %{!static-libtsan:--push-state --no-as-needed}" \
" -ltsan " \
" %{static-libtsan:" LD_DYNAMIC_OPTION "}" \
- " %{!static-libtsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
+ " %{!static-libtsan:--pop-state}" \
STATIC_LIBTSAN_LIBS
#else
#define LIBTSAN_SPEC "-ltsan" STATIC_LIBTSAN_LIBS
@@ -735,10 +735,10 @@ proper position among the other output f
#define LIBLSAN_SPEC STATIC_LIBLSAN_LIBS
#elif defined(HAVE_LD_STATIC_DYNAMIC)
#define LIBLSAN_SPEC "%{static-liblsan:" LD_STATIC_OPTION "}" \
- " %{!static-liblsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \
+ " %{!static-liblsan:--push-state --no-as-needed}" \
" -llsan " \
" %{static-liblsan:" LD_DYNAMIC_OPTION "}" \
- " %{!static-liblsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
+ " %{!static-liblsan:--pop-state}" \
STATIC_LIBLSAN_LIBS
#else
#define LIBLSAN_SPEC "-llsan" STATIC_LIBLSAN_LIBS
@@ -754,10 +754,10 @@ proper position among the other output f
" %{static-libubsan|static:%:include(libsanitizer.spec)%(link_libubsan)}"
#ifdef HAVE_LD_STATIC_DYNAMIC
#define LIBUBSAN_SPEC "%{static-libubsan:" LD_STATIC_OPTION "}" \
- " %{!static-libubsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \
+ " %{!static-libubsan:--push-state --no-as-needed}" \
" -lubsan " \
" %{static-libubsan:" LD_DYNAMIC_OPTION "}" \
- " %{!static-libubsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
+ " %{!static-libubsan:--pop-state}" \
STATIC_LIBUBSAN_LIBS
#else
#define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS
-47
View File
@@ -1,47 +0,0 @@
From b8c4e45d052adc247341066f748421743704b481 Mon Sep 17 00:00:00 2001
From: Nils Andreas Svee <me@lochnair.net>
Date: Thu, 21 Dec 2017 03:14:33 +0100
Subject: [PATCH] Pure 64-bit MIPS
---
gcc/config/mips/mips.h | 8 ++++----
gcc/config/mips/t-linux64 | 6 +++---
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h
index 803ab98e7..afd74752f 100644
--- a/gcc/config/mips/mips.h
+++ b/gcc/config/mips/mips.h
@@ -3330,11 +3330,11 @@ struct GTY(()) machine_function {
/* If we are *not* using multilibs and the default ABI is not ABI_32 we
need to change these from /lib and /usr/lib. */
#if MIPS_ABI_DEFAULT == ABI_N32
-#define STANDARD_STARTFILE_PREFIX_1 "/lib32/"
-#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib32/"
+#define STANDARD_STARTFILE_PREFIX_1 "/lib/"
+#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/"
#elif MIPS_ABI_DEFAULT == ABI_64
-#define STANDARD_STARTFILE_PREFIX_1 "/lib64/"
-#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib64/"
+#define STANDARD_STARTFILE_PREFIX_1 "/lib/"
+#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/"
#endif
/* Load store bonding is not supported by micromips and fix_24k. The
diff --git a/gcc/config/mips/t-linux64 b/gcc/config/mips/t-linux64
index 16c8adf85..bb46204db 100644
--- a/gcc/config/mips/t-linux64
+++ b/gcc/config/mips/t-linux64
@@ -21,6 +21,6 @@ MULTILIB_DIRNAMES = n32 32 64
MIPS_EL = $(if $(filter %el, $(firstword $(subst -, ,$(target)))),el)
MIPS_SOFT = $(if $(strip $(filter MASK_SOFT_FLOAT_ABI, $(target_cpu_default)) $(filter soft, $(with_float))),soft)
MULTILIB_OSDIRNAMES = \
- ../lib32$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabin32$(MIPS_SOFT)) \
- ../lib$(call if_multiarch,:mips$(MIPS_EL)-linux-gnu$(MIPS_SOFT)) \
- ../lib64$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabi64$(MIPS_SOFT))
+ ../lib \
+ ../lib32 \
+ ../lib
--
2.15.1
-89
View File
@@ -1,89 +0,0 @@
--- ./gcc/config/i386/t-linux64.orig 2013-01-14 16:32:37.000000000 +0000
+++ ./gcc/config/i386/t-linux64 2013-04-22 06:12:32.984439677 +0000
@@ -34,6 +34,6 @@
comma=,
MULTILIB_OPTIONS = $(subst $(comma),/,$(TM_MULTILIB_CONFIG))
MULTILIB_DIRNAMES = $(patsubst m%, %, $(subst /, ,$(MULTILIB_OPTIONS)))
-MULTILIB_OSDIRNAMES = m64=../lib64$(call if_multiarch,:x86_64-linux-gnu)
-MULTILIB_OSDIRNAMES+= m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:i386-linux-gnu)
+MULTILIB_OSDIRNAMES = m64=../lib
+MULTILIB_OSDIRNAMES+= m32=../lib32
MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-linux-gnux32)
--- ./gcc/config/aarch64/t-aarch64-linux.orig
+++ ./gcc/config/aarch64/t-aarch64-linux
@@ -22,7 +22,7 @@
LIB1ASMFUNCS = _aarch64_sync_cache_range
AARCH_BE = $(if $(findstring TARGET_BIG_ENDIAN_DEFAULT=1, $(tm_defines)),_be)
-MULTILIB_OSDIRNAMES = mabi.lp64=../lib64$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu)
+MULTILIB_OSDIRNAMES = mabi.lp64=../lib
MULTIARCH_DIRNAME = $(call if_multiarch,aarch64$(AARCH_BE)-linux-gnu)
MULTILIB_OSDIRNAMES += mabi.ilp32=../libilp32
--- ./gcc/config/s390/t-linux64.orig
+++ ./gcc/config/s390/t-linux64
@@ -7,5 +7,5 @@
MULTILIB_OPTIONS = m64/m31
MULTILIB_DIRNAMES = 64 32
-MULTILIB_OSDIRNAMES = ../lib64$(call if_multiarch,:s390x-linux-gnu)
-MULTILIB_OSDIRNAMES += $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:s390-linux-gnu)
+MULTILIB_OSDIRNAMES = m64=../lib
+MULTILIB_OSDIRNAMES+= m32=../lib32
--- ./gcc/config/rs6000/t-linux.orig
+++ ./gcc/config/rs6000/t-linux
@@ -2,7 +2,8 @@
# or soft-float.
ifeq (,$(filter $(with_cpu),$(SOFT_FLOAT_CPUS))$(findstring soft,$(with_float)))
ifneq (,$(findstring powerpc64,$(target)))
-MULTILIB_OSDIRNAMES := .=../lib64$(call if_multiarch,:powerpc64-linux-gnu)
+MULTILIB_OSDIRNAMES := m64=../lib
+MULTILIB_OSDIRNAMES += m32=../lib32
else
ifneq (,$(findstring spe,$(target)))
MULTIARCH_DIRNAME := powerpc-linux-gnuspe$(if $(findstring 8548,$(with_cpu)),,v1)
@@ -14,7 +15,8 @@
MULTIARCH_DIRNAME := $(subst -linux,le-linux,$(MULTIARCH_DIRNAME))
endif
ifneq (,$(findstring powerpc64le,$(target)))
-MULTILIB_OSDIRNAMES := $(subst -linux,le-linux,$(MULTILIB_OSDIRNAMES))
+MULTILIB_OSDIRNAMES := m64=../lib
+MULTILIB_OSDIRNAMES += m32=../lib32
endif
endif
--- ./gcc/config/rs6000/t-linux64.orig
+++ ./gcc/config/rs6000/t-linux64
@@ -28,8 +28,8 @@
MULTILIB_OPTIONS := m64/m32
MULTILIB_DIRNAMES := 64 32
MULTILIB_EXTRA_OPTS :=
-MULTILIB_OSDIRNAMES := m64=../lib64$(call if_multiarch,:powerpc64-linux-gnu)
-MULTILIB_OSDIRNAMES += m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:powerpc-linux-gnu)
+MULTILIB_OSDIRNAMES := m64=../lib
+MULTILIB_OSDIRNAMES += m32=../lib32
rs6000-linux.o: $(srcdir)/config/rs6000/rs6000-linux.c
$(COMPILE) $<
--- ./gcc/config/rs6000/t-linux64bele.orig
+++ ./gcc/config/rs6000/t-linux64bele
@@ -2,6 +2,6 @@
MULTILIB_OPTIONS += mlittle
MULTILIB_DIRNAMES += le
-MULTILIB_OSDIRNAMES += $(subst =,.mlittle=,$(subst lible32,lib32le,$(subst lible64,lib64le,$(subst lib,lible,$(subst -linux,le-linux,$(MULTILIB_OSDIRNAMES))))))
-MULTILIB_OSDIRNAMES += $(subst $(if $(findstring 64,$(target)),m64,m32).,,$(filter $(if $(findstring 64,$(target)),m64,m32).mlittle%,$(MULTILIB_OSDIRNAMES)))
+MULTILIB_OSDIRNAMES = m64=../lib
+MULTILIB_OSDIRNAMES+= m32=../lib32
MULTILIB_MATCHES := ${MULTILIB_MATCHES_ENDIAN}
--- ./gcc/config/rs6000/t-linux64lebe.orig
+++ ./gcc/config/rs6000/t-linux64lebe
@@ -2,6 +2,6 @@
MULTILIB_OPTIONS += mbig
MULTILIB_DIRNAMES += be
-MULTILIB_OSDIRNAMES += $(subst =,.mbig=,$(subst libbe32,lib32be,$(subst libbe64,lib64be,$(subst lib,libbe,$(subst le-linux,-linux,$(MULTILIB_OSDIRNAMES))))))
-MULTILIB_OSDIRNAMES += $(subst $(if $(findstring 64,$(target)),m64,m32).,,$(filter $(if $(findstring 64,$(target)),m64,m32).mbig%,$(MULTILIB_OSDIRNAMES)))
+MULTILIB_OSDIRNAMES := m64=../lib
+MULTILIB_OSDIRNAMES += m32=../lib32
MULTILIB_MATCHES := ${MULTILIB_MATCHES_ENDIAN}
@@ -1,39 +0,0 @@
Highly inspired by:
http://landley.net/hg/aboriginal/file/7e0747a665ab/sources/patches/gcc-core-libgcceh.patch
diff -durN gcc-4.6.0.orig/libgcc/Makefile.in gcc-4.6.0/libgcc/Makefile.in
--- gcc-4.6.0.orig/libgcc/Makefile.in 2011-01-26 05:19:58.000000000 +0100
+++ gcc-4.6.0/libgcc/Makefile.in 2011-09-12 18:17:12.743718974 +0200
@@ -772,8 +772,9 @@
libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_EXT)
endif
+all: libgcc_eh.a
ifeq ($(enable_shared),yes)
-all: libgcc_eh.a libgcc_s$(SHLIB_EXT)
+all: libgcc_s$(SHLIB_EXT)
ifneq ($(LIBUNWIND),)
all: libunwind$(SHLIB_EXT)
endif
@@ -950,10 +951,6 @@
install-shared:
$(mkinstalldirs) $(DESTDIR)$(inst_libdir)
- $(INSTALL_DATA) libgcc_eh.a $(DESTDIR)$(inst_libdir)/
- chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a
- $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a
-
$(subst @multilib_dir@,$(MULTIDIR),$(subst \
@shlib_base_name@,libgcc_s,$(subst \
@shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL))))
@@ -968,6 +965,10 @@
chmod 644 $(DESTDIR)$(inst_libdir)/libgcov.a
$(RANLIB) $(DESTDIR)$(inst_libdir)/libgcov.a
+ $(INSTALL_DATA) libgcc_eh.a $(DESTDIR)$(inst_libdir)/
+ chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a
+ $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a
+
parts="$(INSTALL_PARTS)"; \
for file in $$parts; do \
rm -f $(DESTDIR)$(inst_libdir)/$$file; \
-120
View File
@@ -1,120 +0,0 @@
diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
--- gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads 2018-01-11 00:55:25.000000000 -0800
+++ gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads 2018-11-01 16:16:23.372452951 -0700
@@ -394,12 +394,6 @@ package System.OS_Interface is
PTHREAD_RWLOCK_PREFER_WRITER_NP : constant := 1;
PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
- function pthread_rwlockattr_setkind_np
- (attr : access pthread_rwlockattr_t;
- pref : int) return int;
- pragma Import
- (C, pthread_rwlockattr_setkind_np, "pthread_rwlockattr_setkind_np");
-
function pthread_rwlock_init
(mutex : access pthread_rwlock_t;
attr : access pthread_rwlockattr_t) return int;
@@ -464,11 +458,6 @@ package System.OS_Interface is
protocol : int) return int;
pragma Import (C, pthread_mutexattr_setprotocol);
- function pthread_mutexattr_setprioceiling
- (attr : access pthread_mutexattr_t;
- prioceiling : int) return int;
- pragma Import (C, pthread_mutexattr_setprioceiling);
-
type struct_sched_param is record
sched_priority : int; -- scheduling priority
end record;
diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
--- gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb 2018-01-11 00:55:25.000000000 -0800
+++ gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb 2018-11-13 11:28:36.433964449 -0800
@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
pragma Import
(C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
- function GNAT_has_cap_sys_nice return C.int;
- pragma Import
- (C, GNAT_has_cap_sys_nice, "__gnat_has_cap_sys_nice");
-- We do not have pragma Linker_Options ("-lcap"); here, because this
-- library is not present on many Linux systems. 'libcap' is the Linux
-- "capabilities" library, called by __gnat_has_cap_sys_nice.
@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
-- Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
-- GNU/Linux, so we map 0 .. 98 to 1 .. 99.
- function Get_Ceiling_Support return Boolean;
- -- Get the value of the Ceiling_Support constant (see below).
- -- Note well: If this function or related code is modified, it should be
- -- tested by hand, because automated testing doesn't exercise it.
-
- -------------------------
- -- Get_Ceiling_Support --
- -------------------------
-
- function Get_Ceiling_Support return Boolean is
- Ceiling_Support : Boolean := False;
- begin
- if Locking_Policy /= 'C' then
- return False;
- end if;
-
- declare
- function geteuid return Integer;
- pragma Import (C, geteuid, "geteuid");
- Superuser : constant Boolean := geteuid = 0;
- Has_Cap : constant C.int := GNAT_has_cap_sys_nice;
- pragma Assert (Has_Cap in 0 | 1);
- begin
- Ceiling_Support := Superuser or else Has_Cap = 1;
- end;
-
- return Ceiling_Support;
- end Get_Ceiling_Support;
-
- pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
- Ceiling_Support : constant Boolean := Get_Ceiling_Support;
- pragma Warnings (On, "non-static call not allowed in preelaborated unit");
-- True if the locking policy is Ceiling_Locking, and the current process
-- has permission to use this policy. The process has permission if it is
-- running as 'root', or if the capability was set by the setcap command,
@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
-- Init_Mutex --
----------------
+ pragma Warnings (Off, "formal parameter * is not referenced");
function Init_Mutex (L : RTS_Lock_Ptr; Prio : Any_Priority) return C.int is
+ pragma Warnings (On, "formal parameter * is not referenced");
Mutex_Attr : aliased pthread_mutexattr_t;
Result, Result_2 : C.int;
@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
return Result;
end if;
- if Ceiling_Support then
- Result := pthread_mutexattr_setprotocol
- (Mutex_Attr'Access, PTHREAD_PRIO_PROTECT);
- pragma Assert (Result = 0);
-
- Result := pthread_mutexattr_setprioceiling
- (Mutex_Attr'Access, Prio_To_Linux_Prio (Prio));
- pragma Assert (Result = 0);
-
- elsif Locking_Policy = 'I' then
+ if Locking_Policy = 'I' then
Result := pthread_mutexattr_setprotocol
(Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
pragma Assert (Result = 0);
@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
Result := pthread_rwlockattr_init (RWlock_Attr'Access);
pragma Assert (Result = 0);
- Result := pthread_rwlockattr_setkind_np
- (RWlock_Attr'Access,
- PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP);
- pragma Assert (Result = 0);
-
Result := pthread_rwlock_init (L.RW'Access, RWlock_Attr'Access);
pragma Assert (Result in 0 | ENOMEM);
@@ -0,0 +1,22 @@
Upstream: Yes, https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92216 and
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95184
Reason: GDC produced errors about duplicate symbols when the same interface
was implemented by two classes in the same project.
diff --git a/gcc/d/decl.cc b/gcc/d/decl.cc
index 3824060..7afb1aa 100644 (file)
--- a/gcc/d/decl.cc
+++ b/gcc/d/decl.cc
@@ -1803,8 +1803,11 @@ make_thunk (FuncDeclaration *decl, int offset)
DECL_CONTEXT (thunk) = d_decl_context (decl);
- /* Thunks inherit the public access of the function they are targetting. */
- TREE_PUBLIC (thunk) = TREE_PUBLIC (function);
+ /* Thunks inherit the public access of the function they are targetting.
+ When the function is outside the current compilation unit however, then the
+ thunk must be kept private to not conflict. */
+ TREE_PUBLIC (thunk) = TREE_PUBLIC (function) && !DECL_EXTERNAL (function);
+
DECL_EXTERNAL (thunk) = 0;
/* Thunks are always addressable. */
+8 -2
View File
@@ -30,7 +30,7 @@ pkgver=9.3.0
[ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target=""
pkgname="gcc-armv7"
pkgrel=1
pkgrel=2
pkgdesc="Stage2 cross-compiler for armv7"
url="https://gcc.gnu.org"
arch="x86_64"
@@ -214,6 +214,7 @@ source="https://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$pkgver}/gcc-${_pkg
403-dlang-ibmz.patch
404-dlang-zlib.patch
405-dlang-mips.patch
406-dlang-fix-interface-visibility.patch
"
# gcc-4.8-build-args.patch
@@ -438,6 +439,10 @@ done
exec gcc $_flavor ${1+"$@"}
EOF
chmod 755 "$pkgdir"/usr/bin/c?9
# install lto plugin so regular binutils may use it
mkdir -p "$pkgdir"/usr/lib/bfd-plugins
ln -s /$_gcclibexec/liblto_plugin.so "$pkgdir/usr/lib/bfd-plugins/"
fi
}
@@ -660,4 +665,5 @@ f4ef08454e28c8732db69115e4998ec153399e8d229dd27f923dbdcf57b68128a65640d026cc7f45
9d73f21eaa2458d28a144dd0e5478ed52763a4d8bbf62084b607db52bce1e2242f773c853fc34e6aae2d53c4124948139954627064e850e9dabaddaef5cb9d69 402-dlang-stat.patch
fd056014d0c6f627108d7387bfe46b5fb66786a16fa964da55b0442658b1c8e9e903c641a9e3233000ef37691e32ea4fef22029ab5eba217ccbc8bd5941e81ae 403-dlang-ibmz.patch
ddb3ca26b5e55f6d376036c2ed87959770bfb72d1175d0dba332f705edf6817806d53765c838ff670472a16ab175bd1ce88946c19d83f9d5e53ff2b4d3558dfb 404-dlang-zlib.patch
3f40f796f50d49ea0a185d3454c79606fb5f90ed48c030fe25c1df8c4a72ba7cae37dccdb260cf737beb3e921dc2ddad68effbe446dbf220a07d0158b9b9ca8d 405-dlang-mips.patch"
3f40f796f50d49ea0a185d3454c79606fb5f90ed48c030fe25c1df8c4a72ba7cae37dccdb260cf737beb3e921dc2ddad68effbe446dbf220a07d0158b9b9ca8d 405-dlang-mips.patch
c226bb5c60ae5071549e5ec3ab44dc87b244615ba520973b1d4c50a2b6d3fd941c4e5e8e1f85cad28093ee8627d20415114524b593ad3a9b24998328d3f3ea72 406-dlang-fix-interface-visibility.patch"
@@ -1,156 +0,0 @@
2013-12-30 Magnus Granberg <zorry@gentoo.org>
* gcc/configure.ac Add --enable-esp and define ENABLE_ESP.
Check if we support crtbeginP and define ENABLE_CRTBEGINP.
* gcc/configure Regenerated
--- a/gcc/configure.ac 2011-11-18 11:52:32.000000000 +0100
+++ b/gcc/configure.ac 2012-10-02 17:39:15.649526241 +0200
@@ -5130,6 +5237,55 @@ if test x"${LINKER_HASH_STYLE}" != x; th
[The linker hash style])
fi
+# --------------
+# Esp checks
+# --------------
+
+# Check whether --enable-esp was given and target have the support.
+AC_ARG_ENABLE([esp],
+[AS_HELP_STRING([--enable-esp],
+ [Enable Stack protector and Position independent executable as
+ default if we have suppot for it when compiling
+ and link with -z now as default.
+ Linux targets supported i*86, x86_64, x32,
+ powerpc, powerpc64, ia64, arm and mips.])],
+ enable_esp=$enableval,
+ enable_esp=no)
+if test $enable_esp = yes ; then
+ AC_MSG_CHECKING(if $target support esp)
+ case "$target" in
+ i?86*-*-linux* | x86_64-*-linux* | powerpc*-*-linux* | mips-*-linux* | arm*-*-linux* | ia64-*-linux*)
+ enable_esp=yes
+ AC_DEFINE(ENABLE_ESP, 1,
+ [Define if your target support esp and you have enable it.])
+ ;;
+ *)
+ enable_esp=no
+ ;;
+ esac
+AC_MSG_RESULT($enable_esp)
+fi
+AC_SUBST([enable_esp])
+if test $enable_esp = yes ; then
+ AC_MSG_CHECKING(checking for crtbeginP.o support)
+ if test x$enable_esp = xyes ; then
+ case "$target" in
+ ia64*-*-linux*)
+ enable_crtbeginP=no ;;
+ *-*-linux*)
+ if test x$gcc_cv_ld_pie = xyes && test x$lt_cv_prog_compiler_static_works = xyes; then
+ enable_crtbeginP=yes
+ AC_DEFINE(ENABLE_CRTBEGINP, 1,
+ [Define if your compiler will support crtbeginP.])
+ fi
+ ;;
+ *) enable_crtbeginP=no ;;
+ esac
+ fi
+ AC_MSG_RESULT($enable_crtbeginP)
+fi
+AC_SUBST([enable_crtbeginP])
+
# Configure the subdirectories
# AC_CONFIG_SUBDIRS($subdirs)
--- a/gcc/configure 2013-02-01 21:26:24.000000000 +0100
+++ b/gcc/configure 2013-02-12 01:59:20.000000000 +0100
@@ -600,6 +600,8 @@
ac_subst_vars='LTLIBOBJS
LIBOBJS
PICFLAG
+enable_crtbeginP
+enable_esp
enable_host_shared
enable_plugin
pluginlibs
@@ -920,6 +922,7 @@
enable_plugin
enable_libquadmath_support
with_linker_hash_style
+enable_esp
'
ac_precious_vars='build_alias
host_alias
@@ -1633,6 +1636,11 @@
--enable-plugin enable plugin support
--disable-libquadmath-support
disable libquadmath support for Fortran
+ --enable-esp Enable Stack protector and Position independent
+ executable as default if we have suppot for it when
+ compiling and link with -z now as default.
+ Linux targets supported i*86, x86_64, x32,
+ powerpc, powerpc64, ia64, arm and mips.
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
@@ -27419,6 +27427,59 @@
fi
+# --------------
+# Esp checks
+# --------------
+
+# Check whether --enable-esp was given and target have the support.
+# Check whether --enable-esp was given.
+if test "${enable_esp+set}" = set; then :
+ enableval=$enable_esp; enable_esp=$enableval
+else
+ enable_esp=no
+fi
+
+if test $enable_esp = yes ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $target support esp" >&5
+$as_echo_n "checking if $target support esp... " >&6; }
+ case "$target" in
+ i?86*-*-linux* | x86_64-*-linux* | powerpc*-*-linux* | mips*-*-linux* | arm*-*-linux* | ia64-*-linux*)
+ enable_esp=yes
+
+$as_echo "#define ENABLE_ESP 1" >>confdefs.h
+
+ ;;
+ *)
+ enable_esp=no
+ ;;
+ esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_esp" >&5
+$as_echo "$enable_esp" >&6; }
+fi
+
+if test $enable_esp = yes ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking checking for crtbeginP.o support" >&5
+$as_echo_n "checking checking for crtbeginP.o support... " >&6; }
+ if test x$enable_esp = xyes ; then
+ case "$target" in
+ ia64*-*-linux*)
+ enable_crtbeginP=no ;;
+ *-*-linux*)
+ if test x$gcc_cv_ld_pie = xyes && test x$lt_cv_prog_compiler_static_works = xyes; then
+ enable_crtbeginP=yes
+
+$as_echo "#define ENABLE_CRTBEGINP 1" >>confdefs.h
+
+ fi
+ ;;
+ *) enable_crtbeginP=no ;;
+ esac
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_crtbeginP" >&5
+$as_echo "$enable_crtbeginP" >&6; }
+fi
+
+
# Configure the subdirectories
# AC_CONFIG_SUBDIRS($subdirs)
@@ -1,32 +0,0 @@
2013-02-13 Magnus Granberg <zorry@gentoo.org>
* gcc/config.in Add ENABLE_CRTBEGINP, ENABLE_ESP
--- ./gcc/config.in 2009-04-21 11:08:08.000000000 +0200
+++ ./gcc/config.in 2009-05-12 00:10:08.000000000 +0200
@@ -46,6 +46,12 @@
#endif
+/* Define to 1 to enable crtbeginP.o. */
+#ifndef USED_FOR_TARGET
+#undef ENABLE_CRTBEGINP
+#endif
+
+
/* Define to 1 to specify that we are using the BID decimal floating point
format instead of DPD */
#ifndef USED_FOR_TARGET
@@ -65,6 +65,12 @@
#endif
+/* Define to 1 to enable esp. */
+#ifndef USED_FOR_TARGET
+#undef ENABLE_ESP
+#endif
+
+
/* Define to 1 to enable fixed-point arithmetic extension to C. */
#ifndef USED_FOR_TARGET
#undef ENABLE_FIXED_POINT
@@ -1,96 +0,0 @@
2012-01-17 Magnus Granberg <zorry@gentoo.org>
* gcc/Makefile.in Add -fno-PIE. to ALL_CFLAGS and
ALL_CXXFLAGS if enable_esp yes.
Echo enable_esp and enable_crtbeginP to tmp-libgcc.mvars.
* libgcc/Makefile.in Add crtbeginP.o to EXTRA_PARTS if enable_crtbeginP yes
We add new file crtbeginP.o if enable_crtbeginP yes
Add -fno-PIE. to CRTSTUFF_CFLAGS.
--- a/gcc/Makefile.in 2011-11-09 02:20:14.000000000 +0100
+++ b/gcc/Makefile.in 2011-12-24 22:28:08.864804375 +0100
@@ -247,6 +247,14 @@ LINKER_FLAGS = $(CFLAGS)
endif
endif
+# We don't want to compile the compiler with -fPIE, it make PCH fail.
+enable_esp = @enable_esp@
+ifeq ($(enable_esp),yes)
+ESP_NOPIE_CFLAGS = -fno-PIE
+else
+ESP_NOPIE_CFLAGS=
+endif
+
# -------------------------------------------
# Programs which operate on the build machine
# -------------------------------------------
@@ -974,12 +982,13 @@ INTERNAL_CFLAGS = -DIN_GCC @CROSS@
# This is the variable actually used when we compile. If you change this,
# you probably want to update BUILD_CFLAGS in configure.ac
-ALL_CFLAGS = $(T_CFLAGS) $(CFLAGS-$@) \
+ALL_CFLAGS = $(ESP_NOPIE_CFLAGS) $(T_CFLAGS) $(CFLAGS-$@) \
$(CFLAGS) $(INTERNAL_CFLAGS) $(COVERAGE_FLAGS) $(WARN_CFLAGS) @DEFS@
# The C++ version.
-ALL_CXXFLAGS = $(T_CFLAGS) $(CFLAGS-$@) $(CXXFLAGS) $(INTERNAL_CFLAGS) \
- $(COVERAGE_FLAGS) $(NOEXCEPTION_FLAGS) $(WARN_CXXFLAGS) @DEFS@
+ALL_CXXFLAGS = $(ESP_NOPIE_CFLAGS) $(T_CFLAGS) $(CFLAGS-$@) $(CXXFLAGS) \
+ $(INTERNAL_CFLAGS) $(COVERAGE_FLAGS) $(NOEXCEPTION_FLAGS) \
+ $(WARN_CXXFLAGS) @DEFS@
# Likewise. Put INCLUDES at the beginning: this way, if some autoconf macro
# puts -I options in CPPFLAGS, our include files in the srcdir will always
@@ -1814,6 +1823,8 @@ libgcc.mvars: config.status Makefile spe
echo GCC_CFLAGS = '$(GCC_CFLAGS)' >> tmp-libgcc.mvars
echo INHIBIT_LIBC_CFLAGS = '$(INHIBIT_LIBC_CFLAGS)' >> tmp-libgcc.mvars
echo TARGET_SYSTEM_ROOT = '$(TARGET_SYSTEM_ROOT)' >> tmp-libgcc.mvars
+ echo enable_esp = '$(enable_esp)' >> tmp-libgcc.mvars
+ echo enable_crtbeginP = '@enable_crtbeginP@' >> tmp-libgcc.mvars
mv tmp-libgcc.mvars libgcc.mvars
--- a/libgcc/Makefile.in 2011-11-22 04:01:02.000000000 +0100
+++ b/libgcc/Makefile.in 2011-12-25 15:18:22.449610631 +0100
@@ -219,6 +219,17 @@ else
DECNUMINC =
endif
+ifeq ($(enable_esp),yes)
+ESP_NOPIE_CFLAGS = -fno-PIE
+else
+ESP_NOPIE_CFLAGS=
+endif
+
+# We add crtbeginP.o to the EXTRA_PARTS list if enable_crtbeginP = yes
+ifeq ($(enable_crtbeginP),yes)
+EXTRA_PARTS += crtbeginP.o
+endif
+
# Options to use when compiling libgcc2.a.
#
LIBGCC2_DEBUG_CFLAGS = -g
@@ -279,7 +290,7 @@ INTERNAL_CFLAGS = $(CFLAGS) $(LIBGCC2_CF
CRTSTUFF_CFLAGS = -O2 $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \
-finhibit-size-directive -fno-inline -fno-exceptions \
-fno-zero-initialized-in-bss -fno-toplevel-reorder -fno-tree-vectorize \
- -fno-stack-protector \
+ -fno-stack-protector $(ESP_NOPIE_CFLAGS) \
$(INHIBIT_LIBC_CFLAGS)
# Extra flags to use when compiling crt{begin,end}.o.
@@ -966,6 +977,13 @@ crtendS$(objext): $(srcdir)/crtstuff.c
# This is a version of crtbegin for -static links.
crtbeginT$(objext): $(srcdir)/crtstuff.c
$(crt_compile) $(CRTSTUFF_T_CFLAGS) -c $< -DCRT_BEGIN -DCRTSTUFFT_O
+
+# This is a version of crtbegin for -static -fPIE links.
+ifeq ($(enable_crtbeginP),yes)
+crtbeginP$(objext): $(srcdir)/crtstuff.c
+ $(crt_compile) $(CRTSTUFF_T_CFLAGS_S) \
+ -c $< -DCRT_BEGIN -DCRTSTUFFT_O -DCRTSTUFFS_O
+endif
ifeq ($(enable_vtable_verify),yes)
# These are used in vtable verification; see comments in source files for
-25
View File
@@ -1,25 +0,0 @@
2013-03-24 Magnus Granberg <zorry@gentoo.org>
* gcc/gcc.c include esp.h
static const char *cc1_spec We set that in esp.h if ENABLE_ESP.
--- ./gcc/gcc.c 2010-01-21 10:29:30.000000000 -0500
+++ ./gcc/gcc.c 2010-01-29 23:29:16.000000000 -0500
@@ -44,6 +44,7 @@
#include "opts.h"
#include "params.h"
#include "vec.h"
+#include "config/esp.h" /* for --enable-esp support */
#include "filenames.h"
/* By default there is no special suffix for target executables. */
@@ -822,7 +823,9 @@
static const char *asm_debug;
static const char *cpp_spec = CPP_SPEC;
+#ifndef ENABLE_ESP
static const char *cc1_spec = CC1_SPEC;
+#endif
static const char *cc1plus_spec = CC1PLUS_SPEC;
static const char *link_gcc_c_sequence_spec = LINK_GCC_C_SEQUENCE_SPEC;
static const char *link_ssp_spec = LINK_SSP_SPEC;
@@ -1,31 +0,0 @@
Enable -D_FORTIFY_SOURCE=2 by default.
Original patch from:
http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo/src/patchsets/gcc/4.9.2/gentoo/10_all_default-fortify-source.patch
--- a/gcc/c-family/c-cppbuiltin.c
+++ b/gcc/c-family/c-cppbuiltin.c
@@ -951,6 +951,9 @@ c_cpp_builtins (cpp_reader *pfile)
builtin_define_with_value ("__REGISTER_PREFIX__", REGISTER_PREFIX, 0);
builtin_define_with_value ("__USER_LABEL_PREFIX__", user_label_prefix, 0);
+ /* Fortify Source enabled by default w/optimization. */
+ cpp_define (pfile, "_FORTIFY_SOURCE=((defined __OPTIMIZE__ && __OPTIMIZE__ > 0) ? 2 : 0)");
+
/* Misc. */
if (flag_gnu89_inline)
cpp_define (pfile, "__GNUC_GNU_INLINE__");
--- a/gcc/doc/gcc.info
+++ b/gcc/doc/gcc.info
@@ -6255,6 +6255,11 @@ find out the exact set of optimizations that are enabled at each level.
Please note the warning under '-fgcse' about invoking '-O2' on
programs that use computed gotos.
+ NOTE: In Alpine Linux, `-D_FORTIFY_SOURCE=2' is set by default, and is
+ activated when `-Os' or `-O1' or higher is used. This enables additional
+ compile-time and run-time checks for several libc functions. To disable,
+ specify either `-U_FORTIFY_SOURCE' or `-D_FORTIFY_SOURCE=0'.
+
'-O3'
Optimize yet more. '-O3' turns on all optimizations specified by
'-O2' and also turns on the '-finline-functions',
@@ -1,24 +0,0 @@
Enable -Wtrampolines by default.
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -640,7 +640,7 @@ Common Var(warn_system_headers) Warning
Do not suppress warnings from system headers
Wtrampolines
-Common Var(warn_trampolines) Warning
+Common Var(warn_trampolines) Init(1) Warning
Warn whenever a trampoline is generated
Wtype-limits
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -4007,6 +4007,8 @@ headers---for that, @option{-Wunknown-pragmas} must also be used.
for most targets, it is made up of code and thus requires the stack
to be made executable in order for the program to work properly.
+ This warning is enabled by default in Gentoo.
+
@item -Wfloat-equal
@opindex Wfloat-equal
@opindex Wno-float-equal
@@ -1,17 +0,0 @@
libgfortran does not respect --disable-werror
https://bugs.gentoo.org/433435
http://gcc.gnu.org/PR54724
--- a/libgfortran/configure
+++ b/libgfortran/configure
@@ -5764,7 +5764,7 @@ fi
# Add -Wall -fno-repack-arrays -fno-underscoring if we are using GCC.
if test "x$GCC" = "xyes"; then
- AM_FCFLAGS="-I . -Wall -Werror -fimplicit-none -fno-repack-arrays -fno-underscoring"
+ AM_FCFLAGS="-I . -Wall -fimplicit-none -fno-repack-arrays -fno-underscoring"
## We like to use C99 routines when available. This makes sure that
## __STDC_VERSION__ is set such that libc includes make them available.
AM_CFLAGS="-std=gnu99 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wextra -Wwrite-strings"
@@ -1,16 +0,0 @@
2012-01-24 Magnus Granberg <zorry@gentoo.org>
* gcc/common.opt Add -nopie
--- a/gcc/common.opt 2011-11-23 19:51:17.000000000 +0100
+++ b//gcc/common.opt 2012-01-24 16:56:24.302224357 +0100
@@ -2280,6 +2280,9 @@ Driver
nodefaultlibs
Driver
+nopie
+Driver
+
nostartfiles
Driver
@@ -1,17 +0,0 @@
libgomp does not respect --disable-werror
https://bugs.gentoo.org/229059
http://gcc.gnu.org/PR38436
--- a/libgomp/configure
+++ b/libgomp/configure
@@ -4282,7 +4282,7 @@ save_CFLAGS="$CFLAGS"
# Add -Wall -Werror if we are using GCC.
if test "x$GCC" = "xyes"; then
- XCFLAGS="$XCFLAGS -Wall -Werror"
+ XCFLAGS="$XCFLAGS -Wall"
fi
# Find other programs we need.
@@ -1,40 +0,0 @@
2014-04-23 Magnus Granberg <zorry@gentoo.org>
* gcc/config/gnu-user.h If ENABLE_CRTBEGINP, -static and -pie use crtbegineP.o.
* gcc/config/rs6000/sysv4.h If ENABLE_CRTBEGINP, -static and -pie use crtbegineP.o.
--- a/gcc/config/gnu-user.h 2014-01-02 23:23:26.000000000 +0100
+++ b/gcc/config/gnu-user.h 2014-04-23 00:55:06.390265454 +0200
@@ -40,7 +40,15 @@ see the files COPYING3 and COPYING.RUNTI
provides part of the support for getting C++ file-scope static
object constructed before entering `main'. */
-#if defined HAVE_LD_PIE
+#if defined (HAVE_LD_PIE) && defined (ENABLE_CRTBEGINP)
+#define GNU_USER_TARGET_STARTFILE_SPEC \
+ "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
+ crti.o%s %{static:%{pie:crtbeginP.o%s;:crtbeginT.o%s}; \
+ shared|pie:crtbeginS.o%s;:crtbegin.o%s} \
+ %{fvtable-verify=none:%s; \
+ fvtable-verify=preinit:vtv_start_preinit.o%s; \
+ fvtable-verify=std:vtv_start.o%s}"
+#elif defined (HAVE_LD_PIE) && ! defined (ENABLE_CRTBEGINP)
#define GNU_USER_TARGET_STARTFILE_SPEC \
"%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s} \
--- a/gcc/config/rs6000/sysv4.h 2009-04-10 01:23:07.000000000 +0200
+++ b/gcc/config/rs6000/sysv4.h 2009-09-08 04:41:50.000000000 +0200
@@ -883,7 +883,12 @@
%{!mnewlib: %{pthread:-lpthread} %{shared:-lc} \
%{!shared: %{profile:-lc_p} %{!profile:-lc}}}"
-#ifdef HAVE_LD_PIE
+#if defined (HAVE_LD_PIE) && defined (ENABLE_CRTBEGINP)
+#define STARTFILE_LINUX_SPEC "\
+%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
+%{mnewlib:ecrti.o%s;:crti.o%s} \
+%{static:%{pie:crtbeginP.o%s;:crtbeginT.o%s}} %{!static:%{shared|pie:crtbeginS.o%s;:crtbegin.o%s}}"
+#elif defined (HAVE_LD_PIE) && ! defined (ENABLE_CRTBEGINP)
#define STARTFILE_LINUX_SPEC "\
%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
%{mnewlib:ecrti.o%s;:crti.o%s} \
@@ -1,44 +0,0 @@
2014-04-24 Magnus Granberg <zorry@gentoo.org>
* gcc/doc/invoke.texi Add NOTES about -fstack-protector-all, -pie and
-fPIE/-fpie when --enable-esp is enable, this options is on by default.
--- a/gcc/doc/invoke.texi 2009-04-01 09:18:47.000000000 +0200
+++ b/gcc/doc/invoke.texi 2009-06-18 14:08:38.000000000 +0200
@@ -9233,6 +9245,11 @@ If a guard check fails, an error message
@opindex fstack-protector-all
Like @option{-fstack-protector} except that all functions are protected.
+NOTE: NOTE: When --enable-esp this option is enabled by default
+for C, C++, ObjC, ObjC++, if neither @option{-fno-stack-protector},
+@option{-nostdlib}, @option{-ffreestanding}, @option{-fstack-protector},
+@option{-fstack-protector-strong}or @option{-fstack-protector-all}are found.
+
@item -fstack-protector-strong
@opindex fstack-protector-strong
Like @option{-fstack-protector} but includes additional functions to
@@ -7960,6 +7965,12 @@
that were used to generate code (@option{-fpie}, @option{-fPIE},
or model suboptions) when you specify this option.
+NOTE: When --enable-esp this option is enabled by default
+for C, C++, ObjC, ObjC++, if neither @option{-fno-pie} or @option{-fno-PIE}
+or @option{-fno-pic} or @option{-fno-PIC} or @option{-nostdlib} or
+@option{-nostartfiles} or @option{-shared} or @option{-pg} or @option{-p}
+are found.
+
@item -rdynamic
@opindex rdynamic
Pass the flag @option{-export-dynamic} to the ELF linker, on targets
@@ -15889,6 +15910,11 @@
@code{__pie__} and @code{__PIE__}. The macros have the value 1
for @option{-fpie} and 2 for @option{-fPIE}.
+NOTE: When --enable-esp this option is enabled by default
+for C, C++, ObjC, ObjC++, if neither @option{-fno-pie} or @option{-fno-PIE}
+or @option{-fno-pic} or @option{-fno-PIC} or @option{-nostdlib} or
+@option{-nostartfiles} or @option{-shared} are found.
+
@item -fno-jump-tables
@opindex fno-jump-tables
Do not use jump tables for switch statements even where it would be
@@ -1,56 +0,0 @@
2013-03-24 Magnus Granberg <zorry@gentoo.org>
* gcc/config/i386/gnu-user-common.h (DRIVER_SELF_SPECS): Add ESP_DRIVER_SELF_SPEC.
* gcc/config/i386/gnu-user.h (SUBTARGET_EXTRA_SPECS): Add ESP_EXTRA_SPECS.
* gcc/config/i386/i386.h (SUBTARGET_EXTRA_SPECS): Add ESP_EXTRA_SPECS.
--- a/gcc/config/i386/gnu-user-common.h 2013-01-10 21:38:27.000000000 +0100
+++ b/gcc/config/i386/gnu-user-common.h 2013-02-14 00:51:44.689637605 +0100
@@ -70,3 +70,7 @@ along with GCC; see the file COPYING3.
/* Static stack checking is supported by means of probes. */
#define STACK_CHECK_STATIC_BUILTIN 1
+
+#ifdef ENABLE_ESP
+#define DRIVER_SELF_SPECS ESP_DRIVER_SELF_SPEC
+#endif
--- a/gcc/config/i386/gnu-user.h 2011-05-05 14:32:50.000000000 +0200
+++ b/gcc/config/i386/gnu-user.h 2012-07-09 14:28:38.726289455 +0200
@@ -93,9 +93,16 @@ along with GCC; see the file COPYING3.
"--32 %{!mno-sse2avx:%{mavx:-msse2avx}} %{msse2avx:%{!mavx:-msse2avx}}"
#undef SUBTARGET_EXTRA_SPECS
+#ifdef ENABLE_ESP
#define SUBTARGET_EXTRA_SPECS \
{ "link_emulation", GNU_USER_LINK_EMULATION },\
- { "dynamic_linker", GNU_USER_DYNAMIC_LINKER }
+ { "dynamic_linker", GNU_USER_DYNAMIC_LINKER }, \
+ ESP_EXTRA_SPECS
+#else
+#define SUBTARGET_EXTRA_SPECS \
+ { "link_emulation", GNU_USER_LINK_EMULATION },\
+ { "dynamic_linker", GNU_USER_DYNAMIC_LINKER }
+#endif
#undef LINK_SPEC
#define LINK_SPEC "-m %(link_emulation) %{shared:-shared} \
--- a/gcc/config/i386/i386.h 2011-11-24 23:11:12.000000000 +0100
+++ b/gcc/config/i386/i386.h 2012-07-09 14:21:24.575276517 +0200
@@ -617,13 +617,16 @@ enum target_cpu_default
Do not define this macro if it does not need to do anything. */
#ifndef SUBTARGET_EXTRA_SPECS
+#ifdef ENABLE_ESP
+#define SUBTARGET_EXTRA_SPECS ESP_EXTRA_SPECS
+#else
#define SUBTARGET_EXTRA_SPECS
#endif
+#endif
#define EXTRA_SPECS \
{ "cc1_cpu", CC1_CPU_SPEC }, \
SUBTARGET_EXTRA_SPECS
-
/* Set the value of FLT_EVAL_METHOD in float.h. When using only the
FPU, assume that the fpcw is set to extended precision; when using
@@ -1,35 +0,0 @@
2013-06-03 Magnus Granberg <zorry@gentoo.org>
* gcc/config/arm/arm.h (DRIVER_SELF_SPECS): Add ESP_DRIVER_SELF_SPEC.
* gcc/config/arm/elf.h (SUBSUBTARGET_EXTRA_SPECS): Add ESP_EXTRA_SPECS.
--- a/gcc/config/arm/arm.h 2013-01-15 17:17:28.000000000 +0100
+++ b/gcc/config/arm/arm.h 2013-02-18 22:45:18.327284928 +0100
@@ -2326,6 +2326,11 @@ extern const char *host_detect_local_cpu
# define MCPU_MTUNE_NATIVE_SPECS ""
#endif
-#define DRIVER_SELF_SPECS MCPU_MTUNE_NATIVE_SPECS
-
+#ifdef ENABLE_ESP
+# define DRIVER_SELF_SPECS \
+ MCPU_MTUNE_NATIVE_SPECS, \
+ ESP_DRIVER_SELF_SPEC
+#else
+# define DRIVER_SELF_SPECS MCPU_MTUNE_NATIVE_SPECS
+#endif
#endif /* ! GCC_ARM_H */
--- a/gcc/config/arm/elf.h 2013-01-10 21:38:27.000000000 +0100
+++ b/gcc/config/arm/elf.h 2013-05-19 02:15:49.595855825 +0200
@@ -49,7 +49,11 @@
#endif
#undef SUBSUBTARGET_EXTRA_SPECS
+#ifdef ENABLE_ESP
+#define SUBSUBTARGET_EXTRA_SPECS ESP_EXTRA_SPECS
+#else
#define SUBSUBTARGET_EXTRA_SPECS
+#endif
#ifndef ASM_SPEC
#define ASM_SPEC "\
@@ -1,135 +0,0 @@
2014-05-12 Magnus Granberg <zorry@gentoo.org>
* gcc/esp.h New file to support --enable-esp
Version 20140512.1
--- a/gcc/config/esp.h 2010-04-09 16:14:00.000000000 +0200
+++ b/gcc/config/esp.h 2012-06-23 01:00:31.248348491 +0200
@@ -0,0 +1,127 @@
+/* License terms see GNU GENERAL PUBLIC LICENSE Version 3.
+ * Version 20140512.1
+ * Magnus Granberg (Zorry) <zorry@gentoo.org> */
+#ifndef GCC_ESP_H
+#define GCC_ESP_H
+
+/* This file will add -fstack-protector-all, -fstack-check, -fPIE, -pie and -z now
+ as default if the defines and the spec allow it.
+ Added a hack for gcc-specs-* in toolchain-funcs.eclass and _filter-hardened in flag-o-matic.eclass
+ to support older hardened GCC patches and we don't need to change the code on gcc-specs-* and _filter-hardened.
+ This will add some unsupported upstream commands options as -nopie and -nonow.
+ -D__KERNEL__ is added so we don't have -fPIE, -pie and -fstack-protector-all and -fstack-check when building kernels.
+ ESP_CC1_SPEC is added to CC1_SPEC.
+ ESP_CC1_STRICT_OVERFLOW_SPEC is added so we don't disable the strict-overflow check.
+ ESP_LINK_PIE_CHECK_SPEC check for -pie, -p, -pg, -profile and -static.
+ ENABLE_CRTBEGINP add support for crtbeginP.o, build -static with -fPIE or -fpie.
+*/
+#ifdef ENABLE_ESP
+
+ /* Hack to support gcc-specs-* in toolchain-funcs.eclass and _filter-hardened in flag-o-matic.eclass */
+ #define ESP_CC1_SPEC " %(esp_cc1_ssp) %(esp_cc1_pie) %(esp_cc1_strict_overflow)"
+ #if defined ( EFAULT_SSP ) || defined ( EFAULT_PIE_SSP )
+ #define ESP_CC1_SSP_SPEC "%{!fno-stack-protector: %{!fno-stack-protector-all: %{!fno-stack-check: }}}"
+ #else
+ #define ESP_CC1_SSP_SPEC ""
+ #endif
+ #if defined ( EFAULT_PIE ) || defined ( EFAULT_PIE_SSP )
+ #define ESP_CC1_PIE_SPEC "%{!nopie: }"
+ #else
+ #define ESP_CC1_PIE_SPEC ""
+ #endif
+ #define ESP_CC1_STRICT_OVERFLOW_SPEC "%{!fstrict-overflow:%{!fno-strict-overflow: -fno-strict-overflow}}"
+
+ /* ESP_LINK_SPEC is added to LINK_PIE_SPEC if esp is enable
+ -z now will be added if we don't have -vanilla spec. We do a -pie incompatible check
+ Don't remove the specs in the end */
+ #define ESP_LINK_SPEC "%(esp_link_now) %(esp_link_pie_check) "
+ #define ESP_LINK_NOW_SPEC "%{!nonow:-z now}"
+
+ /* We use ESP_DRIVER_SELF_SPEC to add pie and ssp command-line options. */
+ #define ESP_DRIVER_SELF_SPEC "%{D__KERNEL__:;:%{!nopie:%(esp_options_pie) \
+ %(esp_link_pie)} %(esp_options_ssp) }"
+
+ /* This will add -fstack-protector-all if we don't have -nostdlib -nodefaultlibs -fno-stack-protector -fstack-protector
+ -fstack-protector-all and we have EFAULT_SSP or EFAULT_PIE_SSP defined. */
+ #if defined ( EFAULT_SSP ) || defined ( EFAULT_PIE_SSP )
+ #define ESP_OPTIONS_SSP_SPEC \
+ "%{nostdlib|ffreestanding|fno-stack-protector|fstack-protector| \
+ fstack-protector-all|fstack-protector-strong:;:-fstack-protector-all} \
+ %{fstack-check|fstack-check=*:;: -fstack-check}"
+ #else
+ #define ESP_OPTIONS_SSP_SPEC ""
+ #endif
+
+ /* If EFAULT_PIE or EFAULT_PIE_SSP is defined we will add -fPIE -pie */
+ #if defined ( EFAULT_PIE ) || defined ( EFAULT_PIE_SSP )
+
+ /* This will add -fPIE if we don't have -pie -fpic -fPIC -fpie -fPIE -fno-pic -fno-PIC -fno-pie -fno-PIE -shared -static
+ -nostdlib -nostartfiles. */
+ /* With ENABLE_CRTBEGINP we don't need to check for -static */
+ #ifdef ENABLE_CRTBEGINP
+ #define ESP_OPTIONS_PIE_SPEC \
+ "%{!pie: %{!fpic:%{!fPIC:%{!fpie:%{!fPIE: %{!fno-pic:%{!fno-PIC:%{!fno-pie:%{!fno-PIE: \
+ %{!shared: %{!nostdlib: %{!nostartfiles:-fPIE}} } }}}} }}}} }"
+ #else
+ #define ESP_OPTIONS_PIE_SPEC \
+ "%{!pie: %{!fpic:%{!fPIC:%{!fpie:%{!fPIE: %{!fno-pic:%{!fno-PIC:%{!fno-pie:%{!fno-PIE: \
+ %{!shared: %{!static: %{!nostdlib: %{!nostartfiles:-fPIE}} } }}}} }}}} }}"
+ #endif
+
+ /* This will add -pie if we don't have -pie -A -fno-pic -fno-PIC -fno-pie -fno-PIE -shared -static -r -nostdlib
+ -nostartfiles */
+ /* With ENABLE_CRTBEGINP we don't need to check for -static
+ and we add -pie only to get the start and endfiles. -pie will not go to the linker. */
+ #ifdef ENABLE_CRTBEGINP
+ #define ESP_LINK_PIE_SPEC \
+ "%{!pie:%{!A:%{!fno-pie:%{!fno-PIE:%{!fno-pic:%{!fno-PIC:%{!shared:%{!r: \
+ %{!nostdlib:%{!nostartfiles:-pie}}}}}}}}}}"
+ #else
+ #define ESP_LINK_PIE_SPEC \
+ "%{!pie:%{!A:%{!fno-pie:%{!fno-PIE:%{!fno-pic:%{!fno-PIC:%{!shared:%{!static:%{!r: \
+ %{!nostdlib:%{!nostartfiles:-pie}}}}}}}}}}}"
+ #endif
+
+ /* This will check if -pie is set when (-static) -pg -p -profile. If set it will make gcc print out
+ "-pie and (static)|pg|p|profile are incompatible when linking" */
+ /* With ENABLE_CRTBEGINP we don't need to check for -static */
+ #ifdef ENABLE_CRTBEGINP
+ #define ESP_LINK_PIE_CHECK_SPEC \
+ "%{pie:%{pg|p|profile:%e-pie and -pg|p|profile are incompatible when linking}}"
+ #else
+ #define ESP_LINK_PIE_CHECK_SPEC \
+ "%{pie:%{static|pg|p|profile:%e-pie and -static|pg|p|profile are incompatible when linking}}"
+ #endif
+
+ /* We don't pass -pie to the linker when -static. */
+ #ifdef ENABLE_CRTBEGINP
+ #define LINK_PIE_SPEC "%{!static:%{pie:-pie}} %(esp_link)"
+ #else
+ #define LINK_PIE_SPEC "%{pie:-pie} %(esp_link)"
+ #endif
+
+ #else
+ #define ESP_OPTIONS_PIE_SPEC ""
+ #define ESP_LINK_PIE_CHECK_SPEC ""
+ #define ESP_LINK_PIE_SPEC ""
+ #define LINK_PIE_SPEC "%{pie:-pie} %(esp_link)"
+ #endif
+
+ /* We add extra spec name's to the EXTRA_SPECS list */
+ #define ESP_EXTRA_SPECS \
+ { "esp_cc1", ESP_CC1_SPEC }, \
+ { "esp_cc1_pie", ESP_CC1_PIE_SPEC }, \
+ { "esp_cc1_ssp", ESP_CC1_SSP_SPEC }, \
+ { "esp_cc1_strict_overflow", ESP_CC1_STRICT_OVERFLOW_SPEC }, \
+ { "esp_link", ESP_LINK_SPEC }, \
+ { "esp_link_now", ESP_LINK_NOW_SPEC }, \
+ { "esp_link_pie", ESP_LINK_PIE_SPEC }, \
+ { "esp_link_pie_check", ESP_LINK_PIE_CHECK_SPEC }, \
+ { "esp_driver_self", ESP_DRIVER_SELF_SPEC }, \
+ { "esp_options_pie", ESP_OPTIONS_PIE_SPEC }, \
+ { "esp_options_ssp", ESP_OPTIONS_SSP_SPEC }
+
+ static const char *cc1_spec = CC1_SPEC ESP_CC1_SPEC;
+
+#endif
+#endif /* End GCC_ESP_H */
@@ -1,67 +0,0 @@
Apply Alpine Linux specific differences to Gentoo ESP configuration:
- default PIE and SSP by default without additional CFLAGS (to clean up APKBUILD)
- do not enable -fstack-check by default (caused failures in programs that setup
small stack in musl)
- enable -z relro by default
- enable -fstack-protector-strong instead of -fstack-protector-all by default
--- gcc-4.9.2/gcc/config/esp.h 2014-12-10 15:54:19.925060848 +0000
+++ gcc-4.9.2/gcc/config/esp.h 2014-12-10 15:59:16.793850060 +0000
@@ -4,7 +4,7 @@
#ifndef GCC_ESP_H
#define GCC_ESP_H
-/* This file will add -fstack-protector-all, -fstack-check, -fPIE, -pie and -z now
+/* This file will add -fstack-protector-strong, -fPIE, -pie, -z relro and -z now
as default if the defines and the spec allow it.
Added a hack for gcc-specs-* in toolchain-funcs.eclass and _filter-hardened in flag-o-matic.eclass
to support older hardened GCC patches and we don't need to change the code on gcc-specs-* and _filter-hardened.
@@ -16,11 +16,14 @@
ENABLE_CRTBEGINP add support for crtbeginP.o, build -static with -fPIE or -fpie.
*/
#ifdef ENABLE_ESP
+
+ /* Enable by default on Alpine */
+ #define EFAULT_PIE_SSP
/* Hack to support gcc-specs-* in toolchain-funcs.eclass and _filter-hardened in flag-o-matic.eclass */
#define ESP_CC1_SPEC " %(esp_cc1_ssp) %(esp_cc1_pie) %(esp_cc1_strict_overflow)"
#if defined ( EFAULT_SSP ) || defined ( EFAULT_PIE_SSP )
- #define ESP_CC1_SSP_SPEC "%{!fno-stack-protector: %{!fno-stack-protector-all: %{!fno-stack-check: }}}"
+ #define ESP_CC1_SSP_SPEC "%{!fno-stack-protector: %{!fno-stack-protector-all: }}"
#else
#define ESP_CC1_SSP_SPEC ""
#endif
@@ -34,20 +37,20 @@
/* ESP_LINK_SPEC is added to LINK_PIE_SPEC if esp is enable
-z now will be added if we don't have -vanilla spec. We do a -pie incompatible check
Don't remove the specs in the end */
- #define ESP_LINK_SPEC "%(esp_link_now) %(esp_link_pie_check) "
+ #define ESP_LINK_SPEC "%(esp_link_now) %(esp_link_relro) %(esp_link_pie_check) "
#define ESP_LINK_NOW_SPEC "%{!nonow:-z now}"
+ #define ESP_LINK_RELRO_SPEC "%{!norelro:-z relro}"
/* We use ESP_DRIVER_SELF_SPEC to add pie and ssp command-line options. */
#define ESP_DRIVER_SELF_SPEC "%{D__KERNEL__:;:%{!nopie:%(esp_options_pie) \
%(esp_link_pie)} %(esp_options_ssp) }"
- /* This will add -fstack-protector-all if we don't have -nostdlib -nodefaultlibs -fno-stack-protector -fstack-protector
+ /* This will add -fstack-protector-strong if we don't have -nostdlib -nodefaultlibs -fno-stack-protector -fstack-protector
-fstack-protector-all and we have EFAULT_SSP or EFAULT_PIE_SSP defined. */
#if defined ( EFAULT_SSP ) || defined ( EFAULT_PIE_SSP )
#define ESP_OPTIONS_SSP_SPEC \
"%{nostdlib|ffreestanding|fno-stack-protector|fstack-protector| \
- fstack-protector-all|fstack-protector-strong:;:-fstack-protector-all} \
- %{fstack-check|fstack-check=*:;: -fstack-check}"
+ fstack-protector-all|fstack-protector-strong:;:-fstack-protector-strong}"
#else
#define ESP_OPTIONS_SSP_SPEC ""
#endif
@@ -115,6 +118,7 @@
{ "esp_cc1_strict_overflow", ESP_CC1_STRICT_OVERFLOW_SPEC }, \
{ "esp_link", ESP_LINK_SPEC }, \
{ "esp_link_now", ESP_LINK_NOW_SPEC }, \
+ { "esp_link_relro", ESP_LINK_RELRO_SPEC }, \
{ "esp_link_pie", ESP_LINK_PIE_SPEC }, \
{ "esp_link_pie_check", ESP_LINK_PIE_CHECK_SPEC }, \
{ "esp_driver_self", ESP_DRIVER_SELF_SPEC }, \
@@ -1,28 +0,0 @@
libitm checks for AVX support in the assembler and adds -mavx to x86_avx.cc
which defines the needed typedefs. User CFLAGS can override -mavx however,
so also use the fallback typedef if __AVX__ isn't defined.
https://bugs.gentoo.org/417271
http://gcc.gnu.org/PR53113
--- a/libitm/config/x86/x86_avx.cc
+++ b/libitm/config/x86/x86_avx.cc
@@ -29,7 +29,7 @@
extern "C" {
-#ifndef HAVE_AS_AVX
+#if !defined (HAVE_AS_AVX) || !defined(__AVX__)
// If we don't have an AVX capable assembler, we didn't set -mavx on the
// command-line either, which means that libitm.h defined neither this type
// nor the functions in this file. Define the type and unconditionally
@@ -40,7 +40,7 @@ typedef float _ITM_TYPE_M256 __attribute__((vector_size(32), may_alias));
// Re-define the memcpy implementations so that we can frob the
// interface to deal with possibly missing AVX instruction set support.
-#ifdef HAVE_AS_AVX
+#if defined(HAVE_AS_AVX) && defined(__AVX__)
#define RETURN(X) return X
#define STORE(X,Y) X = Y
#define OUTPUT(T) _ITM_TYPE_##T
@@ -1,18 +0,0 @@
2008-07-25 Magnus Granberg <zorry@ume.nu>
* include/libiberty.h (asprintf): Don't declare if defined as a macro
--- a/include/libiberty.h
+++ b/include/libiberty.h
@@ -609,8 +609,11 @@ extern int pwait (int, int *, int);
/* Like sprintf but provides a pointer to malloc'd storage, which must
be freed by the caller. */
+/* asprintf may be declared as a macro by glibc with __USE_FORTIFY_LEVEL. */
+#ifndef asprintf
extern int asprintf (char **, const char *, ...) ATTRIBUTE_PRINTF_2;
#endif
+#endif
#if !HAVE_DECL_VASPRINTF
/* Like vsprintf but provides a pointer to malloc'd storage, which
@@ -1,10 +0,0 @@
--- a/libiberty/Makefile.in
+++ b/libiberty/Makefile.in
@@ -246,6 +246,7 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS)
$(AR) $(AR_FLAGS) $(TARGETLIB) \
$(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \
$(RANLIB) $(TARGETLIB); \
+ cp $(TARGETLIB) ../ ; \
cd ..; \
else true; fi
@@ -1,190 +0,0 @@
From 160397ef3c3331099af028f1b8d3e085b07d88ad Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 29 Mar 2013 08:59:00 +0400
Subject: [PATCH 16/35] gcc: poison-system-directories
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Upstream-Status: Inappropriate [distribution: codesourcery]
---
gcc/Makefile.in | 2 +-
gcc/common.opt | 4 ++++
gcc/config.in | 6 ++++++
gcc/configure | 20 ++++++++++++++++++--
gcc/configure.ac | 10 ++++++++++
gcc/doc/invoke.texi | 9 +++++++++
gcc/gcc.c | 2 ++
gcc/incpath.c | 19 +++++++++++++++++++
8 files changed, 69 insertions(+), 3 deletions(-)
Index: gcc-4.9-20140316/gcc/common.opt
===================================================================
--- gcc-4.9-20140316.orig/gcc/common.opt
+++ gcc-4.9-20140316/gcc/common.opt
@@ -603,6 +603,10 @@ Wpedantic
Common Var(pedantic) Warning
Issue warnings needed for strict compliance to the standard
+Wpoison-system-directories
+Common Var(flag_poison_system_directories) Init(1) Warning
+Warn for -I and -L options using system directories if cross compiling
+
Wshadow
Common Var(warn_shadow) Warning
Warn when one local variable shadows another
Index: gcc-4.9-20140316/gcc/config.in
===================================================================
--- gcc-4.9-20140316.orig/gcc/config.in
+++ gcc-4.9-20140316/gcc/config.in
@@ -138,6 +138,12 @@
#endif
+/* Define to warn for use of native system header directories */
+#ifndef USED_FOR_TARGET
+#undef ENABLE_POISON_SYSTEM_DIRECTORIES
+#endif
+
+
/* Define if you want all operations on RTL (the basic data structure of the
optimizer and back end) to be checked for dynamic type safety at runtime.
This is quite expensive. */
Index: gcc-4.9-20140316/gcc/configure
===================================================================
--- gcc-4.9-20140316.orig/gcc/configure
+++ gcc-4.9-20140316/gcc/configure
@@ -928,6 +928,7 @@ with_system_zlib
enable_maintainer_mode
enable_link_mutex
enable_version_specific_runtime_libs
+enable_poison_system_directories
enable_plugin
enable_host_shared
enable_libquadmath_support
@@ -1648,6 +1649,8 @@ Optional Features:
--enable-version-specific-runtime-libs
specify that runtime libraries should be installed
in a compiler-specific directory
+ --enable-poison-system-directories
+ warn for use of native system header directories
--enable-plugin enable plugin support
--enable-host-shared build host code as shared libraries
--disable-libquadmath-support
@@ -27702,6 +27705,19 @@ if test "${enable_version_specific_runti
fi
+# Check whether --enable-poison-system-directories was given.
+if test "${enable_poison_system_directories+set}" = set; then :
+ enableval=$enable_poison_system_directories;
+else
+ enable_poison_system_directories=no
+fi
+
+if test "x${enable_poison_system_directories}" = "xyes"; then
+
+$as_echo "#define ENABLE_POISON_SYSTEM_DIRECTORIES 1" >>confdefs.h
+
+fi
+
# Substitute configuration variables
Index: gcc-4.9-20140316/gcc/configure.ac
===================================================================
--- gcc-4.9-20140316.orig/gcc/configure.ac
+++ gcc-4.9-20140316/gcc/configure.ac
@@ -5366,6 +5366,16 @@ AC_ARG_ENABLE(version-specific-runtime-l
[specify that runtime libraries should be
installed in a compiler-specific directory])])
+AC_ARG_ENABLE([poison-system-directories],
+ AS_HELP_STRING([--enable-poison-system-directories],
+ [warn for use of native system header directories]),,
+ [enable_poison_system_directories=no])
+if test "x${enable_poison_system_directories}" = "xyes"; then
+ AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES],
+ [1],
+ [Define to warn for use of native system header directories])
+fi
+
# Substitute configuration variables
AC_SUBST(subdirs)
AC_SUBST(srcdir)
Index: gcc-4.9-20140316/gcc/doc/invoke.texi
===================================================================
--- gcc-4.9-20140316.orig/gcc/doc/invoke.texi
+++ gcc-4.9-20140316/gcc/doc/invoke.texi
@@ -260,6 +260,7 @@ Objective-C and Objective-C++ Dialects}.
-Woverlength-strings -Wpacked -Wpacked-bitfield-compat -Wpadded @gol
-Wparentheses -Wpedantic-ms-format -Wno-pedantic-ms-format @gol
-Wpointer-arith -Wno-pointer-to-int-cast @gol
+-Wno-poison-system-directories @gol
-Wredundant-decls -Wno-return-local-addr @gol
-Wreturn-type -Wsequence-point -Wshadow @gol
-Wsign-compare -Wsign-conversion -Wfloat-conversion @gol
@@ -4230,6 +4231,14 @@ headers---for that, @option{-Wunknown-pr
for most targets, it is made up of code and thus requires the stack
to be made executable in order for the program to work properly.
+@item -Wno-poison-system-directories
+@opindex Wno-poison-system-directories
+Do not warn for @option{-I} or @option{-L} options using system
+directories such as @file{/usr/include} when cross compiling. This
+option is intended for use in chroot environments when such
+directories contain the correct headers and libraries for the target
+system rather than the host.
+
@item -Wfloat-equal
@opindex Wfloat-equal
@opindex Wno-float-equal
Index: gcc-4.9-20140316/gcc/gcc.c
===================================================================
--- gcc-4.9-20140316.orig/gcc/gcc.c
+++ gcc-4.9-20140316/gcc/gcc.c
@@ -764,6 +764,8 @@ proper position among the other output f
"%{fuse-ld=*:-fuse-ld=%*}\
%X %{o*} %{e*} %{N} %{n} %{r}\
%{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!nostartfiles:%S}} " VTABLE_VERIFICATION_SPEC " \
+ %{Wno-poison-system-directories:--no-poison-system-directories}\
+ %{Werror=poison-system-directories:--error-poison-system-directories}\
%{static:} %{L*} %(mfwrap) %(link_libgcc) " SANITIZER_EARLY_SPEC " %o\
%{fopenmp|ftree-parallelize-loops=*:%:include(libgomp.spec)%(link_gomp)}\
%{fgnu-tm:%:include(libitm.spec)%(link_itm)}\
Index: gcc-4.9-20140316/gcc/incpath.c
===================================================================
--- gcc-4.9-20140316.orig/gcc/incpath.c
+++ gcc-4.9-20140316/gcc/incpath.c
@@ -28,6 +28,7 @@
#include "intl.h"
#include "incpath.h"
#include "cppdefault.h"
+#include "diagnostic-core.h"
/* Microsoft Windows does not natively support inodes.
VMS has non-numeric inodes. */
@@ -382,6 +383,24 @@ merge_include_chains (const char *sysroo
}
fprintf (stderr, _("End of search list.\n"));
}
+
+#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES
+ if (flag_poison_system_directories)
+ {
+ struct cpp_dir *p;
+
+ for (p = heads[QUOTE]; p; p = p->next)
+ {
+ if ((!strncmp (p->name, "/usr/include", 12))
+ || (!strncmp (p->name, "/usr/local/include", 18))
+ || (!strncmp (p->name, "/usr/X11R6/include", 18)))
+ warning (OPT_Wpoison_system_directories,
+ "include location \"%s\" is unsafe for "
+ "cross-compilation",
+ p->name);
+ }
+ }
+#endif
}
/* Use given -I paths for #include "..." but not #include <...>, and
-483
View File
@@ -1,483 +0,0 @@
# Automatically generated aport, do not edit!
# Generator: pmbootstrap aportgen gcc4-armhf
# Based on: main/gcc4 (from postmarketOS)
CTARGET_ARCH=armhf
CTARGET="$(arch_to_hostspec ${CTARGET_ARCH})"
LANG_OBJC=false
LANG_JAVA=false
LANG_GO=false
LANG_FORTRAN=false
LANG_ADA=false
options="!strip !tracedeps"
# abuild doesn't try to tries to install "build-base-$CTARGET_ARCH"
# when this variable matches "no*"
BOOTSTRAP="nobuildbase"
# abuild will only cross compile when this variable is set, but it
# needs to find a valid package database in there for dependency
# resolving, so we set it to /.
CBUILDROOT="/"
_cross_configure="--disable-bootstrap --with-sysroot=/usr/$CTARGET"
pkgname="gcc4-armhf"
pkgver=9999
_pkgver=4.9.2
pkgrel=2
pkgdesc="Stage2 cross-compiler for armhf"
url="http://gcc.gnu.org"
arch="x86_64"
license="GPL LGPL"
_gccrel=$_pkgver-r$pkgrel
depends="isl binutils-armhf mpc1"
makedepends_build="gcc g++ paxmark bison flex texinfo gawk zip gmp-dev mpfr-dev mpc1-dev zlib-dev"
makedepends_host="linux-headers gmp-dev mpfr-dev mpc1-dev isl-dev zlib-dev musl-dev-armhf binutils-armhf"
subpackages=""
options="!strip !tracedeps"
# We only care about C, so we can compile old Linux kernels
LANG_CXX=false
LANG_OBJC=false
LANG_JAVA=false
LANG_GO=false
LANG_FORTRAN=false
LANG_ADA=false
LIBGOMP="false"
LIBGCC="false"
LIBATOMIC="false"
LIBITM="false"
if [ "$CHOST" != "$CTARGET" ]; then
if [ "$BOOTSTRAP" = nolibc ]; then
LANG_CXX=false
LANG_ADA=false
LIBGCC=false
_builddir="$srcdir/build-cross-pass2"
else
_builddir="$srcdir/build-cross-final"
fi
LANG_OBJC=false
LANG_JAVA=false
LANG_GO=false
LANG_FORTRAN=false
LIBGOMP=false
LIBATOMIC=false
LIBITM=false
# reset target flags (should be set in crosscreate abuild)
# fixup flags. seems gcc treats CPPFLAGS as global without
# _FOR_xxx variants. wrap it in CFLAGS and CXXFLAGS.
export CFLAGS="$CPPFLAGS $CFLAGS"
export CXXFLAGS="$CPPFLAGS $CXXFLAGS"
unset CPPFLAGS
export CFLAGS_FOR_TARGET=" "
export CXXFLAGS_FOR_TARGET=" "
export LDFLAGS_FOR_TARGET=" "
STRIP_FOR_TARGET="$CTARGET-strip"
elif [ "$CBUILD" != "$CHOST" ]; then
# fixup flags. seems gcc treats CPPFLAGS as global without
# _FOR_xxx variants. wrap it in CFLAGS and CXXFLAGS.
export CFLAGS="$CPPFLAGS $CFLAGS"
export CXXFLAGS="$CPPFLAGS $CXXFLAGS"
unset CPPFLAGS
# reset flags and cc for build
export CC_FOR_BUILD="gcc"
export CXX_FOR_BUILD="g++"
export CFLAGS_FOR_BUILD=" "
export CXXFLAGS_FOR_BUILD=" "
export LDFLAGS_FOR_BUILD=" "
export CFLAGS_FOR_TARGET=" "
export CXXFLAGS_FOR_TARGET=" "
export LDFLAGS_FOR_TARGET=" "
# Languages that do not need bootstrapping
LANG_OBJC=false
LANG_JAVA=false
LANG_GO=false
LANG_FORTRAN=false
STRIP_FOR_TARGET=${CROSS_COMPILE}strip
_builddir="$srcdir/build-cross-native"
else
STRIP_FOR_TARGET=${CROSS_COMPILE}strip
_builddir="$srcdir/build"
fi
# Go needs {set,make,swap}context, unimplemented in musl
[ "$CTARGET_LIBC" = musl ] && LANG_GO=false
# libitm has TEXTRELs in ARM build, so disable for now
case "$CTARGET_ARCH" in
arm*) LIBITM=false ;;
mips*) LIBITM=false ;;
esac
# Fortran uses libquadmath if toolchain has __float128
# currently on x86, x86_64 and ia64
LIBQUADMATH=$LANG_FORTRAN
case "$CTARGET_ARCH" in
x86 | x86_64) LIBQUADMATH=$LANG_FORTRAN ;;
*) LIBQUADMATH=false ;;
esac
# libatomic is a dependency for openvswitch
$LIBATOMIC && subpackages="$subpackages libatomic::$CTARGET_ARCH"
$LIBGCC && subpackages="$subpackages libgcc::$CTARGET_ARCH"
$LIBQUADMATH && subpackages="$subpackages libquadmath::$CTARGET_ARCH"
if $LIBGOMP; then
depends="$depends libgomp=$_gccrel"
subpackages="$subpackages libgomp::$CTARGET_ARCH"
fi
_languages=c
if $LANG_CXX; then
_languages="$_languages,c++"
fi
if $LANG_OBJC; then
subpackages="$subpackages libobjc::$CTARGET_ARCH gcc-objc$_target:objc"
_languages="$_languages,objc"
fi
if $LANG_JAVA; then
subpackages="$subpackages libgcj::$CTARGET_ARCH gcc-java$_target:java"
_languages="$_languages,java"
fi
if $LANG_GO; then
subpackages="$subpackages libgo::$CTARGET_ARCH gcc-go$_target:go"
_languages="$_languages,go"
fi
if $LANG_FORTRAN; then
subpackages="$subpackages libgfortran::$CTARGET_ARCH gfortran$_target:gfortran"
_languages="$_languages,fortran"
fi
if $LANG_ADA; then
subpackages="$subpackages libgnat::$CTARGET_ARCH gcc-gnat$_target:gnat"
_languages="$_languages,ada"
makedepends_build="$makedepends_build gcc-gnat gcc-gnat$_cross"
fi
makedepends="$makedepends_build $makedepends_host"
source="http://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$_pkgver}/gcc-${_pkgbase:-$_pkgver}.tar.gz
http://sourceware.org/pub/java/ecj-4.9.jar
01_all_gcc49_configure.patch
02_all_gcc48_config.in.patch
03_all_gcc49_Makefile.in.patch
05_all_gcc48_gcc.c.patch
16_all_gcc47_nopie_option.patch
20_all_gcc49_config_crtbeginp.patch
24_all_gcc49_invoke.texi.patch
34_all_gcc48_config_i386.patch
35_all_gcc48_config_arm.patch
40_all_gcc49_config_esp.patch
41_all_gcc49_config_esp_alpine.patch
10_all_default-fortify-source.patch
12_all_default-warn-trampolines.patch
15_all_libgfortran-Werror.patch
16_all_libgomp-Werror.patch
48_all_x86_pr53113_libitm-avx.patch
50_all_libiberty-asprintf.patch
51_all_libiberty-pic.patch
67_all_gcc-poison-system-directories.patch
gcc49-cloog-dl.patch
gcc-ice-hack.patch
gcc-spec-env.patch
libgcc-always-build-gcceh.a.patch
gcc-4.6-pr32219.patch
gcc-4.9-musl.patch
gcc-4.8-musl-fix-iteratephdr.patch
gcc-4.8-musl-libssp.patch
gcc-4.9-musl-fortify.patch
boehm-gc-uclibc.patch
boehm-gc-musl.patch
gcc-pure64.patch
fix-gcj-musl.patch
fix-gcj-iconv-musl.patch
musl-posix_memalign-c++.patch
pr63740.patch
pr64037.patch
gcc-4.8-build-args.patch
fix-cxxflags-passing.patch
fix-cxxflags-for-target.patch
ada-no-pie.patch
ada-fixes.patch
ada-shared.patch
ada-musl.patch
vanilla.specs
hardenednossp.specs
hardenednopie.specs
hardenednopiessp.specs
"
# we build out-of-tree
_gccdir="$srcdir"/gcc-${_pkgbase:-$_pkgver}
_gcclibdir=/usr/lib/gcc/${CTARGET}/$_pkgver
_gcclibexec=/usr/libexec/gcc/${CTARGET}/$_pkgver
prepare() {
cd "$_gccdir"
_err=
for i in $source; do
case "$i" in
*.patch)
msg "Applying $i"
patch -p1 -F3 -i "$srcdir"/$i || _err="$_err $i"
;;
esac
done
if [ -n "$_err" ]; then
error "The following patches failed:"
for i in $_err; do
echo " $i"
done
return 1
fi
# see http://gcc.gnu.org/ml/java/2008-04/msg00027.html
mv "$srcdir"/ecj-*.jar ecj.jar
echo ${_pkgver} > gcc/BASE-VER
}
build() {
local _arch_configure=
local _libc_configure=
local _bootstrap_configure=
local _symvers=
cd "$_gccdir"
case "$CTARGET" in
aarch64-*-*-*) _arch_configure="--with-arch=armv8-a --with-abi=lp64";;
armv5-*-*-*eabi) _arch_configure="--with-arch=armv5te --with-tune=arm926ej-s --with-float=soft --with-abi=aapcs-linux";;
armv6-*-*-*eabihf) _arch_configure="--with-arch=armv6zk --with-tune=arm1176jzf-s --with-fpu=vfp --with-float=hard --with-abi=aapcs-linux";;
armv7-*-*-*eabihf) _arch_configure="--with-arch=armv7-a --with-tune=generic-armv7-a --with-fpu=vfpv3-d16 --with-float=hard --with-abi=aapcs-linux --with-mode=thumb";;
mips-*-*-*) _arch_configure="--with-arch=mips32 --with-mips-plt --with-float=soft --with-abi=32";;
mips64-*-*-*) _arch_configure="--with-arch=mips3 --with-tune=mips64 --with-mips-plt --with-float=soft --with-abi=64";;
mips64el-*-*-*) _arch_configure="--with-arch=mips3 --with-tune=mips64 --with-mips-plt --with-float=soft --with-abi=64";;
mipsel-*-*-*) _arch_configure="--with-arch=mips32 --with-mips-plt --with-float=soft --with-abi=32";;
powerpc-*-*-*) _arch_configure="--enable-secureplt --enable-decimal-float=no";;
powerpc64*-*-*-*) _arch_configure="--with-abi=elfv2 --enable-secureplt --enable-decimal-float=no --enable-targets=powerpcle-linux";;
i486-*-*-*) _arch_configure="--with-arch=i486 --with-tune=generic --enable-cld";;
i586-*-*-*) _arch_configure="--with-arch=i586 --with-tune=generic --enable-cld";;
s390x-*-*-*) _arch_configure="--with-arch=z196 --with-tune=zEC12 --with-zarch --with-long-double-128 --enable-decimal-float";;
esac
case "$CTARGET_ARCH" in
mips*) _hash_style_configure="--with-linker-hash-style=sysv" ;;
*) _hash_style_configure="--with-linker-hash-style=gnu" ;;
esac
case "$CTARGET_LIBC" in
musl)
# musl does not support mudflap, or libsanitizer
# libmpx uses secure_getenv and struct _libc_fpstate not present in musl
# alpine musl provides libssp_nonshared.a, so we don't need libssp either
_libc_configure="--disable-libssp --disable-libmpx --disable-libmudflap --disable-libsanitizer"
_symvers="--disable-symvers"
export libat_cv_have_ifunc=no
;;
esac
case "$BOOTSTRAP" in
nolibc) _bootstrap_configure="--with-newlib --disable-shared --enable-threads=no" ;;
*) _bootstrap_configure="--enable-shared --enable-threads --enable-tls" ;;
esac
$LIBGOMP || _bootstrap_configure="$_bootstrap_configure --disable-libgomp"
$LIBATOMIC || _bootstrap_configure="$_bootstrap_configure --disable-libatomic"
$LIBITM || _bootstrap_configure="$_bootstrap_configure --disable-libitm"
$LIBQUADMATH || _arch_configure="$_arch_configure --disable-libquadmath"
msg "Building the following:"
echo ""
echo " CBUILD=$CBUILD"
echo " CHOST=$CHOST"
echo " CTARGET=$CTARGET"
echo " CTARGET_ARCH=$CTARGET_ARCH"
echo " CTARGET_LIBC=$CTARGET_LIBC"
echo " languages=$_languages"
echo " arch_configure=$_arch_configure"
echo " libc_configure=$_libc_configure"
echo " cross_configure=$_cross_configure"
echo " bootstrap_configure=$_bootstrap_configure"
echo " hash_style_configure=$_hash_style_configure"
echo ""
mkdir -p "$_builddir"
cd "$_builddir"
"$_gccdir"/configure --prefix=/usr/gcc4 \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--build=${CBUILD} \
--host=${CHOST} \
--target=${CTARGET} \
--with-pkgversion="postmarketOS ${_pkgver}" \
--enable-checking=release \
--disable-fixed-point \
--disable-libstdcxx-pch \
\
--disable-bootstrap \
--disable-libstdcxx \
\
--disable-multilib \
--disable-nls \
--disable-werror \
$_symvers \
--enable-__cxa_atexit \
--enable-default-pie \
--enable-cloog-backend \
--enable-languages=$_languages \
$_arch_configure \
$_libc_configure \
$_cross_configure \
$_bootstrap_configure \
--with-system-zlib \
$_hash_style_configure
make
}
package() {
cd "$_builddir"
make -j1 DESTDIR="${pkgdir}" install
local prefix=/usr/gcc4
if [ "$CHOST" = "$CTARGET" ]; then
# gcc symlinks
ln -s gcc "$pkgdir$prefix"/bin/cc
ln -s gcc "$pkgdir$prefix"/bin/gcc4
fi
# remove docs
rm -r "$pkgdir/usr/share/"
# we don't support gcj -static
# and saving 35MB is not bad.
find "$pkgdir" -name libgcj.a -o -name libgtkpeer.a \
-o -name libgjsmalsa.a -o -name libgcj-tools.a \
-o -name libjvm.a -o -name libgij.a -o -name libgcj_bc.a \
-o -name libjavamath.a \
| xargs rm -f
# strip debug info from some static libs
${STRIP_FOR_TARGET} -g `find "$pkgdir" \( -name libgfortran.a -o -name libobjc.a -o -name libgomp.a \
-o -name libmudflap.a -o -name libmudflapth.a \
-o -name libgcc.a -o -name libgcov.a -o -name libquadmath.a \
-o -name libitm.a -o -name libgo.a -o -name libcaf\*.a \
-o -name libatomic.a -o -name libasan.a -o -name libtsan.a \) \
-a -type f`
if $LANG_JAVA; then
sed -i -e 's/lib: /&%{static:%eJava programs cannot be linked statically}/' \
"$pkgdir"/usr/lib/libgcj.spec
fi
if [ "$CHOST" != "$CTARGET" ]; then
# cross-gcc: remove any files that would conflict with the
# native gcc package
rm -rf "$pkgdir$prefix"/bin/cc \
"$pkgdir$prefix"/include \
"$pkgdir$prefix"/share
# libcc1 does not depend on target, don't ship it
rm -rf "$pkgdir$prefix"/lib/libcc1.so*
# fixup gcc library symlinks to be linker scripts so
# linker finds the libs from relocated sysroot
for so in "$pkgdir$prefix"/$CTARGET/lib/*.so; do
if [ -h "$so" ]; then
local _real=$(basename $(readlink "$so"))
rm -f "$so"
echo "GROUP ($_real)" > "$so"
fi
done
# Link binutils binaries to /usr/gcc4
# This is the path GCC4 will look for them, if we don't create these
# symlinks, it will use the native binutils instead (which is of course
# failing and causes many headaches). See also: '-B' in 'man gcc'.
echo "Link binutils binaries to /usr/gcc4"
mkdir -p "$pkgdir$prefix/$CTARGET/bin"
for i in "as" "ld"; do
ln -sv "/usr/$CTARGET/bin/$i" \
"$pkgdir$prefix/$CTARGET/bin/$i"
done
# Link binutils to gcc4-* (so 'CROSS_COMPILE=gcc4-...' works)
echo "Link binutils to gcc4-*"
mkdir -p "$pkgdir/usr/bin"
for i in "elfedit" "gprof" "addr2line" "strings" "as" "ld" "size" "ld.bfd" \
"readelf" "nm" "ar" "strip" "dwp" "objdump" "objcopy" "c++filt" "ranlib"; do
ln -sv "/usr/bin/$CTARGET-$i" \
"$pkgdir/usr/bin/gcc4-$CTARGET-$i"
done
fi
# Link all binaries from /usr/gcc4/bin/* to /usr/bin/gcc4-*
echo "Link all gcc binaries to /usr/bin/gcc4-*"
mkdir -p "$pkgdir"/usr/bin
cd "$pkgdir$prefix/bin/"
for i in *; do
ln -sv "$prefix/bin/$i" "$pkgdir/usr/bin/gcc4-$i"
done
}
sha512sums="35a1386ae2b8629cd464383fbb3c61e94a07f3691f48b8029b97cc62a60c792ffb870aad2343b2ad8185bf46f77e1e1dd62309ecdadc42f919874c6e2c58b936 gcc-4.9.2.tar.gz
28f8c6fdbcb19e950b1d0bafb3bcc7a8cba87bc673aa6027cece116599cdee80f0cf5e95a1440544890239f5c754e8a93ab46d9daedd937faef445d7ea33b226 ecj-4.9.jar
618a8d037ccad15e60182acc9c85ba844cb9b5800a22ece0b814e43541b01b4e390a2847f86debb351f4b05580241747fde87e86a17060744e7bb2b9a3dc5bd4 01_all_gcc49_configure.patch
21770259c7916e55568027926e4a543eea468b04436cc61c28f749be5a6635c48e68b7924a8eb19a76733a9d2f00921ba06faddaedbf14b1cdad5ab1810cc6c6 02_all_gcc48_config.in.patch
3afe2cc407b5440333d9517daca3257e08a7318695d20645a9186cafac53afa6d0c075af67398ff7abd06250567cc6c751e6dabb65a310eef9a5d981e910aa25 03_all_gcc49_Makefile.in.patch
e98cc321d71e5bb62c6116b30ed6f11044bda440e238026a83dec63f04a0587440bdae50ec211b07976fcd9deb329f9dd1dac1317dae5003088a8a8bddbb97c1 05_all_gcc48_gcc.c.patch
98a4da3137177c5cad7dd7d35ad39cd416aa36f07867714e09ab8c0d8b759d2659063aa87b16ac1b708a283afd2ac54e20b327a32d1147720996d7bc11dcbd63 16_all_gcc47_nopie_option.patch
8fc6f2fd921c560fb1d7ba17b5cef4ea8071ee6909d372e41201667c011f948560fa543b1246cf55c0009622abf0dbc0bd79f718a853f2f0b59290e3df2c2968 20_all_gcc49_config_crtbeginp.patch
32bfe9c1f6f566de72c93388622001ff4b95086ea6f476bdfc08403ea474f98212f7396bc75d88a79a053159f78dca922ec6f641f83d9959ad419b0d8901b504 24_all_gcc49_invoke.texi.patch
dd5b9b30eb7716cb3c010ca79a83ed6219ff6e6f2557deb4e1d26cecac0f2b14c4ef7bf4dc5c2aec88aae5463763f5f64454b8a627ebd1d0a5c92984017025ad 34_all_gcc48_config_i386.patch
8829f85323d8b11e26e3c19ced4a51875fc63f1483cfdc4d0f579a6cb37e1b6e23fcf33a87a574a6e0007250374ea46d117a136e73a40fbe43f0e39d9b2dd1a8 35_all_gcc48_config_arm.patch
976994900d20a448b97fa91e1d758b6da6d8ad9121b3dbc2e8f66ff8006d8e496cd3dddc41394db6c4d20366d56fe12375b97f494d6fb9abb8e64ab626acc2ef 40_all_gcc49_config_esp.patch
e2d027be2e76a64a607ae44566d163bcc2a03c9e14d5bd20cd8bb15c2e9e395d8964b747a6a9c49541a5d1613d721855b73d60cce7c834427b44788fa92d44dc 41_all_gcc49_config_esp_alpine.patch
6cdac0741568b418af1e267a69b487e48a98e319f5ec8ab2bad293f2520ceced40c7df7ddef84963f5b101b94f34e441574c501ef3993ded097beb7c9d3b205f 10_all_default-fortify-source.patch
5069e4b741488913a646a9b5d871af8e7f7a606158ea09305d0ddd46257c5b659770627bc2ca3abeaae039da1717b3ba6c9cd90554a441da74eb4ecf24c13074 12_all_default-warn-trampolines.patch
c18a99b7303a734fe4dca9d4e90e21d18e5bd71c7d91e1a26c86b1354c73f567590a875941bfe64ce59f0393023b91c606c96b30885c55b98a790c3ab0c84ca7 15_all_libgfortran-Werror.patch
433404fd9bfa172d69fff4a5505e8648cbbbf5f052d2b4235608ff7af0c4063d557d25d80c85c5bd0d1e1ed64b568e7bbc0cdbce11cc74db4c0189af3a01634a 16_all_libgomp-Werror.patch
ff16f259fff8d78230593eee8641eab5a72c5c517c6ac5f09597edbc624d964b33f185a0dd5772d6029f757a5edb66431b3eab77dac71e76a0ef155bb7443d2c 48_all_x86_pr53113_libitm-avx.patch
c6c314a2d24531b4286436dec7189f83e443c4cfa9b88339a4c324c2d40812d766ed44dcfd4a0c3b67695bb76969a4d8a9784ff95876ceba23def305ef8a48f8 50_all_libiberty-asprintf.patch
0a0bc72b9366158f5d23fff1928e756fdd212433bac6ab1f00d632f241382820db8db5d475ddf11ea020eaf7e2e71b12fb9b1c3c870cf84adf6c2b16f15aabca 51_all_libiberty-pic.patch
9b623a0b00254326596a56fff23dacc97e560823ebdf35698799fc7ab5e98984c71b7ddfceeb1589bbbdd1ba89a742cd7becf8f70f0081dfc26bcef4198b1b5d 67_all_gcc-poison-system-directories.patch
9c6aa6d7f096c3aaebbe21d52967872195aea130b51d60a1934255b00bf1b23d24ec598c7763152f987f7999da9e56f512d169958666a3133641de3780a75d3f gcc49-cloog-dl.patch
7242876e4bba34235f6f3ea960d72439638bd31547284ca96cb94c97a2d46dd7b38a3709fd159cf86efa1e8a44e3e9125fe82bc3a1cc71153591755827d6c9fd gcc-ice-hack.patch
ce9c1f923e2c6d17347ec2d3d8482351a9644194b2753627389294d43bb4f11b9c2ef41eda1b46ad83d09901a0bedebd5b6b8a57a198646030ab61e8d2d8cb48 gcc-spec-env.patch
d08d7ead2de0429e5c9055d5b029ec2be9a8c821d22cecaf9b51f633652c493333f98963d9267fa2fa63850c50ae5eefd5f59e5910ec10d20044dac082182a8b libgcc-always-build-gcceh.a.patch
9fc5e32f2573ae67b6cf22119d636d10a47c42718635bceff7d457a93a3f664ae1ed10e154f70964ba2d26b0de04f879a8c05de6411112760d40433373dd0a80 gcc-4.6-pr32219.patch
e2be926c0ed4d67587857652678253a2a4e42294009a0c4b9fc420e53b0e6d44d1a2c6c2c62db837bc010470e9e62eb4af1ba7f51ff507c41e40922cd022dd26 gcc-4.9-musl.patch
b5b0210dfaccfe0b06f0a9090666b1fae2a3faa4140b7930146b29531f0da9beb1f2c1f7e7bc2bd29179f9fe05dc30e246e96220b8ff75a90f75e8350c9058a1 gcc-4.8-musl-fix-iteratephdr.patch
e6d9b103c128e5d4eca515b1496d78b05708de770597c883daddd95ea41e77b5ef1be613b989357cc870a7efd9e43b011022c2d302e7056cff7b69e764906ff2 gcc-4.8-musl-libssp.patch
600fe5098dc54edaa9808fd5717af9dec058953f9ad37d49cfba1db4f7e9a7a8f02019342f75157fc575946fa693259422184de27b7ecc8386d9f3ecc0f7cc5d gcc-4.9-musl-fortify.patch
e1d6a450dfb40b134ad7f759c4c10174d2490b0093fe47cb33479245f26a3a8c54ebcf6255943c0ccfcb5095600d1c05e530baeed35609c8ffe75caac8e57c49 boehm-gc-uclibc.patch
bda845a6aa1854d2c883910b115f79ccfa93dfc2b5eac69a3a236d83eb34cadc140731d616ffc24698c7abc8878dd15f231bcc5119f1860e575a120b311706c7 boehm-gc-musl.patch
4a5aeff0399782c752e6e3f2f48d984b2056dfb5d229b23a24eee1562d241339989b2203f139821cfc03c9b25c9bd7da6ccbbdc7a09d242e4de7f0d606c6f63c gcc-pure64.patch
f89ddeb21bc8f97e6a850a6b70b4501a8f3e49a4bc8cc82897488decda5d98ad01cb7f6c8b392d452e9579924a523bc75da6e0648c1c976d42e40af48b10343b fix-gcj-musl.patch
54d67cc008b735e47771314171930c5d8b8f5f5dc97fcf4214824c105c808f3e75d22d5a4fdf5068ed0457fa0d46c60cfb442e276259a4a5e9b8722a027d18e6 fix-gcj-iconv-musl.patch
7de81fc8c7eb36690949eb30082515454978440a8f389b12407ac5e9125ef6824d6059ffb5b063ab1ccc6c4827b1a6a0984b538f056b85e3171800a6f723ec8b musl-posix_memalign-c++.patch
095281d940ad7504ed7071cc9800d81db33eb4aa5465696ef7b12bf1213dbdfa701f4392095c5167b331c38219b19d25a0798524b319f1c77aa8522d76d8c92c pr63740.patch
efc04b179d41b484eddddc56d0e442634995d56c994e6295ae09b9856ab46649d5f45f51ea84494ab39df41c213772d0e68aee67e66fdf340f0a647b55629ced pr64037.patch
abe9aaf9aa956058d0386a4396a511d176a46bb3906b90e952383646cdc158cbeb0a5dc616a1ccb1ca7d49fd0b5e351532aa15a3b13362abbf1ca4266f54a687 gcc-4.8-build-args.patch
35d6d59f0b7b968f282f56767c9e0823a7bdc5aa0d450aca50fbd802649a7ca608b47671244a3faa208a9b0d6832cabb5a22724157dc817b2c0ad63d09f93282 fix-cxxflags-passing.patch
c731f4aaaa65c8950e1b2bd9331410f92d378fd8c7e718532dccaa27ee11984d51d74216c3611e89a802325b81d7f184116839dce2dab50cae9b643c20a82fe7 fix-cxxflags-for-target.patch
e80a08de4b43fb71f7699bcce360cd99bc525dab20b9109e7152bd211def5d8e728f88771ed59f15ed520cbf069364debc4f822c10a1abf7e2c7badd67e1c83c ada-no-pie.patch
b37195a126476775e2ef16e0adc9173664c514339fb319f628debd8a4133fa53e022278387c68fc260cf813e58602617e9e629ea8177133bfdf5972398fe1c55 ada-fixes.patch
3f5bc334d9f73d06f5f7c876738d02356acdd08958bea0e4d2095ebf15c2c2ec4e411abdae0297505ae9a1699ca01b17338e853184e84663203b192b0d35fc19 ada-shared.patch
76d7d35066534c332956a88da84a95c8c54c6e0742c3c46e6b256395bf67f7c167b5ecd47fbed697fb1c9d7a41016c99e7dcd06465516a0e963707a0eab8f8b6 ada-musl.patch
83a0996a48096032bcc674a6d28524f1cd2d81837621ebe4c15b5aedbd551c77ce5576b6307adb673ef0e4ac0431d935ad6a427edca2af5c21b6be9176bfaddb vanilla.specs
e4d38905527c500c61c421d782a8ac6ef2b034b15fd81d868486ac330a70922937d3c47e0684e9f3250744569b56a8df199499a4a5c107a6d544dca84458dc12 hardenednossp.specs
b56f7c308c5aefd0cfc647abd75939508a6640c53fce7c19da7c7d8ef4405d29b0d88800117fc7ff8d0022b035d511fb6d478e745bb2ed12a1b63f9f8cf3e168 hardenednopie.specs
f5ac7282201006548ed2bd835234af64d6f79f13f0b9a3410f5c794537e0ea91601361ae72180f49870b6b0f9af5f16002c86660feb94df346b9b1d9602e9d3a hardenednopiessp.specs"
-44
View File
@@ -1,44 +0,0 @@
--- gcc-4.8.1/gcc/ada/terminals.c.orig
+++ gcc-4.8.1/gcc/ada/terminals.c
@@ -984,13 +984,6 @@
#include <stdio.h>
#include <stdlib.h>
-/* On some system termio is either absent or including it will disable termios
- (HP-UX) */
-#if ! defined (__hpux__) && ! defined (FREEBSD) && \
- ! defined (__APPLE__) && ! defined(__rtems__)
-# include <termio.h>
-#endif
-
#include <sys/ioctl.h>
#include <termios.h>
#include <fcntl.h>
@@ -1078,7 +1078,7 @@
char *slave_name = NULL;
#ifdef USE_GETPT
- master_fd = getpt ();
+ master_fd = posix_openpt (O_RDWR);
#elif defined (USE_OPENPTY)
status = openpty (&master_fd, &slave_fd, NULL, NULL, NULL);
#elif defined (USE_CLONE_DEVICE)
@@ -1179,7 +1170,7 @@
int status;
/* ensure that s is filled with 0 */
- bzero (&s, sizeof (&s));
+ bzero (&s, sizeof (s));
/* Get the current terminal settings */
status = tcgetattr (fd, &s);
--- gcc-4.8.1/gcc/ada/cal.c.orig
+++ gcc-4.8.1/gcc/ada/cal.c
@@ -65,6 +65,7 @@
#include <time.h>
#else
#include <sys/time.h>
+#include <time.h>
#endif
#ifdef __MINGW32__
-136
View File
@@ -1,136 +0,0 @@
diff -ru gcc-4.9.2/gcc/ada/adaint.c gcc-4.9.2/gcc/ada/adaint.c
--- gcc-4.9.2/gcc/ada/adaint.c 2014-02-24 18:51:58.000000000 -0200
+++ gcc-4.9.2/gcc/ada/adaint.c 2014-12-10 12:05:44.621173474 -0200
@@ -67,6 +67,11 @@
#include <sys/pstat.h>
#endif
+#if defined (linux)
+#define _GNU_SOURCE 1
+#include <sched.h>
+#endif
+
#ifdef VMS
#define _POSIX_EXIT 1
#define HOST_EXECUTABLE_SUFFIX ".exe"
@@ -3891,8 +3896,6 @@
return (void *) syscall (__NR_gettid);
}
-#include <sched.h>
-
/* glibc versions earlier than 2.7 do not define the routines to handle
dynamically allocated CPU sets. For these targets, we use the static
versions. */
@@ -3901,7 +3904,7 @@
/* Dynamic cpu sets */
-cpu_set_t *
+void *
__gnat_cpu_alloc (size_t count)
{
return CPU_ALLOC (count);
@@ -3914,33 +3917,33 @@
}
void
-__gnat_cpu_free (cpu_set_t *set)
+__gnat_cpu_free (void *set)
{
- CPU_FREE (set);
+ CPU_FREE ((cpu_set_t *) set);
}
void
-__gnat_cpu_zero (size_t count, cpu_set_t *set)
+__gnat_cpu_zero (size_t count, void *set)
{
- CPU_ZERO_S (count, set);
+ CPU_ZERO_S (count, (cpu_set_t *) set);
}
void
-__gnat_cpu_set (int cpu, size_t count, cpu_set_t *set)
+__gnat_cpu_set (int cpu, size_t count, void *set)
{
/* Ada handles CPU numbers starting from 1, while C identifies the first
CPU by a 0, so we need to adjust. */
- CPU_SET_S (cpu - 1, count, set);
+ CPU_SET_S (cpu - 1, count, (cpu_set_t *) set);
}
#else /* !CPU_ALLOC */
/* Static cpu sets */
-cpu_set_t *
+void *
__gnat_cpu_alloc (size_t count ATTRIBUTE_UNUSED)
{
- return (cpu_set_t *) xmalloc (sizeof (cpu_set_t));
+ return xmalloc (sizeof (cpu_set_t));
}
size_t
@@ -3950,23 +3953,23 @@
}
void
-__gnat_cpu_free (cpu_set_t *set)
+__gnat_cpu_free (void *set)
{
free (set);
}
void
-__gnat_cpu_zero (size_t count ATTRIBUTE_UNUSED, cpu_set_t *set)
+__gnat_cpu_zero (size_t count ATTRIBUTE_UNUSED, void *set)
{
- CPU_ZERO (set);
+ CPU_ZERO ((cpu_set_t *) set);
}
void
-__gnat_cpu_set (int cpu, size_t count ATTRIBUTE_UNUSED, cpu_set_t *set)
+__gnat_cpu_set (int cpu, size_t count ATTRIBUTE_UNUSED, void *set)
{
/* Ada handles CPU numbers starting from 1, while C identifies the first
CPU by a 0, so we need to adjust. */
- CPU_SET (cpu - 1, set);
+ CPU_SET (cpu - 1, (cpu_set_t *) set);
}
#endif /* !CPU_ALLOC */
#endif /* linux */
diff -ru gcc-4.9.2/gcc/ada/adaint.h gcc-4.9.2/gcc/ada/adaint.h
--- gcc-4.9.2/gcc/ada/adaint.h 2014-02-24 18:51:58.000000000 -0200
+++ gcc-4.9.2/gcc/ada/adaint.h 2014-12-10 12:03:48.377834174 -0200
@@ -266,13 +266,11 @@
/* Routines for interface to required CPU set primitives */
-#include <sched.h>
-
-extern cpu_set_t *__gnat_cpu_alloc (size_t);
+extern void * __gnat_cpu_alloc (size_t);
extern size_t __gnat_cpu_alloc_size (size_t);
-extern void __gnat_cpu_free (cpu_set_t *);
-extern void __gnat_cpu_zero (size_t, cpu_set_t *);
-extern void __gnat_cpu_set (int, size_t, cpu_set_t *);
+extern void __gnat_cpu_free (void *);
+extern void __gnat_cpu_zero (size_t, void *);
+extern void __gnat_cpu_set (int, size_t, void *);
#endif
#if defined (_WIN32)
--- gcc-4.9.2/gcc/ada/gcc-interface/Makefile.in.orig 2014-12-11 08:16:33.364902456 -0200
+++ gcc-4.9.2/gcc/ada/gcc-interface/Makefile.in 2014-12-11 08:16:51.998236755 -0200
@@ -1948,7 +1948,7 @@
endif
# ARM linux, GNU eabi
-ifeq ($(strip $(filter-out arm% linux-gnueabi%,$(target_cpu) $(target_os))),)
+ifeq ($(strip $(filter-out arm% linux-gnueabi% linux-muslgnueabi%,$(target_cpu) $(target_os))),)
LIBGNAT_TARGET_PAIRS = \
a-intnam.ads<a-intnam-linux.ads \
s-inmaop.adb<s-inmaop-posix.adb \
-66
View File
@@ -1,66 +0,0 @@
--- gcc-4.9.2/gcc/ada/gcc-interface/Makefile.in.orig 2014-05-17 13:13:12.000000000 -0300
+++ gcc-4.9.2/gcc/ada/gcc-interface/Makefile.in 2014-12-10 12:01:32.304493855 -0200
@@ -2570,23 +2570,23 @@
gnatchop gnatcmd gnatkr gnatls gnatprep gnatxref gnatfind gnatname \
gnatclean -bargs $(ADA_INCLUDES) $(GNATBIND_FLAGS)
$(GNATLINK) -v gnatcmd -o ../../gnat$(exeext) \
- --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
+ --GCC="$(GCC_LINK)" -fno-PIE $(TOOLS_LIBS)
$(GNATLINK) -v gnatchop -o ../../gnatchop$(exeext) \
- --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
+ --GCC="$(GCC_LINK)" -fno-PIE $(TOOLS_LIBS)
$(GNATLINK) -v gnatkr -o ../../gnatkr$(exeext) \
- --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
+ --GCC="$(GCC_LINK)" -fno-PIE $(TOOLS_LIBS)
$(GNATLINK) -v gnatls -o ../../gnatls$(exeext) \
- --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
+ --GCC="$(GCC_LINK)" -fno-PIE $(TOOLS_LIBS)
$(GNATLINK) -v gnatprep -o ../../gnatprep$(exeext) \
- --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
+ --GCC="$(GCC_LINK)" -fno-PIE $(TOOLS_LIBS)
$(GNATLINK) -v gnatxref -o ../../gnatxref$(exeext) \
- --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
+ --GCC="$(GCC_LINK)" -fno-PIE $(TOOLS_LIBS)
$(GNATLINK) -v gnatfind -o ../../gnatfind$(exeext) \
- --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
+ --GCC="$(GCC_LINK)" -fno-PIE $(TOOLS_LIBS)
$(GNATLINK) -v gnatname -o ../../gnatname$(exeext) \
- --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
+ --GCC="$(GCC_LINK)" -fno-PIE $(TOOLS_LIBS)
$(GNATLINK) -v gnatclean -o ../../gnatclean$(exeext) \
- --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
+ --GCC="$(GCC_LINK)" -fno-PIE $(TOOLS_LIBS)
../../gnatsym$(exeext): ../stamp-tools
$(GNATMAKE) -c $(ADA_INCLUDES) gnatsym --GCC="$(CC) $(ALL_ADAFLAGS)"
@@ -2608,7 +2608,7 @@
$(GNATMAKE) -j0 -c $(ADA_INCLUDES) gnatmake --GCC="$(CC) $(ALL_ADAFLAGS)"
$(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatmake
$(GNATLINK) -v gnatmake -o ../../gnatmake$(exeext) \
- --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
+ --GCC="$(GCC_LINK)" -fno-PIE $(TOOLS_LIBS)
# Note the use of the "mv" command in order to allow gnatlink to be linked with
# with the former version of gnatlink itself which cannot override itself.
@@ -2618,7 +2618,7 @@
$(GNATMAKE) -j0 -c $(ADA_INCLUDES) gnatlink --GCC="$(CC) $(ALL_ADAFLAGS)"
$(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatlink
$(GNATLINK) -v gnatlink -o ../../gnatlinknew$(exeext) \
- --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
+ --GCC="$(GCC_LINK)" -fno-PIE $(TOOLS_LIBS)
$(MV) ../../gnatlinknew$(exeext) ../../gnatlink$(exeext)
# Needs to be built with CC=gcc
@@ -2627,10 +2627,10 @@
# Likewise for the tools
../../gnatmake$(exeext): $(P) b_gnatm.o $(GNATMAKE_OBJS)
- +$(GCC_LINK) $(ALL_CFLAGS) -o $@ b_gnatm.o $(GNATMAKE_OBJS) $(TOOLS_LIBS)
+ +$(GCC_LINK) $(ALL_CFLAGS) -fno-PIE -o $@ b_gnatm.o $(GNATMAKE_OBJS) $(TOOLS_LIBS)
../../gnatlink$(exeext): $(P) b_gnatl.o $(GNATLINK_OBJS)
- +$(GCC_LINK) $(ALL_CFLAGS) -o $@ b_gnatl.o $(GNATLINK_OBJS) $(TOOLS_LIBS)
+ +$(GCC_LINK) $(ALL_CFLAGS) -fno-PIE -o $@ b_gnatl.o $(GNATLINK_OBJS) $(TOOLS_LIBS)
../stamp-gnatlib-$(RTSDIR):
@if [ ! -f stamp-gnatlib-$(RTSDIR) ] ; \
-30
View File
@@ -1,30 +0,0 @@
Index: b/gcc/ada/link.c
===================================================================
--- a/gcc/ada/link.c
+++ b/gcc/ada/link.c
@@ -105,9 +105,9 @@
#elif defined (__FreeBSD__)
const char *__gnat_object_file_option = "-Wl,@";
-const char *__gnat_run_path_option = "-Wl,-rpath,";
-char __gnat_shared_libgnat_default = STATIC;
-char __gnat_shared_libgcc_default = STATIC;
+const char *__gnat_run_path_option = "";
+char __gnat_shared_libgnat_default = SHARED;
+char __gnat_shared_libgcc_default = SHARED;
int __gnat_link_max = 8192;
unsigned char __gnat_objlist_file_supported = 1;
const char *__gnat_object_library_extension = ".a";
@@ -127,9 +127,9 @@
#elif defined (linux) || defined(__GLIBC__)
const char *__gnat_object_file_option = "-Wl,@";
-const char *__gnat_run_path_option = "-Wl,-rpath,";
-char __gnat_shared_libgnat_default = STATIC;
-char __gnat_shared_libgcc_default = STATIC;
+const char *__gnat_run_path_option = "";
+char __gnat_shared_libgnat_default = SHARED;
+char __gnat_shared_libgcc_default = SHARED;
int __gnat_link_max = 8192;
unsigned char __gnat_objlist_file_supported = 1;
const char *__gnat_object_library_extension = ".a";
-62
View File
@@ -1,62 +0,0 @@
--- gcc-4.8.1/boehm-gc/os_dep.c.orig 2013-09-17 07:46:00.969884340 +0000
+++ gcc-4.8.1/boehm-gc/os_dep.c 2013-09-17 06:53:53.629884946 +0000
@@ -26,7 +26,7 @@
# define __KERNEL__
# include <asm/signal.h>
# undef __KERNEL__
-# else
+# elif defined(__GLIBC__)
/* Kernels prior to 2.1.1 defined struct sigcontext_struct instead of */
/* struct sigcontext. libc6 (glibc2) uses "struct sigcontext" in */
/* prototypes, so we have to include the top-level sigcontext.h to */
--- gcc-4.8.2/boehm-gc/dyn_load.c.orig 2014-02-17 14:13:09.519850231 +0200
+++ gcc-4.8.2/boehm-gc/dyn_load.c 2014-02-17 14:14:27.906093514 +0200
@@ -459,9 +459,7 @@
/* For glibc 2.2.4+. Unfortunately, it doesn't work for older */
/* versions. Thanks to Jakub Jelinek for most of the code. */
-# if (defined(LINUX) || defined (__GLIBC__)) /* Are others OK here, too? */ \
- && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
- || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG)))
+# if (defined(LINUX) || defined (__GLIBC__))
/* We have the header files for a glibc that includes dl_iterate_phdr. */
/* It may still not be available in the library on the target system. */
--- gcc-4.8.2/boehm-gc/include/private/gcconfig.h.orig 2014-02-17 14:14:36.026049422 +0200
+++ gcc-4.8.2/boehm-gc/include/private/gcconfig.h 2014-02-17 14:17:11.345207887 +0200
@@ -684,7 +684,7 @@
# ifdef __ELF__
# define DYNAMIC_LOADING
# include <features.h>
-# if defined(__GLIBC__)&& __GLIBC__>=2
+# if 1
# define SEARCH_FOR_DATA_START
# else /* !GLIBC2 */
extern char **__environ;
@@ -1147,7 +1147,7 @@
# define DATASTART ((ptr_t)((((word) (_etext)) + 0xfff) & ~0xfff))
# endif
# include <features.h>
-# if defined(__GLIBC__) && __GLIBC__ >= 2
+# if 1
# define SEARCH_FOR_DATA_START
# else
extern char **__environ;
@@ -1367,7 +1367,7 @@
# define HBLKSIZE 4096
# endif
# define USE_GENERIC_PUSH_REGS
-# if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 2 || __GLIBC__ > 2
+# if 1
# define LINUX_STACKBOTTOM
# else
# define STACKBOTTOM 0x80000000
@@ -1858,7 +1858,7 @@
# ifdef __ELF__
# define DYNAMIC_LOADING
# include <features.h>
-# if defined(__GLIBC__) && __GLIBC__ >= 2
+# if 1
# define SEARCH_FOR_DATA_START
# else
extern char **__environ;
-11
View File
@@ -1,11 +0,0 @@
--- ./boehm-gc/include/gc.h.orig
+++ ./boehm-gc/include/gc.h
@@ -503,7 +503,7 @@
#if defined(__linux__) || defined(__GLIBC__)
# include <features.h>
# if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
- && !defined(__ia64__)
+ && !defined(__ia64__) && !defined(__UCLIBC__)
# ifndef GC_HAVE_BUILTIN_BACKTRACE
# define GC_HAVE_BUILTIN_BACKTRACE
# endif
@@ -1,5 +0,0 @@
--- gcc-4.8.1/config/mt-gnu.orig
+++ gcc-4.8.1/config/mt-gnu
@@ -1 +1 @@
-CXXFLAGS_FOR_TARGET = $(CXXFLAGS) -D_GNU_SOURCE
+CXXFLAGS_FOR_TARGET := $(CXXFLAGS_FOR_TARGET) -D_GNU_SOURCE
@@ -1,10 +0,0 @@
--- gcc-4.8.1/Makefile.in.orig
+++ gcc-4.8.1/Makefile.in
@@ -169,6 +169,7 @@
# built for the build system to override those in BASE_FLAGS_TO_PASSS.
EXTRA_BUILD_FLAGS = \
CFLAGS="$(CFLAGS_FOR_BUILD)" \
+ CXXFLAGS="$(CXXFLAGS_FOR_BUILD)" \
LDFLAGS="$(LDFLAGS_FOR_BUILD)"
# This is the list of directories to built for the host system.
-120
View File
@@ -1,120 +0,0 @@
--- gcc-4.8.2/libjava/gnu/gcj/convert/natIconv.cc.orig 2014-02-18 18:46:14.897880526 +0200
+++ gcc-4.8.2/libjava/gnu/gcj/convert/natIconv.cc 2014-02-18 18:50:08.766613550 +0200
@@ -24,6 +24,13 @@
#ifdef HAVE_ICONV
#include <iconv.h>
+#include <endian.h>
+
+#if __BYTE_ORDER == __BIG_ENDIAN
+#define UCS2_CHARSET "UCS-2BE"
+#else
+#define UCS2_CHARSET "UCS-2LE"
+#endif
template<typename T>
static inline size_t
@@ -45,7 +52,7 @@
_Jv_GetStringUTFRegion (encoding, 0, encoding->length(), buffer);
buffer[len] = '\0';
- iconv_t h = iconv_open ("UCS-2", buffer);
+ iconv_t h = iconv_open (UCS2_CHARSET, buffer);
if (h == (iconv_t) -1)
throw new ::java::io::UnsupportedEncodingException (encoding);
@@ -99,18 +106,6 @@
throw new ::java::io::CharConversionException ();
}
- if (iconv_byte_swap)
- {
- size_t max = (old_out - outavail) / sizeof (jchar);
- for (size_t i = 0; i < max; ++i)
- {
- // Byte swap.
- jchar c = (((out[outpos + i] & 0xff) << 8)
- | ((out[outpos + i] >> 8) & 0xff));
- outbuf[i] = c;
- }
- }
-
inpos += old_in - inavail;
return (old_out - outavail) / sizeof (jchar);
#else /* HAVE_ICONV */
@@ -145,7 +140,7 @@
_Jv_GetStringUTFRegion (encoding, 0, encoding->length(), buffer);
buffer[len] = '\0';
- iconv_t h = iconv_open (buffer, "UCS-2");
+ iconv_t h = iconv_open (buffer, UCS2_CHARSET);
if (h == (iconv_t) -1)
throw new ::java::io::UnsupportedEncodingException (encoding);
@@ -187,20 +182,6 @@
char *inbuf = (char *) &chars[inpos];
char *outbuf = (char *) &out[count];
- if (iconv_byte_swap)
- {
- // Ugly performance penalty -- don't use losing systems!
- temp_buffer = (jchar *) _Jv_Malloc (inlength * sizeof (jchar));
- for (int i = 0; i < inlength; ++i)
- {
- // Byte swap.
- jchar c = (((chars[inpos + i] & 0xff) << 8)
- | ((chars[inpos + i] >> 8) & 0xff));
- temp_buffer[i] = c;
- }
- inbuf = (char *) temp_buffer;
- }
-
size_t loop_old_in = old_in;
while (1)
{
@@ -252,44 +233,7 @@
jboolean
gnu::gcj::convert::IOConverter::iconv_init (void)
{
- // Some versions of iconv() always return their UCS-2 results in
- // big-endian order, and they also require UCS-2 inputs to be in
- // big-endian order. For instance, glibc 2.1.3 does this. If the
- // UTF-8=>UCS-2 iconv converter has this feature, then we assume
- // that all UCS-2 converters do. (This might not be the best
- // heuristic, but is is all we've got.)
- jboolean result = false;
-#ifdef HAVE_ICONV
- iconv_t handle = iconv_open ("UCS-2", "UTF-8");
- if (handle != (iconv_t) -1)
- {
- jchar c;
- unsigned char in[4];
- char *inp, *outp;
- size_t inc, outc, r;
-
- // This is the UTF-8 encoding of \ufeff. At least Tru64 UNIX libiconv
- // needs the trailing NUL byte, otherwise iconv fails with EINVAL.
- in[0] = 0xef;
- in[1] = 0xbb;
- in[2] = 0xbf;
- in[3] = 0x00;
-
- inp = (char *) in;
- inc = 4;
- outp = (char *) &c;
- outc = 2;
-
- r = iconv_adapter (iconv, handle, &inp, &inc, &outp, &outc);
- // Conversion must be complete for us to use the result.
- if (r != (size_t) -1 && inc == 0 && outc == 0)
- result = (c != 0xfeff);
-
- // Release iconv handle.
- iconv_close (handle);
- }
-#endif /* HAVE_ICONV */
- return result;
+ return false;
}
void
-49
View File
@@ -1,49 +0,0 @@
--- gcc-4.8.2/libjava/gnu/classpath/natSystemProperties.cc.orig 2014-02-18 10:55:08.617678779 +0200
+++ gcc-4.8.2/libjava/gnu/classpath/natSystemProperties.cc 2014-02-18 10:56:31.927227453 +0200
@@ -289,7 +289,7 @@
// just default to `en_US'.
setlocale (LC_ALL, "");
char *locale = setlocale (LC_MESSAGES, "");
- if (locale && strlen (locale) >= 2)
+ if (locale && strlen (locale) >= 2 && (locale[2] == '\0' || locale[2] == '_'))
{
char buf[3];
buf[2] = '\0';
--- gcc-4.8.2/libjava/posix-threads.cc.orig 2014-02-18 13:22:01.789933726 +0200
+++ gcc-4.8.2/libjava/posix-threads.cc 2014-02-18 13:29:50.924058875 +0200
@@ -657,6 +657,7 @@
struct sched_param param;
pthread_attr_t attr;
struct starter *info;
+ size_t ss;
if (data->flags & FLAG_START)
return;
@@ -675,8 +676,25 @@
// Set stack size if -Xss option was given.
if (gcj::stack_size > 0)
{
- int e = pthread_attr_setstacksize (&attr, gcj::stack_size);
+ ss = gcj::stack_size;
+ }
+ else
+ {
+ int e = pthread_attr_getstacksize (&attr, &ss);
+ if (e != 0)
+ JvFail (strerror (e));
+
+ // Request at least 1meg of stack
+ if (ss >= 1024 * 1024)
+ ss = 0;
+ else
+ ss = 1024 * 1024;
+ }
+
+ if (ss)
+ {
+ int e = pthread_attr_setstacksize (&attr, ss);
if (e != 0)
JvFail (strerror (e));
}
info = (struct starter *) _Jv_AllocBytes (sizeof (struct starter));
Loaded 100 of 2317 files, more files were not shown because too many files have changed in this diff. Show more