Compare commits

..
Author SHA1 Message Date
Alexey Minnekhanov 865019f98d cross/busybox-static-*: upgrade to 1.34.1-r6 2022-07-07 11:46:12 +03:00
Luca Weiss d489a67288 main/postmarketos-ui-sxmo-de-sway: depend on postmarketos-upgrade-gtk3 (MR 3198) 2022-06-27 07:52:24 +02:00
Luca Weiss 0b768ba3e1 main/postmarketos-ui-sxmo-de-dwm: depend on postmarketos-upgrade-gtk3 (MR 3198) 2022-06-27 07:52:24 +02:00
Luca Weiss 0bc135b737 main/postmarketos-ui-plasma-mobile: depend on postmarketos-upgrade-gtk3 (MR 3198) 2022-06-27 07:52:24 +02:00
Luca Weiss 13c96c4608 main/postmarketos-ui-phosh: depend on postmarketos-upgrade-gtk3 (MR 3198) 2022-06-27 07:52:23 +02:00
Bart Ribbers 97f41f3859 main/postmarketos-upgrade-gtk3: new aport (MR 3198) 2022-06-27 07:52:18 +02:00
Luca Weiss 3512cc3749 main/linux-postmarketos-rockchip: fix waydroid kconfig check (MR 3252)
Recently pmbootstrap mandates also vndbinder being part of
CONFIG_ANDROID_BINDER_DEVICES. Adjust the config so it matches.

[ci:skip-build]: already built successful in CI
2022-06-24 10:06:32 +02:00
Oliver Smith 2ac9f6c444 main/postmarketos-release-upgrade: upgrade to 1.2.1 (MR 3237)
(cherry picked from commit f7b5c3bed2)
2022-06-15 13:15:53 +02:00
Oliver Smith 733bda8af3 main/postmarketos-release-upgrade: upgrade to 1.2.0 (MR 3232)
Most importantly, this fixes upgrading to edge.

Related: https://gitlab.com/postmarketOS/postmarketos-release-upgrade/-/tags/1.2.0
(cherry picked from commit 01e348b3a5)
2022-06-14 10:20:46 +02:00
Oliver Smith 2a0d32970c main/postmarketos-release-upgrade: upgrade to 1.1.2 (MR 3227)
(cherry picked from commit b3a26d80b7)
2022-06-12 14:10:28 +02:00
Oliver Smith 64299d6c32 main/postmarketos-release-upgrade: new aport (MR 3197)
[ci:skip-build]: already built successfully in CI

(cherry picked from commit 8c4e11ab5b)
2022-06-07 09:48:20 +02:00
Martijn Braam 5e70101c75 main/postmarketos-base: bump to v21.12.5 (MR 3132)
[ci:skip-build]: already built successfully in CI
2022-05-15 19:20:03 +02:00
Martijn Braam 6317d99f9f main/postmarketos-tweaks: upgrade to 0.12.0 (MR 3129) (MR 3132)
[ci:skip-build]: already built successfully in CI
2022-05-15 14:08:37 +02:00
Antoni Aloy Torrens 03cb8c537a community/linux-samsung-espresso3g: Fix WiFi reboot issue (MR 3130) (MR 3132)
- Patch from Robert Nelson and Hansem Ro.

- Based on the work of Hansem Ro,
  who owns another device, the First Generation Kindle Fire,
  which has similar specifications as the Samsung Galaxy Tab 2 7.0.
2022-05-15 14:08:32 +02:00
Yassine Oudjana b311110ae6 xiaomi-scorpio: change device tree name (MR 3126) (MR 3132)
The device tree in the kernel is now named msm8996pro-xiaomi-scorpio.dts.
[ci:skip-build]: already built successfully in CI
2022-05-13 23:11:18 +02:00
Yassine Oudjana e68f911757 community/linux-postmarketos-qcom-msm8996: upgrade to 5.17.6 (MR 3126) (MR 3132)
- Add support for Xiaomi Mi 5s Plus (xiaomi-natrium)
- Update charger driver
- Fix race condition in qcom-ngd-ctrl probe
2022-05-13 23:10:09 +02:00
Alexander Martinz b1620dd736 community/linux-postmarketos-qcom-sdm845: upgrade to 5.17.5 (MR 3118) (MR 3132)
For a merge list, please see the merge commits:
  - 5.17.1 - (https://gitlab.com/sdm845-mainline/linux/-/commit/6151d07534a46eee9ddfbbaedd756a4752e9e6c2)
  - 5.17.2 - (https://gitlab.com/sdm845-mainline/linux/-/commit/c8e2541a5370c981ad8f6949761f7be3848ea863)
  - 5.17.3 - (https://gitlab.com/sdm845-mainline/linux/-/commit/f7006752c1317055acf3a56a4fa8fb5f189c2eb4)
  - 5.17.4 - (https://gitlab.com/sdm845-mainline/linux/-/commit/ee8fb89013f6772493eb7be5a9d361dbcd69b179)
  - 5.17.5 - (https://gitlab.com/sdm845-mainline/linux/-/commit/b33c0511c507e34750d3cb6c1ca3f91e0f0249bc)

Change-Id: Ic1ec5571bd981aa6c24c619aac24ecd2a941d604
Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>
[ci:skip-build]: already built successfully in CI
2022-05-13 23:09:32 +02:00
Anjandev Momi 6ed9582957 temp/superd: backport for sxmo 1.9.0 (MR 3102)
sxmo 1.9.0 will not be packaged in pmOS stable but we want superd in pmOS stable
so we can support users using the latest git head on pmOS stable.

[ci:skip-build]: already built successfully in CI
2022-05-06 08:54:48 +02:00
Alexey Min 6724df91cf main/postmarketos-base: fix error after upstream changes (MR 2970) (MR 3094)
Fixes error: postmarketos-base-18-r0: trying to overwrite etc/fstab owned by alpine-baselayout-data-3.2.0-r20.

caused by https://gitlab.alpinelinux.org/alpine/aports/-/commit/9ecba8a514827daf64521008306fb137b498ebf5

NOTE by ollieparanoid: cherry-picked from
432627c921 (master branch) by Dylan to fix
upgrading from v21.12 to the next release. Thanks!
2022-04-26 09:42:16 +02:00
Martijn Braam 017cebbf13 main/postmarketos-base: bump to v21.12.4 (MR 3070)
[ci:ignore-count] [ci:skip-build]
2022-04-17 23:49:55 +02:00
Joel Selvaraj 4aaa125a6b community/linux-postmarketos-qcom-sdm845: upgrade to 5.17.0 (MR 2982) (MR 3070) 2022-04-14 14:24:21 +02:00
Joel Selvaraj 67da3b37be community/soc-qcom-sdm845: update ucm conf and add q6voiced for call audio support (MR 2982) (MR 3070)
Also, moving the modemmanager.conf file from the main package to the
nonfree-firmware subpackage as Modem Manager is going to work
only if the nonfree-firmwares are present.
2022-04-14 14:24:21 +02:00
Joel Selvaraj 55abb4944e community/device-xiaomi-beryllium: add q6voiced conf and fix dependency (MR 2982) (MR 3070)
The soc-qcom-sdm845-nonfree-firmware dependency is now moved from
firmware-xiaomi-beryllium package to the device package.
This will make the firmware package to only depend on firmware files.
2022-04-14 14:24:20 +02:00
Joel Selvaraj 177d39daa9 community/device-oneplus-enchilada: add q6voiced conf and fix dependency (MR 2982) (MR 3070)
The soc-qcom-sdm845-nonfree-firmware dependency is now moved from
firmware-oneplus-sdm845 package to the device package.
This will make the firmware package to only depend on firmware  files.
2022-04-14 14:24:19 +02:00
Joel Selvaraj 2fc34fb266 community/device-oneplus-fajita: fix dependency (MR 2982) (MR 3070)
The soc-qcom-sdm845-nonfree-firmware dependency is now moved from
firmware-oneplus-sdm845 package to the device package.
This will make the firmware package to only depend on firmware  files.
2022-04-14 14:24:18 +02:00
Joel Selvaraj 7fa696223d community/firmware-oneplus-sdm845: remove soc-qcom-sdm845-nonfree-firmware dependency (MR 2982) (MR 3070)
The soc-qcom-sdm845-nonfree-firmware dependency is now moved from
firmware-oneplus-sdm845 package to the device package.
This will make the firmware package to only depend on firmware  files.
Also, pmb:cross-native is added to the package options so CI testcases
doesn't fail.
2022-04-14 14:24:18 +02:00
Sicelo A. Mhlongo 4a8b8c252e linux-nokia-n900: update kernel to LTS 5.15.31 (MR 3032) (MR 3070)
[ci:skip-build] Already built successfuly on CI in MR
2022-04-12 19:00:30 +02:00
Martijn Braam 8bd151c7d4 community/samsung-espresso3g: backport from edge (MR 3070)
Backport the samsung-espresso3g related packages from
edge for the stable service pack
2022-04-12 19:00:30 +02:00
Dylan Van Assche e6ed74041c linux-odroid-hc2: upgrade to 5.16.14 (MR 3006) (MR 3070)
[ci:skip-build]: already built successfully in CI
2022-04-12 19:00:29 +02:00
Martijn Braam 606c55ed3c device/pine64-pinephone: increase lima timeout (MR 3070)
The lima timeout is increased to 2000ms to prevent an issue
where the screen starts flickering between 2 frames when the
CPU load is high.

For details see https://gitlab.com/postmarketOS/pmaports/-/issues/805
2022-04-12 19:00:23 +02:00
Martijn Braam 9c9c991d76 main/powersupply: upgrade to 0.6.0 (MR 3025) (MR 3070) 2022-04-12 18:55:02 +02:00
Martijn Braam dc4a225992 main/postmarketos-tweaks: upgrade to 0.11.0 (MR 3024) (MR 3070) 2022-04-11 16:28:39 +02:00
Oliver Smith 9f89fa86b3 cross/busybox-static-*: upgrade to 1.34.1-r5 2022-04-10 14:37:16 +02:00
Oliver Smith 00da43910d Revert "temp/squeekboard: backport upgrade to 1.16.0 (MR 2967)"
Fails to build, revert it to unblock publishing the rest of the service
pack. Details in:
https://gitlab.com/postmarketOS/pmbootstrap/-/issues/2110

This reverts commit 9540fe060d.
2022-03-14 08:38:59 +01:00
Alexander Martinz 5a8eca20c6 linux-postmarketos-qcom-sdm845: upgrade to 5.16.12 (MR 2986) (MR 2967)
For a merge list, please see the merge commits:
  - 5.16.6  - (https://gitlab.com/sdm845-mainline/linux/-/commit/521f32a4e0920b3ef3bc29fd0a6811dbe8c6f21a)
  - 5.16.7  - (https://gitlab.com/sdm845-mainline/linux/-/commit/36f968514b328e4dae65ca4503707643f691b3e8)
  - 5.16.8  - (https://gitlab.com/sdm845-mainline/linux/-/commit/3023f6e3b7d4c1e4d10efc603fbe0d6e333a39f4)
  - 5.16.9  - (https://gitlab.com/sdm845-mainline/linux/-/commit/a87b941715f881a715add95260cff3699063073c)
  - 5.16.10 - (https://gitlab.com/sdm845-mainline/linux/-/commit/eb85bcb0a34a8620fe0b3f2bb04d3ed4fa64d31f)
  - 5.16.11 - (https://gitlab.com/sdm845-mainline/linux/-/commit/73291a1c42e0696daf0ccd8c5e89481579d4fad7)
  - 5.16.12 - (https://gitlab.com/sdm845-mainline/linux/-/commit/77c0e13ec39469a2e3057e1c1853f425626b50e4)

Change-Id: I806a2c57793e7815d24b57cf46621b9ec5d10f3b
Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>

(cherry picked from commit 5ec32e252e)

[ci:skip-build]: CI will not be able to complete building this
[ci:skip-vercheck]: did not change the version of APKBUILDs on purpose
when fixing the checksum change for the CVE patches (see first patch in
this merge request)
2022-03-13 17:08:02 +01:00
Alexander Martinz 1ba0383f39 linux-postmarketos-qcom-sdm845: upgrade to 5.16.5 (MR 2899) (MR 2967)
For a merge list, please see the merge commits:
  - 5.16.3 - (https://gitlab.com/sdm845-mainline/linux/-/commit/98fb3b41210d7de922ece6651ea89231e3aed163)
  - 5.16.4 - (https://gitlab.com/sdm845-mainline/linux/-/commit/2962c41f9da16a931f39fc78678fd63bedc62a51)
  - 5.16.5 - (https://gitlab.com/sdm845-mainline/linux/-/commit/9ee391628fb83b8c419ce5d4fe7ef47fddf30be0)

Change-Id: If5ba0303b6a9a636ec1f303739804a9fa9c37e2a
Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>

[ci:skip-build] Already built successfuly on CI in MR

(cherry picked from commit fac272225b)
2022-03-13 17:04:59 +01:00
Alexander Martinz 6a1527e8c5 linux-postmarketos-qcom-sdm845: upgrade to 5.16.2 (MR 2877) (MR 2967)
Merge list:

5fd3e07fd10e Linux 5.16.2
a498f4a42b81 ALSA: hda/realtek: Re-order quirk entries for Lenovo
21ad9041b615 ALSA: hda/realtek: Add quirk for Legion Y9000X 2020
5053b09e0e90 ALSA: hda/tegra: Fix Tegra194 HDA reset failure
ea3fcb111c87 ALSA: hda: ALC287: Add Lenovo IdeaPad Slim 9i 14ITL5 speaker quirk
73990b61c549 ALSA: hda/realtek - Fix silent output on Gigabyte X570 Aorus Master after reboot from Windows
2ac0c35159be ALSA: hda/realtek: Use ALC285_FIXUP_HP_GPIO_LED on another HP laptop
08968ce43f9d ALSA: hda/realtek: Add speaker fixup for some Yoga 15ITL5 devices
7faa2fb7bcd1 perf annotate: Avoid TUI crash when navigating in the annotation of recursive functions
1f21b193707e firmware: qemu_fw_cfg: fix kobject leak in probe error path
fd8a2f12de64 firmware: qemu_fw_cfg: fix NULL-pointer deref on duplicate entries
261f47d05859 firmware: qemu_fw_cfg: fix sysfs information leak
105ee59fc79e rtlwifi: rtl8192cu: Fix WARNING when calling local_irq_restore() with interrupts enabled
230d1fa69ff8 media: uvcvideo: fix division by zero at stream start
c923276ddd49 video: vga16fb: Only probe for EGA and VGA 16 color graphic cards
0b1a05b219fe 9p: fix enodata when reading growing file
4947e1735a87 9p: only copy valid iattrs in 9P2000.L setattr implementation
cda396e5ce51 NFSD: Fix zero-length NFSv3 WRITEs
f3f2900c93e2 remoteproc: qcom: pas: Add missing power-domain "mxc" for CDSP
07f5f305ed81 KVM: s390: Clarify SIGP orders versus STOP/RESTART
60af2066bc5d KVM: x86: don't print when fail to read/write pv eoi memory
ec985a8dfbe9 KVM: x86: Register Processor Trace interrupt hook iff PT enabled in guest
51d24f081b90 KVM: x86: Register perf callbacks after calling vendor's hardware_setup()
68fe61050dc2 perf: Protect perf_guest_cbs with RCU
8b1530a3772a vfs: fs_context: fix up param length parsing in legacy_parse_param
af8ad4718278 remoteproc: qcom: pil_info: Don't memcpy_toio more than is provided
931b93ac1fce orangefs: Fix the size of a memory allocation in orangefs_bufmap_alloc()
16a1622c3424 drm/amd/display: explicitly set is_dsc_supported to false before use
3bddfeab42ab devtmpfs regression fix: reconfigure on each mount

Change-Id: I3238c7c90d5723ca09df84a825dc4ad156dc92f9
Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>

[ci:skip-build] Already built well once on CI in MR

(cherry picked from commit 2ed6d379fc)
2022-03-13 17:04:59 +01:00
Alexander Martinz 4cc66cb8d6 linux-postmarketos-qcom-sdm845: upgrade to 5.16.1 (MR 2858) (MR 2967)
Ran `pmbootstrap kconfig edit linux-postmarketos-qcom-sdm845` to
regenerate the defconfig.

Change-Id: Ie4b9e6e4a790d37a1a1d8f479e7e10dfd3ef9db0
Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>

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

(cherry picked from commit dc66d0cbfd)
2022-03-13 17:04:59 +01:00
Alexander Martinz 61b976d56b linux-postmarketos-qcom-sdm845: enable visionox rm69299 (MR 2738) (MR 2967)
SHIFT6mq (axolotl) requires this panel driver.
Config is already merged upstream:
  - https://gitlab.com/sdm845-mainline/linux/-/commit/9ed86f14d0718d81a55708abe5355fd2a8a09b8d

Change-Id: I7d0286084df53b1a160702e8928f4691153b64f4
Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>

[ci:skip-build] Already built on CI in MR

(cherry picked from commit a9122b9cef)
2022-03-13 17:04:59 +01:00
elagost 33a490eb03 device-pine64-pinephone: add kb151 to initrd (MR 2966) (MR 2967)
(cherry picked from commit 4db07ad794)
2022-03-13 17:04:58 +01:00
Yassine Oudjana 973b7f226a community/linux-postmarketos-qcom-msm8996: upgrade to 5.16.12 (MR 2979) (MR 2967)
- Add support for the rear camera on xiaomi-scorpio
- Improve charging from SDPs
- Add extcon support on oneplus-oneplus3(t)
- Add container and zram kconfig checks to APKBUILD

[ci:skip-build] Already built successfuly on CI in MR

(cherry picked from commit 79be2d5074)
2022-03-13 17:04:58 +01:00
elagost 23dc6762da linux-postmarketos-allwinner: set kb151 as module (MR 2966) (MR 2967)
backported to 5.15.13 from:
(cherry picked from commit 297ff6bf57)
2022-03-13 17:04:58 +01:00
Clayton Craft 79bfaf0ae7 postmarketos-ui-phosh: enable waked by default (MR 2963) (MR 2967)
This will make resuming on alarm work out of the box. Not sure how this
was missed previously...?

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

(cherry picked from commit 164e9f010d)
2022-03-13 17:04:58 +01:00
Sicelo A. Mhlongo f86dd50c5d linux-nokia-n900: update to latest stable kernel (MR 2964) (MR 2967)
- update to kernel 5.15.25 stable
- add TUN as module, fixes pma#1435
- drop fully-upstreamed patches (lp55xx)
- add iio support for lis302dl (will send upstream)
- update N900 dts for lis302dl over iio (will send upstream)
- assign higher priority to patches from kernel.org (resolves pmb#2107)

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

(cherry picked from commit 18046f68f2)
2022-03-13 17:04:58 +01:00
Clayton Craft 4638d70d96 temp/dino: upgrade to latest in upstream feature/handy branch (MR 2930) (MR 2967)
[ci:skip-build]: already built successfully in CI

(cherry picked from commit b0971223a3)
2022-03-13 17:04:58 +01:00
Clayton Craft 0bb28a2a07 temp/mmsd-tng: remove aport (MR 2967)
A newer version is in the Alpine 3.15 stable branch
2022-03-13 17:04:58 +01:00
Clayton Craft 1ad9f95c5a temp/portfolio: backport upgrade to 0.9.3 (MR 2967) 2022-03-13 17:04:58 +01:00
Clayton Craft 7d9d0153b0 main/postmarketos-ui-phosh: add support for automounting disks (MR 2905) (MR 2967)
This installs/starts udiskie, a udisk2 helper, that facilitates
auto-mounting of removable drives.

Note support for umounting is broken in the current Portfolio release,
so disks have to be umounted manually:

    udiskie-umount /run/media/<user>/*

I decided to add this to the `depends` and not `pmb_recommends`, because
I felt like 1) this is a feature that folks would expect to work, 2) by
having it in depends, it'll 'fix' existing installs where mounting
removable disks automatically is not implemented

(cherry picked from commit 5979bd6813)
2022-03-13 17:04:58 +01:00
Pablo Correa Gómez 91cdd0fbaa main/postmarketos-ui-phosh: add default handlers for tel and sms (MR 2932) (MR 2967)
Closes #929

(cherry picked from commit 5eed24ebad)
2022-03-13 17:04:57 +01:00
Clayton Craft 9540fe060d temp/squeekboard: backport upgrade to 1.16.0 (MR 2967) 2022-03-13 17:04:57 +01:00
Clayton Craft 7da7c1409e main/postmarketos-base: set os-release to SP3 (MR 2967) 2022-03-13 17:04:57 +01:00
Oliver Smith 3961141cba linux-*: put CVE patches into pmaports repository (MR 2967)
The checksums of the patches on git.kernel.org have changed. Put the
patches inside this git repository instead of downloading it from
git.kernel.org.
2022-03-13 17:04:50 +01:00
Clayton Craft 292d8caf96 linux-*: add patch for CVE-2022-0847 (MR 2990)
the following kernels were excluded:

- linux-asus-me176c, since dirtypipe is only >=5.8 and that kernel is 5.4
- linux-nokia-n900: 5.15.25 is already patched
- linux-postmarketos-qcom-msm8996: 5.16.12 is already patched
- linux-postmarketos-qcom-sdm845: 5.16.12 is already patched

* note not all of these kernels are at the versions above, but they will
  be in the service pack 3 releas

  [ci:skip-build] too many kernels for CI to build before timing out
2022-03-09 14:20:08 -08:00
Clayton Craft 78c3fa5e0e main/linux-*: drop kernels not used by any devices in 21.12 (MR 2990) 2022-03-09 13:31:47 -08:00
Minecrell a96b4e098d {main,cross}: restore gcc4/gcc6 for v21.12 stable branch (MR 2942)
Compilers are a big pain to build, and right now everyone who wants to
test the stable branch on some unsupported downstream devices has to
build gcc4/6 themselves locally, wasting lots of precious energy. :)

Having these (cross-)compilers available in the postmarketOS repo for
stable releases can be also useful for other projects. For example,
for lk2nd I would like to do some basic compile testing with gcc4
(since this is what Qualcomm used). The gcc4 from postmarketOS is
pretty much the most easily available gcc4-armv7 for Alpine Linux. :)

This should not have any disadvantage for devices using stable, there
will just be additional packages available in the binary repository.

This commit simply reverts parts of b78a0ca7 ("remove packages not
supported in v21.12").

[ci:skip-build]: already built locally, will probably take too long
[ci:skip-vercheck]: let's keep the existing pkgrel for those
2022-02-27 18:24:22 +01:00
Anjandev Momi 57a8cef9e2 temp/sxmo-utils: upgrade to 1.8.2 (MR 2943)
[ci:skip-build] already built successfully in CI
2022-02-17 11:29:05 -08:00
Clayton Craft a095646449 postmarketos-base: add sysctl config to disable rp_filter on ipv4 (MR 2943)
MMS support (via mmsd-tng) involves sending/receiving network
requests/responses over the wwan interface. If it's ipv4-only and the
device is connected to some other ipv4 network on another iface (like
wifi), this can cause the rp_filter to reject responses on wwan iface
because it incorrectly thinks they are martian packets.

This does theoretically disable some "security" feature in the kernel,
but it's worth noting that:

1) rp_filter isn't implemented at all in the kernel for ipv6

2) other distros (mobian, pureos at least) are also disabling rp_filter

3) this seems to be a relatively common problem with folks using mms on
   pmOS, since many carriers' data networks are ipv4-only

also see:
https://gitlab.com/kop316/mmsd/-/merge_requests/55/diffs?commit_id=b22c253fb939ff1eb949ea4e628706e6a28c851a

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

(cherry picked from commit caec14561d)
2022-02-16 12:16:45 -08:00
Anjandev Momi 0d566ce9e6 temp/wlroots: copy to sxmo-wlroots to override the fork in stable (MR 2927)
sxmo-wlroots was installed from aports 3.15 when pmOS v21.12 was released.
As such, apk always looks for a package named sxmo-wlroots to satisfy
the wlroots dependancy while sxmo-wlroots is in 3.15.

This patch copies the contents of the latest required wlroots into
sxmo-wlroots so that users dont have to deal with outdated library
on the latest service pack 2. Moreover, apk wont complain about
sxmo-wlroots doesnt exist resulting in broken installs and manual
intervention.

[ci:skip-vercheck]
2022-02-11 23:45:42 -08:00
Clayton Craft 6a8841e398 temp/phosh: backport upgrade to 0.15.0-r1
[ci:ignore-count]
[ci:skip-vercheck]
2022-02-10 17:01:20 -08:00
Clayton Craft 4e89402406 temp/mmsd-tng: backport upgrade to 1.8 2022-02-10 17:01:19 -08:00
Clayton Craft 0ddfc2077d temp/chatty: backport upgrade to 0.6.1
backported from Alpine edge

[ci:ignore-count]
2022-02-09 11:45:46 -08:00
Anjandev Momi 1bd0fa467c sxmo: upgrade to 1.8.2 (MR 2912)
[ci:skip-build] already built successfully in CI

(cherry picked from commit 9b595f3815)
2022-02-09 11:45:46 -08:00
Anjandev Momi 9898705fc8 temp/clickclack: backport upgrade to 0.2 2022-02-09 11:45:45 -08:00
Anjandev Momi ad20f67825 temp/wayout: backport upgrade to 0.1.2 2022-02-09 11:45:45 -08:00
Anjandev Momi 26ddea8821 temp/sxmo-dmenu: backport upgrade to 5.0.13 2022-02-09 11:45:44 -08:00
Anjandev Momi dfb8a2d84c temp/sxmo-utils: backport upgrade to 1.8.1 2022-02-09 11:45:44 -08:00
Anjandev Momi 8ddc4328c8 temp/wlroots: backport from alpine edge to support sxmo-sway 2022-02-09 11:45:43 -08:00
Anjandev Momi d463aba185 temp/wayland-protocol: backport from alpine edge to support sxmo-sway 2022-02-09 11:45:43 -08:00
Anjandev Momi 0c3400c1d1 temp/wayland: backport from alpine edge to support sxmo-sway 2022-02-09 11:45:42 -08:00
Anjandev Momi f2b76ae1b1 temp/sxmo-sway: backport from alpine edge 2022-02-09 11:45:42 -08:00
Jakob Hauser 232c85d05f samsung-serranove: add udev rule for modem (MR 2800)
Due to a regression in ModemManager 1.18.2, a special case to reduce
facility lock query was implemented in ModemManager. Versions up to
1.18.6 need to be patched (separate merge request, possibly in Alpine
Linux). For more details, see pmaports issue #1274.

This udev rule makes use of this special case for device
samsung-serranove.

(cherry picked from commit 9abe7e28b2)
2022-02-09 11:45:41 -08:00
Oliver Smith 1045728f90 main/postmarketos-ui-phosh: add !pipewire-pulse (MR 2890)
Prevent apk from pulling in pipewire-pulse instead of pulseaudio, as
this leads to various audio issues with Phosh in postmarketOS (volume
buttons not working, no sound in various applications).

Pipewire will be a great replacement for pulseaudio, but let's rather
enable it intentionally for Phosh once we fixed everything that's
currently breaking with it. Without this patch it may get installed when
installing or upgrading other packages (not entirely sure how it gets
triggered yet, but I have seen it myself multiple times and we've gotten
reports about it).

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

(cherry picked from commit b70a36190b)
2022-02-09 11:45:41 -08:00
Dylan Van Assche 0186690579 main/postmarketos-ui-phosh: ask for SIM unlock (MR 2896)
Show a prompt at startup to unlock the SIM if it is locked.

(cherry picked from commit 284391cd9f)
2022-02-09 11:45:40 -08:00
Newbyte 3686c42324 main/postmarketos-ui-phosh: remove notice about numeric passwords (MR 2883)
Phosh supports arbitrary passwords as of release 0.15.0.

(cherry picked from commit ca6579f545)
2022-02-09 11:45:39 -08:00
Pablo Correa Gómez 71d721043b main/postmarketos-ui-phosh: disable gnome-software auto updates (MR 2653)
The `download-updates` keyword is not a good naming, but it does
not only download, but also tries to install the updates

(cherry picked from commit c3a61c0b9e)
2022-02-09 11:45:39 -08:00
Oliver Smith 6275cdf21b main/postmarketos-ondev: upgrade to 0.7.4 (MR 2891)
Allow non-numeric passwords for Phosh too (now that it's implemented
there).

[ci:skip-build] Already built successfuly on CI in MR

(cherry picked from commit 142a15c464)
2022-02-09 11:45:38 -08:00
Clayton Craft f583c06350 temp/phosh: backport upgrade 0.15.0 from Alpine edge
New features/bug fixes for the stable branch
2022-02-09 11:45:38 -08:00
Clayton Craft 60892ad1ea temp/phoc: backport upgrade to 0.10.0 from Alpine edge
Required for phosh 0.15.0
2022-02-09 11:45:37 -08:00
Clayton Craft a1b96c7c43 temp/chatty: backport upgrade 0.6.0 from Alpine edge
This new release fixes a few issues for SMS, and adds support for MMS
2022-02-09 11:45:37 -08:00
Clayton Craft 2a70c74460 main/postmarketos-base: set os-release to SP2
(cherry picked from commit 4e1f741af8f40ca60c3f4168121720c35ecd4e25)
2022-02-09 11:45:36 -08:00
Oliver Smith 86f6dac53b cross/busybox-static-*: upgrade to 1.34.1-r4 2022-02-05 11:37:32 +01:00
Anjandev Momi 30ea5af0d7 temp/wvkbd: backport upgrade to 0.7 (support sxmo 1.7.1) (MR 2862) 2022-01-19 02:42:47 -05:00
Anjandev Momi d9b96e0eff temp/sxmo-utils: backport upgrade to 1.7.1 (MR 2862) 2022-01-18 22:11:28 -05:00
Anjandev Momi 4bcc439f83 temp/sxmo-dmenu: backport upgrade to 5.0.12 (support sxmo 1.7.1) (MR 2862) 2022-01-18 22:11:01 -05:00
Anjandev Momi 397b1bce85 temp/svkbd: backport upgrade to 0.4.1 (support sxmo 1.7.1) (MR 2862) 2022-01-18 22:07:53 -05:00
Anjandev Momi dd677d21bd temp/sxmo-swayidle: remove (MR 2862) 2022-01-18 22:01:39 -05:00
Stacy Harper f0c3e657ab main/postmarketos-ui-sxmo-de-sway: rely on upstream swayidle (MR 2859) 2022-01-18 17:50:32 +01:00
Stacy Harper 59b6abf4e8 temp/swayidle: fork from alpine aports (MR 2859) 2022-01-18 17:50:32 +01:00
Martijn Braam db8391a655 main/postmarketos-base: adjust for v21.12.1 (MR 2845)
[ci:skip-vercheck]
[ci:ignore-count]
[ci:skip-build]
2022-01-16 22:58:22 +01:00
Martijn Braam 3dd9a7cc8c main/linux-postmarketos-allwinner: upgrade to 5.15.13 (MR 2845)
Adds a newer stable release of the kernel with additional config for the
PinePhone keyboard
2022-01-16 22:00:11 +01:00
Sicelo A. Mhlongo d64f66441d temp/i3blocks: backport i3blocks from testing (MR 2845)
i3blocks is required for i3wm on N900. Since it is not in Alpine stable
release, backport it. Alpine maintainer has been contacted to promote it to
community
2022-01-15 13:24:31 +01:00
Sicelo A. Mhlongo 8796e198d7 linux-nokia-n900: workaround for modem regression (MR 2852) (MR 2845)
This is a cherry pick of Leste commit 2c7e4a1ac8ec1f908927793e893566aac3dcb9df,
to revert mainline commit f959dcd6ddfd29235030e8026471ac1b022ad2b0, which breaks
N900 modem. This is a temporary workaround until a proper fix is found.
2022-01-15 13:24:31 +01:00
Martijn Braam 3482b09b46 device-nokia-n900: reintroduce in stable (MR 2845) 2022-01-14 15:32:57 +01:00
Pablo Correa Gómez e76c5d0677 temp/gnome-control-center: enable printer panel (MR 2795) (MR 2845)
The bug that made the cups client in the panel crash is now
fixed and the panel is finally usable
2022-01-14 15:32:56 +01:00
Martijn Braam aab5b1b74d temp/sxmo-swayidle: backport from alpine (MR 2845) 2022-01-14 15:32:55 +01:00
Anjandev Momi 77f33d2318 main/sxmo-common: upgrade to 1.7.1, add vvmd dependency (MR 2830) (MR 2845) 2022-01-14 15:32:54 +01:00
Maarten van Gompel 1c303d77b7 main/postmarketos-ui-sxmo-de-dwm: upgrade to 1.7.0 (MR 2827) (MR 2845) 2022-01-14 15:32:54 +01:00
Maarten van Gompel 99fa6b12a7 main/postmarketos-ui-sxmo-de-sway: upgrade to 1.7.0 (MR 2827) (MR 2845) 2022-01-14 15:32:53 +01:00
Maarten van Gompel a354374d48 main/sxmo-common: upgrade to 1.7.0 (MR 2827) (MR 2845) 2022-01-14 15:32:52 +01:00
Martijn Braam 8258f947eb temp/gnss-share: backport from alpine (MR 2845) 2022-01-14 15:32:51 +01:00
Clayton Craft 33c89091e9 purism-librem5: replace gpsd with gnss-share (MR 2736) (MR 2845)
gnss-share is a location provider I wrote for the librem 5's GPS module,
and can be used directly from geoclue. It allows saving and loading
A-GPS data (manual steps, for now) to facilitate faster fixes.

I'm not completely happy with having to use sed to patch geoclue's conf,
but:

1) I really only need to change 1 line

2) there's a non-zero chance geoclue's conf will be changed in aports if
   new permissions are required for things later

So carrying the config in the device package and using
"replaces=geoclue" (like the postmarketos-* stuff) didn't seem like a
maintainable solution long term since the geoclue conf might gain needed
fixes/features that might make a copy in the device package outdated...
2022-01-13 16:54:51 +01:00
Jakob Hauser e637569763 main/postmarketos-ui-mate: add pulseaudio (MR 2820)
To make sound work out of the box. And being able to choose audio
output when connected via bluetooth.

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

(cherry picked from commit 7e9cb6a305)
2022-01-07 12:26:30 +01:00
Clayton Craft c78ba7bcfe temp/gnome-clocks: remove fork (MR 2811)
Alpine aports 3.15 has a newer version of gnome-clocks AND is has the
backgrounding patch... so this fork should have been removed once those
were added upstream in aports but it was missed.

[ci:skip-build] already built successfully in CI
2022-01-02 20:02:28 -08:00
Oliver Smith 104bd52d99 main/postmarketos-tweaks: upgrade to 0.9.0 (MR 2801)
(cherry picked from commit 734aa53e49)
2021-12-29 13:26:35 +01:00
Caleb Connolly ea1b695f4c temp/hkdm: upgrade to 0.1.7 (MR 2787)
Fix zombie processes being created on every command run.

[ci:skip-build] already built successfully in CI (except aarch64, it
times out, but builds OK locally)
2021-12-27 20:20:04 -08:00
Maarten van Gompel 302fbe4417 main/postmarketos-ui-sxmo-de-{dwm|sway}: upgrade to 1.6.1 (MR 2794)
[ci:skip-build] already built successfully in CI
2021-12-27 16:02:49 -08:00
Caleb Connolly 891df96df3 linux-postmarketos-qcom-sdm845: upgrade to 5.16-rc5 (MR 2776)
[ci:skip-build] already built successfully in CI

(cherry picked from commit 28f2b00a14)
2021-12-19 19:06:25 -08:00
Caleb Connolly 01c310d222 temp/hkdm: work around weird cargo fetch bug (MR 2770)
Vendor all the deps, they have been included in hkdm so that cargo can
build offline and not try and run git...

[ci:skip-build] aarch64 times out in CI, but other archs build OK and it
builds locally with pmb
2021-12-19 15:13:53 -08:00
Dylan Van Assche 2d6ed707e4 linux-odroid-hc2: upgrade to 5.15.7 (MR 2774)
And add patches for CVE-2021-39685

[ci:skip-build] Already built on CI in MR

(cherry picked from commit d5c96ecc4c)
2021-12-20 00:09:37 +03:00
Antoni Aloy Torrens b761152430 main/postmarketos-base-ui: add Xwrapper script for X11 (MR 2773)
Xorg needs an Xwrapper.config script with the line 'needs_root_rights=yes' to get tinydm + sxmo to work

(cherry picked from commit bd178b8db3)
2021-12-19 21:56:13 +03:00
Yassine Oudjana 143506cdc4 main/linux-postmarketos-qcom-msm8996: upgrade to 5.15.10 (MR 2771)
[ci:skip-build] Already built on CI in MR

(cherry picked from commit d7bd728c05)
2021-12-18 15:26:27 +03:00
Bart Ribbers 46576a7f28 main/linux-postmarketos-rockchip: add patches for CVE-2021-39685 (MR 2765)
[ci:skip-build] Already built on CI in MR

(cherry picked from commit 8a43a51b94)
2021-12-17 20:54:34 +03:00
Bart Ribbers c3d7583ef9 main/linux-postmarketos-allwinner: add patches for CVE-2021-39685 (MR 2764)
[ci:skip-build] Already built on CI in MR

(cherry picked from commit 1e047e8977)
2021-12-17 20:54:25 +03:00
Minecrell a4358266e3 main/linux-postmarketos-qcom-msm8916: add patches for CVE-2021-39685 (MR 2757)
NOTE: Should be likely backported without the kernel config changes
      since Alpine 3.15 still has the older gcc version.

[ci:skip-build] Already built successfully on CI

(cherry picked from commit c1a8c0a631)
2021-12-17 16:15:06 +01:00
Alexey Min dfcd843108 main/linux-postmarketos-qcom-msm8974: upgrade to 5.15.9 (MR 2746)
Simple upgrade with few generic kernel features enabled
 * IWD support
 * F2FS
 * NTFS3_FS
 * USB mass storage support
 * disable MTD and build more things as modules to reduce
   kernel size to compensate some new built-in options,
   as kernel doesn't boot otherwise.

No new things for pmOS's devices (yet). Should work same as before.

v5.15.9 contains latest CVE fixes.

Also mark myself as maintainer.

(cherry picked from commit a6b343c833)
(cherry picked from commit 83d8199ee8)

(.config regenrated using gcc-10)

[ci:skip-build] Builds locally
2021-12-17 06:44:08 +03:00
Caleb Connolly 44bf58ca79 phosh,plasma-mobile,sxmo-de-dwm,sxmo-de-sway install ttyescape by default (MR 2754)
[ci:skip-build] already built successfully in CI

(cherry picked from commit fe708f8bc3)
2021-12-16 17:14:05 -08:00
Caleb Connolly ed316f2ec6 main/ttyescape: upgrade to hkdm/buffyboard (MR 2713)
This upgrades ttyescape to use buffyboard, a new fbkeyboard replacement
by @Cherrypicker. It adds a lot of missing keys and uses the same layout
as Phosh's Squeekboard, so should feel much more like home for Phosh
users.

This also switches to the new HKDM daemon for hotkey handling, replacing
triggerhappy.

[ci:skip-build] already passed

(cherry picked from commit 029cf83cf1)
2021-12-16 17:14:05 -08:00
Caleb Connolly 3465259c52 main/triggerhappy: drop 2021-12-16 17:14:05 -08:00
Caleb Connolly 6ebebfeacc temp/buffyboard: fork from alpine aports
Forked from alpine
2021-12-16 17:14:04 -08:00
Caleb Connolly 5db451a732 temp/hkdm: fork from alpine aports
Forked from alpine for 21.12
2021-12-16 17:14:04 -08:00
Oliver Smith 351a5682a5 main/postmarketos-ui-phosh: firefox improvements (MR 2741)
Display the app icon properly, instead of the "unknown" icon, in the
activity view. Phosh attempts to open a .desktop file with the name of
the gtk app-id, but the app-id is "firefox" and the file is named
org.mozilla.firefox.desktop (see related commit, where it was renamed
for a good reason). The way Phosh is doing the name lookup doesn't
always work for other apps too, phosh_get_desktop_app_info_for_app_id()
has workarounds e.g. for gnome-control-center hardcoded. As workaround,
add a .desktop file that makes the icon show up properly, but is not
displayed anywhere else (NoDisplay=true).

Replace epiphany with FF in the default favorite applications in phosh
(top 4 displayed at the top). We already install FF instead of epiphany
and so the 4th place is currently empty.

Related: https://gitlab.alpinelinux.org/alpine/aports/-/commit/2d291a4afc2c71e25c8fd9fff188eff436b80580
(cherry picked from commit 51fce1f111)
2021-12-16 17:14:04 -08:00
Minecrell d9246162b0 community/linux-asus-me176c: upgrade to 5.4.165 (MR 2756)
Should fix CVE-2021-39685

[ci:skip-build] Already built on CI in MR

(cherry picked from commit 717130ccfe)
2021-12-16 17:04:31 -08:00
Clayton Craft b56caef806 linux-purism-librem5: backport fixes for CVE-2021-39685 (MR 2761)
[ci:skip-build] already built successfully in CI

(cherry picked from commit 20a0fee217)
2021-12-16 15:41:00 -08:00
Clayton Craft e0c5363a43 main/sxmo-common: don't disable polkit service in post-{install,upgrade} (MR 2755)
rc-update fails if this service is not in the default runlevel,which is
the case if it's a brand new installation, or would be the case later on
upgrading this package again after the service was already removed from
the runlevel.

The issue that c47c62e3 set out to solve isn't fatal, if polkit fails to
start by openrc then users can manually remove it from the runlevel.

partially reverts c47c62e3

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

(cherry picked from commit a3611e3797)
2021-12-15 20:42:23 -08:00
Caleb Connolly a99ce58cfd linux-postmarketos-qcom-sdm845: upgrade to 5.16-rc4 (MR 2690)
Finally a new upgrade! This brings along some minor driver changes and
improvements, more stuff slowly landing upstream.

We also get a few new splats during boot, these are inevitable at this
point due to fw_devlink changes and large reworking of the drm/msm code,
they are caused by the common clock framework not knowing that some
clocks are left enabled by the bootloader, it panics when they aren't in
a state it expects. They are harmless as far as I know.

[ci:skip-build]

(cherry picked from commit 4ed5c1fe13)
2021-12-15 19:25:56 -08:00
Anjandev Momi 864d2d128d sxmo: Dont add polkit to default run level (MR 2750)
it's started by dbus

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

(cherry picked from commit c47c62e31f)
2021-12-15 17:23:08 -08:00
Oliver Smith 80184e1873 main/mobile-config-firefox: upgrade to 3.0.0 (MR 2740)
Related: https://gitlab.com/postmarketOS/mobile-config-firefox/-/tags/3.0.0
(cherry picked from commit 2a83c33cb9)
2021-12-15 16:22:21 -08:00
Clayton Craft 47fb01b5d5 main/msm-firmware-loader: fix shellcheck failure (MR 2752)
A recent(?) update in shellcheck made this fail, possibly because the
test in shellcheck was fixed(?) or ???

The failure this fixes is:

Test with shellcheck: ./main/msm-firmware-loader/msm-firmware-loader.sh
In msm-firmware-loader.sh line 49:
	if [ -z "${FW_PARTITIONS##*$PARTNAME*}" ] && [ -n "$PARTNAME" ]
                                   ^-------^ SC2295 (info): Expansions inside ${..} need to be quoted separately, otherwise they match as patterns.

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

(cherry picked from commit 16472c5b2c)
2021-12-15 16:19:46 -08:00
Bobby The Builder f677d9013a main/linux-postmarketos-allwinner: upgrade to 5.15.3 (MR 2701)
[ci:skip-build]: already built successfully in CI

(cherry picked from commit ba23cc03b0)
2021-12-12 13:29:17 -08:00
Clayton Craft b0c61184ad temp/megapixels-purism: new aport (MR 2659)
This packages the megapixels fork that purism has supporting the librem
5.

The `provides="megapixels"` is there so that apk doesn't try to install
both megapixels and this package side-by-side. If the user explicitly
installs megapixels-purism, apk will remove megapixels first. The
original megapixels is still preferred by apk by default.

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

(cherry picked from commit f6f97c5469)
2021-12-12 17:49:33 +01:00
Clayton Craft 40802ad95a pine64-pinephone: configure shorter default suspend time (MR 2728)
[ci:skip-build] already built successfully in CI

(cherry picked from commit 1ef69646d0)
2021-12-10 11:10:12 -08:00
Clayton Craft 198fb563c9 temp/gnome-control-center: add patch for additional suspend time options (MR 2728)
[ci:skip-build] already built successfully in CI

(cherry picked from commit 00056d48f4)
2021-12-10 11:09:57 -08:00
Clayton Craft 62bf533ab0 ci: disable x86 and armhf
These are not supported in the release
2021-12-10 10:51:38 -08:00
Minecrell 8268991d95 modem/msm-modem: uim-selection: Allow configuring wait time for SIM (MR 2695)
Unfortunately it looks like some modem firmwares (or SIM cards?) need
more time until the SIM card shows up in the modem. This means that the
SIM card might not get configured, making it look like it was not
detected at all. On the other hand, having the previous long wait loop
affects _all devices_ when there is really no SIM inserted.

The proper solution would be to make it possible to configure SIM cards
once they show up (probably in ModemManager). Until then, try to make it
possible to workaround this by introducing a configurable delay to wait
for the SIM card. It is set to minimal "1 seconds" by default but could
be increased by the user if needed to give the modem enough time to detect
the SIM card.

This reverts commit 683b543a3b ("msm-modem-uim-selection: Don't wait
for SIM (MR 2470)" but with a new configuration mechanism and a default
of 1 second only.

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

(cherry picked from commit f563e0ddcf)
2021-12-10 10:33:12 -08:00
Bart Ribbers 5d002b77e9 main/postmarketos-ui-plasma-mobile: switch to modemmanager (MR 2730)
Upstream has switched from ofono to modemmanager since Plasma 5.23 and
Plasma Mobile Gear 21.12. Since the latter has just been released it's
now time to switch our images too.

The modemmanager service will be enabled to start on default and for
existing installations the .post-upgrade script will disable and stop
the existing ofono service and enable and start modemmanager instead.
2021-12-08 11:26:50 +01:00
Nikita Travkin f29c8d42a3 wileyfox-crackling: Add udev rule for proximity sensor (MR 2700)
iio-sensor-proxy wants to know when to report "near" status. Add an udev
rule defining that value as a workaround untl it can be passed from
the DT.

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

(cherry picked from commit 8df6c1c0f7)
2021-12-05 22:45:15 -08:00
Clayton Craft 81db456f12 main/postmarketos-ui-bigscreen: drop package
Depends on things in edge/testing. PureTryOut said to drop it from the
release.
2021-12-05 22:25:09 -08:00
Clayton Craft cc00ba9aef device/community/firmware-pine64-rockpro64: move from testing (MR 2727)
Devices that depend on this are in community.

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

(cherry picked from commit 69634b878e)
2021-12-05 21:32:00 -08:00
Clayton Craft 4f9e9ec8ca device/community/firmware-odroid-hc2: move from testing (MR 2726)
I suspect this was missed when the Odroid HC2 device was moved to
community.

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

(cherry picked from commit bbec68b244)
2021-12-05 21:24:44 -08:00
Yassine Oudjana add178efb3 main/linux-postmarketos-qcom-msm8996: upgrade to 5.15.6 (MR 2720)
[ci:skip-build] already built successfully in CI

(cherry picked from commit a59b385db3)
2021-12-05 21:21:36 -08:00
Yassine Oudjana 7cb0151270 xiaomi-scorpio: flash the kernel automatically (MR 2721)
Enable automatic kernel flashing on update.

(cherry picked from commit f3e6d4f227)
2021-12-05 22:11:18 +01:00
Yassine Oudjana 3aca1f5d9a xiaomi-scorpio: add DRM to the initramfs (MR 2721)
Add DRM modules and GPU firmware to the initramfs.

(cherry picked from commit 1a52b9c78f)
2021-12-05 22:11:11 +01:00
Jakob Hauser 2bf084173d samsung-a3|a5|klte|serranove: remap left touch key (MR 2718)
Remapping the left key of tm2-touchkey to KEY_MENU.

The KEY_APPSELECT, which is set by the device tree, is not available in
the postmarketOS UIs. In X11 UIs this is due to keycode limitation to
8 bit. In Wayland UIs the keycodes don't have this limitation but xkb
keycodes higher 255 are not processed correctly by several software
packages. It still makes sense to keep KEY_APPSELECT in the device tree
because this is the correct mapping intended by the manufacturers when
running the kernel on Android.

(cherry picked from commit c655f5cc9c)
2021-12-05 21:55:14 +01:00
Dylan Van Assche 1e3ee0b978 linux-odroid-hc2: upgrade to 5.15.5 (MR 2724)
Tested on my ODROID HC2 running edge

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

(cherry picked from commit 415ff553f0)
2021-12-05 21:35:05 +01:00
Oliver Smith 472a00fbf5 main/mobile-config-firefox: upgrade to 3.0.0_rc1 (MR 2723)
(cherry picked from commit 60a917222a)
2021-12-05 13:58:52 +01:00
Anjandev Momi fdc3843a05 sxmo-common: update bluetooth for new pipewire/wireplumber (MR 2717)
(cherry picked from commit 11ce9f240c)
2021-12-05 12:45:27 +01:00
Oliver Smith 01d03a0ab3 main/postmarketos-ondev: upgrade to 0.7.3 (MR 2712)
Increase boot size from 128 MiB to 256 MiB.

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

(cherry picked from commit 07bbd8c0c8)
2021-12-01 15:50:32 -08:00
Oliver Smith 6f928a7413 main/mesa-pvr-classic: drop
Fails to build, remove for now as it's the last remaining package
before the initial build of v21.12 is complete. We may not need it in
v21.12, depending on if we drop the N900 there or not.

Related: https://builds.sr.ht/~postmarketos/job/639197#task-pmbootstrap_build-735
2021-12-01 23:03:34 +01:00
Oliver Smith 8d0a5f3905 main/mkbootimg-osm0sis: fix upstream source
[ci:skip-vercheck]

(cherry picked from commit 6bba554f93)
2021-11-27 19:05:59 +01:00
Oliver Smith 609798716a temp/gnome-software-plugin-apk: fix upstream source
This will be upgraded soon, however let's let this broken URL not block
the initial v21.12 bring up for now. Again, same checksum as the
previous tarball.

For edge we'll probably remove this package and instead Alpine's version
instead. [ci:skip-vercheck]

(cherry picked from commit c39fa96886)
2021-11-27 19:05:48 +01:00
bo41 bbe9832681 ci: remove unused args argument from pmb.parse.apkbuild (MR 2711)
(cherry picked from commit 03c989ed54)
2021-11-27 16:30:01 +01:00
Oliver Smith 3e5a9efba0 main/fbkeyboard: fix upstream source url
again, same checksum, I verified that it builds.
[ci:skip-vercheck]

Related: https://builds.sr.ht/~postmarketos/job/636813#task-pmbootstrap_build-502
(cherry picked from commit f68ebfe7b8)
2021-11-27 13:44:40 +01:00
Oliver Smith 0ec99e4dc4 main/crust: fix upstream source url
Source URL has moved. This is the same version, the checksum of the
tarball is the same. I've verified, that this builds.
[ci:skip-vercheck]

Related: https://builds.sr.ht/~postmarketos/job/636792#task-pmbootstrap_build-343
(cherry picked from commit a38bef1be5)
2021-11-27 13:33:51 +01:00
Oliver Smith a6f4230d32 temp/wayout: fork from alpine edge
Needed for postmarketos-ui-sxmo-de-sway.
2021-11-27 11:25:24 +01:00
Oliver Smith 89608de640 anbox: drop
anbox-image doesn't build because the f-droid version packaged leads to
a 404. But we have waydroid now, which works better than anbox. So let's
drop it. I'll make a MR to drop it from edge too, this patch is for
fixing bpo being stuck while building v21.12.
2021-11-27 11:25:24 +01:00
Oliver Smith da79d8c770 main/postmarketos-ui-lxqt: drop
Depends on lxqt-desktop, which is not available in Alpine 3.15. If you
do need this on pmOS stable, make a MR to bring it back.
2021-11-27 11:25:24 +01:00
Oliver Smith 5a16d01c08 main/ofonoctl, pmos-ui-shelli: drop
Depends on py3-tabulate which is not available in Alpine 3.15. Looks
like nobody is using this in pmOS stable anyway, so let's drop it.

If you do use it, feel free to make a MR to bring it back.
2021-11-27 11:25:24 +01:00
Oliver Smith 7fc91af647 cross/busybox-static-*: upgrade to 1.34.1-r3 2021-11-27 11:25:19 +01:00
Oliver Smith 9c10427166 nokia-n900, samsung-espresso3g: remove
Not supported in v21.12, as discussed in issue pmaports 1276.
2021-11-26 01:27:44 +01:00
Oliver Smith b78a0ca78f remove packages not supported in v21.12
* device/testing, device/unmaintained
* cross/*-armhf, cross/*-x86
* gcc4 and gcc6
* postmarketos-ui-asteroid
2021-11-26 01:25:21 +01:00
Oliver Smith 8dafd0f8a4 main/postmarketos-base: adjust to v21.12 2021-11-26 01:23:57 +01:00
Oliver Smith 9c818a5841 === Branch v21.12 from master ===
Related: https://wiki.postmarketos.org/wiki/Create_release_branch
2021-11-26 01:05:30 +01:00
5712 changed files with 74000 additions and 1872797 deletions

No files matched your search

-22
View File
@@ -1,22 +0,0 @@
#!/bin/sh -e
# Description: run apkbuild-lint on modified APKBUILDs
# Options: native
# Use 'native' because it requires git commit history.
# https://postmarketos.org/pmb-ci
if [ "$(id -u)" = 0 ]; then
set -x
wget "https://gitlab.com/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
sh ./install_pmbootstrap.sh
exec su "${TESTUSER:-pmos}" -c "sh -e $0"
fi
# Wrap pmbootstrap to use this repository for --aports
pmaports="$(cd "$(dirname "$0")"/..; pwd -P)"
_pmbootstrap="$(command -v pmbootstrap)"
pmbootstrap() {
"$_pmbootstrap" --aports="$pmaports" "$@"
}
.ci/lib/apkbuild_linting.py
File renamed without changes.
-1
View File
@@ -1 +0,0 @@
lib/build_changed_aports.sh
-1
View File
@@ -1 +0,0 @@
lib/build_changed_aports.sh
-1
View File
@@ -1 +0,0 @@
lib/build_changed_aports.sh
-1
View File
@@ -1 +0,0 @@
lib/build_changed_aports.sh
-1
View File
@@ -1 +0,0 @@
lib/build_changed_aports.sh
-1
View File
@@ -1 +0,0 @@
lib/build_changed_aports.sh
Executable
+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 ".ci/build_changed_aports.py $JOB_ARCH"
@@ -7,7 +7,7 @@ import sys
import common
# pmbootstrap
import add_pmbootstrap_to_import_path
import testcases.add_pmbootstrap_to_import_path
import pmb.parse
import pmb.parse._apkbuild
import pmb.helpers.pmaports
@@ -11,7 +11,7 @@ import subprocess
import common
# pmbootstrap
import add_pmbootstrap_to_import_path # noqa
import testcases.add_pmbootstrap_to_import_path # noqa
import pmb.parse
import pmb.parse.version
import pmb.helpers.logging
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright 2023 Oliver Smith
# Copyright 2021 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
import argparse
@@ -13,7 +13,7 @@ def get_devices():
""":returns: list of all devices"""
ret = []
pmaports = (os.path.realpath(os.path.join(os.path.dirname(__file__) +
"/../..")))
"/..")))
for path in glob.glob(pmaports + "/device/*/device-*/"):
device = os.path.dirname(path).split("device-", 1)[1]
@@ -110,7 +110,7 @@ def main():
print("")
print("Now it's time to add some documentation:")
print("1) Create a device specific wiki page as described here:")
print(" https://wiki.postmarketos.org/wiki/Help:Device_Page")
print(" <https://wiki.postmarketos.org/wiki/Help:Device_Page>")
print("2) Set 'booting = yes' in the infobox of your device page.")
print("3) Run these tests again with an empty commit in your MR:")
print(" $ git commit --allow-empty -m 'run tests again'")
@@ -121,10 +121,6 @@ def main():
print("it more easily. Many times one person did a port with basic")
print("functionality, and then someone else jumped in and")
print("contributed major new features.")
print("")
print("NOTE: if you renamed a device in pmaports, rename it in the")
print("wiki as well and make sure to add it here:")
print("https://postmarketos.org/renamed")
return 1
else:
print("*** Wiki check successful!")
-43
View File
@@ -1,43 +0,0 @@
#!/bin/sh -e
# Description: verify CODEOWNERS file is sane
# https://postmarketos.org/pmb-ci
# TODO Future improvements:
# * Check that all devices in main/community have someone in CODEOWNERS
# * Check that GitLab user actually exists (e.g. deleted account, account with
# changed user name)
if grep -q " " CODEOWNERS; then
echo
echo "ERROR: Found space indentation in CODEOWNERS."
echo "ERROR: Please indent with tab characters."
grep " " CODEOWNERS
echo
exit 1
fi
fail=0
tmppipe=$(mktemp -u)
mkfifo "$tmppipe"
grep -v "^#" CODEOWNERS | cut -d' ' -f1 > "$tmppipe" &
while IFS= read -r line; do
[ -z "$line" ] && continue
# Check if entry generally exists
# shellcheck disable=SC2086
ls $line >/dev/null 2>&1 || { fail=1; echo "Non-existing: $line"; }
# Check that directories end with a slash
# shellcheck disable=SC2086
if test -d "$(ls -d $line)"; then
echo "$line" | grep -q '/$' || { fail=1; echo "Missing trailing slash: $line"; }
fi
done < "$tmppipe"
rm "$tmppipe"
if [ "$fail" = 1 ]; then
echo
echo "ERROR: Invalid CODEOWNERS entries, see above."
echo
exit 1
fi
-20
View File
@@ -1,20 +0,0 @@
#!/bin/sh -e
# Copyright 2023 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
# Description: check pkgver/pkgrel bumps, amount of changed pkgs etc
# Options: native
# Use 'native' because it requires git commit history.
# https://postmarketos.org/pmb-ci
if [ "$(id -u)" = 0 ]; then
set -x
# In .gitlab-ci.yml currently .ci/pytest.sh runs before this and
# already downloads and runs install_pmbootstrap.sh.
if ! [ -e install_pmbootstrap.sh ]; then
wget "https://gitlab.com/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
sh ./install_pmbootstrap.sh
fi
exec su "${TESTUSER:-pmos}" -c "sh -e $0"
fi
.ci/lib/check_changed_aports_versions.py
+14 -35
View File
@@ -17,13 +17,14 @@ def get_pmaports_dir():
global cache
if "pmaports_dir" in cache:
return cache["pmaports_dir"]
ret = os.path.realpath(os.path.join(os.path.dirname(__file__) + "/../.."))
ret = os.path.realpath(os.path.join(os.path.dirname(__file__) + "/.."))
cache["pmaports_dir"] = ret
return ret
def run_cmd(cmd, check=True, stderr=None):
""" Run a command and return the output """
def run_git(parameters, check=True, stderr=None):
""" Run git in the pmaports dir and return the output """
cmd = ["git", "-C", get_pmaports_dir()] + parameters
try:
return subprocess.check_output(cmd, stderr=stderr).decode()
except subprocess.CalledProcessError:
@@ -32,12 +33,6 @@ def run_cmd(cmd, check=True, stderr=None):
return None
def run_git(parameters, check=True, stderr=None):
""" Run git in the pmaports dir and return the output """
cmd = ["git", "-C", get_pmaports_dir()] + parameters
return run_cmd(cmd, check, stderr)
def add_upstream_git_remote():
""" Add a remote pointing to postmarketOS/pmaports. """
run_git(["remote", "add", "upstream",
@@ -90,21 +85,17 @@ def get_upstream_branch():
return ret
def get_changed_files(removed=True, print_info=True):
def get_changed_files(removed=True):
""" Get all changed files and print them, as well as the branch and the
commit that was used for the diff.
:param removed: also return removed files (default: True)
:returns: set of changed files
"""
def log_info(message):
if print_info:
print(message)
branch_upstream = f"upstream/{get_upstream_branch()}"
commit_head = run_git(["rev-parse", "HEAD"])[:-1]
commit_upstream = run_git(["rev-parse", branch_upstream])[:-1]
log_info("commit HEAD: " + commit_head)
log_info(f"commit {branch_upstream}: f{commit_upstream}")
print("commit HEAD: " + commit_head)
print(f"commit {branch_upstream}: f{commit_upstream}")
# Check if we are HEAD on the upstream branch
if commit_head == commit_upstream:
@@ -113,11 +104,11 @@ def get_changed_files(removed=True, print_info=True):
else:
# otherwise compare with latest common ancestor
commit = run_git(["merge-base", branch_upstream, "HEAD"])[:-1]
log_info("comparing HEAD with: " + commit)
print("comparing HEAD with: " + commit)
# Changed files
ret = set()
log_info("changed file(s):")
print("changed file(s):")
for file in run_git(["diff", "--name-only", commit, "HEAD"]).splitlines():
message = " " + file
if not os.path.exists(file):
@@ -126,7 +117,7 @@ def get_changed_files(removed=True, print_info=True):
ret.add(file)
else:
ret.add(file)
log_info(message)
print(message)
return ret
@@ -143,7 +134,7 @@ def get_changed_packages_sanity_check(count):
print("ERROR: Too many packages have changed!")
print()
print("This is a sanity check, so we don't end up building packages that")
print("have not been modified. CI won't run for more than three hours")
print("have not been modified. CI won't run for more than one hour")
print("anyway.")
print()
print("Your options:")
@@ -164,9 +155,9 @@ def get_changed_packages_sanity_check(count):
sys.exit(1)
def get_changed_packages_paths(print_info=False):
def get_changed_packages():
ret = set()
for file in get_changed_files(print_info=print_info):
for file in get_changed_files():
dirname, filename = os.path.split(file)
# Skip files:
@@ -196,18 +187,6 @@ def get_changed_packages_paths(print_info=False):
elif not os.path.exists(file):
continue # APKBUILD was deleted
ret.add(dirname)
ret.add(os.path.basename(dirname))
return ret
def get_changed_packages():
return set(map(lambda p: os.path.basename(p), iter(get_changed_packages_paths(print_info=True))))
def get_changed_kernels():
ret = []
for pkgname in get_changed_packages():
if pkgname.startswith("linux-"):
ret += [pkgname]
return ret
-13
View File
@@ -1,13 +0,0 @@
#!/bin/sh -e
# Description: editorconfig-checker: lint for trailing whitespaces etc.
# https://postmarketos.org/pmb-ci
if [ "$(id -u)" = 0 ]; then
set -x
apk -q add \
editorconfig-checker
exec su "${TESTUSER:-build}" -c "sh -e $0"
fi
set -x
ec
-14
View File
@@ -1,14 +0,0 @@
#!/bin/sh -e
# Description: lint CI related python scripts/tests
# https://postmarketos.org/pmb-ci
if [ "$(id -u)" = 0 ]; then
set -x
apk -q add py3-flake8
exec su "${TESTUSER:-build}" -c "sh -e $0"
fi
set -x
# shellcheck disable=SC2046
flake8 --ignore E501,F401,E722,W504,W605 $(find .ci -name '*.py')
-16
View File
@@ -1,16 +0,0 @@
#!/bin/sh -e
# Copyright 2024 Caleb Connolly
# SPDX-License-Identifier: GPL-3.0-or-later
# Description: check pkgver/pkgrel bumps, amount of changed pkgs etc
# Options: native
# Use 'native' because it requires git commit history.
# https://postmarketos.org/pmb-ci
if [ "$(id -u)" = 0 ]; then
set -x
apk -q add python3 git
# Keep environment variables
exec su -p "${TESTUSER:-build}" -c "sh -e $0"
fi
.ci/lib/generate_test_pipeline.py
-54
View File
@@ -1,54 +0,0 @@
#!/bin/sh -e
# Description: check various bad patterns with grep
# https://postmarketos.org/pmb-ci
if [ "$(id -u)" = 0 ]; then
set -x
apk -q add grep
exec su "${TESTUSER:-build}" -c "sh -e $0"
fi
# Find CHANGEMEs in APKBUILDs
if grep -qr '(CHANGEME!)' -- *; then
echo "ERROR: Please replace '(CHANGEME!)' in the following files:"
grep --color=always -r '(CHANGEME!)' -- *
exit 1
fi
# DTBs installed to /usr/share/db
# shellcheck disable=SC2016
if grep -qr 'INSTALL_DTBS_PATH="$pkgdir"/usr/share/dtb' device/; then
echo 'ERROR: Please do not install dtbs to /usr/share/dtb!'
echo 'ERROR: Unless you have a good reason not to, please put them in /boot/dtbs'
echo 'ERROR: Files that need fixing:'
# shellcheck disable=SC2016
grep --color=always -r 'INSTALL_DTBS_PATH="$pkgdir"/usr/share/dtb' device/
exit 1
fi
# Find old mkinitfs paths (pre mkinitfs 2.0)
if grep -qr '/etc/postmarketos-mkinitfs' -- *; then
echo "ERROR: Please replace '/etc/postmarketos-mkinitfs' with '/usr/share/mkinitfs' in the following files:"
grep --color=always -r '/etc/postmarketos-mkinitfs' -- *
exit 1
fi
if grep -qr '/usr/share/postmarketos-mkinitfs' -- *; then
echo "ERROR: Please replace '/usr/share/postmarketos-mkinitfs' with '/usr/share/mkinitfs' in the following files:"
grep --color=always -r '/usr/share/postmarketos-mkinitfs' -- *
exit 1
fi
# Direct sourcing of deviceinfo
if grep --exclude='source_deviceinfo' -qEr 'source /etc/deviceinfo|\. /etc/deviceinfo' -- *; then
echo 'ERROR: Please source the source_deviceinfo script instead of sourcing deviceinfo directly!'
grep --color=always --exclude='rootfs-usr-share-misc-source_deviceinfo' -Er 'source /etc/deviceinfo|\. /etc/deviceinfo' -- *
exit 1
fi
# Removed deviceinfo variable
if grep -qr 'deviceinfo_modules_initfs' -- *; then
echo 'ERROR: deviceinfo_modules_initfs variable has been removed. Use "modules-initfs" file instead.'
grep --color=always -r 'deviceinfo_modules_initfs' -- *
exit 1
fi
-16
View File
@@ -1,16 +0,0 @@
#!/bin/sh -e
# Description: check modified kernel configs
# Options: native
# Use 'native' because it requires running pmbootstrap.
# https://postmarketos.org/pmb-ci
if [ "$(id -u)" = 0 ]; then
set -x
wget "https://gitlab.com/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
sh ./install_pmbootstrap.sh
exec su "${TESTUSER:-pmos}" -c "sh -e $0"
fi
export PYTHONUNBUFFERED=1
.ci/lib/check_changed_kernels.py
-1
View File
@@ -1 +0,0 @@
../testcases/add_pmbootstrap_to_import_path
-19
View File
@@ -1,19 +0,0 @@
#!/bin/sh -e
# Description: build modified packages for this architecture
# Options: native slow
# https://postmarketos.org/pmb-ci
if [ "$(id -u)" = 0 ]; then
set -x
wget "https://gitlab.com/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
sh ./install_pmbootstrap.sh
exec su "${TESTUSER:-pmos}" -c "sh -e $0"
fi
export PYTHONUNBUFFERED=1
# Get the architecture from the symlink we are running
arch="$(echo "$0" | cut -d '-' -f 2 | cut -d '.' -f 1)"
set -x
.ci/lib/build_changed_aports.py "$arch"
-83
View File
@@ -1,83 +0,0 @@
#!/usr/bin/env python3
# Copyright 2023 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
import glob
import tempfile
import sys
import subprocess
# Same dir
import common
# pmbootstrap
import add_pmbootstrap_to_import_path # noqa
import pmb.parse
import pmb.helpers.logging
def check_kconfig(args, pkgnames):
last_failed = None
for i in range(len(pkgnames)):
pkgname = pkgnames[i]
print(f" ({i+1}/{len(pkgnames)}) {pkgname}")
apkbuild_path = pmb.helpers.pmaports.find(args, pkgname)
apkbuild = pmb.parse._apkbuild.apkbuild(f"{apkbuild_path}/APKBUILD")
options = []
for opt in apkbuild["options"]:
if "pmb:kconfigcheck" in opt:
options += [opt]
if len(options):
options.sort()
print(f'options="{" ".join(options)}"')
if "!pmb:kconfigcheck" in apkbuild["options"]:
print("skipped (!pmb:kconfigcheck)")
continue
if not pmb.parse.kconfig.check(args, pkgname, details=True):
last_failed = pkgname
return last_failed
def show_error(last_failed):
print("")
print("Please adjust your kernel config. This is required for getting your"
" patch merged.")
print("")
print("Edit your kernel config:")
print(f" pmbootstrap kconfig edit {last_failed}")
print("")
print("Test this kernel config again:")
print(f" pmbootstrap kconfig check {last_failed}")
print("")
print("Run this check again (on all kernels you modified):")
print(" pmbootstrap ci kconfig")
print("")
if __name__ == "__main__":
common.add_upstream_git_remote()
pkgnames = common.get_changed_kernels()
print(f"Changed kernels: {pkgnames}")
if len(pkgnames) == 0:
print("No kernels changed in this branch")
exit(0)
# Initialize args (so we can use pmbootstrap's kconfig parsing)
sys.argv = ["pmbootstrap", "kconfig", "check"]
args = pmb.parse.arguments()
pmb.helpers.logging.init(args)
print("Running kconfig check on changed kernels...")
last_failed = check_kconfig(args, pkgnames)
if last_failed:
show_error(last_failed)
exit(1)
-15
View File
@@ -1,15 +0,0 @@
#!/bin/sh -ex
# Copies packages from previous build artifacts into the
# local binary repo
ARCH="$1"
if [ -z "$ARCH" ]; then
echo "Usage: $0 <arch>"
exit 1
fi
mkdir -p /home/pmos/.local/var/pmbootstrap/packages/edge/"$ARCH"
cp packages/edge/"$ARCH"/*.apk /home/pmos/.local/var/pmbootstrap/packages/edge/"$ARCH"
chown -R 12345:12345 /home/pmos/.local/var/pmbootstrap/packages/edge/"$ARCH"
sudo -u pmos -- pmbootstrap index
-107
View File
@@ -1,107 +0,0 @@
#!/usr/bin/env python3
# Generate a gitlab CI yaml file for the integration tests pipeline
# Configures the parallel:matrix variables for the install/upgrade jobs
# based on the union of all the "test-upgrade" configs in the affected APKBUILDs.
# And the boot matrix based on the "test-boot" config.
# use the matrix variables in the needs: section to sequence the 3 jobs, otherwise
# spawn a pipeline for each device (yikes).
import os
import sys
import glob
import json
import common
# Get modified packages
common.add_upstream_git_remote()
pkgs = common.get_changed_packages_paths()
devices = {}
# We support using "main" as a shortcut for main devices
def get_device_variants(devices):
_devices = []
for d in devices:
if d == "main":
_devices += list(map(lambda x: os.path.basename(x).split("-", 1)[-1],
glob.iglob(os.path.join(common.get_pmaports_dir(),
"device", "main", "device-*"))))
else:
_devices.append(d)
return _devices
# YIKES
def get_device_arch(device):
return common.run_cmd(["sh", "-c",
f"""source {glob.glob(os.path.join(common.get_pmaports_dir(),
'device', '*', f'device-{device}'))[0]}/deviceinfo; echo $deviceinfo_arch"""]).strip()
# Add a device that we should test upgrading pkg on
def add_devices(pkg, devices_upgrade, devices_boot):
devices_upgrade = get_device_variants(devices_upgrade)
devices_boot = get_device_variants(devices_boot)
print(f"Devices for {pkg}: {devices_upgrade} {devices_boot}")
for d in set(devices_upgrade + devices_boot):
if d not in devices.keys():
devices[d] = {"upgrade": False, "boot": False, "arch": get_device_arch(d)}
if d in devices_boot:
devices[d]["boot"] = True
if d in devices_upgrade:
devices[d]["upgrade"] = True
def parse_device_list(key):
cfg = line.split(":")[-1]
if cfg == f"# {key}:":
print(f"Invalid test-upgrade config in {apkbuild}")
sys.exit(1)
return cfg.strip().split()
# Get the union of all the test-upgrade configs
for pkg in pkgs:
apkbuild = os.path.join(pkg, "APKBUILD")
with open(apkbuild) as f:
# ALWAYS test on qemu
upgrade_devices = ["qemu-aarch64", "qemu-amd64"]
boot_devices = []
for line in f:
if line != "\n" and line[0] != "#":
break
if line.startswith("# test-upgrade"):
upgrade_devices += parse_device_list("test-upgrade")
if line.startswith("# test-boot"):
boot_devices += parse_device_list("test-boot")
add_devices(os.path.basename(pkg), upgrade_devices, boot_devices)
print(json.dumps(devices, indent=4))
# Generate the yaml
template = open(os.path.join(os.path.dirname(__file__), "test-pipeline.template.yml")).read()
matrix = ""
for (device, cfg) in devices.items():
# FIXME: riscv64 is not well supported..
if cfg["arch"] == "riscv64":
continue
boot = "true" if cfg["boot"] and "qemu" in device else "false"
upgrade = "true" if cfg["upgrade"] else "false"
print(f"Adding {device} to matrix, upgrade test: {upgrade}, boot test: {boot}")
matrix += f""" - DEVICE: {device}
UPGRADE_TEST: \"{upgrade}\"
BOOT_TEST: \"{boot}\"
BUILD_ARCH_JOB: build-{cfg["arch"]}
"""
variables = f" PACKAGES: {' '.join(map(lambda x: os.path.basename(x), pkgs))}\n"
f = open("test-pipeline.yml", "w")
f.write(template.replace("{{ matrix }}", matrix)
.replace("{{ variables }}", variables))
f.close()
-17
View File
@@ -1,17 +0,0 @@
#!/bin/sh -e
# Copyright 2023 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
if ! mount | grep -q /proc/sys/fs/binfmt_misc; then
echo "Mounting binfmt_misc"
mount -t binfmt_misc none /proc/sys/fs/binfmt_misc
fi
if id "build" > /dev/null 2>&1; then
echo "User 'build' exists already"
else
echo "Creating build user"
adduser -D build
chown -R build:build .
echo 'build ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
fi
-123
View File
@@ -1,123 +0,0 @@
# TEMPLATE pipeline for integration tests
image: alpine:latest
after_script:
- .ci/lib/move_logs.sh $CI_PROJECT_DIR
variables:
PYTHONUNBUFFERED: 1
# This includes a hack to install the packages that were built in a previous
# pipeline (with different signing keys). As for some reason even though we
# replace the signing keys in pmbootstrap with the ones from the previous job
# BEFORE creating the chroot, apk still rejects the packages :(
PMBOOTSTRAP_URL: https://gitlab.com/sdm845-mainline/pmbootstrap.git
PMBOOTSTRAP_TAG: caleb/allow-untrusted-hack
# defines PACKAGES
{{ variables }}
# Variables DEVICE, UPGRADE_TEST, and BOOT_TEST are set in the
# parallel matrix below.
stages:
- install
- upgrade
- boot
workflow:
name: "Testing for $PACKAGES"
# Default rules for all jobs
rules:
- if: $CI_PIPELINE_SOURCE == "parent_pipeline"
install:
# tags:
# - kvm
stage: install
# So we can fetch the packages that were built in the parent pipeline
# and install them in the chroot
needs:
- pipeline: $PARENT_PIPELINE_ID
job: $BUILD_ARCH_JOB
before_script:
- apk add curl sudo
# Avoid using the local pmaports checkout so we don't build packages (and sidestep annoying permissions issues)
- (cd /tmp ; curl -fsSL "https://gitlab.com/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh" | sh)
# Use the same keys as the build job so we can generate an index
- mkdir -p /home/pmos/.local/var/pmbootstrap/config_abuild/
- mv packages/config_abuild/* /home/pmos/.local/var/pmbootstrap/config_abuild/
- chown -R 12345:12345 /home/pmos/.local/var/pmbootstrap/config_abuild
- sudo -u pmos -- pmbootstrap config device ${DEVICE}
# Use the console UI so we pull in some additional system packages
- sudo -u pmos -- pmbootstrap config ui console
# For QEMU (ignored for other devices)
- sudo -u pmos -- pmbootstrap config kernel virt
script:
- ARCH=${BUILD_ARCH_JOB##build-}
# For now we only support packages that are pulled in automatically for the device.
# Introducing support for testing packages that must be explicitly installed requires
# having a job per package and doing dependency/conflict resolution.
- .ci/lib/copy-in-packages.sh $ARCH
- sudo -u pmos -- pmbootstrap install --no-image --password 147147
artifacts:
when: on_failure
paths:
- log.txt
- pmbootstrap.cfg
expire_in: 1 week
parallel:
matrix:
{{ matrix }}
upgrade:
# tags:
# - kvm
stage: upgrade
# So we can fetch the packages that were built in the parent pipeline
# and install them in the chroot
needs:
- pipeline: $PARENT_PIPELINE_ID
job: $BUILD_ARCH_JOB
rules:
- if: $UPGRADE_TEST == "true"
before_script:
- apk add curl sudo
# Avoid using the local pmaports checkout so we don't build packages (and sidestep annoying permissions issues)
- (cd /tmp ; curl -fsSL "https://gitlab.com/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh" | sh)
# Use the same keys as the build job so we can generate an index
- mkdir -p /home/pmos/.local/var/pmbootstrap/config_abuild/
- mv packages/config_abuild/* /home/pmos/.local/var/pmbootstrap/config_abuild/
- chown -R 12345:12345 /home/pmos/.local/var/pmbootstrap/config_abuild
- sudo -u pmos -- pmbootstrap -y zap -a
- sudo -u pmos -- pmbootstrap config device ${DEVICE}
# Use the console UI so we pull in some additional system packages
- sudo -u pmos -- pmbootstrap config ui console
script:
- ARCH=${BUILD_ARCH_JOB##build-}
# For now we only support packages that are pulled in automatically for the device.
# Introducing support for testing packages that must be explicitly installed requires
# having a job per package and doing dependency/conflict resolution.
- sudo -u pmos -- pmbootstrap install --no-image --password 147147
- .ci/lib/copy-in-packages.sh $ARCH
- sudo -u pmos -- pmbootstrap chroot -r -- apk upgrade -a --allow-untrusted
artifacts:
when: on_failure
paths:
- log.txt
- pmbootstrap.cfg
expire_in: 1 week
parallel:
matrix:
{{ matrix }}
boot:
# tags:
# - kvm
stage: boot
rules:
- if: $BOOT_TEST == "true"
script:
- echo boot
parallel:
matrix:
{{ matrix }}
+1 -1
View File
@@ -3,7 +3,7 @@
# SPDX-License-Identifier: GPL-3.0-or-later
if [ -z "$1" ]; then
echo "usage: $(basename "$0") \$CI_PROJECT_DIR"
echo "usage: $(basename $0) \$CI_PROJECT_DIR"
exit 1
fi
-47
View File
@@ -1,47 +0,0 @@
#!/bin/sh -e
# Copyright 2023 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
# Description: lint with various python tests
# Options: native
# Use 'native' because it requires pmbootstrap.
# https://postmarketos.org/pmb-ci
if [ "$(id -u)" = 0 ]; then
set -x
wget "https://gitlab.com/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
sh ./install_pmbootstrap.sh pytest
exec su "${TESTUSER:-pmos}" -c "sh -e $0"
fi
# Require pytest to be installed on the host system
if [ -z "$(command -v pytest)" ]; then
echo "ERROR: pytest command not found, make sure it is in your PATH."
exit 1
fi
# Wrap pmbootstrap to use this repository for --aports
pmaports="$(cd "$(dirname "$0")"/..; pwd -P)"
_pmbootstrap="$(command -v pmbootstrap)"
pmbootstrap() {
"$_pmbootstrap" --aports="$pmaports" "$@"
}
# Make sure that the work folder format is up to date, and that there are no
# mounts from aborted test cases (pmbootstrap#1595)
pmbootstrap work_migrate
pmbootstrap -q shutdown
# Make sure we have a valid device (pmbootstrap#1128)
device="$(pmbootstrap config device)"
deviceinfo="$pmaports/device/*/device-$device/deviceinfo"
# shellcheck disable=SC2086
if ! [ -e $deviceinfo ]; then
echo "ERROR: Could not find deviceinfo file for selected device '$device'."
echo "Expected path: $deviceinfo"
echo "Maybe you have switched to a branch where your device does not exist?"
echo "Use 'pmbootstrap config device qemu-amd64' to switch to a valid device."
exit 1
fi
# Run testcases
pytest -vv -x --tb=native "$pmaports/.ci/testcases" "$@"
+35
View File
@@ -0,0 +1,35 @@
#!/bin/sh -e
# Copyright 2021 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
# Require pmbootstrap
if ! command -v pmbootstrap > /dev/null; then
echo "ERROR: pmbootstrap needs to be installed."
exit 1
fi
# Wrap pmbootstrap to use this repository for --aports
pmaports="$(cd $(dirname $0)/..; pwd -P)"
_pmbootstrap="$(command -v pmbootstrap)"
pmbootstrap() {
"$_pmbootstrap" --aports="$pmaports" "$@"
}
# Make sure that the work folder format is up to date, and that there are no
# mounts from aborted test cases (pmbootstrap#1595)
pmbootstrap work_migrate
pmbootstrap -q shutdown
# Make sure we have a valid device (pmbootstrap#1128)
device="$(pmbootstrap config device)"
deviceinfo="$pmaports/device/*/device-$device/deviceinfo"
if ! [ -e $deviceinfo ]; then
echo "ERROR: Could not find deviceinfo file for selected device '$device'."
echo "Expected path: $deviceinfo"
echo "Maybe you have switched to a branch where your device does not exist?"
echo "Use 'pmbootstrap config device qemu-amd64' to switch to a valid device."
exit 1
fi
# Run testcases
pytest -vv -x --tb=native "$pmaports/.ci/testcases" "$@"
+18 -21
View File
@@ -1,35 +1,33 @@
#!/bin/sh -e
# Copyright 2023 Oliver Smith
# Copyright 2021 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
# Description: lint all shell scripts
# https://postmarketos.org/pmb-ci
DIR="$(cd "$(dirname "$0")/.." && pwd -P)"
set -e
DIR="$(cd "$(dirname "$0")" && pwd -P)"
cd "$DIR/.."
if [ "$(id -u)" = 0 ]; then
set -x
apk -q add shellcheck
exec su "${TESTUSER:-build}" -c "sh -e $0"
# Find CHANGEMEs in APKBUILDs
if grep -qr '(CHANGEME!)' *; then
echo "ERROR: Please replace '(CHANGEME!)' in the following files:"
grep --color=always -r '(CHANGEME!)' *
exit 1
fi
# Shell: shellcheck
sh_files="
./main/mdss-fb-init-hack/mdss-fb-init-hack.sh
./main/osk-sdl/unlock.sh
./main/postmarketos-base/rootfs-usr-lib-firmwareload.sh
./main/postmarketos-base-ui/rootfs-usr-lib-NetworkManager-dispatcher.d-50-dns-filter.sh
./main/postmarketos-base-ui/rootfs-usr-lib-NetworkManager-dispatcher.d-50-tethering.sh
./main/postmarketos-installkernel/installkernel-pmos
./main/postmarketos-initramfs/init.sh
./main/postmarketos-initramfs/init_functions.sh
./main/postmarketos-mkinitfs/init.sh
./main/postmarketos-mkinitfs/init_functions.sh
./main/postmarketos-mkinitfs-hook-debug-shell/20-debug-shell.sh
./main/postmarketos-mkinitfs-hook-debug-shell/setup_usb_storage.sh
./main/postmarketos-mkinitfs-hook-netboot/netboot.sh
./main/postmarketos-update-kernel/update-kernel.sh
./main/swclock-offset/swclock-offset-boot.sh
./main/swclock-offset/swclock-offset-shutdown.sh
./main/ttyescape/*.sh
./main/ttyescape/*.post-install
./main/unl0kr/unlock.sh
./main/msm-firmware-loader/*.sh
./main/msm-firmware-loader/*.post-install
./device/community/soc-qcom-sdm845/call_audio_idle_suspend_workaround.sh
$(find . -path './main/postmarketos-ui-*/*.sh')
$(find . -path './main/postmarketos-ui-*/*.pre-install')
@@ -43,11 +41,10 @@ sh_files="
$(find . -path './main/devicepkg-dev/*.sh')
$(find . -path './main/postmarketos-mvcfg/*.sh')
$(find . -path './.ci/**.sh')
$(find . -path '.ci/*.sh')
"
for file in $sh_files; do
echo "Test with shellcheck: $file"
cd "$DIR/$(dirname "$file")"
shellcheck -e SC1008 -e SC3043 -x "$(basename "$file")"
cd "$DIR/../$(dirname "$file")"
shellcheck -e SC1008 -x "$(basename "$file")"
done
@@ -7,7 +7,7 @@ import sys
import os
import importlib
import importlib.util
from site import getsitepackages
from distutils.sysconfig import get_python_lib
def path_pmbootstrap():
@@ -15,23 +15,20 @@ def path_pmbootstrap():
code from there.
returns: pmbootstrap installation folder
"""
# This variable is set by pmbootstrap 1.52 and later
# If it's undefined, try to find 'pmbootstrap' in path
bin = os.environ.get("PMBOOTSTRAP_CMD") or shutil.which("pmbootstrap")
# Find 'pmbootstrap' executable
bin = shutil.which("pmbootstrap")
if not bin:
print("ERROR: 'pmbootstrap' not found in $PATH")
sys.exit(1)
# Resolve the symlink and verify the folder
directory = os.path.dirname(os.path.realpath(bin))
if os.path.exists(directory + "/pmb/__init__.py"):
return directory
dir = os.path.dirname(os.path.realpath(bin))
if os.path.exists(dir + "/pmb/__init__.py"):
return dir
directories = getsitepackages()
for directory in directories:
if os.path.exists(directory + "/pmb/__init__.py"):
return directory
dir = get_python_lib()
if os.path.exists(dir + "/pmb/__init__.py"):
return dir
# Symlink not set up properly
print("ERROR: 'pmbootstrap' is not a symlink to pmbootstrap.py")
+9 -11
View File
@@ -16,18 +16,20 @@ def device_dependency_check(apkbuild, path):
""" Raise an error if a device package has a dependency that is not allowed
(e.g. because it should be in a subpackage instead). """
# asus-me176c: without this, the device will simply run the broken ACPI
# DSDT table, so we might as well update it. See pmaports!699.
firmware_ok = {"device-asus-me176c": ["firmware-asus-me176c-acpi"]}
pkgname = apkbuild["pkgname"]
for depend in apkbuild["depends"]:
if depend == "linux-firmware-none":
continue
if (depend.startswith("firmware-") or
depend.startswith("linux-firmware")):
if pkgname in firmware_ok and depend in firmware_ok[pkgname]:
continue
raise RuntimeError("Firmware package '" + depend + "' found in"
" depends of " + path + ". These go into"
" subpackages now, see"
" <https://postmarketos.org/devicepkg>.")
if depend == "mesa-dri-gallium":
raise RuntimeError(f"{path}: mesa-dri-gallium shouldn't be in"
" depends anymore (see pmaports!3478)")
def test_aports_device(args):
@@ -38,11 +40,7 @@ def test_aports_device(args):
apkbuild = pmb.parse.apkbuild(path)
# Depends: Require "postmarketos-base"
depend_flag = False
for dependency in apkbuild["depends"]:
if "postmarketos-base" == dependency or "postmarketos-base>" in dependency:
depend_flag = True
if not depend_flag:
if "postmarketos-base" not in apkbuild["depends"]:
raise RuntimeError("Missing 'postmarketos-base' in depends of " +
path)
@@ -85,7 +83,7 @@ def test_aports_device_kernel(args):
# Parse kernels from depends
kernels_depends = []
for depend in apkbuild["depends"]:
if not depend.startswith("linux-") or depend.startswith("linux-firmware-"):
if not depend.startswith("linux-"):
continue
kernels_depends.append(depend)
+7 -28
View File
@@ -3,10 +3,9 @@
# SPDX-License-Identifier: GPL-3.0-or-later
import glob
import os
import pytest
import re
import sys
import os
import add_pmbootstrap_to_import_path
import pmb.parse
@@ -17,15 +16,12 @@ def deviceinfo_obsolete(info):
Test for obsolete options used in the deviceinfo file. They must still be
defined in pmbootstrap's config/__init__.py.
"""
obsolete_options = [
"usb_rndis_function",
"weston_pixman_type",
]
obsolete_options = ["weston_pixman_type"]
for option in obsolete_options:
if option in info and info[option]:
raise RuntimeError(f"option {option} is obsolete, please rename"
" or remove it (see reasons for removal of at"
" https://postmarketos.org/deviceinfo)")
if info[option]:
raise RuntimeError("option '" + option + "' is obsolete, please"
" remove it (reasons for removal are at"
" <https://postmarketos.org/deviceinfo>)")
def test_deviceinfo(args):
@@ -35,8 +31,6 @@ def test_deviceinfo(args):
# Iterate over all devices
last_exception = None
count = 0
pattern = re.compile("^deviceinfo_[a-zA-Z0-9_]*=\".*\"$")
for folder in glob.glob(args.aports + "/device/*/device-*"):
device = folder[len(args.aports):].split("-", 1)[1]
@@ -45,26 +39,11 @@ def test_deviceinfo(args):
f.close()
try:
# variable can not be empty
for line in lines:
# Require space after # for comments
if line.startswith("#") and not line.startswith("# "):
raise RuntimeError("Comment style: please change '#' to"
f" '# ': {line}")
# Skip empty lines and comments
if not line or line.startswith("# "):
continue
# Variable can not be empty
if '=""' in line:
raise RuntimeError("Please remove the empty variable: " + line)
# Check line against regex (can't use multiple lines etc.)
if not pattern.match(line) or line.endswith("\\\""):
raise RuntimeError("Line looks invalid, maybe missing"
" quotes/multi-line string/comment next"
f" to line instead of above? {line}")
# Successful deviceinfo parsing / obsolete options
info = pmb.parse.deviceinfo(args, device)
deviceinfo_obsolete(info)
+2 -7
View File
@@ -15,13 +15,13 @@ def test_aports_firmware(args):
"""
excluded = [
"firmware-motorola-ali", # Depends on firmware-qcom-adreno-a530
"firmware-motorola-potter", # Depends on soc-qcom-msm8916-ucm
"firmware-oneplus-msm8998", # Depends on soc-qcom-sdm845-nonfree-firmware
"firmware-xiaomi-sagit", # Depends on soc-qcom-sdm845-nonfree-firmware
"firmware-oneplus-sdm845", # Depends on soc-qcom-sdm845-nonfree-firmware
"firmware-samsung-baffinlite", # Depends on firmware-aosp-broadcom-wlan
"firmware-samsung-crespo", # Depends on firmware-aosp-broadcom-wlan
"firmware-samsung-maguro", # Depends on firmware-aosp-broadcom-wlan
"firmware-xiaomi-beryllium", # Depends on soc-qcom-sdm845-nonfree-firmware
"firmware-xiaomi-ferrari", # Depends on soc-qcom-msm8916
"firmware-xiaomi-willow", # Doesn't build, source link is dead (pma#1212)
]
@@ -43,8 +43,3 @@ def test_aports_firmware(args):
raise RuntimeError(f"{aport_name}: \"!tracedeps\" missing in"
" options= line. The tracedeps option is superfluous"
" for firmware packages.")
if "noarch" in apkbuild["arch"]:
raise RuntimeError(f"{aport_name}: \"arch\" must not be \"noarch\"!"
" Please limit this firmware package to the"
" required architectures only!")
+4 -4
View File
@@ -34,9 +34,9 @@ def test_aports_kernel(args):
" pmbootstrap installs cross-compiler"
" automatically.")
# check some options only for main and community devices
# nftables support in kernels used by main and community devices
for dir in ["main", "device/main", "device/community"]:
if path.startswith(f"{args.aports}/{dir}"):
if "pmb:kconfigcheck-community" not in apkbuild["options"]:
raise RuntimeError(f"{aport_name}: \"pmb:kconfigcheck-community\" missing in"
" options= line, required for all community/main devices.")
assert pmb.parse.kconfig.check(args,
aport_name.replace("linux-", ""),
force_nftables_check=True)
-87
View File
@@ -1,87 +0,0 @@
#!/usr/bin/env python3
# Copyright 2023 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
import glob
import logging
import os
import pytest
import sys
import add_pmbootstrap_to_import_path
import pmb.parse
import pmb.parse._apkbuild
def apkbuild_check_provides(path, apkbuild, version, pkgname, subpkgname=None):
"""
Verify that a package or subpackage is using provides correctly.
:param path: to the APKBUILD for the error message
:param apkbuild: either the full return of pmb.parse.apkbuild() or a
subpackage of it (apkbuild["subpackages"][$subpkgname])
:param version: like 1.0.0-r3 so we can check against it
:param pkgname: package name
:param subpkgname: subpackage name, if we are looking at a subpackage
:returns: list of error strings
"""
name = pkgname
if subpkgname:
name = f"{pkgname}:{subpkgname}"
logging.info(f"{name}: checking provides")
ret = []
if not apkbuild["provides"]:
return ret
for provide in apkbuild["provides"]:
# Having provides entries without version is valid if the
# provider_priorty is also set (pma#1766)
if apkbuild["provider_priority"]:
continue
# Otherwise the version =$pkgver-r$pkgrel needs to be set. pmbootstrap
# already replaces the variables, so we check against the inserted
# values here.
if not provide.endswith(f"={version}"):
provide_no_ver = provide.split("=", 1)[0]
error = f"error in {path}:\n"
if subpkgname:
error += f"in subpackage:\n {subpkgname}\n"
else:
error += f"in package:\n {pkgname}\n"
error += f"broken provides entry:\n {provide_no_ver}\n"
error += "\n"
error += "This provides entry needs to be changed to"
error += f" '{provide_no_ver}=$pkgver-r$pkgrel'"
error += " (do not replace the variables, without '').\n"
error += "\n"
error += "If you know what you are doing and didn't add the"
error += " version on purpose, you also need to set a"
error += " provider_priority (pma#1766).\n"
error += "Reference:"
error += " https://wiki.alpinelinux.org/wiki/APKBUILD_Reference#provides"
ret += [error]
return ret
def test_provides(args):
errors = []
for path in glob.iglob(f"{args.aports}/**/APKBUILD", recursive=True):
apkbuild = pmb.parse.apkbuild(path)
pkgname = apkbuild["pkgname"]
version = f"{apkbuild['pkgver']}-r{apkbuild['pkgrel']}"
path_rel = os.path.relpath(path, args.aports)
errors += apkbuild_check_provides(path_rel, apkbuild, version, pkgname)
for subpkg, subpkg_data in apkbuild["subpackages"].items():
if not subpkg_data:
# default packaging function like -doc
continue
errors += apkbuild_check_provides(path_rel, subpkg_data, version,
pkgname, subpkg)
if errors:
for error in errors:
logging.error(error)
raise RuntimeError(f"test_provides failed with {len(errors)} errors")
-152
View File
@@ -1,152 +0,0 @@
#!/usr/bin/env python3
# Copyright 2023 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
# Various checks on source= in the APKBUILDs
import glob
import logging
import os
import pytest
import sys
import add_pmbootstrap_to_import_path
import pmb.parse
import pmb.parse._apkbuild
import pmb.parse.apkindex
import pmb.helpers.repo
def parse_source_from_checksums(args, apkbuild_path):
"""
Read the APKBUILD file and parse source files from the checksums at the
bottom. This has always the same format, even if $source is built with hard
to parse shell code (like in postmarketos-base).
:param apkbuild_path: full path to the APKBUILD
:returns: dict of parsed "source" filenames and checksums, e.g.:
{"first.patch": "b4dc4f3…",
"second.patch": "b4dc4f3…"}
"""
start = 'sha512sums="'
in_block = False
ret = {}
with open(apkbuild_path, encoding="utf-8") as handle:
for line in handle.readlines():
# Find start
if not in_block:
if line.startswith(start):
in_block = True
else:
continue
# sha512sums may have lines without checksums:
# https://gitlab.alpinelinux.org/alpine/abuild/-/merge_requests/73
if " " not in line:
continue
try:
checksum, filename = line.rstrip().split(" ", 2)
except ValueError:
raise ValueError("Failed to parse checksums. Try to delete the"
" checksums and generate them again with"
f" 'pmbootstrap checksum': {apkbuild_path}")
# Cut off 'sha512sums="' if the first checksum is in that line
if checksum.startswith(start):
checksum = checksum[len(start):]
# Find end
if filename.endswith('"'):
filename = filename[:-1]
ret[filename] = checksum
return ret
def test_aports_unreferenced_files(args):
"""
Raise an error if an unreferenced file is found
"""
for apkbuild_path in glob.iglob(args.aports + "/**/APKBUILD", recursive=True):
# pmbootstrap parser has some issues with complicated APKBUILDs, skip those.
if apkbuild_path.startswith(args.aports + "/cross/"):
continue
apkbuild = pmb.parse.apkbuild(apkbuild_path)
sources_chk = parse_source_from_checksums(args, apkbuild_path)
# Collect files from subpackages
subpackage_installs = []
subpackage_triggers = []
if apkbuild["subpackages"]:
for subpackage in apkbuild["subpackages"].values():
if not subpackage:
continue
subpackage_installs += subpackage.get("install", [])
subpackage_triggers += subpackage.get("triggers", [])
# Collect trigger files
trigger_sources = []
for trigger in apkbuild["triggers"] + subpackage_triggers:
trigger_sources.append(trigger.split("=")[0])
dirname = os.path.dirname(apkbuild_path)
for file in glob.iglob(dirname + "/**", recursive=True):
rel_file_path = os.path.relpath(file, dirname)
# Skip APKBUILDs and directories
if rel_file_path == "APKBUILD" or os.path.isdir(file):
continue
if os.path.basename(rel_file_path) not in sources_chk \
and rel_file_path not in apkbuild["install"] \
and rel_file_path not in subpackage_installs \
and rel_file_path not in trigger_sources:
raise RuntimeError(f"{apkbuild_path}: found unreferenced file: {rel_file_path}")
def test_distfiles_conflict(args):
"""
Make sure that each filename mentioned in any source= of any APKBUILD
always has the same checksum. This is important because apk caches
downloaded source files in a flat distfiles directory. So if two APKBUILDs
both download a file with the same filename but different checksum, and the
user builds both after each other, abuild will fail on the second build
with a checksum error.
"""
source_all = {}
for apkbuild_path in glob.iglob(f"{args.aports}/**/APKBUILD", recursive=True):
source = parse_source_from_checksums(args, apkbuild_path)
dir_path = os.path.dirname(apkbuild_path)
apkbuild_rel = os.path.relpath(apkbuild_path, args.aports)
for filename, checksum in source.items():
# Files bundled with the APKBUILD don't get copied to the distfiles
# cache, so not relevant for this check. Use glob.glob here and not
# iglob, because we don't want an iterator.
if glob.glob(f"{dir_path}/**/{filename}", recursive=True):
continue
# First time seeing this file
if filename not in source_all:
source_all[filename] = {"checksum": checksum,
"apkbuild_rel": apkbuild_rel}
continue
# Saw this file already with same checksum
if checksum == source_all[filename]["checksum"]:
continue
# Saw this file already with different checksum
logging.error("")
logging.error(f"ERROR: the source file '{filename}' has different"
" checksums in the following files:")
logging.error(f"- {source_all[filename]['apkbuild_rel']}:")
logging.error(f" {source_all[filename]['checksum']}")
logging.error(f"- {apkbuild_rel}:")
logging.error(f" {checksum}")
logging.error("")
logging.error("Fix this by setting a different target filename in"
" the package you modified:")
logging.error("https://wiki.alpinelinux.org/wiki/APKBUILD_Reference#source")
logging.error("")
raise RuntimeError(f"Conflict with source file '{filename}'")
+1 -3
View File
@@ -15,9 +15,7 @@ def test_aports_ui(args):
"""
Raise an error if package in _pmb_recommends is not found
"""
pmaports_cfg = pmb.config.pmaports.read_config(args)
for arch in pmaports_cfg["supported_arches"].split(","):
for arch in pmb.config.build_device_architectures:
for path in glob.iglob(args.aports + "/main/postmarketos-ui-*/APKBUILD"):
apkbuild = pmb.parse.apkbuild(path)
# Skip if arch isn't enabled
+97
View File
@@ -0,0 +1,97 @@
#!/usr/bin/env python3
# Copyright 2021 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
import glob
import pytest
import sys
import os
import add_pmbootstrap_to_import_path
import pmb.parse
import pmb.parse._apkbuild
import pmb.parse.apkindex
import pmb.helpers.repo
def parse_source_from_checksums(args, apkbuild_path):
"""
Read the APKBUILD file and parse source files from the checksums at the
bottom. This has always the same format, even if $source is built with hard
to parse shell code (like in postmarketos-base).
:param apkbuild_path: full path to the APKBUILD
:returns: list of parsed "source" files, e.g.:
["first.patch", "second.patch"]
"""
start = 'sha512sums="'
in_block = False
ret = []
with open(apkbuild_path, encoding="utf-8") as handle:
for line in handle.readlines():
# Find start
if not in_block:
if line.startswith(start):
in_block = True
else:
continue
# sha512sums may have lines without checksums:
# https://gitlab.alpinelinux.org/alpine/abuild/-/merge_requests/73
if " " not in line:
continue
try:
_, filename = line.rstrip().split(" ", 2)
except ValueError:
raise ValueError("Failed to parse checksums. Try to delete the"
" checksums and generate them again with"
f" 'pmbootstrap checksum': {apkbuild_path}")
# Find end
if filename.endswith('"'):
ret += [filename[:-1]]
break
ret += [filename]
return ret
def test_aports_unreferenced_files(args):
"""
Raise an error if an unreferenced file is found
"""
for apkbuild_path in glob.iglob(args.aports + "/**/APKBUILD", recursive=True):
apkbuild = pmb.parse.apkbuild(apkbuild_path)
sources_chk = parse_source_from_checksums(args, apkbuild_path)
# Collect install files from subpackages
subpackage_installs = []
if apkbuild["subpackages"]:
for subpackage in apkbuild["subpackages"].values():
if not subpackage:
continue
try:
subpackage_installs += subpackage["install"]
except KeyError:
continue
# Collect trigger files
trigger_sources = []
if apkbuild["triggers"]:
for trigger in apkbuild["triggers"]:
trigger_sources.append(trigger.split("=")[0])
dirname = os.path.dirname(apkbuild_path)
for file in glob.iglob(dirname + "/**", recursive=True):
rel_file_path = os.path.relpath(file, dirname)
# Skip APKBUILDs and directories
if rel_file_path == "APKBUILD" or os.path.isdir(file):
continue
if os.path.basename(rel_file_path) not in sources_chk \
and rel_file_path not in apkbuild["install"] \
and rel_file_path not in subpackage_installs \
and rel_file_path not in trigger_sources:
raise RuntimeError(f"{apkbuild_path}: found unreferenced file: {rel_file_path}")
-15
View File
@@ -1,15 +0,0 @@
#!/bin/sh -e
# Description: verify devices are documented in the wiki
# Options: native
# Run natively so we don't need to set up a chroot, python3 is the only dep.
# https://postmarketos.org/pmb-ci
if [ "$(id -u)" = 0 ]; then
set -x
apk -q add \
python3
exec su "${TESTUSER:-build}" -c "sh -e $0"
fi
set -x
.ci/lib/check_devices_in_wiki.py --booting
-3
View File
@@ -1,3 +0,0 @@
{
"SpacesAftertabs": true
}
+2 -2
View File
@@ -7,8 +7,8 @@
# Top-most EditorConfig file.
root = true
[{**.{md,ini,sh,rules,nft},**/APKBUILD}]
[**/APKBUILD]
indent_style = tab
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
trim_trailing_whitespace = true
-119
View File
@@ -1,119 +0,0 @@
#!/bin/sh
#
# This hook checks that all local sources specified in the staged APKBUILDs
# are staged too or already committed and that checksums are correct.
#
set -eu
# Maximal allowed size (in bytes) of a file.
FILE_SIZE_LIMIT=262144 # 256 kiB
if ! command -v sha512sum >/dev/null; then
# macOS / BSDs (?) don't have sha512sum, but shasum.
alias sha512sum='shasum -a 512'
fi
error() {
printf '\033[0;31mpre-commit:\033[0m %s\n' "$1" >&2 # red
}
# Prints paths of created or modified files being committed.
changed_files() {
git diff-index \
--name-only \
--cached \
--diff-filter=ACMR HEAD \
-- "$@"
}
# Prints file names and checksums (in format <SHA-512>:<filename>) of local
# sources specified in the APKBUILD ($1).
apkbuild_local_sources() {
apkbuild="$1"
set +eu
. "$apkbuild" || {
error "$apkbuild is invalid"
return 1
}
set -eu
status=0
: ${source:=""}
for src in $source; do
# Skip remote sources.
case "$src" in */*) continue;; esac
echo "$sha512sums" | awk -v src="$src" '
{ if ($2 == src) { ok=1; print($2 ":" $1) } }
END { if (ok != 1) exit 1 }' || {
status=1
error "${apkbuild%/*}: file \"$src\" is missing in \$sha512sums (hint: run pmbootstrap checksum)"
}
done
return $status
}
# check if given object is a symlink
is_symlink() {
test "$(git ls-files --stage "$1" | awk '{print $1}')" = "120000"
}
# Checks that all local sources specified in the APKBUILD file ($1) are
# available in git tree and checksums are correct.
check_local_sources() {
local apkbuild="$1"
local startdir="${apkbuild%/*}"
local status=0
local checksum_act checksum_exp content filename line sources
sources=$(apkbuild_local_sources "$apkbuild")
for line in $sources; do
filename=${line%%:*}
checksum_exp=${line#*:}
if ! git cat-file -e ":$startdir/$filename" 2>/dev/null; then
error "$startdir: missing file \"$filename\""
status=1
continue
fi
if is_symlink ":$startdir/$filename"; then
continue
fi
checksum_act=$(git show ":$startdir/$filename" | sha512sum)
if [ "$checksum_act" != "$checksum_exp -" ]; then
local cmd="pmbootstrap checksum $(basename "$startdir")"
error "$startdir: bad checksum for file \"$filename\" (hint: run $cmd)"
status=1
fi
done
return $status
}
# Checks if the file ($1) being committed is not bigger than FILE_SIZE_LIMIT.
check_file_size() {
local path="$1"
local size
size=$(git cat-file -s ":$path")
if [ $size -gt $FILE_SIZE_LIMIT ]; then
local size_kb=$(( size / 1024 ))
error "file \"$path\" is quite big ($(( size / 1024 )) kiB), better put a remote url in source="
return 1
fi
}
for apkbuild in $(changed_files '**/APKBUILD'); do
check_local_sources "$apkbuild"
done
for path in $(changed_files); do
check_file_size "$path"
done
-49
View File
@@ -1,49 +0,0 @@
#!/bin/sh
#
# This hook adds prefix "<repo>/<pkgname>: " to the commit message when
# committing changes of a single package.
#
MSG_FILE="$1"
SOURCE="$2"
longest_common_prefix() {
awk -F/ '
(NR == 1) { split($0, prefix); prefix_len = NF }
(NR > 1) {
for (i = 1; i <= prefix_len; i++) {
if (prefix[i] != $i) {
prefix_len = i - 1; break
}
}
}
(prefix_len == 0) { exit }
END {
res = prefix[1]
for (i = 2; i <= prefix_len; i++) {
res = res FS prefix[i]
}
print(res)
}'
}
prepend_msg() {
local prefix="$1"
printf '%s\n%s\n' "$prefix" "$(cat "$MSG_FILE")" > "$MSG_FILE"
}
# Do nothing if message has been given using -m, template, merge etc.
[ -z "$SOURCE" ] || exit 0
lcp=$(git diff-index --name-only --cached HEAD | longest_common_prefix)
case "$lcp" in
device/*/*) prepend_msg "$(echo "$lcp" | cut -d/ -f3): ";;
# Multiple packages touched for same device category
# More logic could be added to detect if they all belong to same device
device/*) ;;
[^.]*/*) prepend_msg "$(echo "$lcp" | cut -d/ -f1-2): ";;
esac
exit 0
+1
View File
@@ -20,6 +20,7 @@ dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
+74 -100
View File
@@ -3,66 +3,74 @@
# global settings
image: alpine:latest
after_script:
- .ci/lib/move_logs.sh $CI_PROJECT_DIR
- .ci/move_logs.sh $CI_PROJECT_DIR
stages:
- lint
- build
- test
workflow:
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_PIPELINE_SOURCE == "push"
# defaults for "only"
# We need to run the CI jobs in a "merge request specific context", if CI is
# running in a merge request. Otherwise the environment variable that holds the
# merge request ID is not available. This means, we must set the "only"
# variable accordingly - and if we only do it for one job, all other jobs will
# not get executed. So have the defaults here, and use them in all jobs that
# should run on both the master branch, and in merge requests.
# https://docs.gitlab.com/ee/ci/merge_request_pipelines/index.html#excluding-certain-jobs
.only-default: &only-default
only:
- v21.12
- merge_requests
- tags
# device documentation
wiki:
stage: lint
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
changes:
- device/*/device-*/*
<<: *only-default
only:
refs:
- merge_requests
changes:
- device/*/device-*/*
before_script:
- apk -q add python3
script:
- .ci/lib/gitlab_prepare_ci.sh
- .ci/wiki.sh
- .ci/check_devices_in_wiki.py --booting
# testcases linting
flake8:
testcases-linting:
stage: lint
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
<<: *only-default
only:
refs:
- merge_requests
changes:
- .ci/*
- .ci/*/*
before_script:
- apk -q add py-flake8
script:
- .ci/lib/gitlab_prepare_ci.sh
- .ci/flake8.sh
- flake8 --ignore E501,F401,E722,W504,W605
# shellcheck and various grep checks
shellcheck-grep:
# shellcheck
shellcheck:
stage: lint
<<: *only-default
image: alpine:edge
before_script:
- apk -q add shellcheck
script:
- .ci/lib/gitlab_prepare_ci.sh
- .ci/shellcheck.sh
- .ci/grep.sh
- .ci/codeowners.sh
editor-config:
stage: lint
image: alpine:edge
script:
- .ci/lib/gitlab_prepare_ci.sh
- .ci/ec.sh
# aports checks (generic)
pytest-commits:
aports-static:
stage: lint
<<: *only-default
before_script:
- wget "https://gitlab.com/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
- sh ./install_pmbootstrap.sh pytest
script:
- .ci/lib/gitlab_prepare_ci.sh
- .ci/pytest.sh
- .ci/commits.sh
- su pmos -c ".ci/run_testcases.sh"
- su pmos -c ".ci/check_changed_aports_versions.py"
artifacts:
when: on_failure
paths:
@@ -71,34 +79,52 @@ pytest-commits:
- 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: lint
before_script:
- wget "https://gitlab.com/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
- sh ./install_pmbootstrap.sh
script:
- .ci/lib/gitlab_prepare_ci.sh
- .ci/apkbuild-lint.sh
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- su pmos -c ".ci/apkbuild-linting.py"
only:
- merge_requests
allow_failure: true
# kernel kconfig check
kernel-kconfig:
stage: lint
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
only:
refs:
- v21.12
- merge_requests
changes:
- device/*/linux-*/config-*
- main/linux-*/config-*
before_script:
- wget "https://gitlab.com/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
- sh ./install_pmbootstrap.sh pytest
script:
- .ci/lib/gitlab_prepare_ci.sh
- .ci/kconfig.sh
- su pmos -c "pmbootstrap kconfig check"
# MR settings
# (Checks for "Allow commits from members who can merge to the target branch")
mr-settings:
stage: lint
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
only:
- merge_requests
before_script:
- apk -q add python3
script:
@@ -108,75 +134,23 @@ mr-settings:
# build changed aports
.build:
stage: build
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
<<: *only-default
before_script:
- .ci/lib/gitlab_prepare_ci.sh
after_script:
- wget "https://gitlab.com/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
- sh ./install_pmbootstrap.sh
script:
- .ci/build.sh
- cp -r /home/pmos/.local/var/pmbootstrap/packages/ packages/ || true
- cp -r /home/pmos/.local/var/pmbootstrap/config_abuild packages/ || true
artifacts:
expire_in: 1 week
paths:
- packages/
timeout: 10 h
build-x86_64:
extends: .build
script:
- .ci/build-x86_64.sh
build-x86:
extends: .build
script:
- .ci/build-x86.sh
build-aarch64:
extends: .build
script:
- .ci/build-aarch64.sh
build-armv7:
extends: .build
script:
- .ci/build-armv7.sh
build-armhf:
extends: .build
script:
- .ci/build-armhf.sh
build-riscv64:
extends: .build
script:
- .ci/build-riscv64.sh
# Generate the test pipeline
generate-test-pipeline:
stage: test
# Only test in MRs or when pushing to a stable release branch
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- if: $CI_COMMIT_REF_PROTECTED == 'true' && $CI_COMMIT_BRANCH != '$CI_DEFAULT_BRANCH'
before_script:
- .ci/lib/gitlab_prepare_ci.sh
script:
- .ci/generate-test-pipeline.sh
artifacts:
paths:
- test-pipeline.yml
Run tests:
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- if: $CI_COMMIT_REF_PROTECTED == 'true' && $CI_COMMIT_BRANCH != '$CI_DEFAULT_BRANCH'
needs:
- job: generate-test-pipeline
artifacts: true
trigger:
include:
- artifact: test-pipeline.yml
job: generate-test-pipeline
variables:
PARENT_PIPELINE_ID: $CI_PIPELINE_ID
-48
View File
@@ -1,48 +0,0 @@
<!--
Thank you for using postmarketOS! In order to speed up process of resolving your issue,
we would like you to fill in the following :
-->
### Describe your issue
#### What's the expected behaviour?
#### What's the current behaviour?
#### How to reproduce your issue?
### What device are you using?
<!--
Leave name of your device in vendor-codename format.
If unsure, check name in the device package or leave full name of device
PinePhone: which revision exactly? See https://wiki.pine64.org/index.php/PinePhone#Hardware_revisions
-->
### On what postmarketOS version did you encounter the issue?
<!--
Replace space inside `[ ]` with `x` to fill the checkbox
-->
* [ ] edge (`master` branch)
* [ ] `v23.12`
* [ ] `v23.06` (supported until 2024-01-18)
* [ ] I confirm that the issue still is present after running `sudo apk upgrade -a`
### On what environment did you encounter the issue?
#### Environments
* [ ] GNOME Shell on Mobile
* [ ] Phosh
* [ ] Plasma Mobile
* [ ] Sxmo (Wayland/Sway) **Please post the output of `sxmo_version.sh`**
* [ ] Other: **Please fill out**
### How did you get postmarketOS image?
* [ ] from https://images.postmarketos.org
* [ ] I built it using pmbootstrap
* [ ] It was preinstalled on my device
### What's the build date of the image? (in yyyy-mm-dd format)
<!--
Notes:
can be left empty if unsure
If you downloaded image from images.postmarketos.org, date will be in yyyymmdd format
-->
### Additional information
<!-- logs, etc. -- make use <details> for long listings -->
+6 -1
View File
@@ -1,7 +1,12 @@
{
"subject_format": {
"pass": [
"^(([a-z]+\\/[a-z\\-0-9*{}]+),?)+: [A-Za-z\\/\\-0-9*{}\\(\\)\\.,_&:=' ]+( \\(MR \\d+\\)|)$",
"^[a-z]+/[a-z-0-9*{}]+: new aport(s|)( \\(MR \\d+\\)|)$",
"^[a-z]+/[a-z-0-9*{}]+: pkgrel bump( \\(MR \\d+\\)|)$",
"^[a-z-0-9*{}]+: new device \\([^\\)]+\\)( \\(MR \\d+\\)|)",
"^[a-z]+/[a-z-0-9*{}]+: upgrade to [0-9\\.a-z\\-_]+( \\(MR \\d+\\)|)$",
"^[a-z]+/[a-z-0-9*{}]+: remove( \\(MR \\d+\\)|)$",
"^[a-z]+/[a-z-0-9*{}]+: remove, upstreamed( \\(MR \\d+\\)|)$",
"^CI: [a-z-0-9*{}\\(\\)\\.,_ ][A-Za-z\\/\\-0-9*{}\\(\\)\\.,_ ]+( \\(MR \\d+\\)|)$",
"^mrhlpr.json: [a-z-0-9*{}\\(\\)\\.,_ ][A-Za-z\\/\\-0-9*{}\\(\\)\\.,_ ]+( \\(MR \\d+\\)|)$",
"^pmaports.cfg: [a-z-0-9*{}\\(\\)\\.,_ ][A-Za-z\\/\\-0-9*{}\\(\\)\\.,_ ]+( \\(MR \\d+\\)|)$"
+7 -56
View File
@@ -1,59 +1,10 @@
# https://docs.gitlab.com/ee/user/project/code_owners.html
device/*/*-htc-golfu/ @Newbyte
device/*/*-pine64-pinephone/ @craftyguy @milesalan @bshah @proycon @anjandev @StacyHarper
device/*/*-htc-m8qlul/ @Newbyte
device/*/*-purism-librem5/ @craftyguy @bshah
device/*/device-lg-judyln/ @Newbyte
device/*/device-samsung-m0/ @Newbyte
device/*/linux-postmarketos-exynos4/ @Newbyte
device/*/linux-postmarketos-qcom-msm8939/ @Newbyte
device/*/linux-postmarketos-stericsson/ @Newbyte
device/*/*-qcom-sdm845/ @sdm845-mainline
device/*/*-xiaomi-beryllium/ @joelselvaraj
device/*/device-oneplus-enchilada/ @calebccff
device/*/device-oneplus-fajita/ @calebccff
device/*/firmware-oneplus-sdm845/ @calebccff
device/*/device-shift-axolotl/ @amartinz @calebccff @dylanvanassche
device/*/*-lenovo-21bx/ @craftyguy
device/*/*-lenovo-a6010/ @jenneron
device/*/*-lenovo-a6000/ @jenneron
device/*/device-microsoft-surface-rt/ @jenneron
device/*/device-google-nyan-big/ @jenneron
device/*/device-google-peach-pi/ @jenneron
device/*/linux-google-veyron/ @jenneron
device/*/linux-postmarketos-exynos5/ @jenneron @Grimler
device/*/soc-mediatek-mt8183/ @jenneron
device/*/linux-google-nyan/ @jenneron
device/*/linux-postmarketos-mediatek-mt8173/ @jenneron
device/*/linux-postmarketos-mediatek-mt8183/ @jenneron @binarycraft
device/*/device-google-nyan-blaze/ @jenneron
device/*/firmware-powervr-gx6250/ @jenneron
device/*/device-google-snow/ @jenneron
device/*/firmware-google-veyron-brcm/ @jenneron
device/*/device-google-peach-pit/ @jenneron
device/*/device-lg-judyp/ @jenneron
device/*/linux-postmarketos-grate/ @clamor95 @jenneron
device/*/device-samsung-chagallwifi/ @Grimler
device/*/device-odroid-xu4/ @Grimler
device/*/device-samsung-klimtlte/ @Grimler
device/*/linux-samsung-klimtlte/ @Grimler
device/*/firmware-odroid-xu4/ @Grimler
device/*/linux-samsung-chagallwifi/ @Grimler
device/*/device-huawei-plank/ @gtrxAC
device/*/linux-huawei-plank/ @gtrxAC
device/*/device-samsung-coreprimevelte/ @legolivesmatter @balejk
device/*/linux-samsung-coreprimevelte/ @legolivesmatter @balejk
device/*/*-pine64-pinephone/ @craftyguy @milesalan @bshah @proycon @anjandev @StacyHarper
device/*/*-purism-librem5/ @craftyguy @bshah
main/osk-sdl/ @craftyguy
main/mesa-pvr-dri-classic/ @xc-racer99
main/postmarketos-ui-plasma-mobile/ @bshah
temp/u-boot-librem5/ @craftyguy @bshah
main/postmarketos-update-depthcharge-kernel/ @jenneron
main/osk-sdl/ @craftyguy
main/postmarketos-ui-plasma-mobile/ @bshah
main/ttyescape/ @calebccff
device/*/u-boot-librem5/ @craftyguy @bshah
device/*/alsa-ucm-conf-google-kukui/ @jenneron @binarycraft
device/*/alsa-ucm-conf-google-gru/ @jenneron
device/*/*-videostrong-kii-pro/ @vitali64yt
device/*/*-amlogic-s905*/ @vitali64yt
device/*/linux-postmarketos-amlogic/ @vitali64yt @exkc
# vim: ts=8 sw=4 et
# vim: ts=4 sw=4 et
-89
View File
@@ -1,89 +0,0 @@
# Policy for commits in pmaports
This document defines policy for organising and titling commits for
inclusion in pmaports.
## Definitions
### Device-specific package
A device-specific package is used to apply configuration and
functionality specifically for device support in postmarketOS.
This is in contrast to other packages
(e.g. main/postmarketos-ui-phosh) in postmarketOS that are used
for configuring the distribution without consideration of the
target device.
## General policy
We follow Alpine's aports commit style with some minor exceptions
and additions. Alpine's commit style can be found here:
https://gitlab.alpinelinux.org/alpine/aports/-/blob/master/COMMITSTYLE.md
## Exceptions
### Changes to packages inside of the device directory
While Alpine has the policy of always prefixing package names with
the name of the repository they are in, in the case of pmaports
this can lead to excessively long commit titles due to the nested
subfolders of the device directory. As such, commits changing
packages inside of the device directory should omit the directory
prefix, for example:
device-pine64-pinephone: description of change
Or:
soc-qcom-msm8996: description of change
If the commit only makes device-specific changes, the
commit title can opt to use the following format:
manufacturer-codename: description of change
### Moving devices between categories
As we do not include directory prefixes in device-related commits,
Alpine's commit style for moving packages does not apply. Instead,
we do the following:
manufacturer-codename: move from category to category
For example:
samsung-m0: move from testing to community
## Additions
### Forking packages from Alpine
Run `pmbootstrap aportgen --fork-alpine package` and modify it.
#### Template
- temp/package-name: fork from Alpine
Example: temp/pulseaudio: fork from Alpine
#### Rules
One commit per forked package.
### Adding new devices
Adding a new device package and optionally also a device-specific
Linux and firmware package.
#### Template
- manufacturer-codename: new device
Example: htc-m8qlul: new device
#### Rules
If the device has the option of making use of a device-specific
kernel and/or firmware package, those packages should be included
in the same commit that adds the device package. One device per
commit.
+1 -2
View File
@@ -5,5 +5,4 @@ Helpful resources:
* [APKBUILD reference](https://wiki.alpinelinux.org/wiki/APKBUILD_Reference)
* [Alpine Linux aports](https://gitlab.alpinelinux.org/alpine/aports/)
* [Alpine Linux package search](https://pkgs.alpinelinux.org/packages)
* [postmarketOS package search](https://pkgs.postmarketos.org/packages)
* [postmarketOS commit style](./COMMITSTYLE.md)
* [postmarketOS package search](https://pkgs.postmarketos.org/packages)
-57
View File
@@ -1,57 +0,0 @@
# Reference: https://postmarketos.org/channels.cfg
[channels.cfg]
recommended=edge
[edge]
description=Rolling release / Most devices / Occasional breakage: https://postmarketos.org/edge
branch_pmaports=master
branch_aports=master
mirrordir_alpine=edge
[v23.12]
description=Latest release / Recommended for best stability
branch_pmaports=v23.12
branch_aports=3.19-stable
mirrordir_alpine=v3.19
[v23.06]
description=Old release (supported until 2024-01-18)
branch_pmaports=v23.06
branch_aports=3.18-stable
mirrordir_alpine=v3.18
[v22.12]
description=Old release (unsupported)
branch_pmaports=v22.12
branch_aports=3.17-stable
mirrordir_alpine=v3.17
[v22.06]
description=Old release (unsupported)
branch_pmaports=v22.06
branch_aports=3.16-stable
mirrordir_alpine=v3.16
[v21.12]
description=Old release (unsupported)
branch_pmaports=v21.12
branch_aports=3.15-stable
mirrordir_alpine=v3.15
[v21.06]
description=Old release (unsupported)
branch_pmaports=v21.06
branch_aports=3.14-stable
mirrordir_alpine=v3.14
[v21.03]
description=Old release (unsupported)
branch_pmaports=v21.03
branch_aports=3.13-stable
mirrordir_alpine=v3.13
[v20.05]
description=Old release (unsupported)
branch_pmaports=v20.05
branch_aports=3.12-stable
mirrordir_alpine=v3.12
@@ -0,0 +1,55 @@
From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Tue, 21 Sep 2021 14:53:13 +0000
Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
libraries"
This revert is needed to avoid wrongly tagging objects with the incompatible
IBM long double ABI, which is not supported by musl and will result in
linking errors if used.
This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
---
bfd/elf32-tic6x.c | 3 ---
ld/ldlang.c | 10 ++++------
2 files changed, 4 insertions(+), 9 deletions(-)
diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
index 5754f3cb860..3ad1d612749 100644
--- a/bfd/elf32-tic6x.c
+++ b/bfd/elf32-tic6x.c
@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
case Tag_ABI_PIC:
case Tag_ABI_PID:
- /* Don't transfer these tags from dynamic objects. */
- if ((ibfd->flags & DYNAMIC) != 0)
- continue;
if (out_attr[i].i > in_attr[i].i)
out_attr[i].i = in_attr[i].i;
break;
diff --git a/ld/ldlang.c b/ld/ldlang.c
index 37b64c89ee1..f13beaef9d9 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -7071,13 +7071,11 @@ lang_check (void)
bfd_printable_name (input_bfd), input_bfd,
bfd_printable_name (link_info.output_bfd));
}
-
- /* If the input bfd has no contents, it shouldn't set the
- private data of the output bfd. */
- else if (!file->flags.just_syms
- && ((input_bfd->flags & DYNAMIC) != 0
- || bfd_count_sections (input_bfd) != 0))
+ else if (bfd_count_sections (input_bfd))
{
+ /* If the input bfd has no contents, it shouldn't set the
+ private data of the output bfd. */
+
bfd_error_handler_type pfn = NULL;
/* If we aren't supposed to warn about mismatched input
--
2.33.0
+84
View File
@@ -0,0 +1,84 @@
# Automatically generated aport, do not edit!
# Generator: pmbootstrap aportgen binutils-aarch64
# Based on: main/binutils
pkgname=binutils-aarch64
pkgver=2.37
pkgrel=3
pkgdesc="Tools necessary to build programs for aarch64 targets"
url="https://www.gnu.org/software/binutils/"
makedepends="gettext libtool autoconf automake bison texinfo"
arch="x86_64"
license="GPL-2.0 GPL-3.0-or-later LGPL-2.0 BSD"
source="https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.xz
binutils-ld-fix-static-linking.patch
gold-mips.patch
ld-bfd-mips.patch
0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch
binutils-mips-disable-assert.patch
bfd-close-file-desriptor-if-there-is-no-archive-fd.patch
defang-no-split.patch
"
builddir="$srcdir/binutils-$pkgver"
if [ "$CHOST" = "$CBUILD" ] && [ "$CBUILD" = "$CTARGET" ] && [ "$CTARGET_ARCH" != "riscv64" ]; then
subpackages=""
fi
if [ "$CHOST" != "$CTARGET" ]; then
pkgname="binutils-$CTARGET_ARCH"
subpackages=""
sonameprefix="binutils:"
fi
# secfixes:
# 2.35.2-r1:
# - CVE-2021-3487
# 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 aarch64)"
"$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() {
make install DESTDIR="$pkgdir"
# remove man, info folders
rm -rf "$pkgdir"/usr/share
# remove files that conflict with non-cross binutils
rm -rf "$pkgdir"/usr/lib/bfd-plugins
}
sha512sums="
5c11aeef6935860a6819ed3a3c93371f052e52b4bdc5033da36037c1544d013b7f12cb8d561ec954fe7469a68f1b66f1a3cd53d5a3af7293635a90d69edd15e7 binutils-2.37.tar.xz
ecee33b0e435aa704af1c334e560f201638ff79e199aa11ed78a72f7c9b46f85fbb227af5748e735fd681d1965fcc42ac81b0c8824e540430ce0c706c81e8b49 binutils-ld-fix-static-linking.patch
f55cf2e0bf82f97583a1abe10710e4013ecf7d64f1da2ef8659a44a06d0dd8beaf58dab98a183488ea137f03e32d62efc878d95f018f836f8cec870bc448556f gold-mips.patch
314d2ef9071c89940aa6c8118e8a1e2f191a5d0a4bf596da1ad9cc84f884d8bc7dea8bd7b9fc3f8f1bddd3fd41c6eb017e1e804044b3bf084df1ed9e6e095e2d ld-bfd-mips.patch
70ec22bd72ef6dddecfd970613387dd4a8cdc8730dd3cbf03d5a0c3a7c4d839383167bb06dad21bf7c235329fd44b5dc4aefe762f68544f17155cf002bf1be4a 0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch
609cd90d8b334eb309f586b17b9d335a08d3dbb6def7c3eb5c010028fcb681674031e5b9d853aa7a39a50304356a86afc184b85562b3f228f8197f4d29395c8f binutils-mips-disable-assert.patch
10a0074583d2cc4598710c7e434ba7088da074b105f4f5e951fc61af7150ad62adf60a7c98f6fd13b1771f169e45a5a1ef618240c6893d3f0f3d93fd768a03c6 bfd-close-file-desriptor-if-there-is-no-archive-fd.patch
4652f092c9376f0cb7fd6c72cb37ff7c15c1c6e3408fac79329b7f41a7925c98eb35989a9a040682130988a36401901d6d95afa44f0ce50caa85ee478db6bf03 defang-no-split.patch
"
@@ -0,0 +1,234 @@
Upstream: yes
URL: https://sourceware.org/bugzilla/show_bug.cgi?id=28138
From 1c611b40e6bfc8029bff7696814330b5bc0ee5c0 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Mon, 26 Jul 2021 05:59:55 -0700
Subject: [PATCH] bfd: Close the file descriptor if there is no archive fd
Close the file descriptor if there is no archive plugin file descriptor
to avoid running out of file descriptors on thin archives with many
archive members.
bfd/
PR ld/28138
* plugin.c (bfd_plugin_close_file_descriptor): Close the file
descriptor there is no archive plugin file descriptor.
ld/
PR ld/28138
* testsuite/ld-plugin/lto.exp: Run tmpdir/pr28138 only for
native build.
PR ld/28138
* testsuite/ld-plugin/lto.exp: Run ld/28138 tests.
* testsuite/ld-plugin/pr28138.c: New file.
* testsuite/ld-plugin/pr28138-1.c: Likewise.
* testsuite/ld-plugin/pr28138-2.c: Likewise.
* testsuite/ld-plugin/pr28138-3.c: Likewise.
* testsuite/ld-plugin/pr28138-4.c: Likewise.
* testsuite/ld-plugin/pr28138-5.c: Likewise.
* testsuite/ld-plugin/pr28138-6.c: Likewise.
* testsuite/ld-plugin/pr28138-7.c: Likewise.
(cherry picked from commit 5a98fb7513b559e20dfebdbaa2a471afda3b4742)
(cherry picked from commit 7dc37e1e1209c80e0bab784df6b6bac335e836f2)
---
bfd/plugin.c | 8 +++++++
ld/testsuite/ld-plugin/lto.exp | 34 ++++++++++++++++++++++++++++++
ld/testsuite/ld-plugin/pr28138-1.c | 6 ++++++
ld/testsuite/ld-plugin/pr28138-2.c | 6 ++++++
ld/testsuite/ld-plugin/pr28138-3.c | 6 ++++++
ld/testsuite/ld-plugin/pr28138-4.c | 6 ++++++
ld/testsuite/ld-plugin/pr28138-5.c | 6 ++++++
ld/testsuite/ld-plugin/pr28138-6.c | 6 ++++++
ld/testsuite/ld-plugin/pr28138-7.c | 6 ++++++
ld/testsuite/ld-plugin/pr28138.c | 20 ++++++++++++++++++
10 files changed, 104 insertions(+)
create mode 100644 ld/testsuite/ld-plugin/pr28138-1.c
create mode 100644 ld/testsuite/ld-plugin/pr28138-2.c
create mode 100644 ld/testsuite/ld-plugin/pr28138-3.c
create mode 100644 ld/testsuite/ld-plugin/pr28138-4.c
create mode 100644 ld/testsuite/ld-plugin/pr28138-5.c
create mode 100644 ld/testsuite/ld-plugin/pr28138-6.c
create mode 100644 ld/testsuite/ld-plugin/pr28138-7.c
create mode 100644 ld/testsuite/ld-plugin/pr28138.c
diff --git a/bfd/plugin.c b/bfd/plugin.c
index 6cfa2b66470..3bab8febe88 100644
--- a/bfd/plugin.c
+++ b/bfd/plugin.c
@@ -291,6 +291,14 @@ bfd_plugin_close_file_descriptor (bfd *abfd, int fd)
&& !bfd_is_thin_archive (abfd->my_archive))
abfd = abfd->my_archive;
+ /* Close the file descriptor if there is no archive plugin file
+ descriptor. */
+ if (abfd->archive_plugin_fd == -1)
+ {
+ close (fd);
+ return;
+ }
+
abfd->archive_plugin_fd_open_count--;
/* Dup the archive plugin file descriptor for later use, which
will be closed by _bfd_archive_close_and_cleanup. */
diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp
index def69e43ab3..999d911ce6a 100644
--- a/ld/testsuite/ld-plugin/lto.exp
+++ b/ld/testsuite/ld-plugin/lto.exp
@@ -687,6 +687,40 @@ if { [is_elf_format] && [check_lto_shared_available] } {
}
}
+run_cc_link_tests [list \
+ [list \
+ "Build pr28138.a" \
+ "-T" "" \
+ {pr28138-1.c pr28138-2.c pr28138-3.c pr28138-4.c pr28138-5.c \
+ pr28138-6.c pr28138-7.c} {} "pr28138.a" \
+ ] \
+ [list \
+ "Build pr28138.o" \
+ "" "" \
+ {pr28138.c} {} \
+ ] \
+]
+
+set exec_output [run_host_cmd "sh" \
+ "-c \"ulimit -n 20; \
+ $CC -Btmpdir/ld -o tmpdir/pr28138 \
+ tmpdir/pr28138.o tmpdir/pr28138.a\""]
+set exec_output [prune_warnings $exec_output]
+if [string match "" $exec_output] then {
+ if { [isnative] } {
+ set exec_output [run_host_cmd "tmpdir/pr28138" ""]
+ if [string match "PASS" $exec_output] then {
+ pass "PR ld/28138"
+ } else {
+ fail "PR ld/28138"
+ }
+ } else {
+ pass "PR ld/28138"
+ }
+} else {
+ fail "PR ld/28138"
+}
+
set testname "Build liblto-11.a"
remote_file host delete "tmpdir/liblto-11.a"
set catch_output [run_host_cmd "$ar" "rc $plug_opt tmpdir/liblto-11.a tmpdir/lto-11a.o tmpdir/lto-11b.o tmpdir/lto-11c.o"]
diff --git a/ld/testsuite/ld-plugin/pr28138-1.c b/ld/testsuite/ld-plugin/pr28138-1.c
new file mode 100644
index 00000000000..51d119e1642
--- /dev/null
+++ b/ld/testsuite/ld-plugin/pr28138-1.c
@@ -0,0 +1,6 @@
+extern int a0(void);
+int
+a1(void)
+{
+ return 1 + a0();
+}
diff --git a/ld/testsuite/ld-plugin/pr28138-2.c b/ld/testsuite/ld-plugin/pr28138-2.c
new file mode 100644
index 00000000000..1120cd797e9
--- /dev/null
+++ b/ld/testsuite/ld-plugin/pr28138-2.c
@@ -0,0 +1,6 @@
+extern int a1(void);
+int
+a2(void)
+{
+ return 1 + a1();
+}
diff --git a/ld/testsuite/ld-plugin/pr28138-3.c b/ld/testsuite/ld-plugin/pr28138-3.c
new file mode 100644
index 00000000000..ec464947ee6
--- /dev/null
+++ b/ld/testsuite/ld-plugin/pr28138-3.c
@@ -0,0 +1,6 @@
+extern int a2(void);
+int
+a3(void)
+{
+ return 1 + a2();
+}
diff --git a/ld/testsuite/ld-plugin/pr28138-4.c b/ld/testsuite/ld-plugin/pr28138-4.c
new file mode 100644
index 00000000000..475701b2c5c
--- /dev/null
+++ b/ld/testsuite/ld-plugin/pr28138-4.c
@@ -0,0 +1,6 @@
+extern int a3(void);
+int
+a4(void)
+{
+ return 1 + a3();
+}
diff --git a/ld/testsuite/ld-plugin/pr28138-5.c b/ld/testsuite/ld-plugin/pr28138-5.c
new file mode 100644
index 00000000000..e24f86c363e
--- /dev/null
+++ b/ld/testsuite/ld-plugin/pr28138-5.c
@@ -0,0 +1,6 @@
+extern int a4(void);
+int
+a5(void)
+{
+ return 1 + a4();
+}
diff --git a/ld/testsuite/ld-plugin/pr28138-6.c b/ld/testsuite/ld-plugin/pr28138-6.c
new file mode 100644
index 00000000000..b5b938bdb21
--- /dev/null
+++ b/ld/testsuite/ld-plugin/pr28138-6.c
@@ -0,0 +1,6 @@
+extern int a5(void);
+int
+a6(void)
+{
+ return 1 + a5();
+}
diff --git a/ld/testsuite/ld-plugin/pr28138-7.c b/ld/testsuite/ld-plugin/pr28138-7.c
new file mode 100644
index 00000000000..4ef75bf0f0c
--- /dev/null
+++ b/ld/testsuite/ld-plugin/pr28138-7.c
@@ -0,0 +1,6 @@
+extern int a6(void);
+int
+a7(void)
+{
+ return 1 + a6();
+}
diff --git a/ld/testsuite/ld-plugin/pr28138.c b/ld/testsuite/ld-plugin/pr28138.c
new file mode 100644
index 00000000000..68252c9f382
--- /dev/null
+++ b/ld/testsuite/ld-plugin/pr28138.c
@@ -0,0 +1,20 @@
+#include <stdio.h>
+
+extern int a7(void);
+
+int
+a0(void)
+{
+ return 0;
+}
+
+int
+main()
+{
+ if (a7() == 7)
+ {
+ printf ("PASS\n");
+ return 0;
+ }
+ return 1;
+}
--
2.27.0
@@ -0,0 +1,46 @@
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}}
@@ -0,0 +1,14 @@
diff -urN binutils-2.35.2.orig/bfd/elfxx-mips.c binutils-2.35.2/bfd/elfxx-mips.c
--- binutils-2.35.2.orig/bfd/elfxx-mips.c 2021-01-30 01:38:03.000000000 -0700
+++ binutils-2.35.2/bfd/elfxx-mips.c 2021-05-13 17:35:34.706913601 -0600
@@ -6744,8 +6744,10 @@
in the relocation. */
if (h != NULL && ! SYMBOL_REFERENCES_LOCAL (info, &h->root))
{
+#if 0
BFD_ASSERT (htab->root.target_os == is_vxworks
|| h->global_got_area != GGA_NONE);
+#endif
indx = h->root.dynindx;
if (SGI_COMPAT (output_bfd))
defined_p = h->root.def_regular;
@@ -0,0 +1,38 @@
From 2dad02b6d46eef438cbd14d8511487b056628a38 Mon Sep 17 00:00:00 2001
From: Sergei Trofimovich <siarheit@google.com>
Date: Mon, 26 Jul 2021 22:51:18 +0100
Subject: [PATCH 1/1] texi2pod.pl: add no-op --no-split option support
[PR28144]
Change 2faf902da ("generate single html manual page by default")
added use of --no-split option to makeinfo. binutils reuses
makeinfo options for texi2pod.pl wrapper. Unsupported option
led to silent manpage truncation.
The change adds no-op option support.
etc/
PR 28144
* texi2pod.pl: Handle no-op --no-split option.
(cherry picked from commit 96a7037cd8573cf065aa6b12baca68696f96d9ca)
---
etc/texi2pod.pl | 2 ++
1 file changed, 2 insertions(+)
diff --git a/etc/texi2pod.pl b/etc/texi2pod.pl
index 11f70d156be..dcf2b437640 100644
--- a/etc/texi2pod.pl
+++ b/etc/texi2pod.pl
@@ -59,6 +59,8 @@ while ($_ = shift) {
$flag = shift;
}
push (@ipath, $flag);
+ } elsif (/^--no-split$/) {
+ # ignore option for makeinfo compatibility
} elsif (/^-/) {
usage();
} else {
--
2.27.0
+39
View File
@@ -0,0 +1,39 @@
# 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
@@ -0,0 +1,19 @@
--- ./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
@@ -0,0 +1,55 @@
From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Tue, 21 Sep 2021 14:53:13 +0000
Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
libraries"
This revert is needed to avoid wrongly tagging objects with the incompatible
IBM long double ABI, which is not supported by musl and will result in
linking errors if used.
This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
---
bfd/elf32-tic6x.c | 3 ---
ld/ldlang.c | 10 ++++------
2 files changed, 4 insertions(+), 9 deletions(-)
diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
index 5754f3cb860..3ad1d612749 100644
--- a/bfd/elf32-tic6x.c
+++ b/bfd/elf32-tic6x.c
@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
case Tag_ABI_PIC:
case Tag_ABI_PID:
- /* Don't transfer these tags from dynamic objects. */
- if ((ibfd->flags & DYNAMIC) != 0)
- continue;
if (out_attr[i].i > in_attr[i].i)
out_attr[i].i = in_attr[i].i;
break;
diff --git a/ld/ldlang.c b/ld/ldlang.c
index 37b64c89ee1..f13beaef9d9 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -7071,13 +7071,11 @@ lang_check (void)
bfd_printable_name (input_bfd), input_bfd,
bfd_printable_name (link_info.output_bfd));
}
-
- /* If the input bfd has no contents, it shouldn't set the
- private data of the output bfd. */
- else if (!file->flags.just_syms
- && ((input_bfd->flags & DYNAMIC) != 0
- || bfd_count_sections (input_bfd) != 0))
+ else if (bfd_count_sections (input_bfd))
{
+ /* If the input bfd has no contents, it shouldn't set the
+ private data of the output bfd. */
+
bfd_error_handler_type pfn = NULL;
/* If we aren't supposed to warn about mismatched input
--
2.33.0
+84
View File
@@ -0,0 +1,84 @@
# Automatically generated aport, do not edit!
# Generator: pmbootstrap aportgen binutils-armv7
# Based on: main/binutils
pkgname=binutils-armv7
pkgver=2.37
pkgrel=3
pkgdesc="Tools necessary to build programs for armv7 targets"
url="https://www.gnu.org/software/binutils/"
makedepends="gettext libtool autoconf automake bison texinfo"
arch="x86_64"
license="GPL-2.0 GPL-3.0-or-later LGPL-2.0 BSD"
source="https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.xz
binutils-ld-fix-static-linking.patch
gold-mips.patch
ld-bfd-mips.patch
0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch
binutils-mips-disable-assert.patch
bfd-close-file-desriptor-if-there-is-no-archive-fd.patch
defang-no-split.patch
"
builddir="$srcdir/binutils-$pkgver"
if [ "$CHOST" = "$CBUILD" ] && [ "$CBUILD" = "$CTARGET" ] && [ "$CTARGET_ARCH" != "riscv64" ]; then
subpackages=""
fi
if [ "$CHOST" != "$CTARGET" ]; then
pkgname="binutils-$CTARGET_ARCH"
subpackages=""
sonameprefix="binutils:"
fi
# secfixes:
# 2.35.2-r1:
# - CVE-2021-3487
# 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 armv7)"
"$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() {
make install DESTDIR="$pkgdir"
# remove man, info folders
rm -rf "$pkgdir"/usr/share
# remove files that conflict with non-cross binutils
rm -rf "$pkgdir"/usr/lib/bfd-plugins
}
sha512sums="
5c11aeef6935860a6819ed3a3c93371f052e52b4bdc5033da36037c1544d013b7f12cb8d561ec954fe7469a68f1b66f1a3cd53d5a3af7293635a90d69edd15e7 binutils-2.37.tar.xz
ecee33b0e435aa704af1c334e560f201638ff79e199aa11ed78a72f7c9b46f85fbb227af5748e735fd681d1965fcc42ac81b0c8824e540430ce0c706c81e8b49 binutils-ld-fix-static-linking.patch
f55cf2e0bf82f97583a1abe10710e4013ecf7d64f1da2ef8659a44a06d0dd8beaf58dab98a183488ea137f03e32d62efc878d95f018f836f8cec870bc448556f gold-mips.patch
314d2ef9071c89940aa6c8118e8a1e2f191a5d0a4bf596da1ad9cc84f884d8bc7dea8bd7b9fc3f8f1bddd3fd41c6eb017e1e804044b3bf084df1ed9e6e095e2d ld-bfd-mips.patch
70ec22bd72ef6dddecfd970613387dd4a8cdc8730dd3cbf03d5a0c3a7c4d839383167bb06dad21bf7c235329fd44b5dc4aefe762f68544f17155cf002bf1be4a 0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch
609cd90d8b334eb309f586b17b9d335a08d3dbb6def7c3eb5c010028fcb681674031e5b9d853aa7a39a50304356a86afc184b85562b3f228f8197f4d29395c8f binutils-mips-disable-assert.patch
10a0074583d2cc4598710c7e434ba7088da074b105f4f5e951fc61af7150ad62adf60a7c98f6fd13b1771f169e45a5a1ef618240c6893d3f0f3d93fd768a03c6 bfd-close-file-desriptor-if-there-is-no-archive-fd.patch
4652f092c9376f0cb7fd6c72cb37ff7c15c1c6e3408fac79329b7f41a7925c98eb35989a9a040682130988a36401901d6d95afa44f0ce50caa85ee478db6bf03 defang-no-split.patch
"
@@ -0,0 +1,234 @@
Upstream: yes
URL: https://sourceware.org/bugzilla/show_bug.cgi?id=28138
From 1c611b40e6bfc8029bff7696814330b5bc0ee5c0 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Mon, 26 Jul 2021 05:59:55 -0700
Subject: [PATCH] bfd: Close the file descriptor if there is no archive fd
Close the file descriptor if there is no archive plugin file descriptor
to avoid running out of file descriptors on thin archives with many
archive members.
bfd/
PR ld/28138
* plugin.c (bfd_plugin_close_file_descriptor): Close the file
descriptor there is no archive plugin file descriptor.
ld/
PR ld/28138
* testsuite/ld-plugin/lto.exp: Run tmpdir/pr28138 only for
native build.
PR ld/28138
* testsuite/ld-plugin/lto.exp: Run ld/28138 tests.
* testsuite/ld-plugin/pr28138.c: New file.
* testsuite/ld-plugin/pr28138-1.c: Likewise.
* testsuite/ld-plugin/pr28138-2.c: Likewise.
* testsuite/ld-plugin/pr28138-3.c: Likewise.
* testsuite/ld-plugin/pr28138-4.c: Likewise.
* testsuite/ld-plugin/pr28138-5.c: Likewise.
* testsuite/ld-plugin/pr28138-6.c: Likewise.
* testsuite/ld-plugin/pr28138-7.c: Likewise.
(cherry picked from commit 5a98fb7513b559e20dfebdbaa2a471afda3b4742)
(cherry picked from commit 7dc37e1e1209c80e0bab784df6b6bac335e836f2)
---
bfd/plugin.c | 8 +++++++
ld/testsuite/ld-plugin/lto.exp | 34 ++++++++++++++++++++++++++++++
ld/testsuite/ld-plugin/pr28138-1.c | 6 ++++++
ld/testsuite/ld-plugin/pr28138-2.c | 6 ++++++
ld/testsuite/ld-plugin/pr28138-3.c | 6 ++++++
ld/testsuite/ld-plugin/pr28138-4.c | 6 ++++++
ld/testsuite/ld-plugin/pr28138-5.c | 6 ++++++
ld/testsuite/ld-plugin/pr28138-6.c | 6 ++++++
ld/testsuite/ld-plugin/pr28138-7.c | 6 ++++++
ld/testsuite/ld-plugin/pr28138.c | 20 ++++++++++++++++++
10 files changed, 104 insertions(+)
create mode 100644 ld/testsuite/ld-plugin/pr28138-1.c
create mode 100644 ld/testsuite/ld-plugin/pr28138-2.c
create mode 100644 ld/testsuite/ld-plugin/pr28138-3.c
create mode 100644 ld/testsuite/ld-plugin/pr28138-4.c
create mode 100644 ld/testsuite/ld-plugin/pr28138-5.c
create mode 100644 ld/testsuite/ld-plugin/pr28138-6.c
create mode 100644 ld/testsuite/ld-plugin/pr28138-7.c
create mode 100644 ld/testsuite/ld-plugin/pr28138.c
diff --git a/bfd/plugin.c b/bfd/plugin.c
index 6cfa2b66470..3bab8febe88 100644
--- a/bfd/plugin.c
+++ b/bfd/plugin.c
@@ -291,6 +291,14 @@ bfd_plugin_close_file_descriptor (bfd *abfd, int fd)
&& !bfd_is_thin_archive (abfd->my_archive))
abfd = abfd->my_archive;
+ /* Close the file descriptor if there is no archive plugin file
+ descriptor. */
+ if (abfd->archive_plugin_fd == -1)
+ {
+ close (fd);
+ return;
+ }
+
abfd->archive_plugin_fd_open_count--;
/* Dup the archive plugin file descriptor for later use, which
will be closed by _bfd_archive_close_and_cleanup. */
diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp
index def69e43ab3..999d911ce6a 100644
--- a/ld/testsuite/ld-plugin/lto.exp
+++ b/ld/testsuite/ld-plugin/lto.exp
@@ -687,6 +687,40 @@ if { [is_elf_format] && [check_lto_shared_available] } {
}
}
+run_cc_link_tests [list \
+ [list \
+ "Build pr28138.a" \
+ "-T" "" \
+ {pr28138-1.c pr28138-2.c pr28138-3.c pr28138-4.c pr28138-5.c \
+ pr28138-6.c pr28138-7.c} {} "pr28138.a" \
+ ] \
+ [list \
+ "Build pr28138.o" \
+ "" "" \
+ {pr28138.c} {} \
+ ] \
+]
+
+set exec_output [run_host_cmd "sh" \
+ "-c \"ulimit -n 20; \
+ $CC -Btmpdir/ld -o tmpdir/pr28138 \
+ tmpdir/pr28138.o tmpdir/pr28138.a\""]
+set exec_output [prune_warnings $exec_output]
+if [string match "" $exec_output] then {
+ if { [isnative] } {
+ set exec_output [run_host_cmd "tmpdir/pr28138" ""]
+ if [string match "PASS" $exec_output] then {
+ pass "PR ld/28138"
+ } else {
+ fail "PR ld/28138"
+ }
+ } else {
+ pass "PR ld/28138"
+ }
+} else {
+ fail "PR ld/28138"
+}
+
set testname "Build liblto-11.a"
remote_file host delete "tmpdir/liblto-11.a"
set catch_output [run_host_cmd "$ar" "rc $plug_opt tmpdir/liblto-11.a tmpdir/lto-11a.o tmpdir/lto-11b.o tmpdir/lto-11c.o"]
diff --git a/ld/testsuite/ld-plugin/pr28138-1.c b/ld/testsuite/ld-plugin/pr28138-1.c
new file mode 100644
index 00000000000..51d119e1642
--- /dev/null
+++ b/ld/testsuite/ld-plugin/pr28138-1.c
@@ -0,0 +1,6 @@
+extern int a0(void);
+int
+a1(void)
+{
+ return 1 + a0();
+}
diff --git a/ld/testsuite/ld-plugin/pr28138-2.c b/ld/testsuite/ld-plugin/pr28138-2.c
new file mode 100644
index 00000000000..1120cd797e9
--- /dev/null
+++ b/ld/testsuite/ld-plugin/pr28138-2.c
@@ -0,0 +1,6 @@
+extern int a1(void);
+int
+a2(void)
+{
+ return 1 + a1();
+}
diff --git a/ld/testsuite/ld-plugin/pr28138-3.c b/ld/testsuite/ld-plugin/pr28138-3.c
new file mode 100644
index 00000000000..ec464947ee6
--- /dev/null
+++ b/ld/testsuite/ld-plugin/pr28138-3.c
@@ -0,0 +1,6 @@
+extern int a2(void);
+int
+a3(void)
+{
+ return 1 + a2();
+}
diff --git a/ld/testsuite/ld-plugin/pr28138-4.c b/ld/testsuite/ld-plugin/pr28138-4.c
new file mode 100644
index 00000000000..475701b2c5c
--- /dev/null
+++ b/ld/testsuite/ld-plugin/pr28138-4.c
@@ -0,0 +1,6 @@
+extern int a3(void);
+int
+a4(void)
+{
+ return 1 + a3();
+}
diff --git a/ld/testsuite/ld-plugin/pr28138-5.c b/ld/testsuite/ld-plugin/pr28138-5.c
new file mode 100644
index 00000000000..e24f86c363e
--- /dev/null
+++ b/ld/testsuite/ld-plugin/pr28138-5.c
@@ -0,0 +1,6 @@
+extern int a4(void);
+int
+a5(void)
+{
+ return 1 + a4();
+}
diff --git a/ld/testsuite/ld-plugin/pr28138-6.c b/ld/testsuite/ld-plugin/pr28138-6.c
new file mode 100644
index 00000000000..b5b938bdb21
--- /dev/null
+++ b/ld/testsuite/ld-plugin/pr28138-6.c
@@ -0,0 +1,6 @@
+extern int a5(void);
+int
+a6(void)
+{
+ return 1 + a5();
+}
diff --git a/ld/testsuite/ld-plugin/pr28138-7.c b/ld/testsuite/ld-plugin/pr28138-7.c
new file mode 100644
index 00000000000..4ef75bf0f0c
--- /dev/null
+++ b/ld/testsuite/ld-plugin/pr28138-7.c
@@ -0,0 +1,6 @@
+extern int a6(void);
+int
+a7(void)
+{
+ return 1 + a6();
+}
diff --git a/ld/testsuite/ld-plugin/pr28138.c b/ld/testsuite/ld-plugin/pr28138.c
new file mode 100644
index 00000000000..68252c9f382
--- /dev/null
+++ b/ld/testsuite/ld-plugin/pr28138.c
@@ -0,0 +1,20 @@
+#include <stdio.h>
+
+extern int a7(void);
+
+int
+a0(void)
+{
+ return 0;
+}
+
+int
+main()
+{
+ if (a7() == 7)
+ {
+ printf ("PASS\n");
+ return 0;
+ }
+ return 1;
+}
--
2.27.0
@@ -0,0 +1,46 @@
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}}
@@ -0,0 +1,14 @@
diff -urN binutils-2.35.2.orig/bfd/elfxx-mips.c binutils-2.35.2/bfd/elfxx-mips.c
--- binutils-2.35.2.orig/bfd/elfxx-mips.c 2021-01-30 01:38:03.000000000 -0700
+++ binutils-2.35.2/bfd/elfxx-mips.c 2021-05-13 17:35:34.706913601 -0600
@@ -6744,8 +6744,10 @@
in the relocation. */
if (h != NULL && ! SYMBOL_REFERENCES_LOCAL (info, &h->root))
{
+#if 0
BFD_ASSERT (htab->root.target_os == is_vxworks
|| h->global_got_area != GGA_NONE);
+#endif
indx = h->root.dynindx;
if (SGI_COMPAT (output_bfd))
defined_p = h->root.def_regular;
@@ -0,0 +1,38 @@
From 2dad02b6d46eef438cbd14d8511487b056628a38 Mon Sep 17 00:00:00 2001
From: Sergei Trofimovich <siarheit@google.com>
Date: Mon, 26 Jul 2021 22:51:18 +0100
Subject: [PATCH 1/1] texi2pod.pl: add no-op --no-split option support
[PR28144]
Change 2faf902da ("generate single html manual page by default")
added use of --no-split option to makeinfo. binutils reuses
makeinfo options for texi2pod.pl wrapper. Unsupported option
led to silent manpage truncation.
The change adds no-op option support.
etc/
PR 28144
* texi2pod.pl: Handle no-op --no-split option.
(cherry picked from commit 96a7037cd8573cf065aa6b12baca68696f96d9ca)
---
etc/texi2pod.pl | 2 ++
1 file changed, 2 insertions(+)
diff --git a/etc/texi2pod.pl b/etc/texi2pod.pl
index 11f70d156be..dcf2b437640 100644
--- a/etc/texi2pod.pl
+++ b/etc/texi2pod.pl
@@ -59,6 +59,8 @@ while ($_ = shift) {
$flag = shift;
}
push (@ipath, $flag);
+ } elsif (/^--no-split$/) {
+ # ignore option for makeinfo compatibility
} elsif (/^-/) {
usage();
} else {
--
2.27.0
+39
View File
@@ -0,0 +1,39 @@
# 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
@@ -0,0 +1,19 @@
--- ./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
+5 -5
View File
@@ -7,8 +7,8 @@ if [ -z "$(type -t arch_to_hostspec)" ]; then
fi
pkgname=busybox-static-aarch64
pkgver=1.36.1
pkgrel=18
pkgver=1.34.1
pkgrel=6
_arch="aarch64"
_mirror="http://dl-4.alpinelinux.org/alpine/"
@@ -21,16 +21,16 @@ pkgdesc="Statically linked Busybox for $_arch"
_target="$(arch_to_hostspec $_arch)"
source="
busybox-static-$pkgver-r$pkgrel-$_arch-edge.apk::$_mirror/edge/main/$_arch/busybox-static-$pkgver-r$pkgrel.apk
busybox-static-$pkgver-r$pkgrel-$_arch-v3.15.apk::$_mirror/v3.15/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-edge.apk
tar -xf $srcdir/busybox-static-$pkgver-r$pkgrel-$_arch-v3.15.apk
rm .PKGINFO .SIGN.*
}
sha512sums="
08f68b23bd880be12f95c5e1f071891f6b658fe7576f63d54e71d7390e4afc58de01813b2ea628f2b062830a89b0f69e8bd8a2b15fdb08bb9aba9e2a08971b0b busybox-static-1.36.1-r18-aarch64-edge.apk
8c9251b0d81515e29a66ab037094e0a8107e4a0a64d680fe11bdb9cd1d418d2a1e610907cc423156cd5f759f83937230d24c7f03036bff81c57dc6f9759cf89e busybox-static-1.34.1-r6-aarch64-v3.15.apk
"
-36
View File
@@ -1,36 +0,0 @@
# Automatically generated aport, do not edit!
# Generator: pmbootstrap aportgen busybox-static-armhf
# Stub for apkbuild-lint
if [ -z "$(type -t arch_to_hostspec)" ]; then
arch_to_hostspec() { :; }
fi
pkgname=busybox-static-armhf
pkgver=1.36.1
pkgrel=18
_arch="armhf"
_mirror="http://dl-4.alpinelinux.org/alpine/"
url="http://busybox.net"
license="GPL2"
arch="x86_64"
options="!check !strip"
pkgdesc="Statically linked Busybox for $_arch"
_target="$(arch_to_hostspec $_arch)"
source="
busybox-static-$pkgver-r$pkgrel-$_arch-edge.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-edge.apk
rm .PKGINFO .SIGN.*
}
sha512sums="
20b11081b5d1f25298fd4d8dfde51062f5c65060f5b53840eaad6fb69b94d64c5f5e522c9286f9a56cef4a9c88bdf53dcd385f47451b1563faf2058f1ea928cb busybox-static-1.36.1-r18-armhf-edge.apk
"
+5 -5
View File
@@ -7,8 +7,8 @@ if [ -z "$(type -t arch_to_hostspec)" ]; then
fi
pkgname=busybox-static-armv7
pkgver=1.36.1
pkgrel=18
pkgver=1.34.1
pkgrel=6
_arch="armv7"
_mirror="http://dl-4.alpinelinux.org/alpine/"
@@ -21,16 +21,16 @@ pkgdesc="Statically linked Busybox for $_arch"
_target="$(arch_to_hostspec $_arch)"
source="
busybox-static-$pkgver-r$pkgrel-$_arch-edge.apk::$_mirror/edge/main/$_arch/busybox-static-$pkgver-r$pkgrel.apk
busybox-static-$pkgver-r$pkgrel-$_arch-v3.15.apk::$_mirror/v3.15/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-edge.apk
tar -xf $srcdir/busybox-static-$pkgver-r$pkgrel-$_arch-v3.15.apk
rm .PKGINFO .SIGN.*
}
sha512sums="
8f2fa87d979bdbe88eef0b9dece61001998df960e025902854b2af415b96d63ce9831dbe44d5c32b671c313efdfe9e22743a26de73febcc92d8d45d944ad66c0 busybox-static-1.36.1-r18-armv7-edge.apk
8761d49220d25c1fc6bbc8a69fd22cd1fce55c9c1606327af5bdaaba994960fed188d9694141c8000829ea53bf459fc625e48e7c4d93d63259ffa48ef1e02819 busybox-static-1.34.1-r6-armv7-v3.15.apk
"
+12 -18
View File
@@ -1,6 +1,3 @@
# Maintainer: Oliver Smith <ollieparanoid@postmarketos.org>
# https://wiki.postmarketos.org/wiki/Pmbootstrap:_Cross_Compiling
#
# Wrapper for the "crossdirect" compilation method.
# pmbootstrap mounts the native chroot in the foreign arch (e.g. armhf) chroot
# as /native. This package gets installed into the native chroot, and creates
@@ -19,14 +16,14 @@
# version is implemented as simple shell wrappers.
pkgname=crossdirect
pkgver=5.1.0
pkgrel=0
pkgver=4
pkgrel=3
pkgdesc="Wrappers to launch native cross compilers in foreign chroots"
url="https://postmarketOS.org"
arch="all"
license="MIT"
options="!check"
source="cargo.sh crossdirect.c rustc.sh rust-qemu-linker.sh"
source="crossdirect.c rustc.sh rust-qemu-linker.sh"
build() {
cd "$srcdir"
@@ -43,6 +40,9 @@ build() {
-Werror \
-DHOSTSPEC="\"$_hostspec\"" \
crossdirect.c
# rustc
sed "s/@ARCH@/$_arch/g" rustc.sh >rustc-"$_arch"
done
}
@@ -51,11 +51,9 @@ package() {
_archs="x86_64 armhf armv7 aarch64"
_bins="c++ cc cpp g++ gcc clang clang++"
# Rust wrappers
# Rust: qemu-linker
install -Dm755 "$srcdir/rust-qemu-linker.sh" \
"$pkgdir/usr/lib/crossdirect/rust-qemu-linker"
install -Dm755 "$srcdir/cargo.sh" "$pkgdir/usr/lib/crossdirect/cargo.sh"
install -Dm755 "$srcdir/rustc.sh" "$pkgdir/usr/lib/crossdirect/rustc.sh"
# Iterate over architectures
for _arch in $_archs; do
@@ -75,14 +73,10 @@ package() {
ln -s "crossdirect-$_arch" "$_hostspec-$_bin"
done
ln -s ../cargo.sh cargo
ln -s ../rustc.sh rustc
# Rust: arch-specific rustc wrapper
install -Dm755 "$srcdir/rustc-$_arch" "$_bindir/rustc"
done
}
sha512sums="
0f4b48f250425dc57f63955fc8b38477d23db793bee367c3fbe03c3d2a559ba576434d07518310db4cae9d90d501af4051b80038b10fae94b980e537fc9374ad cargo.sh
500107e5aff8b34e74b54982ebcd447fc41bc8283956d506561b031a055cb30ec12698047c2604918b4b6d8560fe03db427a63dff2b83c907e8494b7f5233f29 crossdirect.c
de2aa6929bbff5db9132673e667f4525b333d062cb1f7a0597dd924de9e5c7215a9f8e2e6263b6fb5ace06f2c4b64f4ebfd0ede9b78add07c2cd08ec8613e98f rustc.sh
ea9bf8db3810d03d0a7395057f3d6e57f7127d87c55deaedc171c255288f5f3cc6fbcc680a5a1b92786cf573875d5dc22521173799fe2639acc97d0715ff905b rust-qemu-linker.sh
"
sha512sums="500107e5aff8b34e74b54982ebcd447fc41bc8283956d506561b031a055cb30ec12698047c2604918b4b6d8560fe03db427a63dff2b83c907e8494b7f5233f29 crossdirect.c
6be16ba88720e628a3ecc8fa53f8e7a21d2af268b0509745d989139874d6b94b640bfcff09575eaa19073810be6ef91169c1f83e94f5cf8e6819f2670d9408de rustc.sh
ea9bf8db3810d03d0a7395057f3d6e57f7127d87c55deaedc171c255288f5f3cc6fbcc680a5a1b92786cf573875d5dc22521173799fe2639acc97d0715ff905b rust-qemu-linker.sh"
-66
View File
@@ -1,66 +0,0 @@
#!/bin/sh -e
if [ -n "$CROSSDIRECT_DEBUG" ]; then
set -x
fi
native_version=$(LD_LIBRARY_PATH=/native/lib:/native/usr/lib /native/usr/bin/rustc -V)
target_version=$(/usr/bin/rustc -V)
if [ "$target_version" != "$native_version" ]; then
echo "ERROR: crossdirect: rustc version mismatch between native and build chroot. Please update your chroots and try again." >&2
exit 1
fi
triplet=$(/usr/bin/rustc -vV | sed -n 's/host: //p')
cmd=$1
shift
case "$cmd" in
build|test|run)
;;
*)
echo "WARNING: crossdirect: 'cargo $cmd $*' command not supported, running in QEMU (slow!)" >&2
export PATH="$(echo "$PATH" | sed 's,/native/usr/lib/crossdirect/[^:]*:,,')"
exec /usr/bin/cargo "$cmd" "$@"
;;
esac
target_dir=${CARGO_TARGET_DIR:-target}
target_already_specified=${CARGO_BUILD_TARGET:+1}
if [ -z "$target_specified" ]; then
for arg in "$@"; do
if [ "$arg_target_dir" = 1 ]; then
target_dir=$arg
arg_target_dir=0
fi
case "$arg" in
--target|--target=*)
target_already_specified=1
break
;;
--target-dir)
arg_target_dir=1
;;
--target-dir=*)
target_dir=${arg##--target-dir=}
;;
esac
done
fi
if [ -n "$target_already_specified" ]; then
exec /usr/bin/cargo "$cmd" "$@"
fi
/usr/bin/cargo "$cmd" --target=$triplet "$@"
# copy target/$triplet/{release,debug,...} to target/{release,debug,...}
if [ -d "$target_dir/$triplet" ]; then
for dir in "$target_dir/$triplet"/*/; do
build=$(basename "$dir")
rm -rf "$target_dir/$build"
cp -r "$target_dir/$triplet/$build" "$target_dir/$build"
done
fi
+41 -31
View File
@@ -1,38 +1,48 @@
#!/bin/sh -e
if [ -n "$CROSSDIRECT_DEBUG" ]; then
set -x
fi
rust_triplet() {
# Find the triplets in Alpine's rust APKBUILD or with:
# pmbootstrap chroot -barmhf --add=rust -- ls /usr/lib/rustlib
case "$1" in
x86_64)
echo "x86_64-alpine-linux-musl"
;;
armhf)
echo "armv6-alpine-linux-musleabihf"
;;
armv7)
echo "armv7-alpine-linux-musleabihf"
;;
aarch64)
echo "aarch64-alpine-linux-musl"
;;
*)
echo "ERROR: don't know the rust triple for $1!" >&2
exit 1
;;
esac
}
# return the correct host architecture when cargo requests it
if [ "$*" = "-vV" ] || [ "$*" = "-V" ]; then
exec /usr/bin/rustc "$*"
fi
arch="@ARCH@" # filled in by APKBUILD
# pmbootstrap installs sccache when building a rust program, unless --no-ccache
# is set. In that case it also sets CCACHE_DISABLE.
SCCACHE=/native/usr/bin/sccache
if ! [ -e "$SCCACHE" ] || [ -n "$CCACHE_DISABLE" ]; then
SCCACHE=""
fi
# We expect the right target to be set in the arguments if compiling for the
# target architecture. Our cargo wrapper passes the right "--target" argument
# automatically. If no target is provided, this is probably a macro or a
# build script, so it should be compiled for the native architecture.
if echo "$*" | grep -qFe "--target"; then
# Not using sccache when building for foreign architecture, as it
# doesn't cache the output with "Non-cacheable reasons: --sysroot"
LD_LIBRARY_PATH=/native/lib:/native/usr/lib \
/native/usr/bin/rustc \
if ! LD_LIBRARY_PATH=/native/lib:/native/usr/lib \
/native/usr/bin/rustc \
-Clinker=/native/usr/lib/crossdirect/rust-qemu-linker \
--target=$(rust_triplet "$arch") \
--sysroot=/usr \
"$@"
else
PATH=/native/usr/bin:/native/bin \
LD_LIBRARY_PATH=/native/lib:/native/usr/lib \
$SCCACHE \
/native/usr/bin/rustc \
-Clink-arg=-Wl,-rpath,/native/lib:/native/usr/lib \
"$@"
"$@"; then
echo "---" >&2
echo "WARNING: crossdirect: cross compiling with rustc failed, trying"\
"again with rustc + qemu" >&2
echo "---" >&2
# Usually the crossdirect approach works; however, when passing
# --extern to rustc with a dynamic library (.so), it fails with an
# error like 'can't find crate for `serde_derive`' (although the crate
# does exist). I think it fails to parse the metadata of the so file
# for some reason. We probably need to adjust rustc's
# librustc_metadata/locator.rs or something (and upstream that
# change!), but I've spent enough time on this already. Let's simply
# fall back to compiling in qemu in the very few cases where this is
# necessary.
/usr/bin/rustc "$@"
fi
+4 -4
View File
@@ -1,14 +1,14 @@
From 47b4bd4deb2c356bb07d2a96f22127aefafec3a4 Mon Sep 17 00:00:00 2001
From 3d818cf1e0a28d094ea415f6748fd1b7285519fc Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <nsz@port70.net>
Date: Fri, 26 Jan 2018 20:32:50 +0000
Subject: [PATCH 01/35] posix_memalign
Subject: [PATCH] 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 3527283693b..c4071b64b53 100644
index 87344d9383f..ece428df487 100644
--- a/gcc/config/i386/pmm_malloc.h
+++ b/gcc/config/i386/pmm_malloc.h
@@ -27,12 +27,13 @@
@@ -38,5 +38,5 @@ index 3527283693b..c4071b64b53 100644
else
return NULL;
--
2.41.0
2.33.1
@@ -1,7 +1,7 @@
From 4fa620d8c3e6730211bfb071eb4c817320491bd0 Mon Sep 17 00:00:00 2001
From 6fcb950659e4382067ff4b297547b178f0697a08 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 02/35] gcc: poison-system-directories
Subject: [PATCH] gcc: poison-system-directories
Add /sw/include and /opt/include based on the original
zecke-no-host-includes.patch patch. The original patch checked for
@@ -21,15 +21,15 @@ Upstream-Status: Pending
gcc/configure | 16 ++++++++++++++++
gcc/configure.ac | 10 ++++++++++
gcc/doc/invoke.texi | 9 +++++++++
gcc/gcc.cc | 2 ++
gcc/incpath.cc | 21 +++++++++++++++++++++
gcc/gcc.c | 2 ++
gcc/incpath.c | 21 +++++++++++++++++++++
7 files changed, 68 insertions(+)
diff --git a/gcc/common.opt b/gcc/common.opt
index 862c474d3c8..64c4277c991 100644
index ec5235c3a41..ca942863064 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -711,6 +711,10 @@ Wreturn-local-addr
@@ -682,6 +682,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.
@@ -41,10 +41,10 @@ index 862c474d3c8..64c4277c991 100644
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 4cad077bfbe..0679fbbf4c6 100644
index 364eba47737..9551c0dfdf9 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -236,6 +236,12 @@
@@ -224,6 +224,12 @@
#endif
@@ -58,18 +58,18 @@ index 4cad077bfbe..0679fbbf4c6 100644
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 c7b26d1927d..8c46369f73f 100755
index 84e0ea21054..3bb7b5b318a 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -1026,6 +1026,7 @@ enable_maintainer_mode
@@ -1010,6 +1010,7 @@ with_system_zlib
enable_maintainer_mode
enable_link_mutex
enable_link_serialization
enable_version_specific_runtime_libs
+enable_poison_system_directories
enable_plugin
enable_host_shared
enable_libquadmath_support
@@ -1788,6 +1789,8 @@ Optional Features:
@@ -1766,6 +1767,8 @@ Optional Features:
--enable-version-specific-runtime-libs
specify that runtime libraries should be installed
in a compiler-specific directory
@@ -78,7 +78,7 @@ index c7b26d1927d..8c46369f73f 100755
--enable-plugin enable plugin support
--enable-host-shared build host code as shared libraries
--disable-libquadmath-support
@@ -31753,6 +31756,19 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then :
@@ -30276,6 +30279,19 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then :
fi
@@ -99,10 +99,10 @@ index c7b26d1927d..8c46369f73f 100755
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 09082e8ccae..5504bf6eb01 100644
index d068618bd8f..44ea4725620 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -7292,6 +7292,16 @@ AC_ARG_ENABLE(version-specific-runtime-libs,
@@ -6608,6 +6608,16 @@ AC_ARG_ENABLE(version-specific-runtime-libs,
[specify that runtime libraries should be
installed in a compiler-specific directory])])
@@ -120,37 +120,37 @@ index 09082e8ccae..5504bf6eb01 100644
AC_SUBST(subdirs)
AC_SUBST(srcdir)
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index af0e5933fdb..b6731a4673c 100644
index 6d3cfcc664e..9d9a4b78ffd 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -384,6 +384,7 @@ Objective-C and Objective-C++ Dialects}.
-Wpacked -Wno-packed-bitfield-compat -Wpacked-not-aligned -Wpadded
-Wparentheses -Wno-pedantic-ms-format
-Wpointer-arith -Wno-pointer-compare -Wno-pointer-to-int-cast
+-Wno-poison-system-directories
-Wno-pragmas -Wno-prio-ctor-dtor -Wredundant-decls
-Wrestrict -Wno-return-local-addr -Wreturn-type
-Wno-scalar-storage-order -Wsequence-point
@@ -8426,6 +8427,14 @@ made up of data only and thus requires no special treatment. But, for
@@ -348,6 +348,7 @@ Objective-C and Objective-C++ Dialects}.
-Wpacked -Wno-packed-bitfield-compat -Wpacked-not-aligned -Wpadded @gol
-Wparentheses -Wno-pedantic-ms-format @gol
-Wpointer-arith -Wno-pointer-compare -Wno-pointer-to-int-cast @gol
+-Wno-poison-system-directories @gol
-Wno-pragmas -Wno-prio-ctor-dtor -Wredundant-decls @gol
-Wrestrict -Wno-return-local-addr -Wreturn-type @gol
-Wno-scalar-storage-order -Wsequence-point @gol
@@ -6927,6 +6928,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.
+@opindex Wno-poison-system-directories
+@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
@item -Wfloat-equal
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index 16bb07f2cdc..33b56e721d2 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -1146,6 +1146,8 @@ proper position among the other output files. */
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 9f790db0daf..b2200c5185a 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -1041,6 +1041,8 @@ proper position among the other output files. */
"%{fuse-ld=*:-fuse-ld=%*} " LINK_COMPRESS_DEBUG_SPEC \
"%X %{o*} %{e*} %{N} %{n} %{r}\
%{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!r:%{!nostartfiles:%S}}} \
@@ -159,10 +159,10 @@ index 16bb07f2cdc..33b56e721d2 100644
%{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.cc b/gcc/incpath.cc
index 4d44321183f..0f3f071b44c 100644
--- a/gcc/incpath.cc
+++ b/gcc/incpath.cc
diff --git a/gcc/incpath.c b/gcc/incpath.c
index 8a2bda00f80..9098ab044ab 100644
--- a/gcc/incpath.c
+++ b/gcc/incpath.c
@@ -26,6 +26,7 @@
#include "intl.h"
#include "incpath.h"
@@ -171,7 +171,7 @@ index 4d44321183f..0f3f071b44c 100644
/* Microsoft Windows does not natively support inodes.
VMS has non-numeric inodes. */
@@ -399,6 +400,26 @@ merge_include_chains (const char *sysroot, cpp_reader *pfile, int verbose)
@@ -393,6 +394,26 @@ merge_include_chains (const char *sysroot, cpp_reader *pfile, int verbose)
}
fprintf (stderr, _("End of search list.\n"));
}
@@ -199,5 +199,5 @@ index 4d44321183f..0f3f071b44c 100644
/* Use given -I paths for #include "..." but not #include <...>, and
--
2.41.0
2.33.1
@@ -0,0 +1,39 @@
From 8e72eea50b282e77163cc3c907170a9da8a638e3 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:45:49 +0000
Subject: [PATCH] Turn on -Wl,-z,relro,-z,now by default.
---
gcc/doc/invoke.texi | 3 +++
gcc/gcc.c | 1 +
2 files changed, 4 insertions(+)
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 9d9a4b78ffd..129dc5b11f3 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -14666,6 +14666,9 @@ For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
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
diff --git a/gcc/gcc.c b/gcc/gcc.c
index b2200c5185a..625c9ab7902 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -1039,6 +1039,7 @@ proper position among the other output files. */
"%{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:%{!r:%{!nostartfiles:%S}}} \
%{Wno-poison-system-directories:--no-poison-system-directories} \
--
2.33.1
@@ -1,44 +0,0 @@
From ff4dd4ce33133e675b7bedc86b73357c04631cb9 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:45:49 +0000
Subject: [PATCH 03/35] specs: turn on -Wl,-z,now by default
Previously, we also used to turn on -z relro here, but we now build
binutils with --enable-relro, which is functionally equivalent.
Binutils does not appear to have a similar option for enabling -z
now by default.
---
gcc/doc/invoke.texi | 3 +++
gcc/gcc.cc | 1 +
2 files changed, 4 insertions(+)
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index b6731a4673c..f393c7846c6 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -17961,6 +17961,9 @@ For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
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,now} is used. To disable, use @option{-Wl,-z,nonow}.
+
@opindex u
@item -u @var{symbol}
Pretend the symbol @var{symbol} is undefined, to force linking of
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index 33b56e721d2..f82fae23c22 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -1144,6 +1144,7 @@ proper position among the other output files. */
"%{flto|flto=*:%<fcompare-debug*} \
%{flto} %{fno-lto} %{flto=*} %l " LINK_PIE_SPEC \
"%{fuse-ld=*:-fuse-ld=%*} " LINK_COMPRESS_DEBUG_SPEC \
+ "-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} \
--
2.41.0
@@ -1,19 +1,19 @@
From 1b315235433701e4a974da259b8d651169ddc7ac Mon Sep 17 00:00:00 2001
From 43d2fb2068739661a61ded0a1124e98947773831 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:46:22 +0000
Subject: [PATCH 04/35] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++,
ObjC, ObjC++, if the optimization level is > 0
Subject: [PATCH] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, ObjC,
ObjC++, if the optimization level is > 0
---
gcc/c-family/c-cppbuiltin.cc | 4 ++++
gcc/doc/invoke.texi | 6 ++++++
gcc/c-family/c-cppbuiltin.c | 4 ++++
gcc/doc/invoke.texi | 6 ++++++
2 files changed, 10 insertions(+)
diff --git a/gcc/c-family/c-cppbuiltin.cc b/gcc/c-family/c-cppbuiltin.cc
index 5d64625fcd7..868d69506e4 100644
--- a/gcc/c-family/c-cppbuiltin.cc
+++ b/gcc/c-family/c-cppbuiltin.cc
@@ -1546,6 +1546,10 @@ c_cpp_builtins (cpp_reader *pfile)
diff --git a/gcc/c-family/c-cppbuiltin.c b/gcc/c-family/c-cppbuiltin.c
index db91a36794a..ed976c71404 100644
--- a/gcc/c-family/c-cppbuiltin.c
+++ b/gcc/c-family/c-cppbuiltin.c
@@ -1385,6 +1385,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);
@@ -25,10 +25,10 @@ index 5d64625fcd7..868d69506e4 100644
if (flag_gnu89_inline)
cpp_define (pfile, "__GNUC_GNU_INLINE__");
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index f393c7846c6..ef3c14a189e 100644
index 129dc5b11f3..1b7ef0c68c6 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -11868,6 +11868,12 @@ also turns on the following optimization flags:
@@ -9231,6 +9231,12 @@ also turns on the following optimization flags:
Please note the warning under @option{-fgcse} about
invoking @option{-O2} on programs that use computed gotos.
@@ -38,9 +38,9 @@ index f393c7846c6..ef3c14a189e 100644
+functions. To disable, specify either @option{-U_FORTIFY_SOURCE} or
+@option{-D_FORTIFY_SOURCE=0}.
+
@opindex O3
@item -O3
@opindex O3
Optimize yet more. @option{-O3} turns on all optimizations specified
--
2.41.0
2.33.1
@@ -1,8 +1,8 @@
From 67c0f5789630b27149f60ff831999ef7c1dba5d5 Mon Sep 17 00:00:00 2001
From ae3a276ae169a782fc114655343afef6bbc1a3ae Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:46:56 +0000
Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the
linker, but always link the sanitizer libraries with --no-as-needed.
Subject: [PATCH] On linux targets pass --as-needed by default to the linker,
but always link the sanitizer libraries with --no-as-needed.
---
gcc/config/aarch64/aarch64-linux.h | 1 +
@@ -18,11 +18,11 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the
gcc/config/rs6000/sysv4.h | 2 +-
gcc/config/s390/linux.h | 2 +-
gcc/config/sparc/linux.h | 2 +-
gcc/gcc.cc | 28 ++++++++++++++++++++--------
gcc/gcc.c | 28 ++++++++++++++++++++--------
14 files changed, 36 insertions(+), 19 deletions(-)
diff --git a/gcc/config/aarch64/aarch64-linux.h b/gcc/config/aarch64/aarch64-linux.h
index 4277f03da2a..b131983a546 100644
index e587e2e9ad6..1d1017aa523 100644
--- a/gcc/config/aarch64/aarch64-linux.h
+++ b/gcc/config/aarch64/aarch64-linux.h
@@ -35,6 +35,7 @@
@@ -34,7 +34,7 @@ index 4277f03da2a..b131983a546 100644
%{shared:-shared} \
%{symbolic:-Bsymbolic} \
diff --git a/gcc/config/alpha/linux-elf.h b/gcc/config/alpha/linux-elf.h
index 03f783f2ad1..d946e700dda 100644
index e25fcac3c59..22b2f7b0d14 100644
--- 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. If not see
@@ -47,7 +47,7 @@ index 03f783f2ad1..d946e700dda 100644
%{shared:-shared} \
%{!shared: \
diff --git a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h
index 7b7b7cbbe14..49c050c6f2c 100644
index 0ec3aa53189..f8bda84de2a 100644
--- a/gcc/config/arm/linux-elf.h
+++ b/gcc/config/arm/linux-elf.h
@@ -70,6 +70,7 @@
@@ -59,19 +59,16 @@ index 7b7b7cbbe14..49c050c6f2c 100644
SUBTARGET_EXTRA_LINK_SPEC
diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h
index eda8010b133..b26b17f2f2a 100644
index ff2e880b1fa..7f30c363e4a 100644
--- a/gcc/config/gnu-user.h
+++ b/gcc/config/gnu-user.h
@@ -136,7 +136,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
@@ -136,17 +136,17 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#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 LIBHWASAN_EARLY_SPEC
#define LIBHWASAN_EARLY_SPEC "%{!shared:libhwasan_preinit%O%s} " \
"%{static-libhwasan:%{!shared:" \
@@ -146,12 +146,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#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 " \
@@ -87,10 +84,10 @@ index eda8010b133..b26b17f2f2a 100644
#undef TARGET_F951_OPTIONS
diff --git a/gcc/config/i386/gnu-user.h b/gcc/config/i386/gnu-user.h
index a79b739089d..e0752673dff 100644
index ae4aa844f02..54b91c0492a 100644
--- a/gcc/config/i386/gnu-user.h
+++ b/gcc/config/i386/gnu-user.h
@@ -68,7 +68,7 @@ along with GCC; see the file COPYING3. If not see
@@ -74,7 +74,7 @@ along with GCC; see the file COPYING3. If not see
{ "link_emulation", GNU_USER_LINK_EMULATION },\
{ "dynamic_linker", GNU_USER_DYNAMIC_LINKER }
@@ -100,7 +97,7 @@ index a79b739089d..e0752673dff 100644
%{!static: \
%{!static-pie: \
diff --git a/gcc/config/i386/gnu-user64.h b/gcc/config/i386/gnu-user64.h
index 3b63b99acf6..759bf0db86f 100644
index 785c68220b8..21dd66b412a 100644
--- a/gcc/config/i386/gnu-user64.h
+++ b/gcc/config/i386/gnu-user64.h
@@ -56,6 +56,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
@@ -112,7 +109,7 @@ index 3b63b99acf6..759bf0db86f 100644
%{!shared: \
%{!static: \
diff --git a/gcc/config/ia64/linux.h b/gcc/config/ia64/linux.h
index 5dfd428aa17..02656dad7fc 100644
index ee38e218aec..0325971d818 100644
--- a/gcc/config/ia64/linux.h
+++ b/gcc/config/ia64/linux.h
@@ -58,7 +58,7 @@ do { \
@@ -125,7 +122,7 @@ index 5dfd428aa17..02656dad7fc 100644
%{!shared: \
%{!static: \
diff --git a/gcc/config/mips/gnu-user.h b/gcc/config/mips/gnu-user.h
index a4e5380b589..3cc61bce69f 100644
index 5d0782100bb..4be5fbb2191 100644
--- 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. If not see
@@ -137,22 +134,22 @@ index a4e5380b589..3cc61bce69f 100644
%{!static: \
%{rdynamic:-export-dynamic} \
diff --git a/gcc/config/riscv/linux.h b/gcc/config/riscv/linux.h
index 3e625e0f867..f8c2c351e5a 100644
index 4afef7c228c..ba1a6e60e05 100644
--- a/gcc/config/riscv/linux.h
+++ b/gcc/config/riscv/linux.h
@@ -48,6 +48,7 @@ along with GCC; see the file COPYING3. If not see
@@ -58,6 +58,7 @@ along with GCC; see the file COPYING3. If not see
"%{mabi=ilp32:_ilp32}"
#define LINK_SPEC "\
+-as-needed \
-melf" XLEN_SPEC DEFAULT_ENDIAN_SPEC "riscv" LD_EMUL_SUFFIX " \
-melf" XLEN_SPEC "lriscv" LD_EMUL_SUFFIX " \
%{mno-relax:--no-relax} \
%{mbig-endian:-EB} \
%{shared} \
diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
index 9e457033d11..08016bf224d 100644
index 2ded3301282..a1e44ddcc0d 100644
--- a/gcc/config/rs6000/linux64.h
+++ b/gcc/config/rs6000/linux64.h
@@ -377,13 +377,13 @@ extern int dot_symbols;
@@ -457,13 +457,13 @@ extern int dot_symbols;
" -m elf64ppc")
#endif
@@ -169,10 +166,10 @@ index 9e457033d11..08016bf224d 100644
%{rdynamic:-export-dynamic} \
-dynamic-linker " GNU_USER_DYNAMIC_LINKER64 "}}} \
diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
index ae932fc22f0..c8ff0c6dc8e 100644
index 9ade72114e9..9490b84a153 100644
--- a/gcc/config/rs6000/sysv4.h
+++ b/gcc/config/rs6000/sysv4.h
@@ -780,7 +780,7 @@ GNU_USER_TARGET_CC1_SPEC
@@ -789,7 +789,7 @@ GNU_USER_TARGET_CC1_SPEC
#define GNU_USER_DYNAMIC_LINKER GLIBC_DYNAMIC_LINKER
#endif
@@ -182,7 +179,7 @@ index ae932fc22f0..c8ff0c6dc8e 100644
-dynamic-linker " GNU_USER_DYNAMIC_LINKER "}}"
diff --git a/gcc/config/s390/linux.h b/gcc/config/s390/linux.h
index 02aa1edaff8..64df5801134 100644
index 6919b468f06..56d52d41b31 100644
--- a/gcc/config/s390/linux.h
+++ b/gcc/config/s390/linux.h
@@ -82,7 +82,7 @@ along with GCC; see the file COPYING3. If not see
@@ -195,7 +192,7 @@ index 02aa1edaff8..64df5801134 100644
%{!shared: \
%{static:-static} \
diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h
index 0e33b3cac2c..c2f44546e62 100644
index 63853e60c03..de6d8675456 100644
--- a/gcc/config/sparc/linux.h
+++ b/gcc/config/sparc/linux.h
@@ -81,7 +81,7 @@ extern const char *host_detect_local_cpu (int argc, const char **argv);
@@ -207,11 +204,11 @@ index 0e33b3cac2c..c2f44546e62 100644
%{!mno-relax:%{!r:-relax}} \
%{!shared: \
%{!static: \
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index f82fae23c22..da6417dd0d1 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -754,8 +754,11 @@ proper position among the other output files. */
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 625c9ab7902..7aec9d3a016 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -695,8 +695,11 @@ proper position among the other output files. */
#ifdef LIBASAN_EARLY_SPEC
#define LIBASAN_SPEC STATIC_LIBASAN_LIBS
#elif defined(HAVE_LD_STATIC_DYNAMIC)
@@ -225,7 +222,7 @@ index f82fae23c22..da6417dd0d1 100644
STATIC_LIBASAN_LIBS
#else
#define LIBASAN_SPEC "-lasan" STATIC_LIBASAN_LIBS
@@ -790,8 +793,11 @@ proper position among the other output files. */
@@ -713,8 +716,11 @@ proper position among the other output files. */
#ifdef LIBTSAN_EARLY_SPEC
#define LIBTSAN_SPEC STATIC_LIBTSAN_LIBS
#elif defined(HAVE_LD_STATIC_DYNAMIC)
@@ -239,7 +236,7 @@ index f82fae23c22..da6417dd0d1 100644
STATIC_LIBTSAN_LIBS
#else
#define LIBTSAN_SPEC "-ltsan" STATIC_LIBTSAN_LIBS
@@ -808,8 +814,11 @@ proper position among the other output files. */
@@ -731,8 +737,11 @@ proper position among the other output files. */
#ifdef LIBLSAN_EARLY_SPEC
#define LIBLSAN_SPEC STATIC_LIBLSAN_LIBS
#elif defined(HAVE_LD_STATIC_DYNAMIC)
@@ -253,7 +250,7 @@ index f82fae23c22..da6417dd0d1 100644
STATIC_LIBLSAN_LIBS
#else
#define LIBLSAN_SPEC "-llsan" STATIC_LIBLSAN_LIBS
@@ -824,8 +833,11 @@ proper position among the other output files. */
@@ -747,8 +756,11 @@ proper position among the other output files. */
#define STATIC_LIBUBSAN_LIBS \
" %{static-libubsan|static:%:include(libsanitizer.spec)%(link_libubsan)}"
#ifdef HAVE_LD_STATIC_DYNAMIC
@@ -268,5 +265,5 @@ index f82fae23c22..da6417dd0d1 100644
#else
#define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS
--
2.41.0
2.33.1
@@ -1,17 +1,17 @@
From bb25e8489384504cd59e4a2538720863da1fb29c Mon Sep 17 00:00:00 2001
From fe4ed38e850c9965482a28e16857dc4a451bbfc6 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:47:43 +0000
Subject: [PATCH 06/35] Enable -Wformat and -Wformat-security by default.
Subject: [PATCH] Enable -Wformat and -Wformat-security by default.
---
gcc/c-family/c.opt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
index a75038930ae..b98726f33ed 100644
index c49da99d395..93f25319005 100644
--- a/gcc/c-family/c.opt
+++ b/gcc/c-family/c.opt
@@ -704,7 +704,7 @@ Warn about function calls with format strings that write past the end
@@ -599,7 +599,7 @@ Warn about function calls with format strings that write past the end
of the destination region. Same as -Wformat-overflow=1.
Wformat-security
@@ -20,7 +20,7 @@ index a75038930ae..b98726f33ed 100644
Warn about possible security problems with format functions.
Wformat-signedness
@@ -725,7 +725,7 @@ C ObjC C++ ObjC++ Var(warn_format_zero_length) Warning LangEnabledBy(C ObjC C++
@@ -620,7 +620,7 @@ C ObjC C++ ObjC++ Var(warn_format_zero_length) Warning LangEnabledBy(C ObjC C++
Warn about zero-length formats.
Wformat=
@@ -30,5 +30,5 @@ index a75038930ae..b98726f33ed 100644
Wformat-overflow=
--
2.41.0
2.33.1
@@ -1,17 +1,17 @@
From 4a728ad48a7b437cc6f2697e26603bf648149f86 Mon Sep 17 00:00:00 2001
From 937c028663fa21fe9694a5725d1e96f3dbfb93fd Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:48:24 +0000
Subject: [PATCH 07/35] Enable -Wtrampolines by default.
Subject: [PATCH] Enable -Wtrampolines by default.
---
gcc/common.opt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/common.opt b/gcc/common.opt
index 64c4277c991..c24839d32bc 100644
index ca942863064..0a0ab6195ee 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -803,7 +803,7 @@ Common Var(warn_system_headers) Warning
@@ -774,7 +774,7 @@ Common Var(warn_system_headers) Warning
Do not suppress warnings from system headers.
Wtrampolines
@@ -19,7 +19,7 @@ index 64c4277c991..c24839d32bc 100644
+Common Var(warn_trampolines) Init(1) Warning
Warn whenever a trampoline is generated.
Wtrivial-auto-var-init
Wtype-limits
--
2.41.0
2.33.1
@@ -1,19 +1,19 @@
From 32f24560d0602f7735d5e9efd92fe3151bd72cea Mon Sep 17 00:00:00 2001
From 43813024350c27cf11fc07dcd3d7a02f752bd0c7 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:49:40 +0000
Subject: [PATCH 08/35] Disable ssp on -nostdlib, -nodefaultlibs and
-ffreestanding Change the buffer size.
Subject: [PATCH] Disable ssp on -nostdlib, -nodefaultlibs and -ffreestanding
Change the buffer size.
---
gcc/gcc.cc | 8 +++++++-
gcc/gcc.c | 8 +++++++-
gcc/params.opt | 2 +-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index da6417dd0d1..b5a6f200635 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -983,6 +983,12 @@ proper position among the other output files. */
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 7aec9d3a016..daeb4d0c8ea 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -886,6 +886,12 @@ proper position among the other output files. */
#define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
#endif
@@ -26,20 +26,20 @@ index da6417dd0d1..b5a6f200635 100644
#ifndef LINK_SSP_SPEC
#ifdef TARGET_LIBC_PROVIDES_SSP
#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
@@ -1282,7 +1288,7 @@ static const char *cc1_options =
@@ -1170,7 +1176,7 @@ static const char *cc1_options =
%{-version:--version}\
%{-help=*:--help=%*}\
%{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
%{!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=single:\
diff --git a/gcc/params.opt b/gcc/params.opt
index 823cdb2ff85..5b096899b40 100644
index 4aec480798b..eaecfab37ad 100644
--- a/gcc/params.opt
+++ b/gcc/params.opt
@@ -1006,7 +1006,7 @@ Common Joined UInteger Var(param_ssa_name_def_chain_limit) Init(512) Param Optim
@@ -853,7 +853,7 @@ Common Joined UInteger Var(param_ssa_name_def_chain_limit) Init(512) Param Optim
The maximum number of SSA_NAME assignments to follow in determining a value.
-param=ssp-buffer-size=
@@ -49,5 +49,5 @@ index 823cdb2ff85..5b096899b40 100644
-param=stack-clash-protection-guard-size=
--
2.41.0
2.33.1
@@ -1,8 +1,8 @@
From c7ec8da7280d7f97f5543eb9ddeca7600aafc43c Mon Sep 17 00:00:00 2001
From 506bda71fad5e51ffe5d1cfbf408f56a5e67afed Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:50:33 +0000
Subject: [PATCH 09/35] Ensure that msgfmt doesn't encounter problems during
gcc bootstrapping.
Subject: [PATCH] Ensure that msgfmt doesn't encounter problems during gcc
bootstrapping.
Solves error messages like the following:
@@ -26,7 +26,7 @@ https://bugs.gentoo.org/295480
2 files changed, 2 insertions(+)
diff --git a/libstdc++-v3/po/Makefile.am b/libstdc++-v3/po/Makefile.am
index 12d34910830..61b13762b71 100644
index a9391d8d167..f7eee24dc8c 100644
--- a/libstdc++-v3/po/Makefile.am
+++ b/libstdc++-v3/po/Makefile.am
@@ -38,6 +38,7 @@ MSGFMT = msgfmt
@@ -38,10 +38,10 @@ index 12d34910830..61b13762b71 100644
all-local: all-local-$(USE_NLS)
diff --git a/libstdc++-v3/po/Makefile.in b/libstdc++-v3/po/Makefile.in
index 8e93445acd2..d6ff06e5ddb 100644
index a0f84b0cfa0..ab24a47a2fd 100644
--- a/libstdc++-v3/po/Makefile.in
+++ b/libstdc++-v3/po/Makefile.in
@@ -561,6 +561,7 @@ uninstall-am:
@@ -548,6 +548,7 @@ uninstall-am:
.po.mo:
@@ -50,5 +50,5 @@ index 8e93445acd2..d6ff06e5ddb 100644
all-local: all-local-$(USE_NLS)
--
2.41.0
2.33.1
@@ -1,17 +1,17 @@
From aaa029bcee68298695b7c4278c90b6bc320d098c Mon Sep 17 00:00:00 2001
From 311daa31ea5f1f0b410c58aeda7c2c4635ec0e2b Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:52:07 +0000
Subject: [PATCH 10/35] Don't declare asprintf if defined as a macro.
Subject: [PATCH] Don't declare asprintf if defined as a macro.
---
include/libiberty.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/include/libiberty.h b/include/libiberty.h
index 1d5c779fcff..19e3cb1e31c 100644
index 141cb886a85..fa0e78eb62f 100644
--- a/include/libiberty.h
+++ b/include/libiberty.h
@@ -652,8 +652,11 @@ extern void *bsearch_r (const void *, const void *,
@@ -645,8 +645,11 @@ extern int pwait (int, int *, int);
/* Like sprintf but provides a pointer to malloc'd storage, which must
be freed by the caller. */
@@ -24,5 +24,5 @@ index 1d5c779fcff..19e3cb1e31c 100644
/* Like asprintf but allocates memory without fail. This works like
xmalloc. */
--
2.41.0
2.33.1
@@ -1,17 +1,17 @@
From 65e01e749205c9af218b01233cebd0077538d0ee Mon Sep 17 00:00:00 2001
From 2146e96bc76ef7d1e6796f991b880ebd0302afa4 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:53:00 +0000
Subject: [PATCH 11/35] libiberty: copy PIC objects during build process
Subject: [PATCH] libiberty: copy PIC objects during build process
---
libiberty/Makefile.in | 1 +
1 file changed, 1 insertion(+)
diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in
index 72608f3e4a7..58356884728 100644
index d6b302e02fd..fd39928546f 100644
--- a/libiberty/Makefile.in
+++ b/libiberty/Makefile.in
@@ -265,6 +265,7 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS)
@@ -263,6 +263,7 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS)
$(AR) $(AR_FLAGS) $(TARGETLIB) \
$(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \
$(RANLIB) $(TARGETLIB); \
@@ -20,5 +20,5 @@ index 72608f3e4a7..58356884728 100644
else true; fi
--
2.41.0
2.33.1
-57
View File
@@ -1,57 +0,0 @@
From 453a815bf2844971a91eaef800af188d9e86b784 Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <nsz@port70.net>
Date: Sat, 24 Oct 2015 20:09:53 +0000
Subject: [PATCH 12/35] libgcc_s
---
gcc/config/i386/i386-expand.cc | 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-expand.cc b/gcc/config/i386/i386-expand.cc
index 0d817fc3f3b..2e99db00db9 100644
--- a/gcc/config/i386/i386-expand.cc
+++ b/gcc/config/i386/i386-expand.cc
@@ -12691,10 +12691,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 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 50b6d8248a2..724ced402a1 100644
--- a/libgcc/config/i386/cpuinfo.c
+++ b/libgcc/config/i386/cpuinfo.c
@@ -63,7 +63,7 @@ __cpu_indicator_init (void)
__cpu_features2);
}
-#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 8506a635790..564296f788e 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.41.0
@@ -0,0 +1,33 @@
From e3b5b8fc0ad9c7bf33930632060385fd340aafb7 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:53:36 +0000
Subject: [PATCH] libitm: disable FORTIFY
---
libitm/configure.tgt | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/libitm/configure.tgt b/libitm/configure.tgt
index d1beb5c9ec8..c2b50b95c01 100644
--- a/libitm/configure.tgt
+++ b/libitm/configure.tgt
@@ -47,6 +47,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
--
2.33.1
+57
View File
@@ -0,0 +1,57 @@
From 75c269d1783e1b83d9bc4f6c826f10f63a0f51a5 Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <nsz@port70.net>
Date: Sat, 24 Oct 2015 20:09:53 +0000
Subject: [PATCH] libgcc_s
---
gcc/config/i386/i386-expand.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-expand.c b/gcc/config/i386/i386-expand.c
index 47d52550e5e..9cb8cc7950e 100644
--- a/gcc/config/i386/i386-expand.c
+++ b/gcc/config/i386/i386-expand.c
@@ -10976,10 +10976,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 83301a1445f..89fdc7eb587 100644
--- a/libgcc/config/i386/cpuinfo.c
+++ b/libgcc/config/i386/cpuinfo.c
@@ -516,7 +516,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 8506a635790..564296f788e 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.33.1
-75
View File
@@ -1,75 +0,0 @@
From 7d7d12137c666761a8dd61179c9651b85dae9b41 Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <nsz@port70.net>
Date: Sat, 7 Nov 2015 02:08:05 +0000
Subject: [PATCH 13/35] nopie
---
gcc/configure | 27 +++++++++++++++++++++++++++
gcc/configure.ac | 13 +++++++++++++
2 files changed, 40 insertions(+)
diff --git a/gcc/configure b/gcc/configure
index 8c46369f73f..e59cbee1767 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -32268,6 +32268,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 5504bf6eb01..57268319de1 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -7552,6 +7552,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.41.0
@@ -1,42 +0,0 @@
From dd5bb97c31a9f57034c70a7a18ba6e2e133084c7 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:59:16 +0000
Subject: [PATCH 14/35] ada: fix shared linking
---
gcc/ada/link.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/gcc/ada/link.c b/gcc/ada/link.c
index f2126441208..22cfa9c641f 100644
--- a/gcc/ada/link.c
+++ b/gcc/ada/link.c
@@ -107,9 +107,9 @@ const char *__gnat_default_libgcc_subdir = "lib";
|| defined (__NetBSD__) || defined (__OpenBSD__) \
|| defined (__QNX__)
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";
@@ -129,9 +129,9 @@ const char *__gnat_default_libgcc_subdir = "lib";
#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";
--
2.41.0
+75
View File
@@ -0,0 +1,75 @@
From 94df93e5a0241488343d6002912dfbd680df8aba Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <nsz@port70.net>
Date: Sat, 7 Nov 2015 02:08:05 +0000
Subject: [PATCH] nopie
---
gcc/configure | 27 +++++++++++++++++++++++++++
gcc/configure.ac | 13 +++++++++++++
2 files changed, 40 insertions(+)
diff --git a/gcc/configure b/gcc/configure
index 3bb7b5b318a..1632337439c 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -30784,6 +30784,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 44ea4725620..6e4d4092af7 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -6866,6 +6866,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.33.1
@@ -1,24 +0,0 @@
From 6bb5b7d9161d05f31b001d8211a9c63caf63fd2f Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:59:43 +0000
Subject: [PATCH 15/35] build: fix CXXFLAGS_FOR_BUILD passing
---
Makefile.in | 1 +
1 file changed, 1 insertion(+)
diff --git a/Makefile.in b/Makefile.in
index 06a9398e172..6ff2b3f9925 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -178,6 +178,7 @@ BUILD_EXPORTS = \
# built for the build system to override those in BASE_FLAGS_TO_PASS.
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.
--
2.41.0
@@ -0,0 +1,25 @@
From ac79c17450c4e3a84ad884583ae80f5949f7ffc0 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:57:09 +0000
Subject: [PATCH] libffi: use __linux__ instead of __gnu_linux__ for musl
---
libffi/src/closures.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libffi/src/closures.c b/libffi/src/closures.c
index 721ff00ea43..22a699c6340 100644
--- a/libffi/src/closures.c
+++ 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
--
2.33.1
@@ -1,25 +0,0 @@
From f0d9e00cac06689f64b214de7aee80d7116ef084 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 07:01:06 +0000
Subject: [PATCH 16/35] add fortify-headers paths
---
gcc/config/linux.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/gcc/config/linux.h b/gcc/config/linux.h
index e3aca79cccc..b3537b8fbeb 100644
--- a/gcc/config/linux.h
+++ b/gcc/config/linux.h
@@ -159,6 +159,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#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
--
2.41.0
@@ -0,0 +1,425 @@
From ebd9bb4708ce923785eec4d3760536cdd4051e0a Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:57:51 +0000
Subject: [PATCH] dlang: update zlib binding
---
libphobos/src/std/zlib.d | 266 ++++++++++++++++++++++++++++-----------
1 file changed, 196 insertions(+), 70 deletions(-)
diff --git a/libphobos/src/std/zlib.d b/libphobos/src/std/zlib.d
index e6cce240fd5..bd2fe37ebec 100644
--- a/libphobos/src/std/zlib.d
+++ b/libphobos/src/std/zlib.d
@@ -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)[] buf)
* 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, size_t destlen = 0u, int winbits = 15)
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,49 +761,40 @@ 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");
}
}
--
2.33.1
@@ -1,31 +0,0 @@
From 857db04f4f1a06e866551b4172fe8f27363f4a92 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
Date: Fri, 21 Aug 2020 07:03:00 +0000
Subject: [PATCH 17/35] 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/gcc.cc | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index b5a6f200635..6cbb726599b 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -991,8 +991,7 @@ proper position among the other output files. */
#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" \
--
2.41.0
@@ -0,0 +1,51 @@
From 3e29fbd28d442a79b56610c515e9b45933244ae8 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:58:22 +0000
Subject: [PATCH] dlang: fix fcntl on mips, add libucontext dep
---
libphobos/configure.tgt | 1 +
libphobos/libdruntime/core/sys/posix/fcntl.d | 15 +++++++++++++++
2 files changed, 16 insertions(+)
diff --git a/libphobos/configure.tgt b/libphobos/configure.tgt
index 94e42bf5509..73f2e4b7f01 100644
--- a/libphobos/configure.tgt
+++ b/libphobos/configure.tgt
@@ -35,6 +35,7 @@ case "${target}" in
;;
mips*-*-linux*)
LIBPHOBOS_SUPPORTED=yes
+ LIBDRUNTIME_NEEDS_UCONTEXT=yes
;;
power*-*-linux*)
LIBPHOBOS_SUPPORTED=yes
diff --git a/libphobos/libdruntime/core/sys/posix/fcntl.d b/libphobos/libdruntime/core/sys/posix/fcntl.d
index 9febcff849b..cb34e2108bd 100644
--- a/libphobos/libdruntime/core/sys/posix/fcntl.d
+++ b/libphobos/libdruntime/core/sys/posix/fcntl.d
@@ -870,6 +870,21 @@ else version (CRuntime_Musl)
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");
--
2.33.1
@@ -1,69 +0,0 @@
From 5a8347e23ab13912b6edec2c6c6e3a101b017c79 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 07:03:42 +0000
Subject: [PATCH 18/35] DP: Use --push-state/--pop-state for gold as well when
linking libtsan.
---
gcc/gcc.cc | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index 6cbb726599b..59390fd39d6 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -755,10 +755,10 @@ proper position among the other output files. */
#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
@@ -794,10 +794,10 @@ proper position among the other output files. */
#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
@@ -815,10 +815,10 @@ proper position among the other output files. */
#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
@@ -834,10 +834,10 @@ proper position among the other output files. */
" %{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
--
2.41.0
Loaded 100 of 5712 files, more files were not shown because too many files have changed in this diff. Show more