Compare commits

...
Author SHA1 Message Date
Caleb Connolly 7595cdbcb1 device/testing/linux-valve-jupiter: new aport 2023-07-02 23:30:07 +01:00
Caleb Connolly db18bf5de3 main/postmarketos-initramfs: fixup device-mapper paths
findfs might produce a block device path like /dev/dm-3, these can
change across boots and devices. Make things more readable and
consistent by mapping from the /dev/dm-* path to the equivalent
/dev/mapper/xyz path. Combined with invoking kpartx from a
/dev/disk/by-partlabel/abc symlink, this results in the final block
device having a name like /dev/mapper/userdata2 on an Android device.

Whilst this is just nicer to work with, this will be especially useful for
the upcoming ondev2 postmarketOS installer to make device-specific
configuration and detection easier.
2023-07-02 00:54:19 +01:00
Caleb Connolly f71ef9f787 main/postmarketos-initramfs: optimise find_*_partition
Save the root/boot partition paths once found, and optimise a few loops.
2023-07-02 00:54:19 +01:00
Caleb Connolly a7d92d9f8b main/postmarketos-initramfs: optimise mount_subpartitions
Drop in mdev.conf and the /lib/mdev/persistent-storage script, these
cause /dev/disk/by-* to be populated in the ramdisk (!!), making it
possible to do look up partition by-label and by-partlabel for free,
compared to findfs which can take some time.

As a first optimisation based on this, check for some partitions using
these paths and prioritise them when looking for subpartitions. Drop the
first find_boot_partition call as it doesn't really save time over the
call in the while loop.
2023-07-02 00:54:19 +01:00
Caleb Connolly 468cbbe102 main/postmarketos-initramfs: rework logging
Make logs always go to kmsg, so that if you have a console configured
then you'll always be able to see the init script output. The
behaviour of PMOS_NO_OUTPUT_REDIRECT is adjusted so that it just
decides whether or not openrc will log to the console or not.

The original stdout/stderr fds are preserved and later restored, this is
important for debug-shell to run on the TTY.
2023-07-02 00:54:19 +01:00
Caleb Connolly 416b90dc61 main/postmarketos-initramfs: silence pbsplash 2023-07-02 00:54:19 +01:00
Caleb Connolly 590d339717 main/postmarketos-mkinitfs-hook-debug-shell: reconfigure logging
It's necessary to reconfigure the stdout/stderr streams before spawning
the debug shell, so that it will correctly launch a getty on the serial
console if available.
2023-07-02 00:54:18 +01:00
Luca Weiss 4b84be3d62 main/postmarketos-initramfs: switch_root with /dev (MR 3230)
Mount /dev (and /run) in initramfs so util-linux switch_root can move
the mounts over to the new sysroot before changing root.
BusyBox switch_root doesn't even attempt to move anything so use
util-linux's switch_root for this.

Explicitly disable tests too...
2023-07-02 00:52:01 +01:00
Newbyte 0bcef33a6d cross/gcc-*: upgrade to 13.1.1_git20230624-r2 2023-07-01 23:09:30 +02:00
Ferass El Hafidi ed29e90653 linux-postmarketos-amlogic: upgrade to 6.4 (MR 4209)
Remove all KII Pro patches as they got merged into 6.4. Also remove V=1
as it's now unnecessary.

Signed-off-by: Ferass El Hafidi <vitali64pmemail@protonmail.com>

[ci:skip-build]: already built successfully in CI
2023-07-01 19:47:51 +02:00
Luca Weiss 6eec0b0503 main/postmarketos-mkinitfs-hook-netboot: show Loading splash once done (MR 4212)
Since the original "Loading..." splash is being shown before the hooks
is being run, we should go back to the "Loading..." splash once we're
done in the hook.

[ci:skip-build]: already built successfully in CI
2023-07-01 19:43:01 +02:00
Luca Weiss 3b5e3cb66a main/postmarketos-mkinitfs-hook-debug-shell: show Loading splash once done (MR 4212)
Since the original "Loading..." splash is being shown before the hooks
is being run, we should go back to the "Loading..." splash once we're
done in the hook.
2023-07-01 19:43:01 +02:00
Newbyte c1fc79202f cross/busybox-static-*: upgrade to 1.36.1-r2 2023-07-01 10:06:12 +02:00
Newbyte 8d9b899b04 cross/gcc-*: upgrade to 13.1.1_git20230624-r1 2023-07-01 10:05:20 +02:00
eval Nya 19fccce9e6 device/linux-samsung-n5110: migrate to armv7 (MR 4184)
[ci:skip-build]: already built successfully in CI
2023-06-29 20:25:04 +02:00
Clayton Craft 34908d3fee valve-jupiter: new device (MR 3877)
Note that only the "linux-edge" kernel is used, and it's likely that
this kernel is still missing some functionality. I'd like to avoid using
a downstream/forked kernel if at all possible...

I chose to use gummiboot for now, since it's really simple to configure.
This can be moved to a more "standard" EFI boot mechanism once pmOS
figures that out.

[ci:skip-build]: already built successfully in CI
2023-06-29 09:34:08 +02:00
Oliver Smith 2d5a9d7d0a device-pine64-pinebookpro: add elogind subpackage (MR 4202)
Move the elogind configuration and post-install call of "loginctl
reload" into an extra subpackage with install_if=elogind.

Fix for:
  Executing device-pine64-pinebookpro-16-r0.post-install
   * service nvme-powersave added to runlevel boot
   * service sysfsconf added to runlevel default
  lib/apk/exec/device-pine64-pinebookpro-16-r0.post-install: line 5: loginctl: not found
  ERROR: device-pine64-pinebookpro-16-r0.post-install: script exited with error 127

Make the post-install scripts more robust while at it, by adding
"exit 0" at the end.
2023-06-28 17:20:50 +02:00
shtirlic 97e752caaf soc-qcom-sdm845: fix pops/clicks sound via alsa buffer tuning (MR 4186)
Update some alsa buffer params to solve sound quality issues

I got working values experimentally after trying
different buffer sizes and limits and watching to pw-top
to ensure there are  no errors during playback from diffrent apps and
sinks.

Contributes to #1534
2023-06-28 10:07:33 +02:00
Iuri cbd746d249 samsung-logands: new device (MR 4198)
[ci:skip-build]: already built successfully in CI
2023-06-28 08:50:39 +02:00
M0Rf30 0acc5220a8 linux-postmarketos-qcom-msm8953: general maintenance update (MR 4197)
This sports:
  - PM8953 GPIO enablement
  - missing properties for motorola-aliIt
  - re-generated panels
  - Xiaomi Redmi S2/Y2 (xiaomi-ysl) support
  - PM8953 thermal zone enablement
  - enable modem on Fairphone FP3

[ci:skip-build]: already built successfully in CI
2023-06-27 09:08:21 +02:00
QC8086 10f86941d6 device-pine64-pinebookpro: Enable s2idle in elogind. (MR 4194)
[ci:skip-build]: already built successfully in CI
2023-06-27 08:52:32 +02:00
Luca Weiss d15a16ec9b device-fairphone-fp3: add lk2nd-msm8953 dependency (MR 4196)
With the new pmbootstrap flasher flash_lk2nd action we should add the
lk2nd package to the device package dependencies. Add it so the flash
works nicely.

[ci:skip-build]: already built successfully in CI
2023-06-25 22:12:45 +02:00
Luca Weiss e5e35027d2 main/lk2nd-msm8953: compile with -O1 to fix booting (MR 4196)
Currently, at least on fairphone-fp3 doing "fastboot boot" crashes
lk2nd, presumably due to some bug when compiled with a newer gcc
version.

Compiling with -O1 works well.

[81660] booting linux @ 0x10000000, ramdisk @ 0x13600000 (3339187), tags/device tree @ 0x13400000
[81660] Jumping to kernel via monitor
[81660] data abort, halting
[81660] r0  0x8f7724fc r1  0x8f772504 r2  0x00000000 r3  0x00000000
[81660] r4  0x00000001 r5  0x8f7724fb r6  0x00000001 r7  0x5b080000
[81660] r8  0x00000000 r9  0x011b9000 r10 0x8f741094 r11 0x8f7725ac
[81660] r12 0x00000001 usp 0x00000000 ulr 0x00000000 pc  0x8f630690
[81660] spsr 0x600001d3
[81660]  fiq r13 0x8f729000 r14 0x00000000
[81660]  irq r13 0x8f72d1a0 r14 0x8f620c2c
[81660] *svc r13 0x8f7724f8 r14 0x8f6147b0
[81660]  und r13 0x8f729000 r14 0x00000000
[81660]  sys r13 0x00000000 r14 0x00000000
[81660] bottom of stack at 0x8f7724f8:
0x8f7724f8: 00726f63 824fe86d 00020000 8f7724fb |cor.m.O.......w.|
0x8f772508: 8f742c01 824fe86d 10000000 00000000 |..t.m.O.........|
0x8f772518: 13400000 00000000 8f628aa0 8f6147b0 |..........b..Ga.|
0x8f772528: 00000000 00000000 13400000 10000000 |................|
0x8f772538: 00000000 00000001 0000000f 824fe86d |............m.O.|
0x8f772548: 13400000 00000000 00000000 00000000 |................|
0x8f772558: 00000000 00000000 00000000 00000000 |................|
0x8f772568: 00000000 00000000 00000000 00000000 |................|
2023-06-25 22:12:45 +02:00
Bart Ribbers 07082620c3 main/postmarketos-ui-plasma-bigscreen: replace dependency on mycroft-core for ovos (MR 4195)
MyCroft has seized development and the package has been removed from
aports. The OpenVoiceOS community has taken over development and has
with ovos a drop-in replacement.
2023-06-25 22:05:18 +02:00
Hugo Osvaldo Barrera 06e52230e9 temp/arm-trusted-firmware: remove (MR 4191)
This package originally existed to carry local patches not included
upstream. That is not longer the case, and using the Alpine package
works fine.

Additionally, this package tends to lag behind; Alpine currently ships
2.8.6.

References: https://gitlab.com/postmarketOS/pmaports/-/issues/1611

[ci:skip-build] already built successfully in CI
2023-06-20 14:19:03 -07:00
Pablo Correa Gómez 16b030c8aa cross/gcc-*: bump to 13.1.1_git20230617 (MR 4192)
[ci:skip-build]: already built successfully in CI
2023-06-19 20:42:02 +02:00
Przemysław Romanik d7c036b978 testing/device-many: rebuild to fix wrong initfs-hook.sh location (MR 4187)
postmarketos-mkinitfs!30 and specifically postmarketos-mkinitfs@6fdc8937,
changes expected hooks location from /etc/postmarketos-mkinitfs/hooks
to /etc/mkinitfs/hooks, and another commit pushed later adds
/usr/share/mkinitfs/hooks to expected directories. This more or less
breaks new pmOS installs done by running pmbootstrap install on edge branch,
which pull current (2023-06-17T16:57+02:00) device-* packages from
https://mirror.postmarketos.org/postmarketos/master.
Many of those packages which included initfs-hook.sh no longer work in that
case, because they had those hooks in old location, which isn't used
by latest postmarketos-mkinitfs.

Rebuilding the affected packages solves the issue.

[ci:ignore-count]

[ci:skip-build]: already built successfully in CI
2023-06-19 17:00:28 +02:00
Clayton Craft 2d0c0891da tablet-x86uefi: add workaround for recovering from ath6kl fw hangs (MR 4189)
Apparently the ath6kl FW can hang at times, so this enables automatic
recovery. This should make wifi on tablets that use ath6kl a little more
reliable.
2023-06-19 16:41:41 +02:00
rom4nik 561e7959f8 samsung-crownlte: fix stuck Samsung boot screen, fix slow boot by adding mfc_fw.bin to firmware (MR 4176)
[ci:skip-build] already built successfully in CI
2023-06-18 10:40:12 -07:00
Henrik Grimler f06a3b1e68 firmware-samsung-dream: add MFC firmware (MR 4188)
Otherwise there is a 3 min delay until we can ssh into the device.

Same issue as on samsung-crownlte, where rom4nik investigated and
found the solution [1].

Note that the display does not work for dreamlte and dream2lte at the
moment, the device gets stuck on the pmos boot splash screen. This
issue is tracked in
https://gitlab.com/postmarketOS/pmaports/-/issues/2102.

[1] https://gitlab.com/postmarketOS/pmaports/-/merge_requests/4176

[ci:skip-build] already built successfully in CI
2023-06-18 10:37:46 -07:00
Clayton Craft d5973bd456 tablet-x86uefi: add ath6kl fw, enable i2c TS, drop phoc scaling (MR 4185)
- ath6kl fw is used by some tablets (e.g. baytrail)

- Add support for i2c touchscreens in initramfs, which enables FDE
  support for tablets that have i2c touchscreens.

- Drop phosh subpackage / phoc.ini. Forcing 1X scaling is wrong on some
  tablets... Phoc/phosh is capable of detecting screen scaling, if it's
  wrong on a tablet then a patch should be submitted upstream to fix it.

[ci:skip-build] already built successfully in CI
2023-06-18 09:35:59 -07:00
Clayton Craft 3cc4b158f9 firmware-ath6kl: new aport (MR 4185)
Firmare for the ath6kl wifi/BT combo chip, used by some tablets
2023-06-18 09:35:59 -07:00
aleiepure cf607b6987 lenovo-achilles: new device (MR 4103)
[ci:skip-build] already built successfully in CI
2023-06-18 07:55:40 -07:00
Alistair Francis 016e512c83 purism-librem5: upgrade to librem5-base 61 (MR 4182)
Signed-off-by: Alistair Francis <alistair@alistair23.me>
2023-06-17 11:03:29 +02:00
Ultra 9e11b3aa03 firmware-motorola-ocean: Use vendor A530 firmware (MR 4070)
Since 6.3.0, the a530_pfp.fw and a530_pm4.fw files provided by
linux-firmware-qcom don't work correctly with ocean. Instead use vendor
provided ones.
2023-06-17 10:52:06 +02:00
TQMatvey ec804dcb33 lenovo-tb128fu: new device (MR 4162)
[ci:skip-build] already built successfully in CI
2023-06-16 09:57:44 -07:00
Clayton Craft 5b4c1d14ff linux-purism-librem5: upgrade to 6.3.7 (MR 4181)
[ci:skip-build] already built successfully in CI
2023-06-16 09:51:43 -07:00
QC8086 f7876f67d6 purism-librem5: Enable quick resume support in ModemManager (MR 4158)
[ci:skip-build] already built successfully in CI
2023-06-16 09:44:48 -07:00
Oliver Smith 2e216a3592 cross/binutils-*: upgrade to 2.40-r12 2023-06-16 09:27:16 +02:00
Sicelo A. Mhlongo d0a12d9c48 ui-i3wm: Depend on wallpaper and polkit (MR 4179)
Wallpaper and polkit dependency are device-agnostic, so remove from N900
package to i3wm

[ci:skip-build]: already built successfully in CI
2023-06-15 22:28:17 +02:00
Denis 2034a8f771 xiaomi-pine: enable hci-usb bluetooth driver (MR 4180)
[ci:skip-build]: already built successfully in CI
2023-06-14 21:55:06 +02:00
Denis af2446e5b4 xiaomi-pine: Better organization of blobs (MR 4180) 2023-06-14 21:55:06 +02:00
Denis 8df8d5ef15 xiaomi-pine: add fix for lightdm CanGraphical issue (MR 4180) 2023-06-14 21:55:05 +02:00
Denis 68b1dfcd20 xiaomi-pine: enable kernel module support (MR 4180) 2023-06-14 21:55:05 +02:00
Oliver Smith f4cab61428 gitlab: issue template: add GNOME mobile 2023-06-13 08:36:05 +02:00
Oliver Smith 35f17bfa38 cross/musl-*: upgrade to 1.2.4-r1 2023-06-13 07:39:46 +02:00
Oliver Smith d1f839d2cb cross/busybox-static-*: upgrade to 1.36.1-r1 2023-06-13 07:39:41 +02:00
Timon Baetz d630f6c1fe community/linux-postmarketos-qcom-msm8996: enable Atheros L1C Gigabit Ethernet support (MR 4160)
Used by Arrow DragonBoard 820c

[ci:skip-build]: already built successfully in CI
2023-06-13 07:33:41 +02:00
Timon Baetz 70fa81059d arrow-db820c: new device (MR 4160) 2023-06-13 07:33:36 +02:00
Jan Jasper de Kroon bb5b986bf3 linux-postmarketos-allwinner: upgrade to 6.3.5 (MR 4161)
This kernel release incorporates the following fix from Megi:
- fixed regression in Pinephone power consumption during sleep (touchscreen
  was not disabled properly, consuming a lot of power)

[ci:skip-build]: already built successfully in CI
2023-06-13 07:24:40 +02:00
Petr Hodina 4e2f839fb0 linux-postmarketos-amlogic: remove CONFIG_ANDROID_BINDER_IPC_SELFTEST (MR 4174)
[ci:skip-build]: already built successfully in CI
2023-06-12 08:43:12 +02:00
Pablo Correa Gómez ef00e24e5a main/postmarketos-base-ui: depend on tzdata (MR 4175)
Most UIs already implicitly depend on this in some way, and from the
user-facing point of view, it is sensible to have the full DB of timezones
available, in case the user wants to swap timezone or requires working
with them in different ways. Having it as a explicit dependency makes more
sense than relying on backward dependencies.

Background: https://gitlab.com/postmarketOS/pmaports/-/issues/2168#note_1426261355
[ci:skip-build]: already built successfully in CI
2023-06-12 07:46:29 +02:00
Newbyte 4f88b15af5 linux-postmarketos-exynos4: upgrade to 6.3.5 (MR 4147)
[ci:skip-build] already built successfully in CI
2023-06-11 11:43:50 -07:00
DownToTwo ad438c06cf inet-a33: new device (MR 4166)
[ci:skip-build]: already built successfully in CI
2023-06-11 13:15:34 +02:00
Clayton Craft e97cb6ff03 tablet-x86uefi: add modules to initfs for booting from eMMC, and graphics (MR 4172)
Some tablets have eMMC, which pmOS can be installed to. These modules
are needed to detect/mount the boot and rootfs partitions.

This also adds i915, which sets up the display and allows the splash
screen / console to work on boot.
2023-06-10 14:52:36 -07:00
Luca Weiss e0bd6dc64c device-fairphone-fp4: use sparse image (MR 4164)
Sparse images get a bit smaller which should lead to faster flashing
times. And they work absolutely fine on FP4, so let's enable them.
2023-06-09 23:17:40 +02:00
Clayton Craft e85eada1ad cross/gcc-*: upgrade to 13.1.1_git20230603-r0 2023-06-09 11:45:27 -07:00
Oliver Smith e537055084 gitlab: issue template: add EOL date to v22.12 2023-06-07 15:56:38 +02:00
Oliver Smith 2611c2c5ef channels.cfg: v23.06 is out now! \o/ 2023-06-07 15:38:03 +02:00
Oliver Smith 6dee0fe989 main/postmarketos-release-upgrade: upgrade to 1.4.0 (MR 4163)
[ci:skip-build]: already built successfully in CI
2023-06-07 11:49:35 +02:00
Sicelo A. Mhlongo d58b8a182f linux-postmarketos-omap: tty and cmdline fixes, upgrade to 6.3.5 (MR 4152)
- make CONFIG_DRM_DISPLAY_CONNECTOR built-in. This resolves 'slow' tty
  initialization that breaks pbsplash on N900
- use CONFIG_CMDLINE_FROM_BOOTLOADER instead of CONFIG_CMDLINE_FORCE, to allow
  kernel to boot with u-boot provided parameters such as
  PMOS_FORCE_PARTITION_RESIZE
- upgrade to 6.3.5

[ci:skip-build]: already built successfully in CI
2023-06-06 18:08:37 +02:00
Oliver Smith f50c6c5a8a main/postmarketos-ui-gnome-mobile: remove dep on wallpapers (MR 4156)
[ci:skip-build]: already built successfully in CI
2023-06-06 17:50:11 +02:00
Oliver Smith 55c2aa08c8 main/postmarketos-ui-gnome: remove dep on wallpapers (MR 4156) 2023-06-06 17:50:10 +02:00
Oliver Smith 334a03eaae main/postmarketos-base-ui-gnome: update wallaper (MR 4156)
Use wallpapers that give a good contrast to read the labels of
launchers in GNOME Shell on Mobile.

Related: https://fosstodon.org/@tbernard@mastodon.social/110312623463860112
2023-06-06 17:50:10 +02:00
Oliver Smith 55c617ef64 main/postmarketos-artwork: add gnome wallpapers (MR 4156)
Add GNOME specific wallpapers with a good contrast, so lables for
launchers on top of the wallpaper can be read nicely.

Also set myself as maintainer since the original maintainer didn't
change the package since 2018.
2023-06-06 17:50:04 +02:00
Daniel Fancsali 0b854b4ec6 linux-google-veryron: enable binfmt_misc as kernel module (MR 4115)
This allows the user (upon loading the module) to handle non-native
binaries transparently - after registering the magic number and the
command for handling execution, the programs can be ran as if compiled
for the host architecture. (Similarly how the shebang line allows
the interpreter to be specified for scirpts).

Common use-cases include

* Using qemu user-space emulation to run
  x86 binaries on ARM (or the other way around), or simply running
  64-bit binaries on 32-bit architectures.
* Allow Java programs to be run transparently.
* Creating cross-architecture chroots (for cross-compilation e.g.)
2023-06-06 12:32:23 +02:00
Willow Barraco d6423db84d linux-pine64-pinephonepro: enable NFS_FSCACHE (MR 4141) 2023-06-06 12:29:37 +02:00
Bart Ribbers 5ce24d3869 soc-qcom-sdm845: move PipeWire workaround script to /usr/share (MR 4155)
It's not actually supposed to be overwritten by the user...
2023-06-06 12:24:40 +02:00
Oliver Smith 8328063651 device-qemu-amd64: add none kernel subpackage (MR 4148)
Add a dummy subpackage that does not install any kernel. This is useful
for testing 'pmbootstrap install' code quickly without actually
downloading and installing a kernel package.
2023-06-06 11:03:35 +02:00
Sicelo A. Mhlongo 80ab66cd2a device-nokia-n900: improve user experience on i3 (MR 4157)
- fix wifi signal quality display, since /proc/net/wireless is no longer
  available in omap kernel
  Suggested-by: DvaMishkiLapa <thesame.personal@gmail.com>

- add `polkit-elogind` so tools like `loginctl poweroff` and `nmtui` do not
  require sudo under i3wm

[ci:skip-build]: already built successfully in CI
2023-06-05 23:50:57 +02:00
Oliver Smith a1b9f90871 modem/msm-modem: increase timeout to 4 (MR 4153)
For a lot of people having the 1 second timeout results in not finding
the sim at all. Let's rather wait up to 4 seconds for the sim to appear,
it was reported that 3 is enough in a report where 1 wasn't.

Related: issue 2072
[ci:skip-build]: already built successfully in CI
2023-06-05 21:06:02 +02:00
Bart Ribbers bd1ee83338 soc-qcom-sdm845: fix post upgrade (MR 4154)
The call_audio_idle_suspend_workaround init service was moved to the
-pulseaudio subpackage, but the -modem subpackage still had a
.post-upgrade referring to it. This moves that to the (recently) new
-pulseaudio package

[ci:skip-build]: already built successfully in CI
2023-06-05 15:27:00 +02:00
Jane Rachinger 5433eecb11 device-pine64-pinebookpro: resize on initial boot (MR 4149)
[ci:skip-build]: already built successfully in CI
2023-06-05 15:12:23 +02:00
Bart Ribbers b982708186 soc-qcom-sdm845: apply workaround for working audio on PipeWire (MR 4139)
Out of the box audio is really quiet and distorted on SDM845 devices when
using PipeWire. This can be worked around by forcing audio to 16 bits
(which PulseAudio uses by default and thus works). This seems to be a
kernel problem and should be fixed properly there but for now we can
apply this workaround to at least be able to switch to PipeWire anytime
soon. The actual workaround is applied by Wireplumber so the dependency
for the subpackage is set to that.

Upstream issue https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/3193
[ci:skip-build]: already built successfully in CI
2023-06-05 14:45:38 +02:00
Newbyte e27bc8a84e linux-purism-librem5: upgrade to 6.3.4pureos1 (MR 4137)
[ci:skip-build]: Already built successfully in CI
2023-06-04 10:21:43 +02:00
Newbyte cb0e167a3c main/postmarketos-mkinitfs-hook-netboot: use source_deviceinfo from devicepkg-utils (MR 4129)
[ci:ignore-count]
2023-06-03 17:44:26 +02:00
Newbyte 0c043b055d main/postmarketos-mkinitfs-hook-debug-shell: use source_deviceinfo from devicepkg-utils (MR 4129) 2023-06-03 17:44:25 +02:00
Newbyte c025160029 main/postmarketos-mkinitfs-hook-console-shell: use source_deviceinfo from devicepkg-utils (MR 4129) 2023-06-03 17:44:25 +02:00
Newbyte a002330b81 planet-geminipda: use source_deviceinfo from devicepkg-utils (MR 4129) 2023-06-03 17:44:25 +02:00
Newbyte 614ac1835d motorola-maserati: use source_deviceinfo from devicepkg-utils (MR 4129) 2023-06-03 17:44:25 +02:00
Newbyte bc6800b368 main/osk-sdl: use source_deviceinfo from devicepkg-utils (MR 4129) 2023-06-03 17:44:25 +02:00
Newbyte ea7522f44e main/postmarketos-base: use source_deviceinfo (MR 4129) 2023-06-03 17:44:25 +02:00
Newbyte 0665493f14 main/postmarketos-bootsplash: use source_deviceinfo (MR 4129) 2023-06-03 17:44:25 +02:00
Newbyte 35129cb2c7 main/postmarketos-update-depthcharge-kernel: use source_deviceinfo (MR 4129) 2023-06-03 17:44:25 +02:00
Newbyte 14bc7fe038 main/postmarketos-update-kernel: use source_deviceinfo (MR 4129) 2023-06-03 17:44:25 +02:00
Newbyte 881dbc6a22 main/postmarketos-initramfs: use source_deviceinfo from devicepkg-utils (MR 4129)
See https://gitlab.com/postmarketOS/pmaports/-/issues/2086
2023-06-03 17:44:24 +02:00
Newbyte 96a21ace3f CI: check for direct sourcing of deviceinfo (MR 4129)
See https://gitlab.com/postmarketOS/pmaports/-/issues/2086
2023-06-03 17:44:24 +02:00
Newbyte d7e56cc7c0 main/devicepkg-utils: new aport (MR 4129) 2023-06-03 17:44:24 +02:00
Newbyte be819d7474 main/devicepkg-dev: set to noarch (MR 4140)
No reason for this to be arch-specific.
2023-06-03 15:04:45 +02:00
Oliver Smith 00e4c6d1b2 linux-google-sargo: remove (MR 4146)
It doesn't build currently (issue 2146) and also it's not used by any
device package currently (with other ports we support selecting between
mainline and downstream kernel in some cases, but not here).

If it's useful, the build can be fixed and it can be added back in a
future patch.
2023-06-03 14:25:47 +02:00
Newbyte f757d06824 device-oneplus-lemonade: use mkdtboimg from android-tools (MR 4145)
[ci:skip-build]: Built successfully locally and would take too long for
the CI to finish.
2023-06-03 06:35:10 +03:00
Newbyte 690f9bf67d firmware-google-crosshatch-mainline-dtbo: use mkdtboimg from android-tools (MR 4145) 2023-06-03 06:35:06 +03:00
Newbyte d4d18a0b81 linux-google-sargo: use mkdtboimg from android-tools (MR 4145) 2023-06-03 06:35:03 +03:00
Newbyte 8bbc90f097 linux-oneplus-instantnoodlep: use mkdtboimg from android-tools (MR 4145)
... and work around https://gitlab.com/postmarketOS/pmaports/-/issues/1990
2023-06-03 06:35:00 +03:00
Newbyte 56c96a30e9 linux-oneplus-kebab: use mkdtboimg from android-tools (MR 4145)
... and work around https://gitlab.com/postmarketOS/pmaports/-/issues/1990
2023-06-03 06:34:57 +03:00
Newbyte f5fc3217f0 linux-postmarketos-mediatek-mt6763: use mkdtboimg from android-tools (MR 4145)
... and work around https://gitlab.com/postmarketOS/pmaports/-/issues/1990
2023-06-03 06:34:54 +03:00
Newbyte c4886f93c7 linux-postmarketos-mediatek-mt6768: use mkdtboimg from android-tools (MR 4145)
... and work around https://gitlab.com/postmarketOS/pmaports/-/issues/1990
2023-06-03 06:34:51 +03:00
Newbyte 9291b05b2c linux-xiaomi-cepheus-downstream: use mkdtboimg from android-tools (MR 4145)
... and also work around https://gitlab.com/postmarketOS/pmaports/-/issues/1990
2023-06-03 06:34:48 +03:00
Newbyte 945a74a9ce main/android-mkdtboimg: remove (MR 4145)
Closes https://gitlab.com/postmarketOS/pmaports/-/issues/1889
2023-06-03 06:34:41 +03:00
Newbyte 2a8a57b08e linux-postmarketos-stericsson: allocate 128 MB of CMA memory (MR 4144)
Closes https://gitlab.com/postmarketOS/pmaports/-/issues/1220

[ci:skip-build] Already build-tested on CI
2023-06-02 19:11:55 +02:00
Clayton Craft bbbc7b7b2d purism-librem5: revert ucm, other cleanup (MR 4138)
changes:

- don't try to set gnss-share socket in geoclue

- install Alsa UCM configs from purism

  Upstream ucm is broken when migrating from the purism ucm, so let's
  just use ucm from purism until someone upstreams something that works.
  What I upstreamed was based on an older ucm from Purism, what they are
  shipping is more correct than upstream ucm...

  This reverts commit 70b7813fee.

  fixes #2134

[ci:skip-build] already built successfully in CI
2023-06-02 08:08:14 -07:00
Newbyte 5a2178cb5a linux-postmarketos-stericsson: upgrade to 6.3.5 (MR 4134)
* remove vendor kernel reference
* remove verbose build option
* add mmc busydetect fix patchset

[ci:skip-build] Already build-tested on CI
2023-06-02 12:33:12 +03:00
Denis 6ab29d06fd xiaomi-pine: update checksum of deviceinfo (MR 4114)
[ci:skip-build]: already built successfully in CI
2023-06-01 14:19:49 +02:00
Denis 0806c84144 xiaomi-pine: fix error in device (MR 4114) 2023-06-01 14:19:31 +02:00
Denis da05e2a230 xiaomi-pine: new device (MR 4114) 2023-06-01 14:19:31 +02:00
Pablo Correa Gómez 66625efa43 temp/gnome-shell-mobile: update mutter_api_version (MR 4119)
See previous commit for rationale

[ci:skip-build] already built successfully in CI
2023-05-31 16:57:21 -07:00
Pablo Correa Gómez 997243f6f7 temp/mutter-mobile: force update of libmutter_api_version (MR 4119)
The forked version includes some new API, but the maintainer wants to
have things as-close-as-possible to upstream. Since APK mostly keeps track
of libraries versions, having the same API version as upstream (there's no
stable ABI for mutter), makes it possible for APK to confuse with non-mobile
mutter. By having an unrealistic API version, we make sure this does not happen
to us.

Fixes #2127
2023-05-31 16:57:21 -07:00
NewbyteandOliver Smith bc0ff89fdc purism-librem5: fix ship mode on Linux 6.3 and higher (MR 4128)
Taken from https://source.puri.sm/Librem5/librem5-base/-/merge_requests/353

Closes https://gitlab.com/postmarketOS/pmaports/-/issues/2130

Co-authored-by: Oliver Smith <ollieparanoid@postmarketos.org>

[ci:skip-build] already built successfully in CI
2023-05-31 13:58:34 -07:00
Luca Weiss b2e5ad1670 main/postmarketos-base-ui: add supervisor to bluetooth service (MR 4136)
Due to an issue, probably in bluez, the bluetooth service often fails to
start on boot. Restarting the service later make bluez start correctly.

While adding the service supervisor for just this issue isn't a great
solution, in any case having a supervisor on such an important system
service is good, and it fixes this issue also by restarting the
bluetooth service after the first failure on boot.

  May 30 08:05:56 fairphone-fp4 daemon.info bluetoothd[1420]: Bluetooth daemon 5.66
  May 30 08:05:56 fairphone-fp4 daemon.err bluetoothd[1420]: src/main.c:main() Unable to get on D-Bus

Also while we're editing the list of subpackages make sure they're
ordered alphabetically.
[ci:skip-build]: already built successfully in CI
2023-05-31 08:05:38 +02:00
armel.guido 403c33eda6 linux-sony-eagle: update prima codeaurora source (MR 4109)
[ci:skip-build]: already built successfully in CI
2023-05-30 22:06:19 +02:00
Hugo Osvaldo Barrera f0b8dceae5 firmware-pine64-pinebookpro: remove (MR 4112)
This has been replaced by linux-firmware-brcm and
linux-firmware-rockchip.

[ci:skip-build]: already built successfully in CI
2023-05-30 22:02:52 +02:00
Hugo Osvaldo Barrera 68d7792bb9 pine64-*: update references to firmware-pine64-pinebookpro (MR 4112) 2023-05-30 22:02:51 +02:00
Hugo Osvaldo Barrera 1edbf01dcb pine64-pinebookpro: use linux-firmware packages (MR 4112)
The `firmware-pine64-pinebookpro` predates the firmware for this device
being available upstream. It is now packaged in two separate packages:
linux-firmware-brcm and linux-firmware-rockchip.

Install those two linux-firmware packages and drop the custom one. This
drop a custom firmware package and also ensure that firmware is kept up to
date with the rest of linux-firmware-*.

The resulting installation includes all the previously included firmware
files and I've confirmed that both sound and wifi work fine (dmesg
indicates bluetooth is available too).
2023-05-30 22:02:51 +02:00
Newbyte 734d4d1572 linux-purism-librem5: upgrade to 6.3.3pureos1 (MR 4126)
[ci:skip-build]: Already built successfully in CI.
2023-05-30 18:34:25 +02:00
Newbyte ca976d487c CI: CI runs for three hours, not one hour (MR 4135)
In 11682fb0ab, the timeout was set to 10
hours. This means that the CI no longer just runs for one hour. However,
we are still limited by GitLab's runners which only give us three hours
of CI time per job, so given the status quo, this is the most likely
duration for someone who hasn't set up their own CI runners.
2023-05-30 09:12:52 +02:00
Clayton Craft df8b0a6665 main/boot-deploy: upgrade to 0.8.2 (MR 4130)
Changelog: https://gitlab.com/postmarketOS/boot-deploy/-/tags/0.8.2

[ci:skip-build]: already built successfully in CI
2023-05-29 11:33:53 -07:00
Clayton Craft 928fa5b9c5 linux-postmarketos-amlogic: upgrade to 6.3.3 (MR 4071)
This also enables a few other things for Amlogic SBCs, including some
kernel config that enables video decoding support, however userspace
still doesn't support it (e.g. requires patched ffmpeg)

[ci:skip-build] already built successfully in CI
2023-05-29 11:27:46 -07:00
Newbyte 7a9d86bc25 cross/gcc-*: upgrade to 13.1.1_git20230527-r1 2023-05-29 18:48:58 +02:00
Ishaaq 5e0a9edcae samsung-starlte: New device (MR 4123)
[ci:skip-build]: already built successfully in CI
2023-05-29 13:16:00 +02:00
Oliver Smith 0ccd191d21 main/mobile-config-firefox: upgrade to 4.0.2 (MR 4125)
[ci:skip-build]: already built successfully in CI
2023-05-29 13:06:50 +02:00
Newbyte b8023b44e1 cross/gcc-*: upgrade to 13.1.1_git20230527-r0 2023-05-29 11:42:50 +02:00
Clayton Craft 3fff515886 purism-librem5: don't install custom geoclue service file (MR 4120)
Geoclue now supports reading from this path:

https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/43661

fixes https://gitlab.com/postmarketOS/pmaports/-/issues/2024

[ci:skip-build]: Already built successfully in CI.
2023-05-29 11:37:39 +02:00
Caleb Connolly 9ba1d82f6e community/linux-postmarketos-qcom-sdm845: upgrade to 6.3.4 (MR 4122)
[ci:skip-build]: already built successfully in CI
2023-05-29 02:37:12 +02:00
Oliver Smith d195f254a2 gitlab issue template: add v23.06 2023-05-29 01:49:33 +02:00
Oliver Smith 6dc3335119 pine64-pinetab: move from community to testing (MR 4116)
[ci:skip-vercheck]
Related: issue 1727
2023-05-28 23:22:05 +02:00
Oliver Smith 559454de25 cross/busybox-static-*: upgrade to 1.36.1 2023-05-28 23:10:21 +02:00
Oliver Smith f427ccd09d cross/binutils-*: upgrade to 2.40-r11 2023-05-28 23:10:15 +02:00
Mighty eeb6fb22eb linux-postmarketos-omap: upgrade to 6.3.4 (MR 4124)
[ci:skip-build]: already built successfully in CI
2023-05-27 21:44:54 +05:30
M0Rf30 a2e7dc074a linux-postmarketos-qcom-msm8953: add motorola-ocean max panel brightness level (MR 4121)
[ci:skip-build] Already build-tested on CI
2023-05-27 06:39:57 +03:00
Hugo Osvaldo Barrera d595967928 pine64-pinebookpro: remove reload of udev rules (MR 4113)
This package no longer ships any udev rules, so this is no longer
necessary.

[ci:skip-build]: already built successfully in CI
2023-05-25 09:02:05 +02:00
Hugo Osvaldo Barrera 4e056b2242 pine64-pinebookpro: drop unnecessary udev rule (MR 4113)
Previously, this extra rule was needed to grant regular users
permissions for the embedded display's backlight. It no longer seems to
be necessary; the presence of this rule is currently a no-op.

Someone else on IRC has tested removing the rule and also confirms this
new behaviour. I suspect this was fixed upstream in eudev.
2023-05-25 09:02:00 +02:00
Luca Weiss 1a50b3a49b main/dtbtool: switch to repository mirror (MR 4111)
Since codeaurora.org has been shut down and this project seemingly
hasn't been migrated to git.codelinaro.org, let's switch to a source
found on GitHub.
2023-05-24 17:19:05 +02:00
Luca Weiss 42d8a5abd5 device-fairphone-fp4: add Bluetooth firmware dependency (MR 4110)
[ci:skip-build] Already build tested on CI
2023-05-24 17:01:03 +03:00
Luca Weiss 8d81c77f05 firmware-fairphone-fp4: package Bluetooth firmware (MR 4110) 2023-05-24 17:00:55 +03:00
Luca Weiss 9813033c80 linux-postmarketos-qcom-sm6350: upgrade to 6.3.3 (MR 4110)
Enable Bluetooth-related options in defconfig since FP4 now has
Bluetooth support.
2023-05-24 17:00:52 +03:00
Oliver Smith a8f0c9268e cross/grub-efi-x86: upgrade to 2.06-r13 2023-05-24 09:50:57 +02:00
Oliver Smith dd80d9b57b channels.cfg: add v23.06 2023-05-24 09:13:36 +02:00
gtrxAC 5aa28ef117 huawei-plank: new device (MR 4096)
[ci:skip-build] already built successfully in CI
2023-05-23 15:19:16 -07:00
M0Rf30 e388dbb57d linux-postmarketos-qcom-sdm660: upgrade to 6.3.3 (MR 3984)
Rebase of sdm660 patchset on top of linux-stable/linux-6.3.y
branch.

Notable changes:
* New device: HMD Global Nokia 6.1 (nokia-pl2)
* New device: Xiaomi Mi A2 (xiaomi-jasmine_sprout)
* usage of pmb:kconfigcheck-community only
* LOCALVERSION is no longer set in kconfig, but at build time

Signed-off-by: Gianluca Boiano <morf3089@gmail.com>

[ci:skip-build] already built successfully in CI
2023-05-23 15:15:13 -07:00
René Kliment 5666109a4a samsung-p4note: use sparse image (MR 4105)
Fixes flashing of rootfs img with heimdall for Samsung Galaxy Note 10.1 N8010.

see https://wiki.postmarketos.org/wiki/Troubleshooting#Heimdall:_Flashing_fails_at_7.25
2023-05-23 22:36:10 +02:00
Jianhua Lu 1db7d64aab testing/device-xiaomi-elish: add audio speaker support (MR 4087) 2023-05-23 09:41:38 +02:00
Jianhua Lu b6cc5c0e9f testing/alsa-ucm-conf-qcom-sm8250: new aport (MR 4087) 2023-05-23 09:41:38 +02:00
Jianhua Lu 866b67e772 testing/firmware-xiaomi-elish: add cirrus and boe variant touchscreen firmware (MR 4087) 2023-05-23 09:41:38 +02:00
Jianhua Lu 30ff0308a2 testing/linux-postmarketos-qcom-sm8250: upgrade to 6.4.0 rc2 (MR 4087) 2023-05-23 09:41:32 +02:00
Oliver Smith 7926019217 cross/binutils-*: upgrade to 2.40-r8 (MR 4107)
Generated with:
https://lists.sr.ht/~postmarketos/pmbootstrap-devel/patches/41318
2023-05-22 08:54:25 +02:00
Anton Bambura 6e2077e604 google-stern: new device (MR 4091)
[ci:skip-build]: already built successfully in CI
2023-05-22 08:08:52 +02:00
Anton Bambura fdd5c560e9 google-cerise: new device (MR 4091) 2023-05-22 08:08:46 +02:00
Newbyte eee2eaf970 linux-purism-librem5: upgrade to 6.3.2pureos1 (MR 4104)
[ci:skip-build]: already built successfully in CI
2023-05-22 07:54:17 +02:00
Newbyte b891b8b18b cross/gcc-*: upgrade to 13.1.1_git20230520-r0 2023-05-21 21:12:02 +02:00
Dylan Van Assche 4b92e922ef main/postmarketos-base-ui: enable USB tethering (MR 3819)
USB tethering allows users to use their phone's WiFi or WWAN interface
as an access point for the device they connect the phone with over USB.
This way, they can use their data plan with a laptop or desktop when
regular Internet access is absent.

Configure NetworkManager to manage the usb0 iface from initfs so users
can configure it in GNOME Settings or KDE. Include a NetworkManager
dispatcher script as well to handle postmarketOS' setup with unudhcpd as
we want to provide an SSH login over USB when tethering is disabled. If
tethering is enabled, unudhpcd is stopped and its functionality is taken
over by NetworkManager through an instance of dnsmasq. NetworkManager
will also configure the necessary settings to allow IP forwarding and
firewall rules during tethering. Once disabled, NetworkManager cleans up
these settings and our dispatcher script starts unudhcpd again.

Due to upstream changes, NetworkManager requires networkmanager-dnsmasq
subpackage as dependency as dnsmasq needs DBus support for
NetworkManager. Without it, NetworkManager will silently fail spawning
dnsmasq instances.
[ci:skip-build]: already built successfully in CI
2023-05-21 19:42:14 +02:00
Newbyte a2a4772177 main/postmarketos-ui-plasma-mobile: don't recommend postmarketos-hidden-desktop-entries (MR 4086)
Package has been removed.

[ci:skip-vercheck]: Not necessary when recommends are changed.
[ci:skip-build]: already built successfully in CI
2023-05-21 17:14:55 +02:00
Newbyte 853f4ba5a5 main/postmarketos-ui-phosh: don't recommend postmarketos-hidden-desktop-entries (MR 4086)
Package has been removed.
2023-05-21 17:14:55 +02:00
Newbyte 8dcb873f9b main/postmarketos-ui-gnome-mobile: don't recommend postmarketos-hidden-desktop-entries (MR 4086)
Package has been removed.
2023-05-21 17:14:55 +02:00
Newbyte a04ca4caff main/postmarketos-hidden-desktop-entries: remove (MR 4086)
GNOME Console can now launch command-line applications from .desktop
files, so they are no longer "useless" in Phosh.

gnome-extensions-app hasn't been pulled in automatically in Phosh for
long. If users install this manually, it would be confusing for it to
not show up. The app itself has an error message that explains they
need to be logged into GNOME for it to work when launched in e.g.
Phosh, so I think that should take care of UX concerns. Additionally,
this package is installed in gnome-mobile as well, where
gnome-extensions-app actually is useful.

firefox-safe-mode has been removed in Alpine:
 - https://git.alpinelinux.org/aports/commit/community/firefox?id=438ee43621e1a83c8309bf7e5e14ba9fce0532ff
 - https://git.alpinelinux.org/aports/commit/community/firefox-esr?id=0f324c8b39ab08cc3f504e4ae959425bec472791

Considering all of this, postmarketos-hidden-desktop-entries no longer
serves a purpose, so let's remove it.
2023-05-21 17:14:50 +02:00
Ishaaq 9f15da8d46 samsung-starlte: new device (MR 4102)
[ci:skip-build]: Already built successfully in CI
2023-05-21 07:32:32 +02:00
hazardchem 4e1f99160d pine64-pinephonepro: Packages for PinePhone Keyboard with sway and X11 (MR 4078)
Copy of the work from this merge as pro model was missed:
https://gitlab.com/postmarketOS/pmaports/-/merge_requests/3845
2023-05-20 11:19:21 +02:00
Anton Bambura fcf33fccaa google-willow: add bluetooth firmware (MR 4099)
[ci:ignore-count]
[ci:skip-build]: Already built successfully in CI.
2023-05-20 11:15:51 +02:00
Anton Bambura fc3421e665 google-makomo: add bluetooth firmware (MR 4099) 2023-05-20 11:15:49 +02:00
Anton Bambura d69cd81186 google-krane: add bluetooth firmware (MR 4099) 2023-05-20 11:15:49 +02:00
Anton Bambura 22df89a1cb google-kodama: add bluetooth firmware (MR 4099) 2023-05-20 11:15:49 +02:00
Anton Bambura 7f78f74025 google-kenzo: add bluetooth firmware (MR 4099) 2023-05-20 11:15:48 +02:00
Anton Bambura af2ae7aa4c google-katsu: add bluetooth firmware (MR 4099) 2023-05-20 11:15:48 +02:00
Anton Bambura a2faf88238 google-kappa: add bluetooth firmware (MR 4099) 2023-05-20 11:15:48 +02:00
Anton Bambura fd0c785eb9 google-kakadu: add bluetooth firmware (MR 4099) 2023-05-20 11:15:48 +02:00
Anton Bambura 36e6a69dd7 google-juniper: add bluetooth firmware (MR 4099) 2023-05-20 11:15:48 +02:00
Anton Bambura 50d260240b google-fennel14: add bluetooth firmware (MR 4099) 2023-05-20 11:15:48 +02:00
Anton Bambura e859e47589 google-fennel: add bluetooth firmware (MR 4099) 2023-05-20 11:15:48 +02:00
Anton Bambura 3ed15d3d19 google-damu: add bluetooth firmware (MR 4099) 2023-05-20 11:15:48 +02:00
Anton Bambura 3c20e11910 google-cozmo: add bluetooth firmware (MR 4099) 2023-05-20 11:15:47 +02:00
Anton Bambura 0f4258d37e google-burnet: add bluetooth firmware (MR 4099) 2023-05-20 11:15:47 +02:00
Anton Bambura 6688808de8 linux-postmarketos-rockchip: enable video decoder (MR 4097)
[ci:skip-build]: Already built successfully in CI.
2023-05-20 11:13:25 +02:00
Anton Bambura 07cdab935a google-bob: enable accelerometer (MR 4098)
Fixed in upstream: https://github.com/eudev-project/eudev/pull/239
2023-05-20 11:09:39 +02:00
Anton Bambura 46304c497c google-kevin: enable accelerometer (MR 4098)
Fixed in upstream: https://github.com/eudev-project/eudev/pull/239
2023-05-20 11:09:38 +02:00
Luca Weiss 486de9b306 device-sony-leo: install lk2nd package (MR 4077)
This enables us to easily flash lk2nd with pmbootstrap during
installation.

[ci:skip-build]: already built successfully in CI
2023-05-19 18:42:19 +02:00
Luca Weiss 00261bc123 device-oneplus-bacon: install lk2nd package (MR 4077)
This enables us to easily flash lk2nd with pmbootstrap during
installation.
2023-05-19 18:42:19 +02:00
Luca Weiss 1e59890385 device-lg-hammerhead: install lk2nd package (MR 4077)
This enables us to easily flash lk2nd with pmbootstrap during
installation.
2023-05-19 18:42:19 +02:00
Luca Weiss 5954048db3 device-fairphone-fp2: install lk2nd package (MR 4077)
This enables us to easily flash lk2nd with pmbootstrap during
installation.
2023-05-19 18:42:18 +02:00
Luca Weiss 644439c79f main/lk2nd: also package appended-dtb variant of msm8974 (MR 4077)
Devices like oneplus-bacon require this variant instead of the standard
variant.
2023-05-19 18:42:18 +02:00
Newbyte e8eb332fa2 main/postmarketos-tweaks: upgrade to 0.13.1 (MR 4100)
[ci:skip-build]: already built successfully in CI
2023-05-19 16:07:31 +02:00
Hugo Osvaldo Barrera e9029c9153 pine64-pinebookpro: switch to upstream udev rules (MR 4095)
The entries kept locally are now part of the upstream rules. We can rely
on those instead and avoid the duplication.

See: https://github.com/eudev-project/eudev/blob/2703baf55615b7554fb67c4f1c241f057f8c0a79/hwdb/60-evdev.hwdb#L625
See: https://github.com/eudev-project/eudev/blob/2703baf55615b7554fb67c4f1c241f057f8c0a79/hwdb/60-keyboard.hwdb#L1526
[ci:skip-build]: already built successfully in CI
2023-05-19 12:11:10 +02:00
Anton Bambura af105937a2 mt8183 devices: remove audio module load configs (MR 4090)
Sound drivers not probing is solved with a patch in 6.1.28-r0 version
of linux-postmarketos-mediatek-mt8183 package.

[ci:ignore-count]
2023-05-19 07:24:32 +00:00
Luca Weiss 44797d1f4e testing/device-huawei-sturgeon: add mainline subpackages (MR 4053)
[ci:skip-build]: already built successfully in CI
2023-05-19 08:11:10 +02:00
Luca Weiss 8ff50a82a8 testing/firmware-huawei-sturgeon: add adsp and more wifi/bt firmware (MR 4053) 2023-05-19 08:11:10 +02:00
Luca Weiss f77fb2e610 testing/device-asus-sparrow: add mainline subpackages (MR 4053) 2023-05-19 08:11:10 +02:00
Luca Weiss a26ede4de6 testing/firmware-asus-sparrow: new aport (MR 4053) 2023-05-19 08:11:10 +02:00
Luca Weiss b1b5f9a8f2 testing/device-lg-lenok: add mainline subpackages (MR 4053) 2023-05-19 08:11:10 +02:00
Luca Weiss 7b4bf89443 testing/firmware-lg-lenok: new aport (MR 4053) 2023-05-19 08:11:10 +02:00
Luca Weiss 476f7fe6ad testing/linux-postmarketos-qcom-msm8226: adjust kernel config (MR 4053)
Enable various configs needed for the apq8026 watches, disable some
options for other platforms and adjust various other configs where it
makes sense.
2023-05-19 08:11:10 +02:00
Luca Weiss f3adab7539 testing/linux-postmarketos-qcom-msm8226: upgrade to 6.3.0 (MR 4053) 2023-05-19 08:11:05 +02:00
Anton Bambura 8e3cc49cfe soc-mediatek-mt8183: add symlink to scp.img (MR 4094)
Add symlink to the place where kernel expects it to be

[ci:skip-build]: already built successfully in CI
2023-05-19 07:49:49 +02:00
Anton Bambura 68a3bf8610 linux-postmarketos-mediatek-mt8183: add support for video decoder (MR 4093)
[ci:skip-build]: already built successfully in CI
2023-05-18 14:41:41 +03:00
Newbyte 6d72b33b41 cross/gcc-*: upgrade to 13.1.1_git20230513-r2 2023-05-17 22:27:00 +02:00
Anton Bambura 9c8ccba142 linux-postmarketos-mediatek-mt8183: upgrade to 6.1.28 (MR 4089)
[ci:skip-build]: Already built successfully in CI
2023-05-17 18:16:00 +02:00
Anton Bambura 3c629c64e3 google-nyan-blaze: add initfs modules for usb storage (MR 4074)
[ci:skip-build]
2023-05-16 23:18:02 +03:00
Anton Bambura 093611357b google-nyan-big: add initfs modules for usb storage (MR 4074) 2023-05-16 23:18:01 +03:00
Anton Bambura daea5dade3 google-nyan-blaze: switch from u-boot script to extlinux (MR 4074) 2023-05-16 23:18:01 +03:00
Anton Bambura 5ae8060f6d google-nyan-big: switch from u-boot script to extlinux (MR 4074) 2023-05-16 23:18:01 +03:00
Anton Bambura 670f23f640 google-nyan-blaze: switch from secondary u-boot to depthcharge (MR 4074) 2023-05-16 23:18:01 +03:00
Anton Bambura 2c6399db1c google-nyan-big: switch from secondary u-boot to depthcharge (MR 4074) 2023-05-16 23:18:01 +03:00
Anton BamburaandAlper Nebi Yasak 5bfe3ab5b5 linux-google-nyan: add a hack for depthcharge (MR 4074)
Prevent kernel self-decompression from overwriting initramfs

Co-authored-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2023-05-16 23:18:01 +03:00
Anton Bambura 08096700f0 linux-google-nyan: upgrade to 6.1.27 (MR 4074)
Also, make it smaller and more modular
2023-05-16 23:18:01 +03:00
Newbyte 91adc26f51 linux-purism-librem5: enable lazy RCU (MR 4080)
See https://gitlab.com/postmarketOS/pmbootstrap/-/issues/2220

[ci:skip-build]: Already built successfully in CI
2023-05-16 18:40:42 +02:00
Newbyte f47d58a680 linux-purism-librem5: upgrade to 6.3.1 (MR 4080) 2023-05-16 18:40:41 +02:00
Joel Selvaraj 86601ff415 community/linux-postmarketos-qcom-sdm845: upgrade to 6.3.2 (MR 4079)
[ci:skip-build]: Already built successfully in CI
2023-05-16 09:19:47 +02:00
Anton Bambura 8ada15f062 google-veyron-jerry: use depthcharge (MR 4067)
Make use of its bootloader, so users don't have to flash U-Boot.
2023-05-16 01:56:38 +03:00
Mek101 34b1aff3cd lg-w5: move from armhf to armv7 (MR 4085)
[ci:skip-build]: already built successfully in CI
2023-05-15 22:29:08 +02:00
Newbyte 9c858aad62 cross/busybox-static-*: upgrade to 1.36.0-r11 2023-05-15 14:40:58 +02:00
Newbyte 8a9170d125 cross/binutils-*: upgrade to 2.40-r7 2023-05-15 14:40:32 +02:00
Newbyte 57b22658a9 cross/gcc-*: upgrade to 13.1.1_git20230513-r1 2023-05-15 10:15:31 +02:00
Anton Bambura a3001a0cb0 main/postmarketos-update-depthcharge-kernel: use kern_guid instead of label (MR 4066)
This allows to flash correct partition when having 2 installations of pmOS.

This will also avoid flashing kernel image when using U-Boot.
2023-05-14 19:22:51 +02:00
Newbyte 13904bb777 cross/busybox-static-*: upgrade to 1.36.0-r10 2023-05-14 18:31:53 +02:00
Newbyte 6352910769 cross/binutils-*: upgrade to 2.40-r6 2023-05-14 18:31:29 +02:00
Newbyte 69aea328e5 purism-librem5: upgrade to librem5-base 60 (MR 4055) 2023-05-13 10:40:21 +02:00
Newbyte 70b7813fee purism-librem5: don't install Alsa UCM configs (MR 4055)
This is now upstream in alsa-ucm-conf v1.2.9, and should as such
be removed from here as to avoid conflicts.
2023-05-13 10:40:17 +02:00
Newbyte 741b9caece cross/grub-efi-x86: upgrade to 2.06-r12 2023-05-13 10:32:21 +02:00
Oliver Smith 4f6b01db82 temp/pulseaudio: upgrade to 16.1 (MR 4075)
[ci:skip-build]: already built successfully in CI
2023-05-12 22:15:40 +02:00
Newbyte 16696849eb temp/pulseaudio: depend on alsa-utils in openrc subpackage (MR 4072)
Closes https://gitlab.com/postmarketOS/pmaports/-/issues/1801

Backport of https://gitlab.alpinelinux.org/alpine/aports/-/commit/3d3c5d17a79a615cd5935455cb31fee4efbe21a3
2023-05-12 08:52:48 +02:00
Martin Lillepuu 5b4df25783 device-oneplus-oneplus3t: remove mesa-dri-gallium from deps (MR 3323) 2023-05-11 20:48:58 +02:00
Martin Lillepuu ffb351f136 device-oneplus-oneplus3t: add GPU acceleration support (MR 3323)
Add GPU acceleration support for Oneplus 3T
2023-05-11 20:48:58 +02:00
Oliver Smith 76f32fecf3 device-pine64-pinephone: add replaces=alsa-ucm-conf (MR 4061)
Override the upstream alsa-ucm-conf for now.

Related: issue 2115
2023-05-11 10:11:09 +02:00
Luca Weiss 74c7092bbd main/postmarketos-ui-asteroid: launch mapplauncherd booster (MR 4063)
All Asteroid apps are launched with the "invoker" which needs the
booster running. Make sure this happens when the UI starts.

Alternatively we could use superd to launch it but for a single
executable this is good enough for now.
2023-05-10 11:54:20 +02:00
M0Rf30 4ded17dc1e linux-postmarketos-qcom-msm8953: enable motorola-ocean panel and sound (MR 4064)
[ci:skip-build]: Already built successfully in CI
2023-05-10 10:32:00 +02:00
Anton Bambura 91b81d92f7 firmware-google-veyron-brcm: add bluetooth firmware (MR 4068)
[ci:skip-build]: Already built successfully in CI
2023-05-10 00:20:09 +02:00
Anton Bambura 5cf259f46e linux-google-veyron: upgrade to 6.1.27 (MR 4069)
Also make it passing kconfig check again.

[ci:skip-build]: Already built successfully in CI
2023-05-10 00:17:21 +02:00
Clayton Craft 047730dfb0 main/postmarketos-ui-kodi: enable shutdown/reboot/suspend options (MR 4065)
These power menu options require this package

[ci:skip-build] already built successfully in CI
2023-05-09 10:01:32 -07:00
Luca Weiss 9a4a818bde community/linux-postmarketos-qcom-sm6350: enable DEVFREQ_THERMAL (MR 4062)
Make sure the GPU can register its thermal device to avoid this error:

  [    9.303081] adreno 3d00000.gpu: [drm:msm_devfreq_init] *ERROR* Couldn't register GPU cooling device

[ci:skip-build]: already built successfully in CI
2023-05-08 18:03:58 +02:00
Yassine Oudjana f71abed592 linux-postmarketos-qcom-msm8996: upgrade to 6.3.1 (MR 4059)
[ci:skip-build]: already built successfully in CI
2023-05-08 17:47:32 +02:00
Andreas Kemnade 3c32dbe814 linux-kobo-clara-mainline: Upgrade to 6.3.0 (MR 4060)
Add most config options for pmbootstrap kconfig check --community
CONFIG_SMP is left out since we have no mulitprocessor systems
using this kernel.

[ci:skip-build]: already built successfully in CI
2023-05-08 17:42:35 +02:00
Barnabás Czémán 3628ed25e8 device-xiaomi-tissot: update panel module names for initramfs (MR 4056)
[ci:skip-build]: already built successfully in CI
2023-05-07 18:55:30 +02:00
Newbyte 919c24cecb cross/busybox-static-*: upgrade to 1.36.0-r9 2023-05-06 23:22:53 +02:00
vipaol f07d122b67 xiaomi-markw: new device (MR 3906) 2023-05-04 20:54:05 +02:00
Clayton Craft b8aca2b914 main/boot-deploy: upgrade to 0.8.1 (MR 4048)
0.8.1:

Fixes:
  - get_free_space: always return an integer (MR 31)

0.8:

Features:
  - Add support for gummiboot
  - Many internal code improvements and bug fixes, see git log for
    details

Fixes:
  - Fix destination space calculation (MR 28)
  - Support destination paths with spaces

[ci:skip-build] already built successfully in CI
2023-05-04 08:39:51 -07:00
Newbyte 2f1d832d4d cross/musl-*: upgrade to 1.2.4 2023-05-03 14:12:26 +00:00
Pablo Correa Gómez d1856dad75 main/postmarketos-ui-xfce4: add elogind-openrc to depends, enable service (MR 4020)
[ci:ignore-count]
2023-05-03 15:56:56 +02:00
Pablo Correa Gómez 83d224df2b main/postmarketos-ui-weston: add elogind-openrc to depends, enable service (MR 4020) 2023-05-03 15:56:56 +02:00
Pablo Correa Gómez bc8bc00ef9 main/postmarketos-ui-sway: add elogind-openrc to depends, enable service (MR 4020) 2023-05-03 15:56:56 +02:00
Pablo Correa Gómez 10e5f418a0 main/postmarketos-ui-plasma-mobile: add elogind-openrc to depends, enable service (MR 4020) 2023-05-03 15:56:56 +02:00
Pablo Correa Gómez ec062f4e09 main/postmarketos-ui-plasma-bigscreen: add elogind-openrc to depends, enable service (MR 4020) 2023-05-03 15:56:56 +02:00
Pablo Correa Gómez 088482b579 main/postmarketos-ui-mate: add elogind-openrc to depends, enable service (MR 4020) 2023-05-03 15:56:56 +02:00
Pablo Correa Gómez 2d2b9bddd8 main/postmarketos-ui-lxqt: add elogind-openrc to depends, enable service (MR 4020) 2023-05-03 15:56:56 +02:00
Pablo Correa Gómez cbb4367c47 main/postmarketos-ui-kodi: add elogind-openrc to depends, enable service (MR 4020) 2023-05-03 15:56:55 +02:00
Pablo Correa Gómez d820779a10 main/postmarketos-ui-i3wm: add elogind-openrc to depends, enable service (MR 4020) 2023-05-03 15:56:55 +02:00
Pablo Correa Gómez ab87fde2f6 main/postmarketos-ui-asteroid: add elogind-openrc to depends, enable service (MR 4020) 2023-05-03 15:56:55 +02:00
Pablo Correa Gómez 6a125a739e main/postmarketos-base-ui-gnome: add elogind-openrc to depends, enable service (MR 4020) 2023-05-03 15:56:55 +02:00
M0Rf30 39f6db50cb linux-postmarketos-qcom-msm8953: upgrade to 6.3.0 (MR 4035)
[ci:skip-build]: Already built successfully in CI
2023-05-03 15:52:33 +02:00
M0Rf30 60fe572b47 xiaomi-vince: remove qcom_fg, i2c_qup from initfs modules, proper panel names (MR 4035) 2023-05-03 15:52:21 +02:00
Luca Weiss b2f939943c testing/linux-postmarketos-qcom-msm8974: upgrade to 6.3.0 (MR 4040)
Manual config changes:
* CONFIG_BPF_SYSCALL=y (waydroid check)
* CONFIG_CGROUP_BPF=y (waydroid check)

[ci:skip-build]: Already built successfully in CI
2023-05-03 15:48:18 +02:00
Oliver Smith e2169ff59f main/postmarketos-ui-lxqt: fix dep: lxpolkit -> lxqt-policykit (MR 4021)
lxpolkit has been removed in Alpine, adjust our packaging:
> this is dead for 10 years, pretty much superceded by lxqt-policykit

Related: https://gitlab.alpinelinux.org/alpine/aports/-/commit/9df419c349175cda0e635ec2bae13683b7eb916f
2023-05-02 08:14:14 +00:00
Luca Weiss 214f898dc5 community/linux-postmarketos-rockchip: adjust kconfig for usb_gadgets (MR 4028)
[ci:skip-build]: takes too long for CI
2023-05-02 08:33:38 +02:00
Luca Weiss 8ddef357b3 community/linux-postmarketos-omap: adjust kconfig for usb_gadgets (MR 4028) 2023-05-02 08:33:03 +02:00
Luca Weiss 65e27349d5 community/linux-postmarketos-exynos4: adjust kconfig for usb_gadgets (MR 4028) 2023-05-02 08:33:03 +02:00
Luca Weiss bec770e995 main/linux-purism-librem5: adjust kconfig for usb_gadgets (MR 4028) 2023-05-02 08:33:03 +02:00
Luca Weiss 9c894f8a73 main/linux-postmarketos-allwinner: adjust kconfig for usb_gadgets (MR 4028) 2023-05-02 08:32:57 +02:00
Caleb Connolly d40db11c30 device-thundercomm-db845c: new device (MR 4047)
Add support for the Qualcomm Robotics (RB3) dev kit, the Thundercomm
DB845c. This is a successor to the arrow 410c board already supported in
postmarketOS. It is based on the SDA845 SoC, almost identical to SDM845
but without a fully featured modem.

All the things you'd expect to work out of the box:
* UART
* USB host and peripheral
* HDMI display out
* Wifi, Bluetooth
2023-05-01 19:28:34 +01:00
Caleb Connolly 6c27c1c460 soc-qcom-sdm845: encapsulate cellular specific stuff (MR 4047)
The upcoming db845c doesn't have cellular modem capabilities, but still
has wifi. Avoid installing modem related configs and services by default
and only install it for devices that need it.
2023-05-01 19:28:34 +01:00
684 changed files with 56431 additions and 13986 deletions

No files matched your search

+7
View File
@@ -38,3 +38,10 @@ if grep -qr '/usr/share/postmarketos-mkinitfs' -- *; then
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
+1 -1
View File
@@ -134,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 one hour")
print("have not been modified. CI won't run for more than three hours")
print("anyway.")
print()
print("Your options:")
+1
View File
@@ -18,6 +18,7 @@ sh_files="
./main/osk-sdl/unlock.sh
./main/postmarketos-base/rootfs-usr-lib-firmwareload.sh
./main/postmarketos-base-ui/rootfs-etc-NetworkManager-dispatcher.d-99-dns-filter.sh
./main/postmarketos-base-ui/rootfs-etc-NetworkManager-dispatcher.d-85-tethering
./main/postmarketos-installkernel/installkernel-pmos
./main/postmarketos-initramfs/init.sh
./main/postmarketos-initramfs/init_functions.sh
+3 -1
View File
@@ -21,12 +21,14 @@
Replace space inside `[ ]` with `x` to fill the checkbox
-->
* [ ] edge (`master` branch)
* [ ] `v22.12`
* [ ] `v23.06`
* [ ] `v22.12` (Supported until 2023-07-06)
* [ ] 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`**
+2
View File
@@ -71,6 +71,8 @@ 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
main/postmarketos-update-depthcharge-kernel/ @jenneron
main/osk-sdl/ @craftyguy
+7 -1
View File
@@ -8,8 +8,14 @@ branch_pmaports=master
branch_aports=master
mirrordir_alpine=edge
[v22.12]
[v23.06]
description=Latest release / Recommended for best stability
branch_pmaports=v23.06
branch_aports=3.18-stable
mirrordir_alpine=v3.18
[v22.12]
description=Old release (supported until: 2023-07-07)
branch_pmaports=v22.12
branch_aports=3.17-stable
mirrordir_alpine=v3.17
+38 -18
View File
@@ -8,21 +8,27 @@ CTARGET="$(arch_to_hostspec $CTARGET_ARCH)"
pkgname=binutils-aarch64
pkgver=2.40
pkgrel=5
pkgrel=12
pkgdesc="Tools necessary to build programs for aarch64 targets"
url="https://www.gnu.org/software/binutils/"
makedepends_build="bison flex texinfo"
makedepends_host="zlib-dev zstd-dev"
makedepends="$makedepends_build $makedepends_host"
makedepends_host="zlib-dev jansson-dev zstd-dev"
arch="x86_64"
license="GPL-2.0-or-later AND LGPL-2.1-or-later AND BSD-3-Clause"
subpackages="binutils-dev binutils-doc"
source="https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.xz
binutils-ld-fix-static-linking.patch
0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch
CVE-2023-1972.patch
binutils-ld-fix-static-linking.patch
riscv64-textrels.patch
"
builddir="$srcdir/binutils-$pkgver"
if [ -z "$BOOTSTRAP" ]; then
makedepends_host="$makedepends_host jansson-dev zstd-dev"
_noboot_configure="--enable-jansson --with-zstd"
fi
if [ "$CHOST" = "$CBUILD" ] && [ "$CBUILD" = "$CTARGET" ] && [ "$CTARGET_ARCH" != "riscv64" ]; then
subpackages="$subpackages binutils-gold"
fi
@@ -34,6 +40,10 @@ if [ "$CHOST" != "$CTARGET" ]; then
fi
# secfixes:
# 2.40-r10:
# - CVE-2023-1972
# 2.40-r0:
# - CVE-2023-1579
# 2.39-r2:
# - CVE-2022-38533
# 2.39-r0:
@@ -73,6 +83,8 @@ build() {
_gold_configure="--disable-gold"
fi
CFLAGS="$CFLAGS -O2" \
CXXFLAGS="$CXXFLAGS -O2" \
./configure \
--build=$CBUILD \
--host=$CHOST \
@@ -82,22 +94,28 @@ build() {
--prefix=/usr \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--disable-multilib \
--disable-gprofng \
--enable-ld=default \
$_gold_configure \
--enable-64-bit-bfd \
$_plugin_configure \
--enable-relro \
--enable-deterministic-archives \
--enable-default-execstack=no \
$_cross_configure \
--sysconfdir=/etc \
$_arch_configure \
--enable-default-hash-style=gnu \
--with-pic \
--disable-werror \
$_cross_configure \
$_gold_configure \
$_plugin_configure \
$_noboot_configure \
--disable-gprofng \
--disable-multilib \
--disable-nls \
--disable-werror \
--enable-64-bit-bfd \
--enable-colored-disassembly \
--enable-default-execstack=no \
--enable-default-hash-style=gnu \
--enable-deterministic-archives \
--enable-ld=default \
--enable-new-dtags \
--enable-relro \
--enable-threads \
--with-bugurl="https://postmarketos.org/issues" \
--with-mmap \
--with-pic \
--with-system-zlib
make
}
@@ -128,6 +146,8 @@ gold() {
sha512sums="
a37e042523bc46494d99d5637c3f3d8f9956d9477b748b3b1f6d7dfbb8d968ed52c932e88a4e946c6f77b8f48f1e1b360ca54c3d298f17193f3b4963472f6925 binutils-2.40.tar.xz
ecee33b0e435aa704af1c334e560f201638ff79e199aa11ed78a72f7c9b46f85fbb227af5748e735fd681d1965fcc42ac81b0c8824e540430ce0c706c81e8b49 binutils-ld-fix-static-linking.patch
70ec22bd72ef6dddecfd970613387dd4a8cdc8730dd3cbf03d5a0c3a7c4d839383167bb06dad21bf7c235329fd44b5dc4aefe762f68544f17155cf002bf1be4a 0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch
b434e126c4c3f70c02b0a5597a0d75a4ea99b1498552c2d0676005ac0ae171c56cf07a6f6e2faa1381f1f4d4a37043a07d177dd4912f09b61109f103853594b2 CVE-2023-1972.patch
ecee33b0e435aa704af1c334e560f201638ff79e199aa11ed78a72f7c9b46f85fbb227af5748e735fd681d1965fcc42ac81b0c8824e540430ce0c706c81e8b49 binutils-ld-fix-static-linking.patch
d138691d953c6f49111601df1731db157d2ecedf1593e37ababb5c12ff10572b5f7982288c81579f4a99097780dbb18d3b457f74daab0f935f59423e69cec56f riscv64-textrels.patch
"
@@ -0,0 +1,37 @@
Patch-Source: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=c22d38baefc5a7a1e1f5cdc9dbb556b1f0ec5c57;hp=f2f9bde5cde7ff34ed0a4c4682a211d402aa1086
https://sourceware.org/bugzilla/show_bug.cgi?id=30285
--
From: Nick Clifton <nickc@redhat.com>
Date: Thu, 30 Mar 2023 09:10:09 +0000 (+0100)
Subject: Fix an illegal memory access when an accessing a zer0-lengthverdef table.
X-Git-Url: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff_plain;h=c22d38baefc5a7a1e1f5cdc9dbb556b1f0ec5c57;hp=f2f9bde5cde7ff34ed0a4c4682a211d402aa1086
Fix an illegal memory access when an accessing a zer0-lengthverdef table.
PR 30285
* elf.c (_bfd_elf_slurp_version_tables): Fail if no version definitions are allocated.
---
diff --git a/bfd/elf.c b/bfd/elf.c
index 027d0143735..185028cbd97 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -9030,6 +9030,9 @@ _bfd_elf_slurp_version_tables (bfd *abfd, bool default_imported_symver)
bfd_set_error (bfd_error_file_too_big);
goto error_return_verdef;
}
+
+ if (amt == 0)
+ goto error_return_verdef;
elf_tdata (abfd)->verdef = (Elf_Internal_Verdef *) bfd_zalloc (abfd, amt);
if (elf_tdata (abfd)->verdef == NULL)
goto error_return_verdef;
@@ -9133,6 +9136,8 @@ _bfd_elf_slurp_version_tables (bfd *abfd, bool default_imported_symver)
bfd_set_error (bfd_error_file_too_big);
goto error_return;
}
+ if (amt == 0)
+ goto error_return;
elf_tdata (abfd)->verdef = (Elf_Internal_Verdef *) bfd_zalloc (abfd, amt);
if (elf_tdata (abfd)->verdef == NULL)
goto error_return;
@@ -0,0 +1,103 @@
Patch-Source: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=225df051d3d4cf714d1791b9035966a6686b3f3d;hp=a70d5ba34cb64bbbb7df4f3055cf5b1967bdf61e#patch1
https://sourceware.org/bugzilla/show_bug.cgi?id=25694
--
From: Nelson Chu <nelson@nelson.ba.rivosinc.com>
Date: Thu, 4 May 2023 09:08:50 +0000 (+0800)
Subject: [PR ld/22263][PR ld/25694] RISC-V: Avoid dynamic TLS relocs in PIE.
X-Git-Url: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff_plain;h=225df051d3d4cf714d1791b9035966a6686b3f3d;hp=a70d5ba34cb64bbbb7df4f3055cf5b1967bdf61e
[PR ld/22263][PR ld/25694] RISC-V: Avoid dynamic TLS relocs in PIE.
Lots of targets already fixed the TEXTREL problem for TLS in PIE.
* For PR ld/25694,
In the check_reloc, refer to spare and loongarch, they don't need to reserve
any local dynamic reloc for TLS LE in pie/pde, and similar to other targets.
So it seems like riscv was too conservative to estimate the TLS LE before.
Just break and don't goto static_reloc for TLS LE in pie/pde can fix the
TEXTREL problem.
* For PR ld/22263,
The risc-v code for TLS GD/IE in the relocate_section seems same as MIPS port.
So similar to MIPS, pr22570, commits 9143e72c6d4d and 1cb83cac9a89, it seems
also the right way to do the same thing for risc-v.
On risc-v, fixes
FAIL: Build pr22263-1
RISC-V haven't supported the TLS transitions, so will need the same fix (use
bfd_link_dll) in the future.
bfd/
PR ld/22263
PR ld/25694
* elfnn-riscv.c (riscv_elf_check_relocs): Replace bfd_link_pic with
bfd_link_dll for TLS IE. Don't need to reserve the local dynamic
relocation for TLS LE in pie/pde, and report error in pic just like
before.
(riscv_elf_relocate_section): For TLS GD/IE, use bfd_link_dll rather
than !bfd_link_pic in determining the dynamic symbol index. Avoid
the index of -1.
---
diff --git a/bfd/elfnn-riscv.c b/bfd/elfnn-riscv.c
index 75af040cf92..762ea231c0b 100644
--- a/bfd/elfnn-riscv.c
+++ b/bfd/elfnn-riscv.c
@@ -824,7 +824,7 @@ riscv_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
break;
case R_RISCV_TLS_GOT_HI20:
- if (bfd_link_pic (info))
+ if (bfd_link_dll (info))
info->flags |= DF_STATIC_TLS;
if (!riscv_elf_record_got_reference (abfd, info, h, r_symndx)
|| !riscv_elf_record_tls_type (abfd, h, r_symndx, GOT_TLS_IE))
@@ -920,11 +920,12 @@ riscv_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
goto static_reloc;
case R_RISCV_TPREL_HI20:
+ /* This is not allowed in the pic, but okay in pie. */
if (!bfd_link_executable (info))
return bad_static_reloc (abfd, r_type, h);
if (h != NULL)
riscv_elf_record_tls_type (abfd, h, r_symndx, GOT_TLS_LE);
- goto static_reloc;
+ break;
case R_RISCV_HI20:
if (bfd_link_pic (info))
@@ -2880,24 +2881,20 @@ riscv_elf_relocate_section (bfd *output_bfd,
if (htab->elf.srelgot == NULL)
abort ();
- if (h != NULL)
- {
- bool dyn, pic;
- dyn = htab->elf.dynamic_sections_created;
- pic = bfd_link_pic (info);
-
- if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, pic, h)
- && (!pic || !SYMBOL_REFERENCES_LOCAL (info, h)))
- indx = h->dynindx;
- }
+ bool dyn = elf_hash_table (info)->dynamic_sections_created;
+ if (h != NULL
+ && h->dynindx != -1
+ && WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, bfd_link_pic (info), h)
+ && (bfd_link_dll (info) || !SYMBOL_REFERENCES_LOCAL (info, h)))
+ indx = h->dynindx;
/* The GOT entries have not been initialized yet. Do it
now, and emit any relocations. */
- if ((bfd_link_pic (info) || indx != 0)
+ if ((bfd_link_dll (info) || indx != 0)
&& (h == NULL
|| ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
|| h->root.type != bfd_link_hash_undefweak))
- need_relocs = true;
+ need_relocs = true;
if (tls_type & GOT_TLS_GD)
{
+38 -18
View File
@@ -8,21 +8,27 @@ CTARGET="$(arch_to_hostspec $CTARGET_ARCH)"
pkgname=binutils-armhf
pkgver=2.40
pkgrel=5
pkgrel=12
pkgdesc="Tools necessary to build programs for armhf targets"
url="https://www.gnu.org/software/binutils/"
makedepends_build="bison flex texinfo"
makedepends_host="zlib-dev zstd-dev"
makedepends="$makedepends_build $makedepends_host"
makedepends_host="zlib-dev jansson-dev zstd-dev"
arch="x86_64"
license="GPL-2.0-or-later AND LGPL-2.1-or-later AND BSD-3-Clause"
subpackages="binutils-dev binutils-doc"
source="https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.xz
binutils-ld-fix-static-linking.patch
0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch
CVE-2023-1972.patch
binutils-ld-fix-static-linking.patch
riscv64-textrels.patch
"
builddir="$srcdir/binutils-$pkgver"
if [ -z "$BOOTSTRAP" ]; then
makedepends_host="$makedepends_host jansson-dev zstd-dev"
_noboot_configure="--enable-jansson --with-zstd"
fi
if [ "$CHOST" = "$CBUILD" ] && [ "$CBUILD" = "$CTARGET" ] && [ "$CTARGET_ARCH" != "riscv64" ]; then
subpackages="$subpackages binutils-gold"
fi
@@ -34,6 +40,10 @@ if [ "$CHOST" != "$CTARGET" ]; then
fi
# secfixes:
# 2.40-r10:
# - CVE-2023-1972
# 2.40-r0:
# - CVE-2023-1579
# 2.39-r2:
# - CVE-2022-38533
# 2.39-r0:
@@ -73,6 +83,8 @@ build() {
_gold_configure="--disable-gold"
fi
CFLAGS="$CFLAGS -O2" \
CXXFLAGS="$CXXFLAGS -O2" \
./configure \
--build=$CBUILD \
--host=$CHOST \
@@ -82,22 +94,28 @@ build() {
--prefix=/usr \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--disable-multilib \
--disable-gprofng \
--enable-ld=default \
$_gold_configure \
--enable-64-bit-bfd \
$_plugin_configure \
--enable-relro \
--enable-deterministic-archives \
--enable-default-execstack=no \
$_cross_configure \
--sysconfdir=/etc \
$_arch_configure \
--enable-default-hash-style=gnu \
--with-pic \
--disable-werror \
$_cross_configure \
$_gold_configure \
$_plugin_configure \
$_noboot_configure \
--disable-gprofng \
--disable-multilib \
--disable-nls \
--disable-werror \
--enable-64-bit-bfd \
--enable-colored-disassembly \
--enable-default-execstack=no \
--enable-default-hash-style=gnu \
--enable-deterministic-archives \
--enable-ld=default \
--enable-new-dtags \
--enable-relro \
--enable-threads \
--with-bugurl="https://postmarketos.org/issues" \
--with-mmap \
--with-pic \
--with-system-zlib
make
}
@@ -128,6 +146,8 @@ gold() {
sha512sums="
a37e042523bc46494d99d5637c3f3d8f9956d9477b748b3b1f6d7dfbb8d968ed52c932e88a4e946c6f77b8f48f1e1b360ca54c3d298f17193f3b4963472f6925 binutils-2.40.tar.xz
ecee33b0e435aa704af1c334e560f201638ff79e199aa11ed78a72f7c9b46f85fbb227af5748e735fd681d1965fcc42ac81b0c8824e540430ce0c706c81e8b49 binutils-ld-fix-static-linking.patch
70ec22bd72ef6dddecfd970613387dd4a8cdc8730dd3cbf03d5a0c3a7c4d839383167bb06dad21bf7c235329fd44b5dc4aefe762f68544f17155cf002bf1be4a 0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch
b434e126c4c3f70c02b0a5597a0d75a4ea99b1498552c2d0676005ac0ae171c56cf07a6f6e2faa1381f1f4d4a37043a07d177dd4912f09b61109f103853594b2 CVE-2023-1972.patch
ecee33b0e435aa704af1c334e560f201638ff79e199aa11ed78a72f7c9b46f85fbb227af5748e735fd681d1965fcc42ac81b0c8824e540430ce0c706c81e8b49 binutils-ld-fix-static-linking.patch
d138691d953c6f49111601df1731db157d2ecedf1593e37ababb5c12ff10572b5f7982288c81579f4a99097780dbb18d3b457f74daab0f935f59423e69cec56f riscv64-textrels.patch
"
+37
View File
@@ -0,0 +1,37 @@
Patch-Source: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=c22d38baefc5a7a1e1f5cdc9dbb556b1f0ec5c57;hp=f2f9bde5cde7ff34ed0a4c4682a211d402aa1086
https://sourceware.org/bugzilla/show_bug.cgi?id=30285
--
From: Nick Clifton <nickc@redhat.com>
Date: Thu, 30 Mar 2023 09:10:09 +0000 (+0100)
Subject: Fix an illegal memory access when an accessing a zer0-lengthverdef table.
X-Git-Url: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff_plain;h=c22d38baefc5a7a1e1f5cdc9dbb556b1f0ec5c57;hp=f2f9bde5cde7ff34ed0a4c4682a211d402aa1086
Fix an illegal memory access when an accessing a zer0-lengthverdef table.
PR 30285
* elf.c (_bfd_elf_slurp_version_tables): Fail if no version definitions are allocated.
---
diff --git a/bfd/elf.c b/bfd/elf.c
index 027d0143735..185028cbd97 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -9030,6 +9030,9 @@ _bfd_elf_slurp_version_tables (bfd *abfd, bool default_imported_symver)
bfd_set_error (bfd_error_file_too_big);
goto error_return_verdef;
}
+
+ if (amt == 0)
+ goto error_return_verdef;
elf_tdata (abfd)->verdef = (Elf_Internal_Verdef *) bfd_zalloc (abfd, amt);
if (elf_tdata (abfd)->verdef == NULL)
goto error_return_verdef;
@@ -9133,6 +9136,8 @@ _bfd_elf_slurp_version_tables (bfd *abfd, bool default_imported_symver)
bfd_set_error (bfd_error_file_too_big);
goto error_return;
}
+ if (amt == 0)
+ goto error_return;
elf_tdata (abfd)->verdef = (Elf_Internal_Verdef *) bfd_zalloc (abfd, amt);
if (elf_tdata (abfd)->verdef == NULL)
goto error_return;
+103
View File
@@ -0,0 +1,103 @@
Patch-Source: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=225df051d3d4cf714d1791b9035966a6686b3f3d;hp=a70d5ba34cb64bbbb7df4f3055cf5b1967bdf61e#patch1
https://sourceware.org/bugzilla/show_bug.cgi?id=25694
--
From: Nelson Chu <nelson@nelson.ba.rivosinc.com>
Date: Thu, 4 May 2023 09:08:50 +0000 (+0800)
Subject: [PR ld/22263][PR ld/25694] RISC-V: Avoid dynamic TLS relocs in PIE.
X-Git-Url: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff_plain;h=225df051d3d4cf714d1791b9035966a6686b3f3d;hp=a70d5ba34cb64bbbb7df4f3055cf5b1967bdf61e
[PR ld/22263][PR ld/25694] RISC-V: Avoid dynamic TLS relocs in PIE.
Lots of targets already fixed the TEXTREL problem for TLS in PIE.
* For PR ld/25694,
In the check_reloc, refer to spare and loongarch, they don't need to reserve
any local dynamic reloc for TLS LE in pie/pde, and similar to other targets.
So it seems like riscv was too conservative to estimate the TLS LE before.
Just break and don't goto static_reloc for TLS LE in pie/pde can fix the
TEXTREL problem.
* For PR ld/22263,
The risc-v code for TLS GD/IE in the relocate_section seems same as MIPS port.
So similar to MIPS, pr22570, commits 9143e72c6d4d and 1cb83cac9a89, it seems
also the right way to do the same thing for risc-v.
On risc-v, fixes
FAIL: Build pr22263-1
RISC-V haven't supported the TLS transitions, so will need the same fix (use
bfd_link_dll) in the future.
bfd/
PR ld/22263
PR ld/25694
* elfnn-riscv.c (riscv_elf_check_relocs): Replace bfd_link_pic with
bfd_link_dll for TLS IE. Don't need to reserve the local dynamic
relocation for TLS LE in pie/pde, and report error in pic just like
before.
(riscv_elf_relocate_section): For TLS GD/IE, use bfd_link_dll rather
than !bfd_link_pic in determining the dynamic symbol index. Avoid
the index of -1.
---
diff --git a/bfd/elfnn-riscv.c b/bfd/elfnn-riscv.c
index 75af040cf92..762ea231c0b 100644
--- a/bfd/elfnn-riscv.c
+++ b/bfd/elfnn-riscv.c
@@ -824,7 +824,7 @@ riscv_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
break;
case R_RISCV_TLS_GOT_HI20:
- if (bfd_link_pic (info))
+ if (bfd_link_dll (info))
info->flags |= DF_STATIC_TLS;
if (!riscv_elf_record_got_reference (abfd, info, h, r_symndx)
|| !riscv_elf_record_tls_type (abfd, h, r_symndx, GOT_TLS_IE))
@@ -920,11 +920,12 @@ riscv_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
goto static_reloc;
case R_RISCV_TPREL_HI20:
+ /* This is not allowed in the pic, but okay in pie. */
if (!bfd_link_executable (info))
return bad_static_reloc (abfd, r_type, h);
if (h != NULL)
riscv_elf_record_tls_type (abfd, h, r_symndx, GOT_TLS_LE);
- goto static_reloc;
+ break;
case R_RISCV_HI20:
if (bfd_link_pic (info))
@@ -2880,24 +2881,20 @@ riscv_elf_relocate_section (bfd *output_bfd,
if (htab->elf.srelgot == NULL)
abort ();
- if (h != NULL)
- {
- bool dyn, pic;
- dyn = htab->elf.dynamic_sections_created;
- pic = bfd_link_pic (info);
-
- if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, pic, h)
- && (!pic || !SYMBOL_REFERENCES_LOCAL (info, h)))
- indx = h->dynindx;
- }
+ bool dyn = elf_hash_table (info)->dynamic_sections_created;
+ if (h != NULL
+ && h->dynindx != -1
+ && WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, bfd_link_pic (info), h)
+ && (bfd_link_dll (info) || !SYMBOL_REFERENCES_LOCAL (info, h)))
+ indx = h->dynindx;
/* The GOT entries have not been initialized yet. Do it
now, and emit any relocations. */
- if ((bfd_link_pic (info) || indx != 0)
+ if ((bfd_link_dll (info) || indx != 0)
&& (h == NULL
|| ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
|| h->root.type != bfd_link_hash_undefweak))
- need_relocs = true;
+ need_relocs = true;
if (tls_type & GOT_TLS_GD)
{
+38 -18
View File
@@ -8,21 +8,27 @@ CTARGET="$(arch_to_hostspec $CTARGET_ARCH)"
pkgname=binutils-armv7
pkgver=2.40
pkgrel=5
pkgrel=12
pkgdesc="Tools necessary to build programs for armv7 targets"
url="https://www.gnu.org/software/binutils/"
makedepends_build="bison flex texinfo"
makedepends_host="zlib-dev zstd-dev"
makedepends="$makedepends_build $makedepends_host"
makedepends_host="zlib-dev jansson-dev zstd-dev"
arch="x86_64"
license="GPL-2.0-or-later AND LGPL-2.1-or-later AND BSD-3-Clause"
subpackages="binutils-dev binutils-doc"
source="https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.xz
binutils-ld-fix-static-linking.patch
0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch
CVE-2023-1972.patch
binutils-ld-fix-static-linking.patch
riscv64-textrels.patch
"
builddir="$srcdir/binutils-$pkgver"
if [ -z "$BOOTSTRAP" ]; then
makedepends_host="$makedepends_host jansson-dev zstd-dev"
_noboot_configure="--enable-jansson --with-zstd"
fi
if [ "$CHOST" = "$CBUILD" ] && [ "$CBUILD" = "$CTARGET" ] && [ "$CTARGET_ARCH" != "riscv64" ]; then
subpackages="$subpackages binutils-gold"
fi
@@ -34,6 +40,10 @@ if [ "$CHOST" != "$CTARGET" ]; then
fi
# secfixes:
# 2.40-r10:
# - CVE-2023-1972
# 2.40-r0:
# - CVE-2023-1579
# 2.39-r2:
# - CVE-2022-38533
# 2.39-r0:
@@ -73,6 +83,8 @@ build() {
_gold_configure="--disable-gold"
fi
CFLAGS="$CFLAGS -O2" \
CXXFLAGS="$CXXFLAGS -O2" \
./configure \
--build=$CBUILD \
--host=$CHOST \
@@ -82,22 +94,28 @@ build() {
--prefix=/usr \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--disable-multilib \
--disable-gprofng \
--enable-ld=default \
$_gold_configure \
--enable-64-bit-bfd \
$_plugin_configure \
--enable-relro \
--enable-deterministic-archives \
--enable-default-execstack=no \
$_cross_configure \
--sysconfdir=/etc \
$_arch_configure \
--enable-default-hash-style=gnu \
--with-pic \
--disable-werror \
$_cross_configure \
$_gold_configure \
$_plugin_configure \
$_noboot_configure \
--disable-gprofng \
--disable-multilib \
--disable-nls \
--disable-werror \
--enable-64-bit-bfd \
--enable-colored-disassembly \
--enable-default-execstack=no \
--enable-default-hash-style=gnu \
--enable-deterministic-archives \
--enable-ld=default \
--enable-new-dtags \
--enable-relro \
--enable-threads \
--with-bugurl="https://postmarketos.org/issues" \
--with-mmap \
--with-pic \
--with-system-zlib
make
}
@@ -128,6 +146,8 @@ gold() {
sha512sums="
a37e042523bc46494d99d5637c3f3d8f9956d9477b748b3b1f6d7dfbb8d968ed52c932e88a4e946c6f77b8f48f1e1b360ca54c3d298f17193f3b4963472f6925 binutils-2.40.tar.xz
ecee33b0e435aa704af1c334e560f201638ff79e199aa11ed78a72f7c9b46f85fbb227af5748e735fd681d1965fcc42ac81b0c8824e540430ce0c706c81e8b49 binutils-ld-fix-static-linking.patch
70ec22bd72ef6dddecfd970613387dd4a8cdc8730dd3cbf03d5a0c3a7c4d839383167bb06dad21bf7c235329fd44b5dc4aefe762f68544f17155cf002bf1be4a 0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch
b434e126c4c3f70c02b0a5597a0d75a4ea99b1498552c2d0676005ac0ae171c56cf07a6f6e2faa1381f1f4d4a37043a07d177dd4912f09b61109f103853594b2 CVE-2023-1972.patch
ecee33b0e435aa704af1c334e560f201638ff79e199aa11ed78a72f7c9b46f85fbb227af5748e735fd681d1965fcc42ac81b0c8824e540430ce0c706c81e8b49 binutils-ld-fix-static-linking.patch
d138691d953c6f49111601df1731db157d2ecedf1593e37ababb5c12ff10572b5f7982288c81579f4a99097780dbb18d3b457f74daab0f935f59423e69cec56f riscv64-textrels.patch
"
+37
View File
@@ -0,0 +1,37 @@
Patch-Source: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=c22d38baefc5a7a1e1f5cdc9dbb556b1f0ec5c57;hp=f2f9bde5cde7ff34ed0a4c4682a211d402aa1086
https://sourceware.org/bugzilla/show_bug.cgi?id=30285
--
From: Nick Clifton <nickc@redhat.com>
Date: Thu, 30 Mar 2023 09:10:09 +0000 (+0100)
Subject: Fix an illegal memory access when an accessing a zer0-lengthverdef table.
X-Git-Url: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff_plain;h=c22d38baefc5a7a1e1f5cdc9dbb556b1f0ec5c57;hp=f2f9bde5cde7ff34ed0a4c4682a211d402aa1086
Fix an illegal memory access when an accessing a zer0-lengthverdef table.
PR 30285
* elf.c (_bfd_elf_slurp_version_tables): Fail if no version definitions are allocated.
---
diff --git a/bfd/elf.c b/bfd/elf.c
index 027d0143735..185028cbd97 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -9030,6 +9030,9 @@ _bfd_elf_slurp_version_tables (bfd *abfd, bool default_imported_symver)
bfd_set_error (bfd_error_file_too_big);
goto error_return_verdef;
}
+
+ if (amt == 0)
+ goto error_return_verdef;
elf_tdata (abfd)->verdef = (Elf_Internal_Verdef *) bfd_zalloc (abfd, amt);
if (elf_tdata (abfd)->verdef == NULL)
goto error_return_verdef;
@@ -9133,6 +9136,8 @@ _bfd_elf_slurp_version_tables (bfd *abfd, bool default_imported_symver)
bfd_set_error (bfd_error_file_too_big);
goto error_return;
}
+ if (amt == 0)
+ goto error_return;
elf_tdata (abfd)->verdef = (Elf_Internal_Verdef *) bfd_zalloc (abfd, amt);
if (elf_tdata (abfd)->verdef == NULL)
goto error_return;
+103
View File
@@ -0,0 +1,103 @@
Patch-Source: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=225df051d3d4cf714d1791b9035966a6686b3f3d;hp=a70d5ba34cb64bbbb7df4f3055cf5b1967bdf61e#patch1
https://sourceware.org/bugzilla/show_bug.cgi?id=25694
--
From: Nelson Chu <nelson@nelson.ba.rivosinc.com>
Date: Thu, 4 May 2023 09:08:50 +0000 (+0800)
Subject: [PR ld/22263][PR ld/25694] RISC-V: Avoid dynamic TLS relocs in PIE.
X-Git-Url: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff_plain;h=225df051d3d4cf714d1791b9035966a6686b3f3d;hp=a70d5ba34cb64bbbb7df4f3055cf5b1967bdf61e
[PR ld/22263][PR ld/25694] RISC-V: Avoid dynamic TLS relocs in PIE.
Lots of targets already fixed the TEXTREL problem for TLS in PIE.
* For PR ld/25694,
In the check_reloc, refer to spare and loongarch, they don't need to reserve
any local dynamic reloc for TLS LE in pie/pde, and similar to other targets.
So it seems like riscv was too conservative to estimate the TLS LE before.
Just break and don't goto static_reloc for TLS LE in pie/pde can fix the
TEXTREL problem.
* For PR ld/22263,
The risc-v code for TLS GD/IE in the relocate_section seems same as MIPS port.
So similar to MIPS, pr22570, commits 9143e72c6d4d and 1cb83cac9a89, it seems
also the right way to do the same thing for risc-v.
On risc-v, fixes
FAIL: Build pr22263-1
RISC-V haven't supported the TLS transitions, so will need the same fix (use
bfd_link_dll) in the future.
bfd/
PR ld/22263
PR ld/25694
* elfnn-riscv.c (riscv_elf_check_relocs): Replace bfd_link_pic with
bfd_link_dll for TLS IE. Don't need to reserve the local dynamic
relocation for TLS LE in pie/pde, and report error in pic just like
before.
(riscv_elf_relocate_section): For TLS GD/IE, use bfd_link_dll rather
than !bfd_link_pic in determining the dynamic symbol index. Avoid
the index of -1.
---
diff --git a/bfd/elfnn-riscv.c b/bfd/elfnn-riscv.c
index 75af040cf92..762ea231c0b 100644
--- a/bfd/elfnn-riscv.c
+++ b/bfd/elfnn-riscv.c
@@ -824,7 +824,7 @@ riscv_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
break;
case R_RISCV_TLS_GOT_HI20:
- if (bfd_link_pic (info))
+ if (bfd_link_dll (info))
info->flags |= DF_STATIC_TLS;
if (!riscv_elf_record_got_reference (abfd, info, h, r_symndx)
|| !riscv_elf_record_tls_type (abfd, h, r_symndx, GOT_TLS_IE))
@@ -920,11 +920,12 @@ riscv_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
goto static_reloc;
case R_RISCV_TPREL_HI20:
+ /* This is not allowed in the pic, but okay in pie. */
if (!bfd_link_executable (info))
return bad_static_reloc (abfd, r_type, h);
if (h != NULL)
riscv_elf_record_tls_type (abfd, h, r_symndx, GOT_TLS_LE);
- goto static_reloc;
+ break;
case R_RISCV_HI20:
if (bfd_link_pic (info))
@@ -2880,24 +2881,20 @@ riscv_elf_relocate_section (bfd *output_bfd,
if (htab->elf.srelgot == NULL)
abort ();
- if (h != NULL)
- {
- bool dyn, pic;
- dyn = htab->elf.dynamic_sections_created;
- pic = bfd_link_pic (info);
-
- if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, pic, h)
- && (!pic || !SYMBOL_REFERENCES_LOCAL (info, h)))
- indx = h->dynindx;
- }
+ bool dyn = elf_hash_table (info)->dynamic_sections_created;
+ if (h != NULL
+ && h->dynindx != -1
+ && WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, bfd_link_pic (info), h)
+ && (bfd_link_dll (info) || !SYMBOL_REFERENCES_LOCAL (info, h)))
+ indx = h->dynindx;
/* The GOT entries have not been initialized yet. Do it
now, and emit any relocations. */
- if ((bfd_link_pic (info) || indx != 0)
+ if ((bfd_link_dll (info) || indx != 0)
&& (h == NULL
|| ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
|| h->root.type != bfd_link_hash_undefweak))
- need_relocs = true;
+ need_relocs = true;
if (tls_type & GOT_TLS_GD)
{
+38 -18
View File
@@ -8,21 +8,27 @@ CTARGET="$(arch_to_hostspec $CTARGET_ARCH)"
pkgname=binutils-riscv64
pkgver=2.40
pkgrel=5
pkgrel=12
pkgdesc="Tools necessary to build programs for riscv64 targets"
url="https://www.gnu.org/software/binutils/"
makedepends_build="bison flex texinfo"
makedepends_host="zlib-dev zstd-dev"
makedepends="$makedepends_build $makedepends_host"
makedepends_host="zlib-dev jansson-dev zstd-dev"
arch="x86_64"
license="GPL-2.0-or-later AND LGPL-2.1-or-later AND BSD-3-Clause"
subpackages="binutils-dev binutils-doc"
source="https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.xz
binutils-ld-fix-static-linking.patch
0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch
CVE-2023-1972.patch
binutils-ld-fix-static-linking.patch
riscv64-textrels.patch
"
builddir="$srcdir/binutils-$pkgver"
if [ -z "$BOOTSTRAP" ]; then
makedepends_host="$makedepends_host jansson-dev zstd-dev"
_noboot_configure="--enable-jansson --with-zstd"
fi
if [ "$CHOST" = "$CBUILD" ] && [ "$CBUILD" = "$CTARGET" ] && [ "$CTARGET_ARCH" != "riscv64" ]; then
subpackages="$subpackages binutils-gold"
fi
@@ -34,6 +40,10 @@ if [ "$CHOST" != "$CTARGET" ]; then
fi
# secfixes:
# 2.40-r10:
# - CVE-2023-1972
# 2.40-r0:
# - CVE-2023-1579
# 2.39-r2:
# - CVE-2022-38533
# 2.39-r0:
@@ -73,6 +83,8 @@ build() {
_gold_configure="--disable-gold"
fi
CFLAGS="$CFLAGS -O2" \
CXXFLAGS="$CXXFLAGS -O2" \
./configure \
--build=$CBUILD \
--host=$CHOST \
@@ -82,22 +94,28 @@ build() {
--prefix=/usr \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--disable-multilib \
--disable-gprofng \
--enable-ld=default \
$_gold_configure \
--enable-64-bit-bfd \
$_plugin_configure \
--enable-relro \
--enable-deterministic-archives \
--enable-default-execstack=no \
$_cross_configure \
--sysconfdir=/etc \
$_arch_configure \
--enable-default-hash-style=gnu \
--with-pic \
--disable-werror \
$_cross_configure \
$_gold_configure \
$_plugin_configure \
$_noboot_configure \
--disable-gprofng \
--disable-multilib \
--disable-nls \
--disable-werror \
--enable-64-bit-bfd \
--enable-colored-disassembly \
--enable-default-execstack=no \
--enable-default-hash-style=gnu \
--enable-deterministic-archives \
--enable-ld=default \
--enable-new-dtags \
--enable-relro \
--enable-threads \
--with-bugurl="https://postmarketos.org/issues" \
--with-mmap \
--with-pic \
--with-system-zlib
make
}
@@ -128,6 +146,8 @@ gold() {
sha512sums="
a37e042523bc46494d99d5637c3f3d8f9956d9477b748b3b1f6d7dfbb8d968ed52c932e88a4e946c6f77b8f48f1e1b360ca54c3d298f17193f3b4963472f6925 binutils-2.40.tar.xz
ecee33b0e435aa704af1c334e560f201638ff79e199aa11ed78a72f7c9b46f85fbb227af5748e735fd681d1965fcc42ac81b0c8824e540430ce0c706c81e8b49 binutils-ld-fix-static-linking.patch
70ec22bd72ef6dddecfd970613387dd4a8cdc8730dd3cbf03d5a0c3a7c4d839383167bb06dad21bf7c235329fd44b5dc4aefe762f68544f17155cf002bf1be4a 0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch
b434e126c4c3f70c02b0a5597a0d75a4ea99b1498552c2d0676005ac0ae171c56cf07a6f6e2faa1381f1f4d4a37043a07d177dd4912f09b61109f103853594b2 CVE-2023-1972.patch
ecee33b0e435aa704af1c334e560f201638ff79e199aa11ed78a72f7c9b46f85fbb227af5748e735fd681d1965fcc42ac81b0c8824e540430ce0c706c81e8b49 binutils-ld-fix-static-linking.patch
d138691d953c6f49111601df1731db157d2ecedf1593e37ababb5c12ff10572b5f7982288c81579f4a99097780dbb18d3b457f74daab0f935f59423e69cec56f riscv64-textrels.patch
"
@@ -0,0 +1,37 @@
Patch-Source: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=c22d38baefc5a7a1e1f5cdc9dbb556b1f0ec5c57;hp=f2f9bde5cde7ff34ed0a4c4682a211d402aa1086
https://sourceware.org/bugzilla/show_bug.cgi?id=30285
--
From: Nick Clifton <nickc@redhat.com>
Date: Thu, 30 Mar 2023 09:10:09 +0000 (+0100)
Subject: Fix an illegal memory access when an accessing a zer0-lengthverdef table.
X-Git-Url: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff_plain;h=c22d38baefc5a7a1e1f5cdc9dbb556b1f0ec5c57;hp=f2f9bde5cde7ff34ed0a4c4682a211d402aa1086
Fix an illegal memory access when an accessing a zer0-lengthverdef table.
PR 30285
* elf.c (_bfd_elf_slurp_version_tables): Fail if no version definitions are allocated.
---
diff --git a/bfd/elf.c b/bfd/elf.c
index 027d0143735..185028cbd97 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -9030,6 +9030,9 @@ _bfd_elf_slurp_version_tables (bfd *abfd, bool default_imported_symver)
bfd_set_error (bfd_error_file_too_big);
goto error_return_verdef;
}
+
+ if (amt == 0)
+ goto error_return_verdef;
elf_tdata (abfd)->verdef = (Elf_Internal_Verdef *) bfd_zalloc (abfd, amt);
if (elf_tdata (abfd)->verdef == NULL)
goto error_return_verdef;
@@ -9133,6 +9136,8 @@ _bfd_elf_slurp_version_tables (bfd *abfd, bool default_imported_symver)
bfd_set_error (bfd_error_file_too_big);
goto error_return;
}
+ if (amt == 0)
+ goto error_return;
elf_tdata (abfd)->verdef = (Elf_Internal_Verdef *) bfd_zalloc (abfd, amt);
if (elf_tdata (abfd)->verdef == NULL)
goto error_return;
@@ -0,0 +1,103 @@
Patch-Source: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=225df051d3d4cf714d1791b9035966a6686b3f3d;hp=a70d5ba34cb64bbbb7df4f3055cf5b1967bdf61e#patch1
https://sourceware.org/bugzilla/show_bug.cgi?id=25694
--
From: Nelson Chu <nelson@nelson.ba.rivosinc.com>
Date: Thu, 4 May 2023 09:08:50 +0000 (+0800)
Subject: [PR ld/22263][PR ld/25694] RISC-V: Avoid dynamic TLS relocs in PIE.
X-Git-Url: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff_plain;h=225df051d3d4cf714d1791b9035966a6686b3f3d;hp=a70d5ba34cb64bbbb7df4f3055cf5b1967bdf61e
[PR ld/22263][PR ld/25694] RISC-V: Avoid dynamic TLS relocs in PIE.
Lots of targets already fixed the TEXTREL problem for TLS in PIE.
* For PR ld/25694,
In the check_reloc, refer to spare and loongarch, they don't need to reserve
any local dynamic reloc for TLS LE in pie/pde, and similar to other targets.
So it seems like riscv was too conservative to estimate the TLS LE before.
Just break and don't goto static_reloc for TLS LE in pie/pde can fix the
TEXTREL problem.
* For PR ld/22263,
The risc-v code for TLS GD/IE in the relocate_section seems same as MIPS port.
So similar to MIPS, pr22570, commits 9143e72c6d4d and 1cb83cac9a89, it seems
also the right way to do the same thing for risc-v.
On risc-v, fixes
FAIL: Build pr22263-1
RISC-V haven't supported the TLS transitions, so will need the same fix (use
bfd_link_dll) in the future.
bfd/
PR ld/22263
PR ld/25694
* elfnn-riscv.c (riscv_elf_check_relocs): Replace bfd_link_pic with
bfd_link_dll for TLS IE. Don't need to reserve the local dynamic
relocation for TLS LE in pie/pde, and report error in pic just like
before.
(riscv_elf_relocate_section): For TLS GD/IE, use bfd_link_dll rather
than !bfd_link_pic in determining the dynamic symbol index. Avoid
the index of -1.
---
diff --git a/bfd/elfnn-riscv.c b/bfd/elfnn-riscv.c
index 75af040cf92..762ea231c0b 100644
--- a/bfd/elfnn-riscv.c
+++ b/bfd/elfnn-riscv.c
@@ -824,7 +824,7 @@ riscv_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
break;
case R_RISCV_TLS_GOT_HI20:
- if (bfd_link_pic (info))
+ if (bfd_link_dll (info))
info->flags |= DF_STATIC_TLS;
if (!riscv_elf_record_got_reference (abfd, info, h, r_symndx)
|| !riscv_elf_record_tls_type (abfd, h, r_symndx, GOT_TLS_IE))
@@ -920,11 +920,12 @@ riscv_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
goto static_reloc;
case R_RISCV_TPREL_HI20:
+ /* This is not allowed in the pic, but okay in pie. */
if (!bfd_link_executable (info))
return bad_static_reloc (abfd, r_type, h);
if (h != NULL)
riscv_elf_record_tls_type (abfd, h, r_symndx, GOT_TLS_LE);
- goto static_reloc;
+ break;
case R_RISCV_HI20:
if (bfd_link_pic (info))
@@ -2880,24 +2881,20 @@ riscv_elf_relocate_section (bfd *output_bfd,
if (htab->elf.srelgot == NULL)
abort ();
- if (h != NULL)
- {
- bool dyn, pic;
- dyn = htab->elf.dynamic_sections_created;
- pic = bfd_link_pic (info);
-
- if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, pic, h)
- && (!pic || !SYMBOL_REFERENCES_LOCAL (info, h)))
- indx = h->dynindx;
- }
+ bool dyn = elf_hash_table (info)->dynamic_sections_created;
+ if (h != NULL
+ && h->dynindx != -1
+ && WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, bfd_link_pic (info), h)
+ && (bfd_link_dll (info) || !SYMBOL_REFERENCES_LOCAL (info, h)))
+ indx = h->dynindx;
/* The GOT entries have not been initialized yet. Do it
now, and emit any relocations. */
- if ((bfd_link_pic (info) || indx != 0)
+ if ((bfd_link_dll (info) || indx != 0)
&& (h == NULL
|| ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
|| h->root.type != bfd_link_hash_undefweak))
- need_relocs = true;
+ need_relocs = true;
if (tls_type & GOT_TLS_GD)
{
+3 -3
View File
@@ -7,8 +7,8 @@ if [ -z "$(type -t arch_to_hostspec)" ]; then
fi
pkgname=busybox-static-aarch64
pkgver=1.36.0
pkgrel=8
pkgver=1.36.1
pkgrel=2
_arch="aarch64"
_mirror="http://dl-4.alpinelinux.org/alpine/"
@@ -32,5 +32,5 @@ package() {
}
sha512sums="
918c25a969447cc34a1c3d8176a3da560bc61d3b028206b08d0ef8cc1147756f0f8a2fff02a560a14062ddfffcbb264368502a0f24725992a5652ea0755ed24a busybox-static-1.36.0-r8-aarch64-edge.apk
25394d1105e40c8decf861c55c68401708ed8dbcd9643194c7c270f9cc4a792d0376cb926816f8803d496610bdbc53494a09a360097981f862958ceb4435768a busybox-static-1.36.1-r2-aarch64-edge.apk
"
+3 -3
View File
@@ -7,8 +7,8 @@ if [ -z "$(type -t arch_to_hostspec)" ]; then
fi
pkgname=busybox-static-armhf
pkgver=1.36.0
pkgrel=8
pkgver=1.36.1
pkgrel=2
_arch="armhf"
_mirror="http://dl-4.alpinelinux.org/alpine/"
@@ -32,5 +32,5 @@ package() {
}
sha512sums="
d6c6d8c34101406c7dd7a237a0b3201908a3180d95aa7905bc4c9bde88ea2427cc808a5456c49bd087ce9ed07cbeae9de62681b6cc98900d7ce66af5b73fc0c8 busybox-static-1.36.0-r8-armhf-edge.apk
6dd546f62fdb8c0a45428bc313c28be573d92e468c52ac1210ea054a4cc701810a5bbee766d53e0374fcca6b6611e9202ab4036899c97b5129ac216ffccadf73 busybox-static-1.36.1-r2-armhf-edge.apk
"
+3 -3
View File
@@ -7,8 +7,8 @@ if [ -z "$(type -t arch_to_hostspec)" ]; then
fi
pkgname=busybox-static-armv7
pkgver=1.36.0
pkgrel=8
pkgver=1.36.1
pkgrel=2
_arch="armv7"
_mirror="http://dl-4.alpinelinux.org/alpine/"
@@ -32,5 +32,5 @@ package() {
}
sha512sums="
b7ebdf31d92ebf6d4a5eebc57a9f9e4d5246e2e325999631bcad71e019e3f6be9ebc2e46ff085a92cee5cd7bb106964ca1f17fd69da47e7b0438bde592dbd830 busybox-static-1.36.0-r8-armv7-edge.apk
b723bb48cc886706271f39a2bc096a1d6adfcca3df6233a3f7e904996e6dcd76a0a7d24fb75e4e637bf6a1b35f71221e8a10cd52a4f1e9bbe403a81d1f83bfc1 busybox-static-1.36.1-r2-armv7-edge.apk
"
+6 -3
View File
@@ -1,14 +1,14 @@
From 74c7b0df9971b6bc75d7d172c2819ffd21d51050 Mon Sep 17 00:00:00 2001
From 75e758609803afe6ced6cd7799b4159f3848a8d5 Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <nsz@port70.net>
Date: Fri, 26 Jan 2018 20:32:50 +0000
Subject: [PATCH] posix_memalign
Subject: [PATCH 01/33] 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 3b2e4f47915..20f790904a2 100644
index 3527283693b..c4071b64b53 100644
--- a/gcc/config/i386/pmm_malloc.h
+++ b/gcc/config/i386/pmm_malloc.h
@@ -27,12 +27,13 @@
@@ -37,3 +37,6 @@ index 3b2e4f47915..20f790904a2 100644
return __ptr;
else
return NULL;
--
2.41.0
@@ -1,7 +1,7 @@
From dd1e75ff4ecda96957465b34681f245e818928bd Mon Sep 17 00:00:00 2001
From 447c2a21d1fa8c2c3b216102a808834d86f12104 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] gcc: poison-system-directories
Subject: [PATCH 02/33] 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
@@ -26,10 +26,10 @@ Upstream-Status: Pending
7 files changed, 68 insertions(+)
diff --git a/gcc/common.opt b/gcc/common.opt
index 8a0dafc522d..0357868e22c 100644
index 862c474d3c8..64c4277c991 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -710,6 +710,10 @@ Wreturn-local-addr
@@ -711,6 +711,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 8a0dafc522d..0357868e22c 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 64c27c9cfac..f0fbf123aa8 100644
index 4cad077bfbe..0679fbbf4c6 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -230,6 +230,12 @@
@@ -236,6 +236,12 @@
#endif
@@ -58,10 +58,10 @@ index 64c27c9cfac..f0fbf123aa8 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 5ce0557719a..e9060112384 100755
index c7b26d1927d..8c46369f73f 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -1023,6 +1023,7 @@ enable_maintainer_mode
@@ -1026,6 +1026,7 @@ enable_maintainer_mode
enable_link_mutex
enable_link_serialization
enable_version_specific_runtime_libs
@@ -69,7 +69,7 @@ index 5ce0557719a..e9060112384 100755
enable_plugin
enable_host_shared
enable_libquadmath_support
@@ -1785,6 +1786,8 @@ Optional Features:
@@ -1788,6 +1789,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 5ce0557719a..e9060112384 100755
--enable-plugin enable plugin support
--enable-host-shared build host code as shared libraries
--disable-libquadmath-support
@@ -31982,6 +31985,19 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then :
@@ -31753,6 +31756,19 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then :
fi
@@ -99,10 +99,10 @@ index 5ce0557719a..e9060112384 100755
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 23bee7010a3..75a7048045c 100644
index 09082e8ccae..5504bf6eb01 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -7421,6 +7421,16 @@ AC_ARG_ENABLE(version-specific-runtime-libs,
@@ -7292,6 +7292,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 23bee7010a3..75a7048045c 100644
AC_SUBST(subdirs)
AC_SUBST(srcdir)
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 07b440190c3..b2de464798a 100644
index b61ecfc1bc8..b290908679e 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -379,6 +379,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
@@ -8029,6 +8030,14 @@ made up of data only and thus requires no special treatment. But, for
@@ -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
@@ -8424,6 +8425,14 @@ made up of data only and thus requires no special treatment. But, for
most targets, it is made up of code and thus requires the stack to be
made executable in order for the program to work properly.
+@item -Wno-poison-system-directories
+@opindex Wno-poison-system-directories
+@item -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 bb07cc244e3..47fb5802194 100644
index 16bb07f2cdc..33b56e721d2 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -1159,6 +1159,8 @@ proper position among the other output files. */
@@ -1146,6 +1146,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}}} \
@@ -160,7 +160,7 @@ index bb07cc244e3..47fb5802194 100644
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 bd2a97938eb..c80f100f476 100644
index 4d44321183f..0f3f071b44c 100644
--- a/gcc/incpath.cc
+++ b/gcc/incpath.cc
@@ -26,6 +26,7 @@
@@ -198,3 +198,6 @@ index bd2a97938eb..c80f100f476 100644
}
/* Use given -I paths for #include "..." but not #include <...>, and
--
2.41.0
@@ -1,7 +1,7 @@
From 40e45739e7d3787acd13b5b9a4c27d843de0ffe2 Mon Sep 17 00:00:00 2001
From b5c378c4c1e71b2dd8b4616d8f61530ee1a3ac98 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:45:49 +0000
Subject: [PATCH] specs: turn on -Wl,-z,now by default
Subject: [PATCH 03/33] 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.
@@ -14,24 +14,24 @@ now by default.
2 files changed, 4 insertions(+)
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index b2de464798a..83bd1bde433 100644
index b290908679e..cb34e6d40c9 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -16872,6 +16872,9 @@ For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
@@ -17959,6 +17959,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}.
+
@item -u @var{symbol}
@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 47fb5802194..d18b5d7b59a 100644
index 33b56e721d2..f82fae23c22 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -1157,6 +1157,7 @@ proper position among the other output files. */
@@ -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 \
@@ -39,3 +39,6 @@ index 47fb5802194..d18b5d7b59a 100644
"%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,8 +1,8 @@
From 666d0aeb808ac9c10d065ae7b196695c81a25a20 Mon Sep 17 00:00:00 2001
From bb3ef1f5acfde9658c922d0aef9283fe60328c33 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:46:22 +0000
Subject: [PATCH] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, ObjC,
ObjC++, if the optimization level is > 0
Subject: [PATCH 04/33] 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 ++++
@@ -10,10 +10,10 @@ Subject: [PATCH] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, ObjC,
2 files changed, 10 insertions(+)
diff --git a/gcc/c-family/c-cppbuiltin.cc b/gcc/c-family/c-cppbuiltin.cc
index 4672ae8486a..573c021e1e8 100644
index 5d64625fcd7..868d69506e4 100644
--- a/gcc/c-family/c-cppbuiltin.cc
+++ b/gcc/c-family/c-cppbuiltin.cc
@@ -1510,6 +1510,10 @@ c_cpp_builtins (cpp_reader *pfile)
@@ -1546,6 +1546,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 4672ae8486a..573c021e1e8 100644
if (flag_gnu89_inline)
cpp_define (pfile, "__GNUC_GNU_INLINE__");
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 83bd1bde433..dda299a9987 100644
index cb34e6d40c9..7f1aa660285 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -10896,6 +10896,12 @@ also turns on the following optimization flags:
@@ -11866,6 +11866,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,6 +38,9 @@ index 83bd1bde433..dda299a9987 100644
+functions. To disable, specify either @option{-U_FORTIFY_SOURCE} or
+@option{-D_FORTIFY_SOURCE=0}.
+
@item -O3
@opindex O3
@item -O3
Optimize yet more. @option{-O3} turns on all optimizations specified
--
2.41.0
@@ -1,8 +1,8 @@
From 75d1a35180cf0967f062765314bf091a64032062 Mon Sep 17 00:00:00 2001
From 0727ad9e4a458d090be6fb0cfbe334d8496cd5e0 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:46:56 +0000
Subject: [PATCH] On linux targets pass --as-needed by default to the linker,
but always link the sanitizer libraries with --no-as-needed.
Subject: [PATCH 05/33] 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 +
@@ -22,7 +22,7 @@ Subject: [PATCH] On linux targets pass --as-needed by default to the linker,
14 files changed, 36 insertions(+), 19 deletions(-)
diff --git a/gcc/config/aarch64/aarch64-linux.h b/gcc/config/aarch64/aarch64-linux.h
index 5e4553d79f5..b516f3ef97f 100644
index 4277f03da2a..b131983a546 100644
--- a/gcc/config/aarch64/aarch64-linux.h
+++ b/gcc/config/aarch64/aarch64-linux.h
@@ -35,6 +35,7 @@
@@ -34,7 +34,7 @@ index 5e4553d79f5..b516f3ef97f 100644
%{shared:-shared} \
%{symbolic:-Bsymbolic} \
diff --git a/gcc/config/alpha/linux-elf.h b/gcc/config/alpha/linux-elf.h
index 17f16a55910..9ec667e9a5e 100644
index 03f783f2ad1..d946e700dda 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 17f16a55910..9ec667e9a5e 100644
%{shared:-shared} \
%{!shared: \
diff --git a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h
index df3da67c4f0..7532bc29f9b 100644
index 7b7b7cbbe14..49c050c6f2c 100644
--- a/gcc/config/arm/linux-elf.h
+++ b/gcc/config/arm/linux-elf.h
@@ -70,6 +70,7 @@
@@ -59,7 +59,7 @@ index df3da67c4f0..7532bc29f9b 100644
SUBTARGET_EXTRA_LINK_SPEC
diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h
index 857c0e077bf..8433e56c3e1 100644
index eda8010b133..b26b17f2f2a 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
@@ -69,9 +69,9 @@ index 857c0e077bf..8433e56c3e1 100644
- 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 "%{static-libhwasan:%{!shared:" \
LD_STATIC_OPTION " --whole-archive -lhwasan --no-whole-archive " \
@@ -145,12 +145,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#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
#define LIBTSAN_EARLY_SPEC "%{!shared:libtsan_preinit%O%s} " \
"%{static-libtsan:%{!shared:" \
LD_STATIC_OPTION " --whole-archive -ltsan --no-whole-archive " \
@@ -87,7 +87,7 @@ index 857c0e077bf..8433e56c3e1 100644
#undef TARGET_F951_OPTIONS
diff --git a/gcc/config/i386/gnu-user.h b/gcc/config/i386/gnu-user.h
index 0102b2a6f3b..994414c1845 100644
index a79b739089d..e0752673dff 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
@@ -100,7 +100,7 @@ index 0102b2a6f3b..994414c1845 100644
%{!static: \
%{!static-pie: \
diff --git a/gcc/config/i386/gnu-user64.h b/gcc/config/i386/gnu-user64.h
index abc8cf624ca..fe656aeae27 100644
index 3b63b99acf6..759bf0db86f 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 +112,7 @@ index abc8cf624ca..fe656aeae27 100644
%{!shared: \
%{!static: \
diff --git a/gcc/config/ia64/linux.h b/gcc/config/ia64/linux.h
index 93510098ccc..3813e536423 100644
index 5dfd428aa17..02656dad7fc 100644
--- a/gcc/config/ia64/linux.h
+++ b/gcc/config/ia64/linux.h
@@ -58,7 +58,7 @@ do { \
@@ -125,7 +125,7 @@ index 93510098ccc..3813e536423 100644
%{!shared: \
%{!static: \
diff --git a/gcc/config/mips/gnu-user.h b/gcc/config/mips/gnu-user.h
index 6aad7192e69..e1256a55add 100644
index a4e5380b589..3cc61bce69f 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,10 +137,10 @@ index 6aad7192e69..e1256a55add 100644
%{!static: \
%{rdynamic:-export-dynamic} \
diff --git a/gcc/config/riscv/linux.h b/gcc/config/riscv/linux.h
index 38803723ba9..3067ed6eac8 100644
index 3e625e0f867..f8c2c351e5a 100644
--- a/gcc/config/riscv/linux.h
+++ b/gcc/config/riscv/linux.h
@@ -58,6 +58,7 @@ along with GCC; see the file COPYING3. If not see
@@ -48,6 +48,7 @@ along with GCC; see the file COPYING3. If not see
"%{mabi=ilp32:_ilp32}"
#define LINK_SPEC "\
@@ -149,7 +149,7 @@ index 38803723ba9..3067ed6eac8 100644
%{mno-relax:--no-relax} \
%{mbig-endian:-EB} \
diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
index b2a7afabc73..34ceb4e4fce 100644
index 9e457033d11..08016bf224d 100644
--- a/gcc/config/rs6000/linux64.h
+++ b/gcc/config/rs6000/linux64.h
@@ -377,13 +377,13 @@ extern int dot_symbols;
@@ -169,10 +169,10 @@ index b2a7afabc73..34ceb4e4fce 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 7e2519de5d4..61215a7a1b3 100644
index ae932fc22f0..c8ff0c6dc8e 100644
--- a/gcc/config/rs6000/sysv4.h
+++ b/gcc/config/rs6000/sysv4.h
@@ -788,7 +788,7 @@ GNU_USER_TARGET_CC1_SPEC
@@ -780,7 +780,7 @@ GNU_USER_TARGET_CC1_SPEC
#define GNU_USER_DYNAMIC_LINKER GLIBC_DYNAMIC_LINKER
#endif
@@ -182,7 +182,7 @@ index 7e2519de5d4..61215a7a1b3 100644
-dynamic-linker " GNU_USER_DYNAMIC_LINKER "}}"
diff --git a/gcc/config/s390/linux.h b/gcc/config/s390/linux.h
index d7b7e7a7b02..d2287f14f2e 100644
index 02aa1edaff8..64df5801134 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 +195,7 @@ index d7b7e7a7b02..d2287f14f2e 100644
%{!shared: \
%{static:-static} \
diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h
index 6a809e9092d..93bfb92d3ff 100644
index 0e33b3cac2c..c2f44546e62 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);
@@ -208,10 +208,10 @@ index 6a809e9092d..93bfb92d3ff 100644
%{!shared: \
%{!static: \
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index d18b5d7b59a..3b76311b544 100644
index f82fae23c22..da6417dd0d1 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -744,8 +744,11 @@ proper position among the other output files. */
@@ -754,8 +754,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 +225,7 @@ index d18b5d7b59a..3b76311b544 100644
STATIC_LIBASAN_LIBS
#else
#define LIBASAN_SPEC "-lasan" STATIC_LIBASAN_LIBS
@@ -780,8 +783,11 @@ proper position among the other output files. */
@@ -790,8 +793,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 +239,7 @@ index d18b5d7b59a..3b76311b544 100644
STATIC_LIBTSAN_LIBS
#else
#define LIBTSAN_SPEC "-ltsan" STATIC_LIBTSAN_LIBS
@@ -798,8 +804,11 @@ proper position among the other output files. */
@@ -808,8 +814,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 +253,7 @@ index d18b5d7b59a..3b76311b544 100644
STATIC_LIBLSAN_LIBS
#else
#define LIBLSAN_SPEC "-llsan" STATIC_LIBLSAN_LIBS
@@ -814,8 +823,11 @@ proper position among the other output files. */
@@ -824,8 +833,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
@@ -267,3 +267,6 @@ index d18b5d7b59a..3b76311b544 100644
STATIC_LIBUBSAN_LIBS
#else
#define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS
--
2.41.0
@@ -1,17 +1,17 @@
From c664283dd30949c5299d1c45bd5740bcfe993d22 Mon Sep 17 00:00:00 2001
From dc3e2f629fe7f8df81c74162c66910339ec5d03d Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:47:43 +0000
Subject: [PATCH] Enable -Wformat and -Wformat-security by default.
Subject: [PATCH 06/33] 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 07da40ef43b..8683f706426 100644
index a75038930ae..b98726f33ed 100644
--- a/gcc/c-family/c.opt
+++ b/gcc/c-family/c.opt
@@ -692,7 +692,7 @@ Warn about function calls with format strings that write past the end
@@ -704,7 +704,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 07da40ef43b..8683f706426 100644
Warn about possible security problems with format functions.
Wformat-signedness
@@ -713,7 +713,7 @@ C ObjC C++ ObjC++ Var(warn_format_zero_length) Warning LangEnabledBy(C ObjC C++
@@ -725,7 +725,7 @@ C ObjC C++ ObjC++ Var(warn_format_zero_length) Warning LangEnabledBy(C ObjC C++
Warn about zero-length formats.
Wformat=
@@ -29,3 +29,6 @@ index 07da40ef43b..8683f706426 100644
Warn about printf/scanf/strftime/strfmon format string anomalies.
Wformat-overflow=
--
2.41.0
@@ -1,17 +1,17 @@
From e4d0ec43e772b6dc7c3708aed5309897df26a125 Mon Sep 17 00:00:00 2001
From d25c373cf839df0720f8d345b5ad55147030515a Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:48:24 +0000
Subject: [PATCH] Enable -Wtrampolines by default.
Subject: [PATCH 07/33] 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 0357868e22c..6d5e5eebe60 100644
index 64c4277c991..c24839d32bc 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -802,7 +802,7 @@ Common Var(warn_system_headers) Warning
@@ -803,7 +803,7 @@ Common Var(warn_system_headers) Warning
Do not suppress warnings from system headers.
Wtrampolines
@@ -20,3 +20,6 @@ index 0357868e22c..6d5e5eebe60 100644
Warn whenever a trampoline is generated.
Wtrivial-auto-var-init
--
2.41.0
@@ -1,8 +1,8 @@
From 27e5d5bd3fed9006a2958d2b09750d15ad07383b Mon Sep 17 00:00:00 2001
From eb58983c3d3126caaab8ed174571b142a095c132 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:49:40 +0000
Subject: [PATCH] Disable ssp on -nostdlib, -nodefaultlibs and -ffreestanding
Change the buffer size.
Subject: [PATCH 08/33] Disable ssp on -nostdlib, -nodefaultlibs and
-ffreestanding Change the buffer size.
---
gcc/gcc.cc | 8 +++++++-
@@ -10,10 +10,10 @@ Subject: [PATCH] Disable ssp on -nostdlib, -nodefaultlibs and -ffreestanding
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index 3b76311b544..cc99d0b7aa1 100644
index da6417dd0d1..b5a6f200635 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -996,6 +996,12 @@ proper position among the other output files. */
@@ -983,6 +983,12 @@ proper position among the other output files. */
#define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
#endif
@@ -26,7 +26,7 @@ index 3b76311b544..cc99d0b7aa1 100644
#ifndef LINK_SSP_SPEC
#ifdef TARGET_LIBC_PROVIDES_SSP
#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
@@ -1295,7 +1301,7 @@ static const char *cc1_options =
@@ -1282,7 +1288,7 @@ static const char *cc1_options =
%{-version:--version}\
%{-help=*:--help=%*}\
%{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
@@ -36,10 +36,10 @@ index 3b76311b544..cc99d0b7aa1 100644
%{fprofile-arcs|fprofile-generate*|coverage:\
%{!fprofile-update=single:\
diff --git a/gcc/params.opt b/gcc/params.opt
index b88e1372005..82a7e25dd2f 100644
index 823cdb2ff85..5b096899b40 100644
--- a/gcc/params.opt
+++ b/gcc/params.opt
@@ -1012,7 +1012,7 @@ Common Joined UInteger Var(param_ssa_name_def_chain_limit) Init(512) Param Optim
@@ -1006,7 +1006,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=
@@ -48,3 +48,6 @@ index b88e1372005..82a7e25dd2f 100644
The lower bound for a buffer to be considered for stack smashing protection.
-param=stack-clash-protection-guard-size=
--
2.41.0
@@ -1,8 +1,8 @@
From 83bf2a316222e2fe0b72968cadf4e334d41173f6 Mon Sep 17 00:00:00 2001
From 823afef2053ca4f79ac13f2b0f52b132282ee705 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:50:33 +0000
Subject: [PATCH] Ensure that msgfmt doesn't encounter problems during gcc
bootstrapping.
Subject: [PATCH 09/33] 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 8f51544989e..5329804d136 100644
index 12d34910830..61b13762b71 100644
--- a/libstdc++-v3/po/Makefile.am
+++ b/libstdc++-v3/po/Makefile.am
@@ -38,6 +38,7 @@ MSGFMT = msgfmt
@@ -38,7 +38,7 @@ index 8f51544989e..5329804d136 100644
all-local: all-local-$(USE_NLS)
diff --git a/libstdc++-v3/po/Makefile.in b/libstdc++-v3/po/Makefile.in
index 243f3db7b72..822210781fa 100644
index 8e93445acd2..d6ff06e5ddb 100644
--- a/libstdc++-v3/po/Makefile.in
+++ b/libstdc++-v3/po/Makefile.in
@@ -561,6 +561,7 @@ uninstall-am:
@@ -49,3 +49,6 @@ index 243f3db7b72..822210781fa 100644
$(MSGFMT) -o $@ $<
all-local: all-local-$(USE_NLS)
--
2.41.0
@@ -1,14 +1,14 @@
From 190064993cd8ddbd48015c1fc1916e4110a97733 Mon Sep 17 00:00:00 2001
From 702cbba342eae468e79d9b42e366b9699c158402 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:52:07 +0000
Subject: [PATCH] Don't declare asprintf if defined as a macro.
Subject: [PATCH 10/33] 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 a65ced9c820..eb20ab0f95f 100644
index 1d5c779fcff..19e3cb1e31c 100644
--- a/include/libiberty.h
+++ b/include/libiberty.h
@@ -652,8 +652,11 @@ extern void *bsearch_r (const void *, const void *,
@@ -23,3 +23,6 @@ index a65ced9c820..eb20ab0f95f 100644
/* Like asprintf but allocates memory without fail. This works like
xmalloc. */
--
2.41.0
@@ -1,14 +1,14 @@
From 838e1daa955d9013c462be3471497cb39641e951 Mon Sep 17 00:00:00 2001
From 18f0ecbdab63b0ee590ef21650ac72879318a8be Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:53:00 +0000
Subject: [PATCH] libiberty: copy PIC objects during build process
Subject: [PATCH 11/33] 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 1b17c2e3a47..8db1176df2e 100644
index 72608f3e4a7..58356884728 100644
--- a/libiberty/Makefile.in
+++ b/libiberty/Makefile.in
@@ -265,6 +265,7 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS)
@@ -19,3 +19,6 @@ index 1b17c2e3a47..8db1176df2e 100644
cd ..; \
else true; fi
--
2.41.0
@@ -1,7 +1,7 @@
From 048c394eb709bfd216e307c1b92ac7f8a7e7758b Mon Sep 17 00:00:00 2001
From e350a47267790a1a624032a645425b4018433e0c 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
Subject: [PATCH 12/33] libgcc_s
---
gcc/config/i386/i386-expand.cc | 4 ++--
@@ -10,10 +10,10 @@ Subject: [PATCH] libgcc_s
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/gcc/config/i386/i386-expand.cc b/gcc/config/i386/i386-expand.cc
index 31780b6daf7..d89898846e1 100644
index 0d817fc3f3b..2e99db00db9 100644
--- a/gcc/config/i386/i386-expand.cc
+++ b/gcc/config/i386/i386-expand.cc
@@ -12338,10 +12338,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget,
@@ -12691,10 +12691,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget,
{
case IX86_BUILTIN_CPU_INIT:
{
@@ -27,7 +27,7 @@ index 31780b6daf7..d89898846e1 100644
return expand_expr (call_expr, target, mode, EXPAND_NORMAL);
}
diff --git a/libgcc/config/i386/cpuinfo.c b/libgcc/config/i386/cpuinfo.c
index dab1d98060f..cf824b4114a 100644
index 50b6d8248a2..724ced402a1 100644
--- a/libgcc/config/i386/cpuinfo.c
+++ b/libgcc/config/i386/cpuinfo.c
@@ -63,7 +63,7 @@ __cpu_indicator_init (void)
@@ -52,3 +52,6 @@ index 8506a635790..564296f788e 100644
-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
@@ -1,30 +0,0 @@
From 717346fbbd6642ba6b0c3af2deb3771794346507 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 06e90973ef3..669e64236c3 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
@@ -1,7 +1,7 @@
From db28b1e0f3b06325026ec5b5e7cdca4e9992e05c Mon Sep 17 00:00:00 2001
From 6ed790bb2e5bf49d186885cad8fd7efc10d8fd36 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
Subject: [PATCH 13/33] nopie
---
gcc/configure | 27 +++++++++++++++++++++++++++
@@ -9,10 +9,10 @@ Subject: [PATCH] nopie
2 files changed, 40 insertions(+)
diff --git a/gcc/configure b/gcc/configure
index e9060112384..2f6b3265a6c 100755
index 8c46369f73f..e59cbee1767 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -32497,6 +32497,33 @@ fi
@@ -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"
@@ -47,10 +47,10 @@ index e9060112384..2f6b3265a6c 100755
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 75a7048045c..e683d3a7a5f 100644
index 5504bf6eb01..57268319de1 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -7681,6 +7681,19 @@ AC_CACHE_CHECK([for -no-pie option],
@@ -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"
@@ -70,3 +70,6 @@ index 75a7048045c..e683d3a7a5f 100644
fi
AC_SUBST([NO_PIE_FLAG])
--
2.41.0
@@ -1,14 +1,14 @@
From fd642f8cd61849a9dc169588be5562ceda96a889 Mon Sep 17 00:00:00 2001
From c7398885b5c2cd91a3ad1a56fde272b719d17ff5 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:59:16 +0000
Subject: [PATCH] ada: fix shared linking
Subject: [PATCH 14/33] 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 a7574efb472..0ad0d66463c 100644
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";
@@ -37,3 +37,6 @@ index a7574efb472..0ad0d66463c 100644
int __gnat_link_max = 8192;
unsigned char __gnat_objlist_file_supported = 1;
const char *__gnat_object_library_extension = ".a";
--
2.41.0
@@ -1,17 +1,17 @@
From a547632f5c7caec4a164e8d5e5b568fb7a461365 Mon Sep 17 00:00:00 2001
From c2861147eacede8c97dbb8d251f7d30ac2116481 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:59:43 +0000
Subject: [PATCH] build: fix CXXFLAGS_FOR_BUILD passing
Subject: [PATCH 15/33] build: fix CXXFLAGS_FOR_BUILD passing
---
Makefile.in | 1 +
1 file changed, 1 insertion(+)
diff --git a/Makefile.in b/Makefile.in
index 593495e1650..b96f60e33e2 100644
index 06a9398e172..6ff2b3f9925 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -176,6 +176,7 @@ BUILD_EXPORTS = \
@@ -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)" \
@@ -19,3 +19,6 @@ index 593495e1650..b96f60e33e2 100644
LDFLAGS="$(LDFLAGS_FOR_BUILD)"
# This is the list of directories to built for the host system.
--
2.41.0
@@ -1,21 +0,0 @@
From 686e85d8a05f9f9e6c983afb13f937bd88fe84dd Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Thu, 6 Jan 2022 03:18:32 +0000
Subject: [PATCH] dlang: use libucontext on mips64
---
libphobos/configure.tgt | 1 +
1 file changed, 1 insertion(+)
diff --git a/libphobos/configure.tgt b/libphobos/configure.tgt
index 0063dd23249..c5e782a1238 100644
--- a/libphobos/configure.tgt
+++ b/libphobos/configure.tgt
@@ -38,6 +38,7 @@ case "${target}" in
;;
mips*-*-linux*)
LIBPHOBOS_SUPPORTED=yes
+ LIBDRUNTIME_NEEDS_UCONTEXT=yes
;;
power*-*-freebsd*)
LIBPHOBOS_SUPPORTED=yes
@@ -1,17 +1,17 @@
From 5bd37f8ee93a0fe1a3f841f48ed6626e7e0aa19d Mon Sep 17 00:00:00 2001
From 736fd338aaa6d0686b15beabac687a20cfb29c27 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 07:01:06 +0000
Subject: [PATCH] add fortify-headers paths
Subject: [PATCH 16/33] 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 74f70793d90..61b07f319f6 100644
index e3aca79cccc..b3537b8fbeb 100644
--- a/gcc/config/linux.h
+++ b/gcc/config/linux.h
@@ -172,6 +172,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
@@ -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 \
@@ -20,3 +20,6 @@ index 74f70793d90..61b07f319f6 100644
{ NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \
{ NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 },
#else
--
2.41.0
@@ -1,11 +1,11 @@
From d2577dc78a1f159e5c41fd0b53e73fa0e264cb52 Mon Sep 17 00:00:00 2001
From f71fef0a3d527ba84faaf63cee2a5ecb2322412e 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] 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.
Subject: [PATCH 17/33] 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.
not seem to fully fix the crosstoolchain and bootstrap sequence wrt.
stack-protector flag usage.
---
@@ -13,10 +13,10 @@ Subject: [PATCH] Alpine musl package provides libssp_nonshared.a. We link to
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index cc99d0b7aa1..c60a75371f8 100644
index b5a6f200635..6cbb726599b 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -1004,8 +1004,7 @@ proper position among the other output files. */
@@ -991,8 +991,7 @@ proper position among the other output files. */
#ifndef LINK_SSP_SPEC
#ifdef TARGET_LIBC_PROVIDES_SSP
@@ -26,3 +26,6 @@ index cc99d0b7aa1..c60a75371f8 100644
#else
#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
"|fstack-protector-strong|fstack-protector-explicit" \
--
2.41.0
@@ -1,7 +1,7 @@
From bbd5c529ef878c2d6096fd4949616714eb82683a Mon Sep 17 00:00:00 2001
From 06624ddc7dfd4dcfb4e41f4549ffcacfbc43b315 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 07:03:42 +0000
Subject: [PATCH] DP: Use --push-state/--pop-state for gold as well when
Subject: [PATCH 18/33] DP: Use --push-state/--pop-state for gold as well when
linking libtsan.
---
@@ -9,10 +9,10 @@ Subject: [PATCH] DP: Use --push-state/--pop-state for gold as well when
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index c60a75371f8..735b2b1bba1 100644
index 6cbb726599b..59390fd39d6 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -745,10 +745,10 @@ proper position among the other output files. */
@@ -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 "}" \
@@ -25,7 +25,7 @@ index c60a75371f8..735b2b1bba1 100644
STATIC_LIBASAN_LIBS
#else
#define LIBASAN_SPEC "-lasan" STATIC_LIBASAN_LIBS
@@ -784,10 +784,10 @@ proper position among the other output files. */
@@ -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 "}" \
@@ -38,7 +38,7 @@ index c60a75371f8..735b2b1bba1 100644
STATIC_LIBTSAN_LIBS
#else
#define LIBTSAN_SPEC "-ltsan" STATIC_LIBTSAN_LIBS
@@ -805,10 +805,10 @@ proper position among the other output files. */
@@ -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 "}" \
@@ -51,7 +51,7 @@ index c60a75371f8..735b2b1bba1 100644
STATIC_LIBLSAN_LIBS
#else
#define LIBLSAN_SPEC "-llsan" STATIC_LIBLSAN_LIBS
@@ -824,10 +824,10 @@ proper position among the other output files. */
@@ -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 "}" \
@@ -64,3 +64,6 @@ index c60a75371f8..735b2b1bba1 100644
STATIC_LIBUBSAN_LIBS
#else
#define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS
--
2.41.0
@@ -1,7 +1,7 @@
From 8fc8d6c26a2a45945182e211bc3ac2eae4d6a11b Mon Sep 17 00:00:00 2001
From cbc762f2d4c8ae714f7a0c762d90453607a5c2e5 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Thu, 6 Jan 2022 03:12:55 +0000
Subject: [PATCH] aarch64: disable multilib support
Subject: [PATCH 19/33] aarch64: disable multilib support
multilib is unsupported on Alpine GCC
---
@@ -9,7 +9,7 @@ multilib is unsupported on Alpine GCC
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/config/aarch64/t-aarch64-linux b/gcc/config/aarch64/t-aarch64-linux
index d0cd546002a..b63a77f4969 100644
index 57bf4100fcd..172894b57ef 100644
--- a/gcc/config/aarch64/t-aarch64-linux
+++ b/gcc/config/aarch64/t-aarch64-linux
@@ -22,7 +22,7 @@ LIB1ASMSRC = aarch64/lib1funcs.asm
@@ -21,3 +21,6 @@ index d0cd546002a..b63a77f4969 100644
MULTIARCH_DIRNAME = $(call if_multiarch,aarch64$(AARCH_BE)-linux-gnu)
MULTILIB_OSDIRNAMES += mabi.ilp32=../libilp32$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu_ilp32)
--
2.41.0
@@ -1,7 +1,7 @@
From 65ad898df141261a1ccd891a99133ad8f9847133 Mon Sep 17 00:00:00 2001
From f820b730e48421ab03e5742dc06e83570690078e Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Thu, 6 Jan 2022 03:13:59 +0000
Subject: [PATCH] s390x: disable multilib support
Subject: [PATCH 20/33] s390x: disable multilib support
multilib is not supported on Alpine GCC at present
---
@@ -20,3 +20,6 @@ index cc6ab367072..7f498ee1cdc 100644
-MULTILIB_OSDIRNAMES += $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:s390-linux-gnu)
+MULTILIB_OSDIRNAMES = m64=../lib
+MULTILIB_OSDIRNAMES+= m32=../lib32
--
2.41.0
@@ -1,45 +0,0 @@
From 714ed6d9649bf9ed42e34fef9c41169921e63921 Mon Sep 17 00:00:00 2001
From: Nils Andreas Svee <me@lochnair.net>
Date: Thu, 21 Dec 2017 03:14:33 +0100
Subject: [PATCH] mips64: disable multilib support
multilib is not supported by Alpine GCC
---
gcc/config/mips/mips.h | 8 ++++----
gcc/config/mips/t-linux64 | 6 +++---
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h
index 858bbba3a36..2d4f553e652 100644
--- a/gcc/config/mips/mips.h
+++ b/gcc/config/mips/mips.h
@@ -3447,11 +3447,11 @@ struct GTY(()) machine_function {
/* If we are *not* using multilibs and the default ABI is not ABI_32 we
need to change these from /lib and /usr/lib. */
#if MIPS_ABI_DEFAULT == ABI_N32
-#define STANDARD_STARTFILE_PREFIX_1 "/lib32/"
-#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib32/"
+#define STANDARD_STARTFILE_PREFIX_1 "/lib/"
+#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/"
#elif MIPS_ABI_DEFAULT == ABI_64
-#define STANDARD_STARTFILE_PREFIX_1 "/lib64/"
-#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib64/"
+#define STANDARD_STARTFILE_PREFIX_1 "/lib/"
+#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/"
#endif
/* Load store bonding is not supported by micromips and fix_24k. The
diff --git a/gcc/config/mips/t-linux64 b/gcc/config/mips/t-linux64
index 2fdd8e00407..406a3676289 100644
--- a/gcc/config/mips/t-linux64
+++ b/gcc/config/mips/t-linux64
@@ -21,6 +21,6 @@ MULTILIB_DIRNAMES = n32 32 64
MIPS_EL = $(if $(filter %el, $(firstword $(subst -, ,$(target)))),el)
MIPS_SOFT = $(if $(strip $(filter MASK_SOFT_FLOAT_ABI, $(target_cpu_default)) $(filter soft, $(with_float))),soft)
MULTILIB_OSDIRNAMES = \
- ../lib32$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabin32$(MIPS_SOFT)) \
- ../lib$(call if_multiarch,:mips$(MIPS_EL)-linux-gnu$(MIPS_SOFT)) \
- ../lib64$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabi64$(MIPS_SOFT))
+ ../lib \
+ ../lib32 \
+ ../lib
@@ -1,7 +1,7 @@
From 3263d8634da6d7e1edb1bfd88e1b2627ce0aa1be Mon Sep 17 00:00:00 2001
From 40c3d28f4d090fcd3486ca2a88d0c7618fdb03ed Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Thu, 6 Jan 2022 03:14:33 +0000
Subject: [PATCH] ppc64[le]: disable multilib support
Subject: [PATCH 21/33] ppc64[le]: disable multilib support
multilib is not presently supported on Alpine GCC
---
@@ -36,7 +36,7 @@ index 4e371255533..128c75c7d39 100644
endif
diff --git a/gcc/config/rs6000/t-linux64 b/gcc/config/rs6000/t-linux64
index 47e0efd5764..f89729af64f 100644
index 01a94242308..b3a76379c03 100644
--- a/gcc/config/rs6000/t-linux64
+++ b/gcc/config/rs6000/t-linux64
@@ -28,8 +28,8 @@
@@ -76,3 +76,6 @@ index 2e63bdb9fc9..c6e1c5db65d 100644
+MULTILIB_OSDIRNAMES := m64=../lib
+MULTILIB_OSDIRNAMES += m32=../lib32
MULTILIB_MATCHES := ${MULTILIB_MATCHES_ENDIAN}
--
2.41.0
@@ -1,7 +1,7 @@
From bf63353ea679e0bbf2c2f17bb64c75ebd590c6e7 Mon Sep 17 00:00:00 2001
From 05cf20eb11b3013c2fbb26c841485f675811058c Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Thu, 6 Jan 2022 03:14:54 +0000
Subject: [PATCH] x86_64: disable multilib support
Subject: [PATCH 22/33] x86_64: disable multilib support
multilib is not presently supported on Alpine GCC
---
@@ -9,7 +9,7 @@ multilib is not presently supported on Alpine GCC
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gcc/config/i386/t-linux64 b/gcc/config/i386/t-linux64
index 5526ad0e6cc..78866afab36 100644
index 138956b0962..bc03dab874f 100644
--- a/gcc/config/i386/t-linux64
+++ b/gcc/config/i386/t-linux64
@@ -33,6 +33,6 @@
@@ -21,3 +21,6 @@ index 5526ad0e6cc..78866afab36 100644
+MULTILIB_OSDIRNAMES = m64=../lib
+MULTILIB_OSDIRNAMES+= m32=../lib32
MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-linux-gnux32)
--
2.41.0
@@ -1,7 +1,7 @@
From 2eed19787020ce52cf07b76a5d167c420ec42b61 Mon Sep 17 00:00:00 2001
From 0920d23e3a345bc17675b9bebc52644c238123e2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
Date: Mon, 3 Jan 2022 07:14:48 +0100
Subject: [PATCH] riscv: disable multilib support
Subject: [PATCH 23/33] riscv: disable multilib support
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -38,15 +38,15 @@ library.
[4]: https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/gcc.c;h=d4c8746b0aa322286decf92aa72a12f0a393b655;hb=HEAD#l9122
[5]: https://gitlab.alpinelinux.org/alpine/aports/-/issues/13369
---
gcc/config/riscv/linux.h | 6 ------
gcc/config/riscv/linux.h | 8 --------
gcc/config/riscv/t-linux | 7 +++++--
2 files changed, 5 insertions(+), 8 deletions(-)
2 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/gcc/config/riscv/linux.h b/gcc/config/riscv/linux.h
index 3067ed6eac8..4c8c85e3285 100644
index f8c2c351e5a..8d9881eadeb 100644
--- a/gcc/config/riscv/linux.h
+++ b/gcc/config/riscv/linux.h
@@ -71,9 +71,3 @@ along with GCC; see the file COPYING3. If not see
@@ -61,11 +61,3 @@ along with GCC; see the file COPYING3. If not see
%{static:-static}}"
#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
@@ -56,6 +56,8 @@ index 3067ed6eac8..4c8c85e3285 100644
- "/usr/lib" XLEN_SPEC "/" ABI_SPEC "/ " \
- "/lib/ " \
- "/usr/lib/ "
-
-#define RISCV_USE_CUSTOMISED_MULTI_LIB select_by_abi
diff --git a/gcc/config/riscv/t-linux b/gcc/config/riscv/t-linux
index 216d2776a18..1a8a863853e 100644
--- a/gcc/config/riscv/t-linux
@@ -69,3 +71,6 @@ index 216d2776a18..1a8a863853e 100644
+MULTILIB_DIRNAMES := $(patsubst rv32%,lib32,$(patsubst rv64%,lib,$(MULTILIB_DIRNAMES)))
MULTILIB_OSDIRNAMES := $(patsubst lib%,../lib%,$(MULTILIB_DIRNAMES))
+MULTILIB_MATCHES := march?rv64gc=march?rv64imafdc
--
2.41.0
@@ -1,7 +1,7 @@
From 51a35c0fa0e793c6a2c64ae1449c0cfd681d8f8a Mon Sep 17 00:00:00 2001
From 5c955776d65f5a018375652904b088a37203899d Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 07:05:41 +0000
Subject: [PATCH] always build libgcc_eh.a
Subject: [PATCH 24/33] always build libgcc_eh.a
highly inspired by:
http://landley.net/hg/aboriginal/file/7e0747a665ab/sources/patches/gcc-core-libgcceh.patch
@@ -10,10 +10,10 @@ highly inspired by:
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in
index 09b3ec8bc2e..c9ca58c64cc 100644
index 6c4dc79ab71..023cede18a7 100644
--- a/libgcc/Makefile.in
+++ b/libgcc/Makefile.in
@@ -957,8 +957,9 @@ ifneq ($(LIBUNWIND),)
@@ -960,8 +960,9 @@ ifneq ($(LIBUNWIND),)
all: libunwind.a
endif
@@ -24,7 +24,7 @@ index 09b3ec8bc2e..c9ca58c64cc 100644
ifneq ($(LIBUNWIND),)
all: libunwind$(SHLIB_EXT)
libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_EXT)
@@ -1160,10 +1161,6 @@ install-libunwind:
@@ -1163,10 +1164,6 @@ install-libunwind:
install-shared:
$(mkinstalldirs) $(DESTDIR)$(inst_libdir)
@@ -35,7 +35,7 @@ index 09b3ec8bc2e..c9ca58c64cc 100644
$(subst @multilib_dir@,$(MULTIDIR),$(subst \
@shlib_base_name@,libgcc_s,$(subst \
@shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL))))
@@ -1180,6 +1177,10 @@ ifeq ($(enable_gcov),yes)
@@ -1183,6 +1180,10 @@ ifeq ($(enable_gcov),yes)
$(RANLIB) $(DESTDIR)$(inst_libdir)/libgcov.a
endif
@@ -46,3 +46,6 @@ index 09b3ec8bc2e..c9ca58c64cc 100644
parts="$(INSTALL_PARTS)"; \
for file in $$parts; do \
rm -f $(DESTDIR)$(inst_libdir)/$$file; \
--
2.41.0
@@ -1,7 +1,7 @@
From 64a1c5f57e278869f41c43ee56cc5defb3dd55c5 Mon Sep 17 00:00:00 2001
From ac6202d063308fbf67e4b617b768536e66a44519 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 07:06:30 +0000
Subject: [PATCH] ada: libgnarl compatibility for musl
Subject: [PATCH 25/33] ada: libgnarl compatibility for musl
---
gcc/ada/libgnarl/s-osinte__linux.ads | 11 ------
@@ -9,7 +9,7 @@ Subject: [PATCH] ada: libgnarl compatibility for musl
2 files changed, 3 insertions(+), 61 deletions(-)
diff --git a/gcc/ada/libgnarl/s-osinte__linux.ads b/gcc/ada/libgnarl/s-osinte__linux.ads
index 7c9e7ca4518..caafc4aa68f 100644
index a5e645d334d..32165347071 100644
--- a/gcc/ada/libgnarl/s-osinte__linux.ads
+++ b/gcc/ada/libgnarl/s-osinte__linux.ads
@@ -403,12 +403,6 @@ package System.OS_Interface is
@@ -38,7 +38,7 @@ index 7c9e7ca4518..caafc4aa68f 100644
sched_priority : int; -- scheduling priority
end record;
diff --git a/gcc/ada/libgnarl/s-taprop__linux.adb b/gcc/ada/libgnarl/s-taprop__linux.adb
index 4ff784f0ea7..b34a12802c6 100644
index 821ceef30e4..ae95b58e01e 100644
--- a/gcc/ada/libgnarl/s-taprop__linux.adb
+++ b/gcc/ada/libgnarl/s-taprop__linux.adb
@@ -198,9 +198,6 @@ package body System.Task_Primitives.Operations is
@@ -130,3 +130,6 @@ index 4ff784f0ea7..b34a12802c6 100644
Result := pthread_rwlock_init (L.RW'Access, RWlock_Attr'Access);
pragma Assert (Result in 0 | ENOMEM);
--
2.41.0
@@ -1,7 +1,7 @@
From 82addb1312f4f58a412a664228944009aa5cb569 Mon Sep 17 00:00:00 2001
From b7404c39a6a76ebe382caa2b9da16006413b21b9 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 07:07:48 +0000
Subject: [PATCH] ada: musl support fixes
Subject: [PATCH 26/33] ada: musl support fixes
---
gcc/ada/Makefile.rtl | 10 +++++-----
@@ -11,10 +11,10 @@ Subject: [PATCH] ada: musl support fixes
4 files changed, 32 insertions(+), 30 deletions(-)
diff --git a/gcc/ada/Makefile.rtl b/gcc/ada/Makefile.rtl
index aaf853e3a2a..e2dd3587ed5 100644
index 96306f8cc9a..090b6770ae5 100644
--- a/gcc/ada/Makefile.rtl
+++ b/gcc/ada/Makefile.rtl
@@ -1633,7 +1633,7 @@ ifeq ($(strip $(filter-out %86 linux%,$(target_cpu) $(target_os))),)
@@ -1549,7 +1549,7 @@ ifeq ($(strip $(filter-out %86 linux%,$(target_cpu) $(target_os))),)
s-intman.adb<libgnarl/s-intman__posix.adb \
s-tpopsp.adb<libgnarl/s-tpopsp__tls.adb \
$(TRASYM_DWARF_UNIX_PAIRS) \
@@ -23,7 +23,7 @@ index aaf853e3a2a..e2dd3587ed5 100644
a-exetim.adb<libgnarl/a-exetim__posix.adb \
a-exetim.ads<libgnarl/a-exetim__default.ads \
s-linux.ads<libgnarl/s-linux.ads \
@@ -2258,7 +2258,7 @@ ifeq ($(strip $(filter-out powerpc% linux%,$(target_cpu) $(target_os))),)
@@ -2174,7 +2174,7 @@ ifeq ($(strip $(filter-out powerpc% linux%,$(target_cpu) $(target_os))),)
s-tasinf.adb<libgnarl/s-tasinf__linux.adb \
s-taspri.ads<libgnarl/s-taspri__posix.ads \
$(TRASYM_DWARF_UNIX_PAIRS) \
@@ -32,7 +32,7 @@ index aaf853e3a2a..e2dd3587ed5 100644
$(ATOMICS_TARGET_PAIRS) \
$(ATOMICS_BUILTINS_TARGET_PAIRS) \
system.ads<libgnat/system-linux-ppc.ads
@@ -2289,7 +2289,7 @@ ifeq ($(strip $(filter-out powerpc% linux%,$(target_cpu) $(target_os))),)
@@ -2205,7 +2205,7 @@ ifeq ($(strip $(filter-out powerpc% linux%,$(target_cpu) $(target_os))),)
endif
# ARM linux, GNU eabi
@@ -41,7 +41,7 @@ index aaf853e3a2a..e2dd3587ed5 100644
LIBGNAT_TARGET_PAIRS = \
a-intnam.ads<libgnarl/a-intnam__linux.ads \
s-inmaop.adb<libgnarl/s-inmaop__posix.adb \
@@ -2504,7 +2504,7 @@ ifeq ($(strip $(filter-out %ia64 linux%,$(target_cpu) $(target_os))),)
@@ -2420,7 +2420,7 @@ ifeq ($(strip $(filter-out %ia64 linux%,$(target_cpu) $(target_os))),)
s-tpopsp.adb<libgnarl/s-tpopsp__tls.adb \
s-taspri.ads<libgnarl/s-taspri__posix-noaltstack.ads \
$(TRASYM_DWARF_UNIX_PAIRS) \
@@ -50,7 +50,7 @@ index aaf853e3a2a..e2dd3587ed5 100644
$(ATOMICS_TARGET_PAIRS) \
$(ATOMICS_BUILTINS_TARGET_PAIRS) \
$(GNATRTL_128BIT_PAIRS) \
@@ -2608,7 +2608,7 @@ ifeq ($(strip $(filter-out %x86_64 linux%,$(target_cpu) $(target_os))),)
@@ -2524,7 +2524,7 @@ ifeq ($(strip $(filter-out %x86_64 linux%,$(target_cpu) $(target_os))),)
s-tpopsp.adb<libgnarl/s-tpopsp__tls.adb \
s-taspri.ads<libgnarl/s-taspri__posix.ads \
$(TRASYM_DWARF_UNIX_PAIRS) \
@@ -58,9 +58,9 @@ index aaf853e3a2a..e2dd3587ed5 100644
+ s-tsmona.adb<libgnat/s-tsmona.adb \
$(ATOMICS_TARGET_PAIRS) \
$(X86_64_TARGET_PAIRS) \
$(GNATRTL_128BIT_PAIRS) \
$(SIMD_PATH_TARGET_PAIRS) \
diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c
index 591d033fbca..a485cbf15b9 100644
index 8522094164e..92b230a462b 100644
--- a/gcc/ada/adaint.c
+++ b/gcc/ada/adaint.c
@@ -91,6 +91,11 @@
@@ -75,7 +75,7 @@ index 591d033fbca..a485cbf15b9 100644
#ifdef __PikeOS__
#define __BSD_VISIBLE 1
@@ -3446,7 +3451,6 @@ __gnat_lwp_self (void)
@@ -3438,7 +3443,6 @@ __gnat_lwp_self (void)
#endif
#if defined (__linux__)
@@ -83,7 +83,7 @@ index 591d033fbca..a485cbf15b9 100644
/* glibc versions earlier than 2.7 do not define the routines to handle
dynamically allocated CPU sets. For these targets, we use the static
@@ -3456,7 +3460,7 @@ __gnat_lwp_self (void)
@@ -3448,7 +3452,7 @@ __gnat_lwp_self (void)
/* Dynamic cpu sets */
@@ -92,7 +92,7 @@ index 591d033fbca..a485cbf15b9 100644
__gnat_cpu_alloc (size_t count)
{
return CPU_ALLOC (count);
@@ -3469,33 +3473,33 @@ __gnat_cpu_alloc_size (size_t count)
@@ -3461,33 +3465,33 @@ __gnat_cpu_alloc_size (size_t count)
}
void
@@ -134,7 +134,7 @@ index 591d033fbca..a485cbf15b9 100644
}
size_t
@@ -3505,23 +3509,23 @@ __gnat_cpu_alloc_size (size_t count ATTRIBUTE_UNUSED)
@@ -3497,23 +3501,23 @@ __gnat_cpu_alloc_size (size_t count ATTRIBUTE_UNUSED)
}
void
@@ -164,10 +164,10 @@ index 591d033fbca..a485cbf15b9 100644
#endif /* !CPU_ALLOC */
#endif /* __linux__ */
diff --git a/gcc/ada/adaint.h b/gcc/ada/adaint.h
index 2631be5ad3e..d442f4bd6cd 100644
index 987432c9307..4d782f07de9 100644
--- a/gcc/ada/adaint.h
+++ b/gcc/ada/adaint.h
@@ -321,13 +321,11 @@ extern void *__gnat_lwp_self (void);
@@ -319,13 +319,11 @@ extern void *__gnat_lwp_self (void);
/* Routines for interface to required CPU set primitives */
@@ -186,10 +186,10 @@ index 2631be5ad3e..d442f4bd6cd 100644
#if defined (_WIN32)
diff --git a/gcc/ada/terminals.c b/gcc/ada/terminals.c
index 32d30a49c7e..d960e32e2d0 100644
index c0ee4a16bb1..ed796a48c1b 100644
--- a/gcc/ada/terminals.c
+++ b/gcc/ada/terminals.c
@@ -1132,7 +1132,7 @@ __gnat_setup_winsize (void *desc ATTRIBUTE_UNUSED,
@@ -1127,7 +1127,7 @@ __gnat_setup_winsize (void *desc ATTRIBUTE_UNUSED,
/* POSIX does not specify how to open the master side of a terminal.Several
methods are available (system specific):
1- using a cloning device (USE_CLONE_DEVICE)
@@ -198,7 +198,7 @@ index 32d30a49c7e..d960e32e2d0 100644
3- openpty (USE_OPENPTY)
When using the cloning device method, the macro USE_CLONE_DEVICE should
@@ -1146,7 +1146,7 @@ __gnat_setup_winsize (void *desc ATTRIBUTE_UNUSED,
@@ -1141,7 +1141,7 @@ __gnat_setup_winsize (void *desc ATTRIBUTE_UNUSED,
#if defined (__APPLE__) || defined (BSD)
#define USE_OPENPTY
#elif defined (__linux__)
@@ -207,7 +207,7 @@ index 32d30a49c7e..d960e32e2d0 100644
#elif defined (__sun__)
#define USE_CLONE_DEVICE "/dev/ptmx"
#elif defined (_AIX)
@@ -1195,8 +1195,8 @@ allocate_pty_desc (pty_desc **desc) {
@@ -1190,8 +1190,8 @@ allocate_pty_desc (pty_desc **desc) {
int master_fd = -1;
char *slave_name = NULL;
@@ -218,3 +218,6 @@ index 32d30a49c7e..d960e32e2d0 100644
#elif defined (USE_OPENPTY)
status = openpty (&master_fd, &slave_fd, NULL, NULL, NULL);
#elif defined (USE_CLONE_DEVICE)
--
2.41.0
@@ -1,7 +1,7 @@
From 573a66e4146c9a65d895af9081a4d3d49cfc9e7a Mon Sep 17 00:00:00 2001
From 401ac3feeea049a8035bf916f550ce6f4e859cba Mon Sep 17 00:00:00 2001
From: Drew DeVault <sir@cmpwn.com>
Date: Wed, 9 Dec 2020 16:07:26 +0000
Subject: [PATCH] configure: Add --enable-autolink-libatomic, use in
Date: Wed, 9 Dec 2020 07:42:06 +0000
Subject: [PATCH 27/33] configure: Add --enable-autolink-libatomic, use in
LINK_GCC_C_SEQUENCE_SPEC [PR81358]
This fixes issues with RISC-V.
@@ -9,19 +9,19 @@ This fixes issues with RISC-V.
Makefile.in | 1 +
gcc/config.in | 6 ++++++
gcc/config/gnu-user.h | 12 +++++++++++-
gcc/configure | 32 ++++++++++++++++++++++++++++++--
gcc/configure.ac | 22 +++++++++++++++++++++-
gcc/configure | 31 ++++++++++++++++++++++++++++++-
gcc/configure.ac | 21 +++++++++++++++++++++
gcc/doc/install.texi | 8 ++++++++
gcc/doc/tm.texi | 8 +++++++-
gcc/doc/tm.texi.in | 8 +++++++-
gcc/gcc.cc | 12 +++++++++++-
9 files changed, 102 insertions(+), 7 deletions(-)
9 files changed, 102 insertions(+), 5 deletions(-)
diff --git a/Makefile.in b/Makefile.in
index b564ddbf792..a95c7407d16 100644
index 6ff2b3f9925..394b105b271 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -232,6 +232,7 @@ HOST_EXPORTS = \
@@ -235,6 +235,7 @@ HOST_EXPORTS = \
RANLIB_FOR_TARGET="$(RANLIB_FOR_TARGET)"; export RANLIB_FOR_TARGET; \
READELF_FOR_TARGET="$(READELF_FOR_TARGET)"; export READELF_FOR_TARGET; \
TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \
@@ -30,7 +30,7 @@ index b564ddbf792..a95c7407d16 100644
GMPLIBS="$(HOST_GMPLIBS)"; export GMPLIBS; \
GMPINC="$(HOST_GMPINC)"; export GMPINC; \
diff --git a/gcc/config.in b/gcc/config.in
index f0fbf123aa8..af84efc4f9e 100644
index 0679fbbf4c6..ee81139b385 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -118,6 +118,12 @@
@@ -47,7 +47,7 @@ index f0fbf123aa8..af84efc4f9e 100644
format instead of DPD */
#ifndef USED_FOR_TARGET
diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h
index 8433e56c3e1..0347f10da8b 100644
index b26b17f2f2a..3f64ea46180 100644
--- a/gcc/config/gnu-user.h
+++ b/gcc/config/gnu-user.h
@@ -109,8 +109,18 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
@@ -71,10 +71,10 @@ index 8433e56c3e1..0347f10da8b 100644
#undef LINK_GCC_C_SEQUENCE_SPEC
diff --git a/gcc/configure b/gcc/configure
index 2f6b3265a6c..6dc65bf4ccb 100755
index e59cbee1767..787c35d4e25 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -981,6 +981,7 @@ with_changes_root_url
@@ -984,6 +984,7 @@ with_changes_root_url
enable_languages
with_multilib_list
with_multilib_generator
@@ -82,7 +82,7 @@ index 2f6b3265a6c..6dc65bf4ccb 100755
with_zstd
with_zstd_include
with_zstd_lib
@@ -1710,6 +1711,9 @@ Optional Features:
@@ -1713,6 +1714,9 @@ Optional Features:
--disable-shared don't provide a shared libgcc
--disable-gcov don't provide libgcov and related host tools
--enable-languages=LIST specify which front-ends to build
@@ -92,7 +92,7 @@ index 2f6b3265a6c..6dc65bf4ccb 100755
--disable-rpath do not hardcode runtime library paths
--enable-sjlj-exceptions
arrange to use setjmp/longjmp exception handling
@@ -8324,7 +8328,6 @@ else
@@ -8329,7 +8333,6 @@ else
fi
@@ -100,7 +100,7 @@ index 2f6b3265a6c..6dc65bf4ccb 100755
# Check whether --with-multilib-generator was given.
if test "${with_multilib_generator+set}" = set; then :
withval=$with_multilib_generator; :
@@ -8332,6 +8335,32 @@ else
@@ -8337,6 +8340,32 @@ else
with_multilib_generator=default
fi
@@ -133,16 +133,11 @@ index 2f6b3265a6c..6dc65bf4ccb 100755
# -------------------------
# Checks for other programs
@@ -34296,4 +34325,3 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
fi
-
diff --git a/gcc/configure.ac b/gcc/configure.ac
index e683d3a7a5f..07c81c78336 100644
index 57268319de1..56bcaa87620 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -1205,6 +1205,27 @@ AC_ARG_WITH(multilib-generator,
@@ -1199,6 +1199,27 @@ AC_ARG_WITH(multilib-generator,
:,
with_multilib_generator=default)
@@ -170,16 +165,11 @@ index e683d3a7a5f..07c81c78336 100644
# -------------------------
# Checks for other programs
# -------------------------
@@ -7839,4 +7860,3 @@ done
],
[subdirs='$subdirs'])
AC_OUTPUT
-
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index 48408d842db..c90be0ee750 100644
index 928fc6b6d4b..81a677014df 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -2295,6 +2295,14 @@ files, but these changed header paths may conflict with some compilation
@@ -2374,6 +2374,14 @@ files, but these changed header paths may conflict with some compilation
environments. Enabled by default, and may be disabled using
@option{--disable-canonical-system-headers}.
@@ -195,7 +185,7 @@ index 48408d842db..c90be0ee750 100644
Tell GCC that when the GNU C Library (glibc) is used on the target it
will be version @var{major}.@var{minor} or later. Normally this can
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index c5006afc00d..56b62c69ae8 100644
index a660e33739b..6183c407a2b 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -381,7 +381,13 @@ the argument @option{-lgcc} to tell the linker to do the search.
@@ -214,7 +204,7 @@ index c5006afc00d..56b62c69ae8 100644
@defmac POST_LINK_SPEC
diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in
index f869ddd5e5b..57c93f24ac3 100644
index f7ab5d48a63..281540aba68 100644
--- a/gcc/doc/tm.texi.in
+++ b/gcc/doc/tm.texi.in
@@ -381,7 +381,13 @@ the argument @option{-lgcc} to tell the linker to do the search.
@@ -233,10 +223,10 @@ index f869ddd5e5b..57c93f24ac3 100644
@defmac POST_LINK_SPEC
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index 735b2b1bba1..f10f3c91aa7 100644
index 59390fd39d6..dae1dd4cf79 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -987,13 +987,23 @@ proper position among the other output files. */
@@ -974,13 +974,23 @@ proper position among the other output files. */
# define ASM_DEBUG_OPTION_SPEC ""
#endif
@@ -261,3 +251,6 @@ index 735b2b1bba1..f10f3c91aa7 100644
#endif
#ifdef ENABLE_DEFAULT_SSP
--
2.41.0
@@ -1,8 +1,8 @@
From 4baaeb9661fa4015d9701e3616ce1ad4e8a07fd8 Mon Sep 17 00:00:00 2001
From cd46156af13743fe93c48d00b0661add2c319226 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
Date: Sun, 29 Aug 2021 09:45:27 +0200
Subject: [PATCH] configure: fix detection of atomic builtins in libatomic
configure script
Date: Sun, 29 Aug 2021 12:23:34 +0200
Subject: [PATCH 28/33] configure: fix detection of atomic builtins in
libatomic configure script
Alpine's --enable-autolink-libatomic (which is enabled for riscv64 by
default) causes the libatomic configure script to incorrectly detect
@@ -22,7 +22,7 @@ See:
1 file changed, 20 insertions(+)
diff --git a/libatomic/configure.tgt b/libatomic/configure.tgt
index 33f8c91ce77..3999db2cf8a 100644
index a92ae9e8309..90b579ca4d8 100644
--- a/libatomic/configure.tgt
+++ b/libatomic/configure.tgt
@@ -30,6 +30,26 @@
@@ -52,3 +52,6 @@ index 33f8c91ce77..3999db2cf8a 100644
case "${target_cpu}" in
alpha*)
# fenv.c needs this option to generate inexact exceptions.
--
2.41.0
@@ -1,15 +1,15 @@
From 20c84de53efcb86993f1a1909e65a97240d6123e Mon Sep 17 00:00:00 2001
From f0f2cad36cd4796426ce1c25a6cec7c70a56741e Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Thu, 30 Jun 2022 17:08:36 +0000
Subject: [PATCH] libstdc++: do not throw exceptions for non-C locales on musl
targets
Date: Thu, 30 Jun 2022 16:44:51 +0000
Subject: [PATCH 29/33] libstdc++: do not throw exceptions for non-C locales on
musl targets
---
libstdc++-v3/config/locale/generic/c_locale.cc | 3 ---
1 file changed, 3 deletions(-)
diff --git a/libstdc++-v3/config/locale/generic/c_locale.cc b/libstdc++-v3/config/locale/generic/c_locale.cc
index 1e4db8d4415..9b79bc3c5dd 100644
index 8849d78fdfa..aff467f98fe 100644
--- a/libstdc++-v3/config/locale/generic/c_locale.cc
+++ b/libstdc++-v3/config/locale/generic/c_locale.cc
@@ -242,9 +242,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
@@ -22,3 +22,6 @@ index 1e4db8d4415..9b79bc3c5dd 100644
}
void
--
2.41.0
@@ -1,7 +1,8 @@
From b6554d1207d0f5771c2f5d11316b61787e4dd705 Mon Sep 17 00:00:00 2001
From b474c9688ebda225ced95ecea0219312110d9c9e Mon Sep 17 00:00:00 2001
From: Mathias LANG <pro.mathias.lang@gmail.com>
Date: Mon, 17 Jan 2022 16:31:09 +0000
Subject: [PATCH] gdc: unconditionally link libgphobos against libucontext
Date: Mon, 17 Jan 2022 03:49:21 +0000
Subject: [PATCH 30/33] gdc: unconditionally link libgphobos against
libucontext
ref: alpine/aports#13422
---
@@ -9,10 +10,10 @@ ref: alpine/aports#13422
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile.in b/Makefile.in
index a95c7407d16..ea942d60387 100644
index 394b105b271..bc4a77fc300 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -53287,7 +53287,7 @@ configure-target-libphobos:
@@ -52809,7 +52809,7 @@ configure-target-libphobos:
esac; \
module_srcdir=libphobos; \
rm -f no-such-file || : ; \
@@ -21,3 +22,6 @@ index a95c7407d16..ea942d60387 100644
$$s/$$module_srcdir/configure \
--srcdir=$${topdir}/$$module_srcdir \
$(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \
--
2.41.0
@@ -1,7 +1,7 @@
From 39f5c9a850917a3c19630c0115ef0d5b0f151c72 Mon Sep 17 00:00:00 2001
From 6598811df64744ba862e36a6dca88578b01dd46e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
Date: Sat, 16 Jul 2022 13:26:49 +0200
Subject: [PATCH] druntime: link against libucontext on all platforms
Date: Sat, 16 Jul 2022 09:21:11 +0200
Subject: [PATCH 31/33] druntime: link against libucontext on all platforms
On musl-based Linux distributions, swapcontext etc. are not provided by
musl but instead by libucontext. Hence, we _always_ need to link against
@@ -12,10 +12,10 @@ an external library for these functions.
2 files changed, 16 deletions(-)
diff --git a/libphobos/configure b/libphobos/configure
index 9da06f087d0..0db0acfb9c2 100755
index 925c53c5f5e..60c2a0c11c6 100755
--- a/libphobos/configure
+++ b/libphobos/configure
@@ -15192,14 +15192,6 @@ fi
@@ -15216,14 +15216,6 @@ fi
# Keep this in sync with core/thread.d, set druntime_fiber_asm_external to
# "yes" for targets that have 'version = AsmExternal'.
druntime_fiber_asm_external=no
@@ -49,3 +49,6 @@ index 45a56f6f76a..fef6e890b1e 100644
if test "$druntime_fiber_asm_external" = no; then
AC_SEARCH_LIBS([swapcontext], [c ucontext], [],
AC_MSG_ERROR([swapcontext required but not found]))
--
2.41.0
@@ -1,14 +1,14 @@
From 4b28b8356c7ecf9375a2c07ac6be226a5693f8d2 Mon Sep 17 00:00:00 2001
From 4e84b0a3c019438b25de7c1e844746e4bc83af42 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
Date: Tue, 19 Jul 2022 01:05:11 +0200
Subject: [PATCH] libgnat: time_t is always 64-bit on musl libc
Date: Tue, 19 Jul 2022 14:54:07 +0200
Subject: [PATCH 32/33] libgnat: time_t is always 64-bit on musl libc
---
gcc/ada/libgnat/s-parame.ads | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/ada/libgnat/s-parame.ads b/gcc/ada/libgnat/s-parame.ads
index 4b8111402ba..b670e78c53b 100644
index 3d6e345a1ba..cfe0b4d3ca6 100644
--- a/gcc/ada/libgnat/s-parame.ads
+++ b/gcc/ada/libgnat/s-parame.ads
@@ -102,7 +102,7 @@ package System.Parameters is
@@ -20,3 +20,6 @@ index 4b8111402ba..b670e78c53b 100644
-- Number of bits in type time_t
----------------------------------------------
--
2.41.0
@@ -1,101 +0,0 @@
From ecc2a2e70e44fa76a75b12d0893bc1702b72a1b4 Mon Sep 17 00:00:00 2001
From: Ian Lance Taylor <iant@golang.org>
Date: Mon, 19 Dec 2022 10:37:06 -0800
Subject: [PATCH] libgo: check for makecontext in -lucontext
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Patch from Sören Tempel.
Change-Id: I74b4052cc7aca19224afd6d9a2739c3fae46b722
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/458396
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
---
libgo/configure | 57 ++++++++++++++++++++++++++++++++++++++++++++++
libgo/configure.ac | 3 +++
2 files changed, 60 insertions(+)
diff --git a/libgo/configure b/libgo/configure
index 460fdad7..a607dbff 100755
--- a/libgo/configure
+++ b/libgo/configure
@@ -14818,6 +14818,63 @@ fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing makecontext" >&5
+$as_echo_n "checking for library containing makecontext... " >&6; }
+if ${ac_cv_search_makecontext+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char makecontext ();
+int
+main ()
+{
+return makecontext ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' ucontext; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_makecontext=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_makecontext+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_makecontext+:} false; then :
+
+else
+ ac_cv_search_makecontext=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_makecontext" >&5
+$as_echo "$ac_cv_search_makecontext" >&6; }
+ac_res=$ac_cv_search_makecontext
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sched_yield" >&5
$as_echo_n "checking for library containing sched_yield... " >&6; }
if ${ac_cv_search_sched_yield+:} false; then :
diff --git a/libgo/configure.ac b/libgo/configure.ac
index 09554a37..a59aa091 100644
--- a/libgo/configure.ac
+++ b/libgo/configure.ac
@@ -570,6 +570,9 @@ PTHREAD_LIBS=
AC_CHECK_LIB([pthread], [pthread_create], PTHREAD_LIBS=-lpthread)
AC_SUBST(PTHREAD_LIBS)
+dnl Test if -lucontext is required for makecontext.
+AC_SEARCH_LIBS([makecontext], [ucontext])
+
dnl Test if -lrt is required for sched_yield or nanosleep or clock_gettime.
AC_SEARCH_LIBS([sched_yield], [rt])
AC_SEARCH_LIBS([nanosleep], [rt])
@@ -0,0 +1,30 @@
From 4cf06fff68090b1681d070a55214f2ab26754edf Mon Sep 17 00:00:00 2001
From: psykose <alice@ayaya.dev>
Date: Mon, 29 May 2023 15:33:11 +0000
Subject: [PATCH 33/33] libphobos: do not use LFS64 symbols
musl does not have these since 1.2.4, we can't use the compat interfaces.
---
libphobos/libdruntime/core/sys/posix/sys/mman.d | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/libphobos/libdruntime/core/sys/posix/sys/mman.d b/libphobos/libdruntime/core/sys/posix/sys/mman.d
index 0d3d517d69a..323aa0af72d 100644
--- a/libphobos/libdruntime/core/sys/posix/sys/mman.d
+++ b/libphobos/libdruntime/core/sys/posix/sys/mman.d
@@ -293,11 +293,7 @@ else version (CRuntime_Bionic)
}
else version (CRuntime_Musl)
{
- static if (__USE_LARGEFILE64) void* mmap64(void*, size_t, int, int, int, off_t);
- static if (__USE_FILE_OFFSET64)
- alias mmap = mmap64;
- else
- void* mmap(void*, size_t, int, int, int, off_t);
+ void* mmap(void*, size_t, int, int, int, off_t);
int munmap(void*, size_t);
}
else version (CRuntime_UClibc)
--
2.41.0
@@ -1,204 +0,0 @@
From b3840bdcc0eee2a4d099a9af52199944ade7acb9 Mon Sep 17 00:00:00 2001
From: Ian Lance Taylor <iant@golang.org>
Date: Tue, 29 Nov 2022 17:28:44 -0800
Subject: [PATCH] syscall, runtime: always call XSI strerror_r
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This does the right thing for either glibc or musl on GNU/Linux.
Based on patch by Sören Tempel.
Change-Id: If2969e131f0fae456d58b35d839d8abe191fcc59
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/454176
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Bypass: Ian Lance Taylor <iant@google.com>
---
libgo/Makefile.am | 1 +
libgo/Makefile.in | 6 +++++-
libgo/go/syscall/errstr.go | 22 ++++++++-----------
libgo/go/syscall/errstr_glibc.go | 33 ----------------------------
libgo/runtime/go-strerror.c | 37 ++++++++++++++++++++++++++++++++
5 files changed, 52 insertions(+), 47 deletions(-)
delete mode 100644 libgo/go/syscall/errstr_glibc.go
create mode 100644 libgo/runtime/go-strerror.c
diff --git a/libgo/Makefile.am b/libgo/Makefile.am
index e0a1eec5..df568743 100644
--- a/libgo/Makefile.am
+++ b/libgo/Makefile.am
@@ -465,6 +465,7 @@ runtime_files = \
runtime/go-nanotime.c \
runtime/go-now.c \
runtime/go-nosys.c \
+ runtime/go-strerror.c \
runtime/go-reflect-call.c \
runtime/go-setenv.c \
runtime/go-signal.c \
diff --git a/libgo/Makefile.in b/libgo/Makefile.in
index 7bef5df9..f2f3f0fc 100644
--- a/libgo/Makefile.in
+++ b/libgo/Makefile.in
@@ -247,7 +247,7 @@ am__objects_4 = runtime/aeshash.lo runtime/go-assert.lo \
runtime/go-fieldtrack.lo runtime/go-matherr.lo \
runtime/go-memclr.lo runtime/go-memmove.lo \
runtime/go-memequal.lo runtime/go-nanotime.lo \
- runtime/go-now.lo runtime/go-nosys.lo \
+ runtime/go-now.lo runtime/go-nosys.lo runtime/go-strerror.lo \
runtime/go-reflect-call.lo runtime/go-setenv.lo \
runtime/go-signal.lo runtime/go-unsafe-pointer.lo \
runtime/go-unsetenv.lo runtime/go-unwind.lo \
@@ -917,6 +917,7 @@ runtime_files = \
runtime/go-nanotime.c \
runtime/go-now.c \
runtime/go-nosys.c \
+ runtime/go-strerror.c \
runtime/go-reflect-call.c \
runtime/go-setenv.c \
runtime/go-signal.c \
@@ -1390,6 +1391,8 @@ runtime/go-now.lo: runtime/$(am__dirstamp) \
runtime/$(DEPDIR)/$(am__dirstamp)
runtime/go-nosys.lo: runtime/$(am__dirstamp) \
runtime/$(DEPDIR)/$(am__dirstamp)
+runtime/go-strerror.lo: runtime/$(am__dirstamp) \
+ runtime/$(DEPDIR)/$(am__dirstamp)
runtime/go-reflect-call.lo: runtime/$(am__dirstamp) \
runtime/$(DEPDIR)/$(am__dirstamp)
runtime/go-setenv.lo: runtime/$(am__dirstamp) \
@@ -1457,6 +1460,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@runtime/$(DEPDIR)/go-reflect-call.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@runtime/$(DEPDIR)/go-setenv.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@runtime/$(DEPDIR)/go-signal.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@runtime/$(DEPDIR)/go-strerror.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@runtime/$(DEPDIR)/go-unsafe-pointer.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@runtime/$(DEPDIR)/go-unsetenv.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@runtime/$(DEPDIR)/go-unwind.Plo@am__quote@
diff --git a/libgo/go/syscall/errstr.go b/libgo/go/syscall/errstr.go
index 6c2441d3..9f688e2a 100644
--- a/libgo/go/syscall/errstr.go
+++ b/libgo/go/syscall/errstr.go
@@ -4,23 +4,19 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build !hurd
-// +build !linux
-
package syscall
-//sysnb strerror_r(errnum int, buf []byte) (err Errno)
-//strerror_r(errnum _C_int, buf *byte, buflen Size_t) _C_int
+import "internal/bytealg"
+
+//extern go_strerror
+func go_strerror(_C_int, *byte, Size_t) _C_int
func Errstr(errnum int) string {
- for len := 128; ; len *= 2 {
- b := make([]byte, len)
- errno := strerror_r(errnum, b)
+ for size := 128; ; size *= 2 {
+ b := make([]byte, size)
+ errno := go_strerror(_C_int(errnum), &b[0], Size_t(len(b)))
if errno == 0 {
- i := 0
- for b[i] != 0 {
- i++
- }
+ i := bytealg.IndexByte(b, 0)
// Lowercase first letter: Bad -> bad, but
// STREAM -> STREAM.
if i > 1 && 'A' <= b[0] && b[0] <= 'Z' && 'a' <= b[1] && b[1] <= 'z' {
@@ -29,7 +25,7 @@ func Errstr(errnum int) string {
return string(b[:i])
}
if errno != ERANGE {
- return "errstr failure"
+ return "strerror_r failure"
}
}
}
diff --git a/libgo/go/syscall/errstr_glibc.go b/libgo/go/syscall/errstr_glibc.go
deleted file mode 100644
index 5b19e6f2..00000000
--- a/libgo/go/syscall/errstr_glibc.go
+++ /dev/null
@@ -1,33 +0,0 @@
-// errstr_glibc.go -- GNU/Linux and GNU/Hurd specific error strings.
-
-// Copyright 2010 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// We use this rather than errstr.go because on GNU/Linux sterror_r
-// returns a pointer to the error message, and may not use buf at all.
-
-// +build hurd linux
-
-package syscall
-
-import "unsafe"
-
-//sysnb strerror_r(errnum int, b []byte) (errstr *byte)
-//strerror_r(errnum _C_int, b *byte, len Size_t) *byte
-
-func Errstr(errnum int) string {
- a := make([]byte, 128)
- p := strerror_r(errnum, a)
- b := (*[1000]byte)(unsafe.Pointer(p))
- i := 0
- for b[i] != 0 {
- i++
- }
- // Lowercase first letter: Bad -> bad, but STREAM -> STREAM.
- if i > 1 && 'A' <= b[0] && b[0] <= 'Z' && 'a' <= b[1] && b[1] <= 'z' {
- c := b[0] + 'a' - 'A'
- return string(c) + string(b[1:i])
- }
- return string(b[:i])
-}
diff --git a/libgo/runtime/go-strerror.c b/libgo/runtime/go-strerror.c
new file mode 100644
index 00000000..13d1d91d
--- /dev/null
+++ b/libgo/runtime/go-strerror.c
@@ -0,0 +1,37 @@
+/* go-strerror.c -- wrapper around XSI-compliant strerror_r.
+
+ Copyright 2022 The Go Authors. All rights reserved.
+ Use of this source code is governed by a BSD-style
+ license that can be found in the LICENSE file. */
+
+/* There are two version of strerror_r on GNU/Linux: a GNU-specific
+ and an XSI-compliant version. The former version is only available
+ on glibc. Since glibc 2.13, the XSI-compliant version is also
+ provided by glibc if _GNU_SOURCE is not defined. Since the
+ entirety of gofrontend is compiled with _GNU_SOURCE, this file
+ exists to selectively undefine it and provides an alias to the
+ XSI-compliant version of strerror_r(3). */
+
+#ifdef __linux__
+
+/* Force selection of XSI-compliant strerror_r by glibc. */
+#undef XOPEN_SOURCE
+#define XOPEN_SOURCE 600
+#undef _POSIX_C_SOURCE
+#define _POSIX_C_SOURCE 200112L
+#undef _GNU_SOURCE
+
+#endif /* __linux__ */
+
+#include <string.h>
+
+#ifndef HAVE_STRERROR_R
+// Provided by go-nosys.c if not provided by libc itself.
+extern int strerror_r (int, char *, size_t);
+#endif
+
+int
+go_strerror (int errnum, char *buf, size_t buflen)
+{
+ return strerror_r (errnum, buf, buflen);
+}
@@ -1,199 +0,0 @@
From 3b9243b891cc06373639a23ed5717b0d1c2d8ea6 Mon Sep 17 00:00:00 2001
From: Ian Lance Taylor <iant@golang.org>
Date: Tue, 14 Jun 2022 06:13:43 -0700
Subject: [PATCH] libgo: permit loff_t and off_t to be macros
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
They are macros in musl libc, rather than typedefs, and -fgo-dump-spec
doesn't handle that case.
Based on patch by Sören Tempel.
Change-Id: Ic9a608fd964a6f78e754aa8e3100aff06ab3dade
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/412075
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
libgo: #include <sys/types.h> when checking for loff_t
Fixes https://gcc.gnu.org/PR106033
Fixes golang/go#53469
Change-Id: I060021b7bb9334949b567442448abb6822fd6d35
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/413214
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
---
libgo/config.h.in | 3 +++
libgo/configure | 12 ++++++++++--
libgo/configure.ac | 11 +++++++++--
libgo/go/syscall/libcall_linux.go | 17 +++++++++--------
libgo/mksysinfo.sh | 6 +-----
libgo/sysinfo.c | 15 ++++++++++++++-
6 files changed, 46 insertions(+), 18 deletions(-)
diff --git a/libgo/config.h.in b/libgo/config.h.in
index 25b8ab8f9ee..2c3c7469675 100644
--- a/libgo/config.h.in
+++ b/libgo/config.h.in
@@ -70,6 +70,9 @@
/* Define to 1 if you have the `fchownat' function. */
#undef HAVE_FCHOWNAT
+/* Define to 1 if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
+
/* Define to 1 if you have the `futimesat' function. */
#undef HAVE_FUTIMESAT
diff --git a/libgo/configure b/libgo/configure
index ffe17c9be55..61a49947eb9 100755
--- a/libgo/configure
+++ b/libgo/configure
@@ -15249,7 +15249,7 @@ $as_echo "#define HAVE_GETIPINFO 1" >>confdefs.h
fi
-for ac_header in port.h sched.h semaphore.h sys/file.h sys/mman.h syscall.h sys/epoll.h sys/event.h sys/inotify.h sys/ptrace.h sys/syscall.h sys/sysctl.h sys/user.h sys/utsname.h sys/select.h sys/socket.h net/bpf.h net/if.h net/if_arp.h net/route.h netpacket/packet.h sys/prctl.h sys/mount.h sys/vfs.h sys/statfs.h sys/timex.h sys/sysinfo.h utime.h linux/ether.h linux/fs.h linux/ptrace.h linux/reboot.h netinet/in_syst.h netinet/ip.h netinet/ip_mroute.h netinet/if_ether.h lwp.h
+for ac_header in fcntl.h port.h sched.h semaphore.h sys/file.h sys/mman.h syscall.h sys/epoll.h sys/event.h sys/inotify.h sys/ptrace.h sys/syscall.h sys/sysctl.h sys/user.h sys/utsname.h sys/select.h sys/socket.h net/bpf.h net/if.h net/if_arp.h net/route.h netpacket/packet.h sys/prctl.h sys/mount.h sys/vfs.h sys/statfs.h sys/timex.h sys/sysinfo.h utime.h linux/ether.h linux/fs.h linux/ptrace.h linux/reboot.h netinet/in_syst.h netinet/ip.h netinet/ip_mroute.h netinet/if_ether.h lwp.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -15546,7 +15546,14 @@ _ACEOF
fi
-ac_fn_c_check_type "$LINENO" "loff_t" "ac_cv_type_loff_t" "$ac_includes_default"
+
+CFLAGS_hold="$CFLAGS"
+CFLAGS="$OSCFLAGS $CFLAGS"
+ac_fn_c_check_type "$LINENO" "loff_t" "ac_cv_type_loff_t" "
+#include <sys/types.h>
+#include <fcntl.h>
+
+"
if test "x$ac_cv_type_loff_t" = xyes; then :
cat >>confdefs.h <<_ACEOF
@@ -15556,6 +15563,7 @@ _ACEOF
fi
+CFLAGS="$CFLAGS_hold"
LIBS_hold="$LIBS"
LIBS="$LIBS -lm"
diff --git a/libgo/configure.ac b/libgo/configure.ac
index 7e2b98ba67c..274fcfc35c7 100644
--- a/libgo/configure.ac
+++ b/libgo/configure.ac
@@ -579,7 +579,7 @@ AC_C_BIGENDIAN
GCC_CHECK_UNWIND_GETIPINFO
-AC_CHECK_HEADERS(port.h sched.h semaphore.h sys/file.h sys/mman.h syscall.h sys/epoll.h sys/event.h sys/inotify.h sys/ptrace.h sys/syscall.h sys/sysctl.h sys/user.h sys/utsname.h sys/select.h sys/socket.h net/bpf.h net/if.h net/if_arp.h net/route.h netpacket/packet.h sys/prctl.h sys/mount.h sys/vfs.h sys/statfs.h sys/timex.h sys/sysinfo.h utime.h linux/ether.h linux/fs.h linux/ptrace.h linux/reboot.h netinet/in_syst.h netinet/ip.h netinet/ip_mroute.h netinet/if_ether.h lwp.h)
+AC_CHECK_HEADERS(fcntl.h port.h sched.h semaphore.h sys/file.h sys/mman.h syscall.h sys/epoll.h sys/event.h sys/inotify.h sys/ptrace.h sys/syscall.h sys/sysctl.h sys/user.h sys/utsname.h sys/select.h sys/socket.h net/bpf.h net/if.h net/if_arp.h net/route.h netpacket/packet.h sys/prctl.h sys/mount.h sys/vfs.h sys/statfs.h sys/timex.h sys/sysinfo.h utime.h linux/ether.h linux/fs.h linux/ptrace.h linux/reboot.h netinet/in_syst.h netinet/ip.h netinet/ip_mroute.h netinet/if_ether.h lwp.h)
AC_CHECK_HEADERS([netinet/icmp6.h], [], [],
[#include <netinet/in.h>
@@ -601,7 +601,14 @@ AC_STRUCT_DIRENT_D_TYPE
AC_CHECK_FUNCS(accept4 dup3 epoll_create1 faccessat fallocate fchmodat fchownat futimesat getxattr inotify_add_watch inotify_init inotify_init1 inotify_rm_watch listxattr mkdirat mknodat open64 openat pipe2 removexattr renameat setxattr sync_file_range splice syscall tee unlinkat unshare utimensat)
AC_TYPE_OFF_T
-AC_CHECK_TYPES([loff_t])
+
+CFLAGS_hold="$CFLAGS"
+CFLAGS="$OSCFLAGS $CFLAGS"
+AC_CHECK_TYPES([loff_t], [], [], [[
+#include <sys/types.h>
+#include <fcntl.h>
+]])
+CFLAGS="$CFLAGS_hold"
LIBS_hold="$LIBS"
LIBS="$LIBS -lm"
diff --git a/libgo/go/syscall/libcall_linux.go b/libgo/go/syscall/libcall_linux.go
index 96974bd3269..65eb1a745f7 100644
--- a/libgo/go/syscall/libcall_linux.go
+++ b/libgo/go/syscall/libcall_linux.go
@@ -209,19 +209,20 @@ func Gettid() (tid int) {
//sys Setxattr(path string, attr string, data []byte, flags int) (err error)
//setxattr(path *byte, name *byte, value *byte, size Size_t, flags _C_int) _C_int
-//sys splice(rfd int, roff *_loff_t, wfd int, woff *_loff_t, len int, flags int) (n int64, err error)
-//splice(rfd _C_int, roff *_loff_t, wfd _C_int, woff *_loff_t, len Size_t, flags _C_uint) Ssize_t
+//sys splice(rfd int, roff *_libgo_loff_t_type, wfd int, woff *_libgo_loff_t_type, len int, flags int) (n int64, err error)
+//splice(rfd _C_int, roff *_libgo_loff_t_type, wfd _C_int, woff *_libgo_loff_t_type, len Size_t, flags _C_uint) Ssize_t
+
func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) {
- var lroff _loff_t
- var plroff *_loff_t
+ var lroff _libgo_loff_t_type
+ var plroff *_libgo_loff_t_type
if roff != nil {
- lroff = _loff_t(*roff)
+ lroff = _libgo_loff_t_type(*roff)
plroff = &lroff
}
- var lwoff _loff_t
- var plwoff *_loff_t
+ var lwoff _libgo_loff_t_type
+ var plwoff *_libgo_loff_t_type
if woff != nil {
- lwoff = _loff_t(*woff)
+ lwoff = _libgo_loff_t_type(*woff)
plwoff = &lwoff
}
n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
diff --git a/libgo/mksysinfo.sh b/libgo/mksysinfo.sh
index 0c52ea5d71a..5aa309155c3 100755
--- a/libgo/mksysinfo.sh
+++ b/libgo/mksysinfo.sh
@@ -403,11 +403,7 @@ fi
# Some basic types.
echo 'type Size_t _size_t' >> ${OUT}
echo "type Ssize_t _ssize_t" >> ${OUT}
-if grep '^const _HAVE_OFF64_T = ' gen-sysinfo.go > /dev/null 2>&1; then
- echo "type Offset_t _off64_t" >> ${OUT}
-else
- echo "type Offset_t _off_t" >> ${OUT}
-fi
+echo "type Offset_t _libgo_off_t_type" >> ${OUT}
echo "type Mode_t _mode_t" >> ${OUT}
echo "type Pid_t _pid_t" >> ${OUT}
echo "type Uid_t _uid_t" >> ${OUT}
diff --git a/libgo/sysinfo.c b/libgo/sysinfo.c
index 336a5983750..fc0210992fa 100644
--- a/libgo/sysinfo.c
+++ b/libgo/sysinfo.c
@@ -354,6 +354,18 @@ enum {
};
#endif
+#if defined(HAVE_LOFF_T)
+// loff_t can be defined as a macro; for -fgo-dump-spec make sure we
+// see a typedef.
+typedef loff_t libgo_loff_t_type;
+#endif
+
+#if defined(HAVE_OFF64_T)
+typedef off64_t libgo_off_t_type;
+#else
+typedef off_t libgo_off_t_type;
+#endif
+
// The following section introduces explicit references to types and
// constants of interest to support bootstrapping libgo using a
// compiler that doesn't support -fdump-go-spec (e.g., clang), via
@@ -534,7 +546,8 @@ SREF(timex);
// From sys/types.h
TREF(pid_t);
TREF(off_t);
-TREF(loff_t);
+TREF(libgo_loff_t_type);
+TREF(libgo_off_t_type);
TREF(size_t);
TREF(ssize_t);
TREF(mode_t);
@@ -1,59 +0,0 @@
From 5e658f4659c551330ea68f5667e4f951b218f32d Mon Sep 17 00:00:00 2001
From: Ian Lance Taylor <iant@golang.org>
Date: Wed, 26 Oct 2022 17:23:42 -0700
Subject: [PATCH] runtime: use _libgo_off_t_type when calling C mmap
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The last argument to the C mmap function is type off_t, not uintptr.
On some 32-bit systems, off_t is larger than uintptr.
Based on patch by Sören Tempel.
Change-Id: Ib6f9d5bcd4734f99a72889e2282b97ec3c8fbd34
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/445735
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
---
libgo/go/runtime/mem_gccgo.go | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/libgo/go/runtime/mem_gccgo.go b/libgo/go/runtime/mem_gccgo.go
index fa3389d8..1e84f4f5 100644
--- a/libgo/go/runtime/mem_gccgo.go
+++ b/libgo/go/runtime/mem_gccgo.go
@@ -15,7 +15,7 @@ import (
//go:linkname sysFree
//extern mmap
-func sysMmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uintptr) unsafe.Pointer
+func sysMmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off _libgo_off_t_type) unsafe.Pointer
//extern munmap
func munmap(addr unsafe.Pointer, length uintptr) int32
@@ -38,7 +38,7 @@ func init() {
}
func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uintptr) (unsafe.Pointer, int) {
- p := sysMmap(addr, n, prot, flags, fd, off)
+ p := sysMmap(addr, n, prot, flags, fd, _libgo_off_t_type(off))
if uintptr(p) == _MAP_FAILED {
return nil, errno()
}
@@ -47,6 +47,7 @@ func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uintptr) (u
// Don't split the stack as this method may be invoked without a valid G, which
// prevents us from allocating more stack.
+//
//go:nosplit
func sysAlloc(n uintptr, sysStat *sysMemStat) unsafe.Pointer {
p, err := mmap(nil, n, _PROT_READ|_PROT_WRITE, _MAP_ANON|_MAP_PRIVATE, mmapFD, 0)
@@ -165,6 +166,7 @@ func sysHugePage(v unsafe.Pointer, n uintptr) {
// Don't split the stack as this function may be invoked without a valid G,
// which prevents us from allocating more stack.
+//
//go:nosplit
func sysFree(v unsafe.Pointer, n uintptr, sysStat *sysMemStat) {
sysStat.add(-int64(n))
@@ -1,71 +0,0 @@
From c86b726c048eddc1be320c0bf64a897658bee13d Mon Sep 17 00:00:00 2001
From: Uros Bizjak <ubizjak@gmail.com>
Date: Wed, 18 May 2022 20:03:26 +0200
Subject: [PATCH] x86: Fix -fsplit-stack feature detection via
TARGET_CAN_SPLIT_STACK
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Since commit c163647ffbc9a20c8feb6e079dbecccfe016c82e -fsplit-stack
is only supported on glibc targets. However, this original commit
required some fixups. As part of the fixup, the changes to the
gnu-user-common.h and gnu.h were partially reverted in commit
60953a23d57b13a672f751bec0c6eefc059eb1ab thus causing TARGET_CAN_SPLIT_STACK
to be defined for non-glibc targets even though -fsplit-stack is
actually not supported and attempting to use it causes a runtime error.
This causes gcc internal code, such as ./gcc/go/gospec.c to not
correctly detect that -fsplit-stack is not supported and thus causes
gccgo to fail compilation on non-glibc targets.
This commit ensures that TARGET_CAN_SPLIT_STACK is only set if the
default libc is glibc. It is presently unclear to me if there is a
better way to detect glibc at pre-processor time.
The proposed changes have been tested on x86 and x86_64 Alpine Linux
(which uses musl libc) and fix compilation of gccgo for this target.
Signed-off-by: Sören Tempel <soeren@soeren-tempel.net>
gcc/ChangeLog:
* config/i386/gnu-user-common.h (defined): Only define
TARGET_CAN_SPLIT_STACK for glibc targets.
* config/i386/gnu.h (defined): Ditto.
---
gcc/config/i386/gnu-user-common.h | 5 +++--
gcc/config/i386/gnu.h | 5 +++--
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/gcc/config/i386/gnu-user-common.h b/gcc/config/i386/gnu-user-common.h
index 23b54c5be52..cab9be2bfb7 100644
--- a/gcc/config/i386/gnu-user-common.h
+++ b/gcc/config/i386/gnu-user-common.h
@@ -66,7 +66,8 @@ along with GCC; see the file COPYING3. If not see
#define STACK_CHECK_STATIC_BUILTIN 1
/* We only build the -fsplit-stack support in libgcc if the
- assembler has full support for the CFI directives. */
-#if HAVE_GAS_CFI_PERSONALITY_DIRECTIVE
+ assembler has full support for the CFI directives. Also
+ we only support -fsplit-stack on glibc targets. */
+#if (DEFAULT_LIBC == LIBC_GLIBC) && HAVE_GAS_CFI_PERSONALITY_DIRECTIVE
#define TARGET_CAN_SPLIT_STACK
#endif
diff --git a/gcc/config/i386/gnu.h b/gcc/config/i386/gnu.h
index 401e60c9a02..fb8d69a97d8 100644
--- a/gcc/config/i386/gnu.h
+++ b/gcc/config/i386/gnu.h
@@ -41,8 +41,9 @@ along with GCC. If not, see <http://www.gnu.org/licenses/>.
#define TARGET_THREAD_SSP_OFFSET 0x14
/* We only build the -fsplit-stack support in libgcc if the
- assembler has full support for the CFI directives. */
-#if HAVE_GAS_CFI_PERSONALITY_DIRECTIVE
+ assembler has full support for the CFI directives. Also
+ we only support -fsplit-stack on glibc targets. */
+#if (DEFAULT_LIBC == LIBC_GLIBC) && HAVE_GAS_CFI_PERSONALITY_DIRECTIVE
#define TARGET_CAN_SPLIT_STACK
#endif
/* We steal the last transactional memory word. */
@@ -1,41 +0,0 @@
From 548720bca6bff21ebc9aba22249d9ce45bbd90c7 Mon Sep 17 00:00:00 2001
From: Ian Lance Taylor <iant@golang.org>
Date: Wed, 29 Jun 2022 15:32:04 -0700
Subject: [PATCH] libgo: handle stat st_atim32 field and SYS_SECCOMP
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Patches for musl support, from Sören Tempel.
Fixes https://gcc.gnu.org/PR105225
Change-Id: If396877d4a4c7d27962226d7a6e3bb91b1344413
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/415294
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
---
libgo/mksysinfo.sh | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libgo/mksysinfo.sh b/libgo/mksysinfo.sh
index 5aa30915..ea1fa17d 100755
--- a/libgo/mksysinfo.sh
+++ b/libgo/mksysinfo.sh
@@ -127,6 +127,7 @@ fi
# The syscall numbers. We force the names to upper case.
grep '^const _SYS_' gen-sysinfo.go | \
+ grep -v '^const _SYS_SECCOMP = ' | \
sed -e 's/const _\(SYS_[^= ]*\).*$/\1/' | \
while read sys; do
sup=`echo $sys | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`
@@ -506,7 +507,7 @@ fi
# For historical reasons Go uses the suffix "timespec" instead of "tim" for
# stat_t's time fields on NetBSD.
-st_times='-e s/st_atim/Atim/ -e s/st_mtim/Mtim/ -e s/st_ctim/Ctim/'
+st_times='-e s/st_atim/Atim/g -e s/st_mtim/Mtim/g -e s/st_ctim/Ctim/g'
if test "${GOOS}" = "netbsd"; then
st_times='-e s/st_atim/Atimespec/ -e s/st_mtim/Mtimespec/ -e s/st_ctim/Ctimespec/'
fi
@@ -1,108 +0,0 @@
From 8f1a91aeff400d572857895b7f5e863ec5a4d93e Mon Sep 17 00:00:00 2001
From: Ian Lance Taylor <iant@golang.org>
Date: Mon, 26 Sep 2022 15:03:53 -0400
Subject: [PATCH] runtime: portable access to sigev_notify_thread_id
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Previously, libgo relied on the _sigev_un implementation-specific
field in struct sigevent, which is only available on glibc.
This patch uses the sigev_notify_thread_id macro instead which is
mandated by timer_create(2). In theory, this should work with any libc
implementation for Linux. Unfortunately, there is an open glibc bug
as glibc does not define this macro. For this reason, a glibc-specific
workaround is required. Other libcs (such as musl) define the macro
and don't require the workaround.
See https://sourceware.org/bugzilla/show_bug.cgi?id=27417
This makes libgo compatible with musl libc.
Based on patch by Sören Tempel.
Change-Id: I0924a53d5212730ebc395ecf9199f85967be8cc6
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/434755
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
---
libgo/go/runtime/os_linux.go | 12 +++++++++++-
libgo/runtime/go-signal.c | 18 ++++++++++++++++++
2 files changed, 29 insertions(+), 1 deletion(-)
diff --git a/libgo/go/runtime/os_linux.go b/libgo/go/runtime/os_linux.go
index 96fb1788..2b2d827c 100644
--- a/libgo/go/runtime/os_linux.go
+++ b/libgo/go/runtime/os_linux.go
@@ -22,6 +22,12 @@ type mOS struct {
profileTimerValid uint32
}
+// setSigeventTID is written in C to set the sigev_notify_thread_id
+// field of a sigevent struct.
+//
+//go:noescape
+func setSigeventTID(*_sigevent, int32)
+
func getProcID() uint64 {
return uint64(gettid())
}
@@ -52,9 +58,12 @@ const (
)
// Atomically,
+//
// if(*addr == val) sleep
+//
// Might be woken up spuriously; that's allowed.
// Don't sleep longer than ns; ns < 0 means forever.
+//
//go:nosplit
func futexsleep(addr *uint32, val uint32, ns int64) {
// Some Linux kernels have a bug where futex of
@@ -73,6 +82,7 @@ func futexsleep(addr *uint32, val uint32, ns int64) {
}
// If any procs are sleeping on addr, wake up at most cnt.
+//
//go:nosplit
func futexwakeup(addr *uint32, cnt uint32) {
ret := futex(unsafe.Pointer(addr), _FUTEX_WAKE_PRIVATE, cnt, nil, nil, 0)
@@ -365,7 +375,7 @@ func setThreadCPUProfiler(hz int32) {
var sevp _sigevent
sevp.sigev_notify = _SIGEV_THREAD_ID
sevp.sigev_signo = _SIGPROF
- *((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
+ setSigeventTID(&sevp, int32(mp.procid))
ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
if ret != 0 {
// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/libgo/runtime/go-signal.c b/libgo/runtime/go-signal.c
index 528d9b6d..aa1b6305 100644
--- a/libgo/runtime/go-signal.c
+++ b/libgo/runtime/go-signal.c
@@ -183,6 +183,24 @@ setSigactionHandler(struct sigaction* sa, uintptr handler)
sa->sa_sigaction = (void*)(handler);
}
+#ifdef __linux__
+
+// Workaround for https://sourceware.org/bugzilla/show_bug.cgi?id=27417
+#ifndef sigev_notify_thread_id
+ #define sigev_notify_thread_id _sigev_un._tid
+#endif
+
+void setSigeventTID(struct sigevent*, int32_t)
+ __asm__ (GOSYM_PREFIX "runtime.setSigeventTID");
+
+void
+setSigeventTID(struct sigevent *sev, int32_t v)
+{
+ sev->sigev_notify_thread_id = v;
+}
+
+#endif // defined(__linux__)
+
// C code to fetch values from the siginfo_t and ucontext_t pointers
// passed to a signal handler.
@@ -1,75 +0,0 @@
From 01be086df55016ad676685c6b0dca6aa11330bfc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
Date: Sun, 17 Jul 2022 13:38:39 +0200
Subject: [PATCH] libphobos: don't define __mode_t twice on musl targets
For musl targets, __mode_t is already aliased to uint, thus if it
aliased in an architecture-specific if-case then it is defined twice
which causes a build error.
To-Do: Report this upstream or revise this patch in a way that is also
works with glibc and submit that upstream.
---
libphobos/libdruntime/core/sys/posix/sys/stat.d | 7 -------
1 file changed, 7 deletions(-)
diff --git a/libphobos/libdruntime/core/sys/posix/sys/stat.d b/libphobos/libdruntime/core/sys/posix/sys/stat.d
index 1fb4e44cbbf..ca31bbb7ccf 100644
--- a/libphobos/libdruntime/core/sys/posix/sys/stat.d
+++ b/libphobos/libdruntime/core/sys/posix/sys/stat.d
@@ -167,7 +167,6 @@ version (linux)
alias __dev_t = ulong;
alias __ino_t = c_ulong;
alias __ino64_t = ulong;
- alias __mode_t = uint;
alias __nlink_t = size_t;
alias __uid_t = uint;
alias __gid_t = uint;
@@ -483,7 +482,6 @@ version (linux)
alias __dev_t = ulong;
alias __ino_t = c_ulong;
alias __ino64_t = ulong;
- alias __mode_t = uint;
alias __nlink_t = uint;
alias __uid_t = uint;
alias __gid_t = uint;
@@ -565,7 +563,6 @@ version (linux)
alias __dev_t = ulong;
alias __ino_t = c_ulong;
alias __ino64_t = ulong;
- alias __mode_t = uint;
alias __nlink_t = size_t;
alias __uid_t = uint;
alias __gid_t = uint;
@@ -660,7 +657,6 @@ version (linux)
alias __dev_t = ulong;
alias __ino_t = c_ulong;
alias __ino64_t = ulong;
- alias __mode_t = uint;
alias __nlink_t = uint;
alias __uid_t = uint;
alias __gid_t = uint;
@@ -746,7 +742,6 @@ version (linux)
alias __dev_t = ulong;
alias __ino_t = c_ulong;
alias __ino64_t = ulong;
- alias __mode_t = uint;
alias __nlink_t = uint;
alias __uid_t = uint;
alias __gid_t = uint;
@@ -838,7 +833,6 @@ version (linux)
alias __dev_t = ulong;
alias __ino_t = c_ulong;
alias __ino64_t = ulong;
- alias __mode_t = uint;
alias __nlink_t = uint;
alias __uid_t = uint;
alias __gid_t = uint;
@@ -914,7 +908,6 @@ version (linux)
alias __dev_t = ulong;
alias __ino_t = c_ulong;
alias __ino64_t = ulong;
- alias __mode_t = uint;
alias __nlink_t = ulong;
alias __uid_t = uint;
alias __gid_t = uint;
@@ -1,36 +0,0 @@
From d53e8a0e94e34dc609e34dd5e404debda2640cfb Mon Sep 17 00:00:00 2001
From: Ian Lance Taylor <iant@golang.org>
Date: Sat, 30 Jul 2022 07:29:28 -0700
Subject: [PATCH] libgo: use SYS_timer_settime32
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Musl defines SYS_timer_settime32, not SYS_timer_settime, on 32-bit systems.
Based on patch by Sören Tempel.
Change-Id: I1f3485028d132ceca1aba595325af24b4d72b894
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/420222
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
---
libgo/sysinfo.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/libgo/sysinfo.c b/libgo/sysinfo.c
index fc021099..180f5c31 100644
--- a/libgo/sysinfo.c
+++ b/libgo/sysinfo.c
@@ -354,6 +354,11 @@ enum {
};
#endif
+#if !defined(SYS_timer_settime) && defined(SYS_timer_settime32)
+// musl defines SYS_timer_settim32 on 32-bit systems.
+#define SYS_timer_settime SYS_timer_settime32
+#endif
+
#if defined(HAVE_LOFF_T)
// loff_t can be defined as a macro; for -fgo-dump-spec make sure we
// see a typedef.
@@ -1,50 +0,0 @@
From a62f20ae78ddd41be682dde8cab075ca4f5dbb2a Mon Sep 17 00:00:00 2001
From: Ian Lance Taylor <iant@golang.org>
Date: Fri, 22 Jul 2022 11:38:20 -0700
Subject: [PATCH] libgo: use POSIX shell arithmetic expansion
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Avoid bash-specific ((expression)) syntax. As the bash syntax
converts a non-zero value to a zero status (and a zero value to a 1
status), and POSIX arithmetic expansion does not, we have to negate
the result.
Based on patch by Sören Tempel.
Change-Id: I4c64fa15de3994a1a5c7c5ec0de6a82ddd858917
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/419154
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
---
libgo/match.sh | 2 +-
libgo/testsuite/gotest | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/libgo/match.sh b/libgo/match.sh
index 7ed587ff..e5ed98de 100755
--- a/libgo/match.sh
+++ b/libgo/match.sh
@@ -111,7 +111,7 @@ gobuild() {
if test "$goarch" != "386"; then
line=$(echo "$line" | sed -e "s/\\(${wrap}\\)386\\(${wrap}\\)/\10\2/g")
fi
- (($line))
+ return $((!($line)))
}
matched=
diff --git a/libgo/testsuite/gotest b/libgo/testsuite/gotest
index 04e4267f..0a0a7e14 100755
--- a/libgo/testsuite/gotest
+++ b/libgo/testsuite/gotest
@@ -302,7 +302,7 @@ gobuild() {
if test "$goarch" != "386"; then
line=$(echo "$line" | sed -e "s/\\(${wrap}\\)386\\(${wrap}\\)/\10\2/g")
fi
- (($line))
+ return $((!($line)))
}
case "x$gofiles" in
@@ -1,65 +0,0 @@
From 7b8400f902ef25ea71ed460716c1afedca357a61 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Wed, 2 Nov 2022 12:31:36 +0100
Subject: [PATCH] libphobos: fix undefined reference to `__cmsg_nxthdr' with
musl
Ported fix from upstream.
Upstream: https://github.com/dlang/dmd/commit/54544260a848c8ebad5582e27ac1e09627cdfb17
Bug-URL: https://issues.dlang.org/show_bug.cgi?id=23157
---
.../libdruntime/core/sys/posix/sys/socket.d | 36 +++++++++++++++++--
1 file changed, 33 insertions(+), 3 deletions(-)
diff --git a/libphobos/libdruntime/core/sys/posix/sys/socket.d b/libphobos/libdruntime/core/sys/posix/sys/socket.d
index c1309a68c9c..e3b536d87e7 100644
--- a/libphobos/libdruntime/core/sys/posix/sys/socket.d
+++ b/libphobos/libdruntime/core/sys/posix/sys/socket.d
@@ -188,10 +188,40 @@ version (linux)
extern (D) inout(ubyte)* CMSG_DATA( return scope inout(cmsghdr)* cmsg ) pure nothrow @nogc { return cast(ubyte*)( cmsg + 1 ); }
- private inout(cmsghdr)* __cmsg_nxthdr(inout(msghdr)*, inout(cmsghdr)*) pure nothrow @nogc;
- extern (D) inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
+ version (CRuntime_Musl)
{
- return __cmsg_nxthdr(msg, cmsg);
+ extern (D)
+ {
+ private size_t __CMSG_LEN(inout(cmsghdr)* cmsg) pure nothrow @nogc
+ {
+ return (cmsg.cmsg_len + size_t.sizeof -1) & cast(size_t)(~(size_t.sizeof - 1));
+ }
+
+ private inout(cmsghdr)* __CMSG_NEXT(inout(cmsghdr)* cmsg) pure nothrow @nogc
+ {
+ return cmsg + __CMSG_LEN(cmsg);
+ }
+
+ private inout(msghdr)* __MHDR_END(inout(msghdr)* mhdr) pure nothrow @nogc
+ {
+ return cast(inout(msghdr)*)(mhdr.msg_control + mhdr.msg_controllen);
+ }
+
+ inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
+ {
+ return cmsg.cmsg_len < cmsghdr.sizeof ||
+ __CMSG_LEN(cmsg) + cmsghdr.sizeof >= __MHDR_END(msg) - cast(inout(msghdr)*)(cmsg)
+ ? cast(inout(cmsghdr)*) null : cast(inout(cmsghdr)*) __CMSG_NEXT(cmsg);
+ }
+ }
+ }
+ else
+ {
+ private inout(cmsghdr)* __cmsg_nxthdr(inout(msghdr)*, inout(cmsghdr)*) pure nothrow @nogc;
+ extern (D) inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
+ {
+ return __cmsg_nxthdr(msg, cmsg);
+ }
}
extern (D) inout(cmsghdr)* CMSG_FIRSTHDR( inout(msghdr)* mhdr ) pure nothrow @nogc
--
2.38.1
+104 -101
View File
@@ -24,15 +24,17 @@ CBUILDROOT="/"
_cross_configure="--disable-bootstrap --with-sysroot=/usr/$CTARGET"
pkgname=gcc-aarch64
_pkgbase=12.2.1 # must match gcc/BASE-VER
_pkgsnap=20220924
pkgver=${_pkgbase}_git$_pkgsnap
pkgver=13.1.1_git20230624
# i.e. 13.1.1, must match gcc/BASE-VER
_pkgbase="${pkgver%%_git*}"
# date component from snapshots
_pkgsnap="${pkgver##*_git}"
[ "$BOOTSTRAP" = "nolibc" ] && pkgname="gcc-pass2"
[ "$CBUILD" != "$CHOST" ] && _cross="-$CARCH" || _cross=""
[ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target=""
pkgname=gcc-aarch64
pkgrel=10
pkgrel=2
pkgdesc="Stage2 cross-compiler for aarch64"
url="https://gcc.gnu.org"
arch="x86_64"
@@ -40,10 +42,9 @@ license="GPL-2.0-or-later AND LGPL-2.1-or-later"
_gccrel=$pkgver-r$pkgrel
depends="binutils-aarch64 mpc1"
makedepends_build="gcc g++ bison flex texinfo gawk zip gmp-dev mpfr-dev mpc1-dev zlib-dev"
# XXX: build hack to upgrade live on builders
makedepends_host="linux-headers gmp-dev mpfr-dev mpc1-dev isl-dev zlib-dev musl-dev-aarch64 binutils-aarch64"
subpackages="g++-aarch64:gpp libstdc++-dev-aarch64:libcxx_dev"
[ "$CHOST" = "$CTARGET" ] && subpackages="gcc-doc$_target"
[ "$CHOST" = "$CTARGET" ] && subpackages="gcc-gdb gcc-doc$_target"
replaces="libstdc++ binutils"
: "${LANG_CXX:=true}"
@@ -77,11 +78,13 @@ if [ "$CHOST" != "$CTARGET" ]; then
_libatomic=false
_libitm=false
# format-sec: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100431
CPPFLAGS="${CPPFLAGS/-Werror=format-security/}"
# reset target flags (should be set in crosscreate abuild)
# fixup flags. seems gcc treats CPPFLAGS as global without
# _FOR_xxx variants. wrap it in CFLAGS and CXXFLAGS.
export CFLAGS="$CPPFLAGS $CFLAGS"
export CXXFLAGS="$CPPFLAGS $CXXFLAGS"
export CFLAGS="$CPPFLAGS -g0 ${CFLAGS/-Werror=format-security/}"
export CXXFLAGS="$CPPFLAGS -g0 ${CXXFLAGS/-Werror=format-security/}"
unset CPPFLAGS
export CFLAGS_FOR_TARGET=" "
export CXXFLAGS_FOR_TARGET=" "
@@ -89,10 +92,12 @@ if [ "$CHOST" != "$CTARGET" ]; then
STRIP_FOR_TARGET="$CTARGET-strip"
elif [ "$CBUILD" != "$CHOST" ]; then
# format-sec: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100431
CPPFLAGS="${CPPFLAGS/-Werror=format-security/}"
# fixup flags. seems gcc treats CPPFLAGS as global without
# _FOR_xxx variants. wrap it in CFLAGS and CXXFLAGS.
export CFLAGS="$CPPFLAGS $CFLAGS"
export CXXFLAGS="$CPPFLAGS $CXXFLAGS"
export CFLAGS="$CPPFLAGS -g0 ${CFLAGS/-Werror=format-security/}"
export CXXFLAGS="$CPPFLAGS -g0 ${CXXFLAGS/-Werror=format-security/}"
unset CPPFLAGS
# reset flags and cc for build
@@ -117,6 +122,21 @@ elif [ "$CBUILD" != "$CHOST" ]; then
else
STRIP_FOR_TARGET=${CROSS_COMPILE}strip
_builddir="$srcdir/build"
# format-sec: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100431
CPPFLAGS="${CPPFLAGS/-Werror=format-security/}"
# pass -g0 by default to bypass -g, since we don't do debug
# if -dbg added, the -g is appended and overrides this
export CFLAGS="$CPPFLAGS -g0 ${CFLAGS/-Werror=format-security/} -O2"
export CXXFLAGS="$CPPFLAGS -g0 ${CXXFLAGS/-Werror=format-security/} -O2"
unset CPPFLAGS
# https://gcc.gnu.org/install/build.html
export CFLAGS_FOR_TARGET="$CFLAGS"
export CXXFLAGS_FOR_TARGET="$CXXFLAGS"
export LDFLAGS_FOR_TARGET="$LDFLAGS"
export BOOT_CFLAGS="$CFLAGS"
export BOOT_CXXFLAGS="$CXXFLAGS"
export BOOT_LDFLAGS="$LDFLAGS"
fi
case "$CARCH" in
@@ -148,7 +168,7 @@ esac
# currently on x86, x86_64 and ia64
_libquadmath=$LANG_FORTRAN
case "$CTARGET_ARCH" in
x86 | x86_64) _libquadmath=$LANG_FORTRAN ;;
x86 | x86_64 | ppc64le) _libquadmath=$LANG_FORTRAN ;;
*) _libquadmath=false ;;
esac
@@ -225,41 +245,28 @@ source="https://dev.alpinelinux.org/archive/gcc/${_pkgbase%%.*}-$_pkgsnap/gcc-${
0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch
0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch
0011-libiberty-copy-PIC-objects-during-build-process.patch
0012-libitm-disable-FORTIFY.patch
0013-libgcc_s.patch
0014-nopie.patch
0015-dlang-use-libucontext-on-mips64.patch
0016-ada-fix-shared-linking.patch
0017-build-fix-CXXFLAGS_FOR_BUILD-passing.patch
0018-add-fortify-headers-paths.patch
0019-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch
0020-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch
0021-mips64-disable-multilib-support.patch
0022-aarch64-disable-multilib-support.patch
0023-s390x-disable-multilib-support.patch
0024-ppc64-le-disable-multilib-support.patch
0025-x86_64-disable-multilib-support.patch
0026-riscv-disable-multilib-support.patch
0027-always-build-libgcc_eh.a.patch
0028-ada-libgnarl-compatibility-for-musl.patch
0029-ada-musl-support-fixes.patch
0033-gcc-go-link-to-libucontext.patch
0034-Use-generic-errstr.go-implementation-on-musl.patch
0035-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch
0036-configure-fix-detection-of-atomic-builtins-in-libato.patch
0037-libgo-Recognize-off64_t-and-loff_t-definitions-of-mu.patch
0039-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch
0041-go-gospec-forcibly-disable-fsplit-stack-support.patch
0042-gcc-go-fix-build-error-with-SYS_SECCOMP.patch
0043-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch
0044-gdc-unconditionally-link-libgphobos-against-libucont.patch
0045-druntime-link-against-libucontext-on-all-platforms.patch
0049-libgo-adjust-name-of-union-in-sigevent-struct.patch
0050-libphobos-don-t-define-__mode_t-twice-on-musl-target.patch
0051-libgo-Explicitly-define-SYS_timer_settime-for-32-bit.patch
0052-libgnat-time_t-is-always-64-bit-on-musl-libc.patch
0053-libgo-make-match.sh-POSIX-shell-compatible.patch
0054-libphobos-fix-undefined-reference-to-__cmsg_nxthdr-w.patch
0012-libgcc_s.patch
0013-nopie.patch
0014-ada-fix-shared-linking.patch
0015-build-fix-CXXFLAGS_FOR_BUILD-passing.patch
0016-add-fortify-headers-paths.patch
0017-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch
0018-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch
0019-aarch64-disable-multilib-support.patch
0020-s390x-disable-multilib-support.patch
0021-ppc64-le-disable-multilib-support.patch
0022-x86_64-disable-multilib-support.patch
0023-riscv-disable-multilib-support.patch
0024-always-build-libgcc_eh.a.patch
0025-ada-libgnarl-compatibility-for-musl.patch
0026-ada-musl-support-fixes.patch
0027-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch
0028-configure-fix-detection-of-atomic-builtins-in-libato.patch
0029-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch
0030-gdc-unconditionally-link-libgphobos-against-libucont.patch
0031-druntime-link-against-libucontext-on-all-platforms.patch
0032-libgnat-time_t-is-always-64-bit-on-musl-libc.patch
0033-libphobos-do-not-use-LFS64-symbols.patch
"
# we build out-of-tree
@@ -303,7 +310,7 @@ build() {
case "$CTARGET" in
aarch64-*-*-*) _arch_configure="--with-arch=armv8-a --with-abi=lp64";;
armv5-*-*-*eabi) _arch_configure="--with-arch=armv5te --with-tune=arm926ej-s --with-float=soft --with-abi=aapcs-linux";;
armv6-*-*-*eabihf) _arch_configure="--with-arch=armv6zk --with-tune=arm1176jzf-s --with-fpu=vfp --with-float=hard --with-abi=aapcs-linux";;
armv6-*-*-*eabihf) _arch_configure="--with-arch=armv6kz --with-tune=arm1176jzf-s --with-fpu=vfpv2 --with-float=hard --with-abi=aapcs-linux";;
armv7-*-*-*eabihf) _arch_configure="--with-arch=armv7-a --with-tune=generic-armv7-a --with-fpu=vfpv3-d16 --with-float=hard --with-abi=aapcs-linux --with-mode=thumb";;
mips-*-*-*) _arch_configure="--with-arch=mips32 --with-mips-plt --with-float=soft --with-abi=32";;
mips64-*-*-*) _arch_configure="--with-arch=mips3 --with-tune=mips64 --with-mips-plt --with-float=soft --with-abi=64";;
@@ -312,7 +319,7 @@ build() {
powerpc-*-*-*) _arch_configure="--enable-secureplt --enable-decimal-float=no";;
powerpc64*-*-*-*) _arch_configure="--with-abi=elfv2 --enable-secureplt --enable-decimal-float=no --enable-targets=powerpcle-linux";;
i486-*-*-*) _arch_configure="--with-arch=i486 --with-tune=generic --enable-cld";;
i586-*-*-*) _arch_configure="--with-arch=i586 --with-tune=generic --enable-cld";;
i586-*-*-*) _arch_configure="--with-arch=pentium-m --with-fpmath=sse --with-tune=generic --enable-cld";;
s390x-*-*-*) _arch_configure="--with-arch=z196 --with-tune=zEC12 --with-zarch --with-long-double-128 --enable-decimal-float";;
riscv64-*-*-*) _arch_configure="--with-arch=rv64gc --with-abi=lp64d --enable-autolink-libatomic";;
esac
@@ -358,11 +365,7 @@ build() {
echo " hash_style_configure=$_hash_style_configure"
echo ""
export CFLAGS="$CFLAGS -O2"
export CXXFLAGS="$CXXFLAGS -O2"
export CPPFLAGS="$CPPFLAGS -O2"
local version="Alpine $pkgver-r$pkgrel"
local version="Alpine $pkgver"
local gccconfiguration="
--prefix=/usr
--mandir=/usr/share/man
@@ -371,6 +374,7 @@ build() {
--host=$CHOST
--target=$CTARGET
--enable-checking=release
--disable-cet
--disable-fixed-point
--disable-libstdcxx-pch
--disable-multilib
@@ -381,6 +385,8 @@ build() {
--enable-default-pie
--enable-default-ssp
--enable-languages=$_languages
--enable-link-serialization=2
--enable-linker-build-id
$_arch_configure
$_libc_configure
$_cross_configure
@@ -417,7 +423,7 @@ build() {
package() {
cd "$_builddir"
make DESTDIR="$pkgdir" install
make -j1 DESTDIR="$pkgdir" install
ln -s gcc "$pkgdir"/usr/bin/cc
@@ -553,6 +559,7 @@ libcxx_dev() {
replaces="g++"
amove usr/${_target:+$CTARGET/}lib/libstdc++.a \
usr/${_target:+$CTARGET/}lib/libstdc++exp.a \
usr/${_target:+$CTARGET/}lib/libstdc++.so \
usr/${_target:+$CTARGET/}lib/libstdc++fs.a \
usr/${_target:+$CTARGET/}lib/libsupc++.a \
@@ -763,52 +770,48 @@ gnat() {
mv "$pkgdir"/usr/bin/*gnat* "$subpkgdir"/usr/bin/
}
gdb() {
pkgdesc="$pkgdesc (gdb printers)"
install_if="$pkgname=$pkgver-r$pkgrel gdb"
amove \
usr/share/gdb/python/ \
usr/share/gcc-*/python/
}
sha512sums="
ba4d9e73d108088da26fbefe18d9b245b76771ffe752c2b4b31bdf38a2d0b638fbc115c377526c27311d4d7ffd4e0d236a5af5016bd364ccaa11a4989d1401e8 gcc-12-20220924.tar.xz
41cbb4d69218006cf9e0cdb6c86212ef451f8decd52a50a7dbb4d34726009da7a4e0261c852b46cb584db253a4bae2f31dc485c506cb545e64a7d26e0ba6c2b6 0001-posix_memalign.patch
531155055cda7f119bcac6479bcae73af9201cd596af9cf1616850bbcf4393b91c5de9f2fbbc1cde6e158fb4df7237b033146f662dff5fa0ea12151cc514adb8 0002-gcc-poison-system-directories.patch
c1275d77b5269386a2ec683933570810f5a2ba1208c161ed887797eb9aee3cb82ef08a8964635902614e6a6e83f3065ba0801c9355d85dd8d60cb1fa20bdf687 0003-specs-turn-on-Wl-z-now-by-default.patch
a54e45bff4484a35d3826435a414d909281453f5605f4081cf3be1f15336cceed93a1d8a54e92e2fa97188623e3030ca1323d7749141e228a7db73795230d86a 0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch
ad132ddbd0c33a3983e3de4f74d8fdb8cb1ddf53ef54de0a5c12efb49e42014ed117165d43f396bcf3455ecfe2c8620e0326e73b4160a370a4cc92d213329c34 0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch
0b9ce0f130a7b797770f3d58a5200575f20e5663c86c0c5710718b7bffd3416cc2f05861613d9c258428e9541c6e0b9837d01f0c99d383e2c3de0503a988e861 0006-Enable-Wformat-and-Wformat-security-by-default.patch
e7813acc7ead61373c212cefbe53eb020b4c5bd8f0f35ee972e0524060713f911624f5a1a871feada642e1f3f5e48c8508125ca2da09de351d544bedf1d44ada 0007-Enable-Wtrampolines-by-default.patch
d0d0566a11e4828bdd6f53346a9a6b9841f3066d3f4a05ee2b6fe97aeb4552654170e7662318ea18fc777c3e75c88a067097478fc4e880a3f9c134b8a3af2277 0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch
f75e63d9d933874f18fb7f55b135c60dfa0377abafa8e0edb91b85d5f00f4f072d0a338ba5d9baec18494211dbbda8068782830dbafbb37068936f76aede270f 0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch
afa4daba222a19569588736a8276dc7c12223a7c222f3dd3795dc3f1cd90f40b90518971ae27b358020354f89562c9680ec8b8e24e85e6d4f8e54e79d185359b 0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch
79dac82249fb573ec477e1451a33883302eb63a5110853faed117f5021221f2153e2ec845dd5a0043b1bf9f0e5736ef0c89743ff2d771774a281c8b24542803a 0011-libiberty-copy-PIC-objects-during-build-process.patch
b035f85c1703b45d15c1d1ffe7d23400e01625e5d403504911cc92f740b02586447de2a9d66a9f80f12b9c227bc193e2a43942c8af2bdb42cdeff8272bbe6068 0012-libitm-disable-FORTIFY.patch
9fb4d396a9493d2d68fe829ce075ba4c5df148b1d6aaab315a6f8ccbdd70d0e052a5dc50369adc2dab005b4a3becd1504b182faed6e82c86accb95f5bc2b9f50 0013-libgcc_s.patch
f82ac22961d842c9f8e731a601bb255918cc160969888363ad2d83e2ccf08b19114a200d46bcf99d097bf530f470c2b1e71e46828bc1b9fff5469ff945f541d8 0014-nopie.patch
6527dc9d250db48d56cf01e9299461bf22a838ffda96c40d448e18f457b206cec2322275d2d5abbbaf3c6573c5e7eba12724c9691b601f118ff7520e19726373 0015-dlang-use-libucontext-on-mips64.patch
6c3ce0ccd68b19e2c76172d8f24b0747ee0af2b8de7af692f2f699848267d7fc42fec8e5c303102fe05be7e934b56f21eea17ce47c8aca20570590830d88e9b0 0016-ada-fix-shared-linking.patch
7089a96aaec8e0b222cb3fa7301d71bb2e328a24dec33e15ea9e3e7695bcae919308249b9a3be5ea2f3b1f069f9fd1739066f31d12317fcdab0596dba9ca54a4 0017-build-fix-CXXFLAGS_FOR_BUILD-passing.patch
b7ebdeee0b143052fdd6e3efa070ea8621d4fb729312cbc787d618e666b593990a20cd9044a786265970d8e09ec13da03b797009543d0b657b0fe924f2dcaa68 0018-add-fortify-headers-paths.patch
8e682893d6367732ab8c490b915112a68d98855deec3bd8db91dc0d9bf486b8c044b13ee2b95c4806da7ac17c41034e081b7a66861018274cb33fdb2fd6df04a 0019-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch
a14c5f98ade5af8cd6e3a0244752674d9c4f6dadb4260f98f1949bff51ac1211a3f8319e0f933f776e98998d2c7221004f92413f97ccc2e966f8462ed6d33597 0020-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch
28c1d477da79aa212ac79e4b02cf865d8b9c31cec6c42f41b4268e3f3c49bf67fb51e54180abe543a54e550788bb472bfcf1b4bc38d072a792d7403dbbee178a 0021-mips64-disable-multilib-support.patch
0920e31c46bf937b47a0602766f042d45adb71abf332ee84399c665c12298ef115cff945fe26d646b0276bfdfdd04913970e6f1f8784a11c26e15111c854643d 0022-aarch64-disable-multilib-support.patch
e4c6bf7ec40f2798c8e5b40a543aecffd5591a2805546b3b97aaa4fbe4df6ce4330a60973a9ddfbca9890590606d5204e7f653ab2b6e4b2c13feeb595b68e63a 0023-s390x-disable-multilib-support.patch
0e956d793c94283ce5af7fe84bfcbb655585a9573608e9bf497fa7b726e12daa391e44977d0a8c97fb460aba89b1773b91e036b0ee1ef4d6263a3943cb63d9cd 0024-ppc64-le-disable-multilib-support.patch
95917fcb60dbc0a8134db9beb583f3c9ea61128499c214f594c434ec8246641ec41e245ce2d1d9b85ffd40ea0e5764f7a33c5522b2547145814245ac0fa25025 0025-x86_64-disable-multilib-support.patch
b40d7e4712c035674c993bbb55475290ec14523b3f0fd05493514bac4e9adaa6641faf815fc40ffc00119d9fd64be28218ee874c289ec7430eeef05ab2fcae5e 0026-riscv-disable-multilib-support.patch
674360ce2ee9f704d0632cc98756f9fe8dd8ca30064fb9d3423b437f7e679c1c51e765b15e535dcb278cd2769583690acb3395b91e4fd5f6f4e3b97879fcc313 0027-always-build-libgcc_eh.a.patch
f060687adcd5297124e4000f1ba1e3fd5d7d124da04d948cbd0d4a6c69a90a2b29a4a0dbbe13a83ab6950724f434de012b681bdbcdf53c0100b40fe3d00f2f2f 0028-ada-libgnarl-compatibility-for-musl.patch
5160bae68e20a1966c1f6d655ee98af759e9b9ee842718ae6007d467b418e1cf3b307528a0841477b5259671ce868521b06c0f2e947b7b8f3a398c53dd978252 0029-ada-musl-support-fixes.patch
72631fbef4843d6ada52f3173b257e027605866a3faf1d8e34438cbf2581952f97bf6f9569ee44fcd7c4b3b337612eaeb0612fb2e6451903f219e4d99bf719db 0033-gcc-go-link-to-libucontext.patch
141c0428f988cbd102000d4db8d4150485f6da5c064469493ea378cd579bed99330658f41fe106c0d07d1c1aa436ec3f864403ed1ba79f791a1d727b42d46910 0034-Use-generic-errstr.go-implementation-on-musl.patch
d9ba710f770e053c8f212e821817c188091a829658050b9ab5906388553ec60fec37943ea43c270e92a9014902949f3c98fc4639032d92b8145b375bb29e193e 0035-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch
ab90d8fdd977d6cd3da096a1c76d77be3e89a020b2127247771711a32eb608cceed21834ef488ab4b69bb0f408b098fdfb61630819e3d1a1e57d5af67800ee74 0036-configure-fix-detection-of-atomic-builtins-in-libato.patch
8bc6823f0b3c66f7b73d7ddb64ffa6930463285c2e9a14a2bc1882bcc4271144eaa1107d713294699caf9481648163cbf43921a2b8e4ac0d55c78a804bae8a3d 0037-libgo-Recognize-off64_t-and-loff_t-definitions-of-mu.patch
f0744c01859e67deed404c97e1870b2876935fdc467e51980373744936574c314d5d21134734c5d515e7f3cd3483ef98045b9bbcd81c568c6038fac96ffb5fa0 0039-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch
d6dc1bfb881a313d167aaa5658790b0f55eea4336c408cfc6613dd5783440dafd0d37c43031a5f3e69be40f632e38371cd4fb6e5f0494ac4ea4d7d5025d2ae02 0041-go-gospec-forcibly-disable-fsplit-stack-support.patch
684c6a6d52512b973429b6e709966439ac1e174f9e79a33d4a638b452245b457b34752b4b4034ba983f6a712f86522e7adf715bab00a6603f64a12139c5b1e39 0042-gcc-go-fix-build-error-with-SYS_SECCOMP.patch
25014dfa99d96ee70ce0ad22e9f7974f0a51cc50b3b9c2db49df50774c8cd29e497ceed120486bee50be83bfb07f2009ed310eb9b0543f2795bd7359b87eadd2 0043-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch
75fd83ac05ab0a08d5f48547b08810f9934209bc78b5db59d65f33887b382af7ec24d8a29d40f86325c05af40c1ae1ec6466c839f646af90afc895a13073d07b 0044-gdc-unconditionally-link-libgphobos-against-libucont.patch
13e047153076d6e1fc40c9f5b6bfe5699c0e5460248f3d2b35ae36677cb960525af7b0b025997e5000a8492cec5e77a86828d66b4058c0d7f89fde0ab3890142 0045-druntime-link-against-libucontext-on-all-platforms.patch
c33ca2553642c2dbd1c65cd97046548f08775785a3db06d761e3bbe61398c37bc382fe132c0c3fa2101dfd4eea2a6d48bf4fae899a0ddb811c81abd7be35c122 0049-libgo-adjust-name-of-union-in-sigevent-struct.patch
179cd15d629884a66e954fd76066675efa594686b970facbb12ad50769e5d70b5530d7f61e77120e26d1c3dfc701cfc5295f341f635db998df73c41bc8e62172 0050-libphobos-don-t-define-__mode_t-twice-on-musl-target.patch
c82d7c8d340a76df3d796565a79b0ccc04ddffef39927620e1f3719bf2dc1db101ba13aef24b46c5bc95b7bf1e31c8bda4ab0936ba4c9c5e5047ba08826c982c 0051-libgo-Explicitly-define-SYS_timer_settime-for-32-bit.patch
eb403d8ea665fd5dc2c11faf43b055e6a3bf480a397ceee3e0ca1e38ec7d2392315f2694ed9a34ffbc99e464f2873fbbf91be8646ea4dea5d3636e3ea22fefa0 0052-libgnat-time_t-is-always-64-bit-on-musl-libc.patch
22fb6edf1ed0387e2b93839ffe6e82a7fee420950af90e91199c3488d966702fdeb1a3396d22be0c73a4051525da9349c93d070a0d83b724c83f2b268da6483f 0053-libgo-make-match.sh-POSIX-shell-compatible.patch
9b74d0a0e4140b597708a295bcf51b93944782698470e2ba9bc0f0d4a830fc418da9624eccc85f3d65ff6d50b8ebf40cecd34d5b045db9e6c29614e981e93f92 0054-libphobos-fix-undefined-reference-to-__cmsg_nxthdr-w.patch
0732cc63e8677d5c7d07d5eee837bf95fbc63d8592511963d3e47b7af816d0f81ad8c0a234c31df003fcd37682badc18e63a6ffe78a8ba3744e289f5319535f7 gcc-13-20230624.tar.xz
5738a25e510d47058ea7acf44f47292c365f74f60f75d600c3bdf79022a78e3c14c87648e23d3f44612833123ba1ae6776c8a6ea4371bf8c2cf31ea8296a0278 0001-posix_memalign.patch
35cba990b41ba8fd2544404a0330ceddfbc7b63475f4ebb515552d5ec494d0099f0585240a36099431ae6dcaf9bd7674ca0224f0dd4310cd3597aabadedd1d07 0002-gcc-poison-system-directories.patch
fa3b349be7e7f49c1d2192a84d6fc6b9f9b750381607711950d3ad5c867c677dac65dc2274fa4227aa6909d6b5e0fcc59b137254202035e930a2c6a0ba494e2f 0003-specs-turn-on-Wl-z-now-by-default.patch
495b08b8b25f25f616fd68d205c23232d8307a35dae81f5d37e248ec704734e40618d5e3855f1cedeaa615b1d03e5a34089695faca9798d51a367a0e3bc59b78 0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch
ee10b0b91e7b0a91a47b6708dd8a41c8f08a89f87a3eed57aed2ea3df5b7109a2a33741651a294a10f056c736beeb0be0fb6004c0517e8687a80bc33be50d8c9 0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch
87dca73e398acf396ade55b8cd533d3e90889444c27069df9840a57d524d8f045781b4a38f9e0e52595a510049a0832a5067f6f0200df00fc51501316fa7c61b 0006-Enable-Wformat-and-Wformat-security-by-default.patch
5eca632dbb3f709ee92ba89e062642cfcf854aa31426b8eca859432773bff4bffd35fa6a7418a760bed89a30a1f64e1de87b0353e9d332d8abc72c14e236e1ed 0007-Enable-Wtrampolines-by-default.patch
d46546536564f76abcda3a54b0c159175aca7044542fdcdf1f08c46bfabff452e2ba7d535e9e5b04c9c595c3f865bf80bdece8aee4a0bc24baea4f2c94fcf0bb 0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch
00ce50efdeb9a31cbd9ca2d2fa22cd27b1d972e96c01948bd9ae95aff7275e6bc894196ff871107c5feadb6cb832119127240f4539fda35d4326955babf5f510 0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch
46a228b875f835fd1c2cae479f5e931cd2afc4124690ebb935ea49a3fc4ed46b69d4c76e18a1d7632283690e9d51fbcb90f478fc0b87d532dc095fcf067de7e6 0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch
b2c5e2af8f6f50da5795de7fb94309149eb63b1dcc31d72147975702b751e7af0f89adbde7e359416a4ad7749c3d251e6c2b8b57c9a24c77e15c9ce4730d5e4a 0011-libiberty-copy-PIC-objects-during-build-process.patch
8c60c72a123d984452b57bc6a7d3dea3ab092e963d459d8a69a27384c8cf2d7e0e718d1dda2957b62cb2d0353dd851e57c3d1791f90adf6a32393b64846677d9 0012-libgcc_s.patch
082a1dcca42899fc7c70616f0b73fc640fbaae8c4f08c960c71bd9f2cda57bf34a662f1f6327a6eb7e026ebe3414ee71303c3354687ad6c14068fdf37025f2e5 0013-nopie.patch
ced25410c21b0bac351ef4a6c2d381f4e0a1c0f4043899bbed2f10ad5f5c39ec6ff4cde07c62d486643a89421c28266798234c318a09a029bc1a79d6adee1c0e 0014-ada-fix-shared-linking.patch
f245428f57f1d59e353b3c1d745c7cb3987689d8ef3cb38e113f69750dca08ed76681ed72b2d5ee659d0d6c33179c4b12eb1d509c0baf185cc8c8549e0c09f8f 0015-build-fix-CXXFLAGS_FOR_BUILD-passing.patch
4fd357f4f24899f742e19680db543647dea556e3144744ac990474ee01f32d28e1724f6f56dac4ba2ce2491aae88ffea16b6f7c33b74132deb2f932d550f119a 0016-add-fortify-headers-paths.patch
dd028aeb2e8a32157a419f4450fa70a96522ce2de88febfac374d11f1340660584c7547eaa287715f585289aa313b17918a52b64bc758778833f387c0e3c3506 0017-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch
47eb31a354177f4abd699e6bcb29ba688eeb51511b27969a88e25a0153108023ceb3d821fe3ffca0491dafec5341a3186b813519b9d043450eeec990bfc7d7d4 0018-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch
b77e98c45d28e42ec9f9842b5aab3fd69b8696ea69376a049e7792bd5cef98c730ab5a458406084fb7be2f3c361962c407b72dde3dd27857f55433f3fc749b3c 0019-aarch64-disable-multilib-support.patch
79b3a8ea1fe452a2f8fdf2b15b75754ed00f2993120596e7870622d4d608edf8c3ddc31181dafa40815fdfe277a10d539830484f09a57c3b0ee5677785224e04 0020-s390x-disable-multilib-support.patch
d250d791dd9d5190eee9fc54326830b0e19d9986e801d0576199808c6e211f5137ce71b92e0dbfb1ab910c22311b4b48dbbd63fa9390c2e2491dce80062e5f51 0021-ppc64-le-disable-multilib-support.patch
51206e8132e93bb79f891f0f69461982435fa4212b1bf91c75b9bb9ee7fd25106d53fad21470f4706b5d258fbe1715ef7524d6c2bb94813b7d4a48d949a176f7 0022-x86_64-disable-multilib-support.patch
b774c6a750077a546d1cef0b31812d5d68cf64a8abdd47a30180fb6f3a848941e7986f4a587da9a6ab034e5083068723620319e3f821f0db3ff66dc4c33faf06 0023-riscv-disable-multilib-support.patch
1b6ed17c5798d8fd80826188c35232d0f90843d6cba060ea784fdfa5b5cb2490ac4507ce9802f7f6f50ccb7fe5db34cd6860c256e9da311710c95b1d4870fc1c 0024-always-build-libgcc_eh.a.patch
4b9f4446254720e692478fb016798b44c6ebc021816dff49fe32b6eac4f4da091c47adf46f040df603ee74f4986a832257eaad4d3c594b6d50a23e447c755586 0025-ada-libgnarl-compatibility-for-musl.patch
fbc903ca64f8a17ea8ffce4cb882dd53713dee3b24b729ab81741a8133802b9c95619596829706fcfe26350a33e8558dc9b9edf92802170041c3f4f831b2ff2c 0026-ada-musl-support-fixes.patch
8d3f37bd75a9fea17c277b380aa943ad44989c65e6aabbf09f9c3f35acb1f048dbe361bc788b6ef2133dee3b9f646c56637811fe33171a50a2a024fe9d78e6ef 0027-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch
04a07053c82842f1ec5ec58723c0801659f8174318e32d1e966411422bfa9665f259ba9025d030e0e298608d6eeff423cbe5ed9981717d691a49de8806ead7aa 0028-configure-fix-detection-of-atomic-builtins-in-libato.patch
3398fcb9273e5d76006b2c2c0215cf9ead757faa4751f7a55cf7bc687894ac38da47e76700860ea3c7f8feb18361e4ce8ce6b16a365fdfe4c61032bd53da56e7 0029-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch
ac86593db92aca836a91dd7ad3060e6c1d92b1b7c685a6fa1b51281f76b091fb07058d8d53f16f7df18eb148fde0526723c6cf6fc4c38471399dc7fde8892307 0030-gdc-unconditionally-link-libgphobos-against-libucont.patch
e2f8901bf30494563373a24cb632a251056cb99dbb9cce789817f12016da323f702d981ce4ba9d7d52eefc33f257568509d391776fd022b012e589b43857c696 0031-druntime-link-against-libucontext-on-all-platforms.patch
434d3739d7e6ecc5017c29711c3a7c207e7c673d2a535607dea78a5a5d265d8efb74b7f726c18efc13e9c80c29385ce1b4e3b53c7d1c9d55bb1b8a217425f3ea 0032-libgnat-time_t-is-always-64-bit-on-musl-libc.patch
8a56a2a1d1c60894ab429ecc8fa3ddbfdd6c7e3cc9f764b4f260695a2cd54442668e9b4c7ba62d833e5dbc05548586aefc344caf9ea87cdf6de60ce3c30f9da9 0033-libphobos-do-not-use-LFS64-symbols.patch
"
+6 -3
View File
@@ -1,14 +1,14 @@
From 74c7b0df9971b6bc75d7d172c2819ffd21d51050 Mon Sep 17 00:00:00 2001
From 75e758609803afe6ced6cd7799b4159f3848a8d5 Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <nsz@port70.net>
Date: Fri, 26 Jan 2018 20:32:50 +0000
Subject: [PATCH] posix_memalign
Subject: [PATCH 01/33] 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 3b2e4f47915..20f790904a2 100644
index 3527283693b..c4071b64b53 100644
--- a/gcc/config/i386/pmm_malloc.h
+++ b/gcc/config/i386/pmm_malloc.h
@@ -27,12 +27,13 @@
@@ -37,3 +37,6 @@ index 3b2e4f47915..20f790904a2 100644
return __ptr;
else
return NULL;
--
2.41.0
@@ -1,7 +1,7 @@
From dd1e75ff4ecda96957465b34681f245e818928bd Mon Sep 17 00:00:00 2001
From 447c2a21d1fa8c2c3b216102a808834d86f12104 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] gcc: poison-system-directories
Subject: [PATCH 02/33] 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
@@ -26,10 +26,10 @@ Upstream-Status: Pending
7 files changed, 68 insertions(+)
diff --git a/gcc/common.opt b/gcc/common.opt
index 8a0dafc522d..0357868e22c 100644
index 862c474d3c8..64c4277c991 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -710,6 +710,10 @@ Wreturn-local-addr
@@ -711,6 +711,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 8a0dafc522d..0357868e22c 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 64c27c9cfac..f0fbf123aa8 100644
index 4cad077bfbe..0679fbbf4c6 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -230,6 +230,12 @@
@@ -236,6 +236,12 @@
#endif
@@ -58,10 +58,10 @@ index 64c27c9cfac..f0fbf123aa8 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 5ce0557719a..e9060112384 100755
index c7b26d1927d..8c46369f73f 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -1023,6 +1023,7 @@ enable_maintainer_mode
@@ -1026,6 +1026,7 @@ enable_maintainer_mode
enable_link_mutex
enable_link_serialization
enable_version_specific_runtime_libs
@@ -69,7 +69,7 @@ index 5ce0557719a..e9060112384 100755
enable_plugin
enable_host_shared
enable_libquadmath_support
@@ -1785,6 +1786,8 @@ Optional Features:
@@ -1788,6 +1789,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 5ce0557719a..e9060112384 100755
--enable-plugin enable plugin support
--enable-host-shared build host code as shared libraries
--disable-libquadmath-support
@@ -31982,6 +31985,19 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then :
@@ -31753,6 +31756,19 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then :
fi
@@ -99,10 +99,10 @@ index 5ce0557719a..e9060112384 100755
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 23bee7010a3..75a7048045c 100644
index 09082e8ccae..5504bf6eb01 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -7421,6 +7421,16 @@ AC_ARG_ENABLE(version-specific-runtime-libs,
@@ -7292,6 +7292,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 23bee7010a3..75a7048045c 100644
AC_SUBST(subdirs)
AC_SUBST(srcdir)
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 07b440190c3..b2de464798a 100644
index b61ecfc1bc8..b290908679e 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -379,6 +379,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
@@ -8029,6 +8030,14 @@ made up of data only and thus requires no special treatment. But, for
@@ -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
@@ -8424,6 +8425,14 @@ made up of data only and thus requires no special treatment. But, for
most targets, it is made up of code and thus requires the stack to be
made executable in order for the program to work properly.
+@item -Wno-poison-system-directories
+@opindex Wno-poison-system-directories
+@item -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 bb07cc244e3..47fb5802194 100644
index 16bb07f2cdc..33b56e721d2 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -1159,6 +1159,8 @@ proper position among the other output files. */
@@ -1146,6 +1146,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}}} \
@@ -160,7 +160,7 @@ index bb07cc244e3..47fb5802194 100644
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 bd2a97938eb..c80f100f476 100644
index 4d44321183f..0f3f071b44c 100644
--- a/gcc/incpath.cc
+++ b/gcc/incpath.cc
@@ -26,6 +26,7 @@
@@ -198,3 +198,6 @@ index bd2a97938eb..c80f100f476 100644
}
/* Use given -I paths for #include "..." but not #include <...>, and
--
2.41.0
@@ -1,7 +1,7 @@
From 40e45739e7d3787acd13b5b9a4c27d843de0ffe2 Mon Sep 17 00:00:00 2001
From b5c378c4c1e71b2dd8b4616d8f61530ee1a3ac98 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:45:49 +0000
Subject: [PATCH] specs: turn on -Wl,-z,now by default
Subject: [PATCH 03/33] 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.
@@ -14,24 +14,24 @@ now by default.
2 files changed, 4 insertions(+)
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index b2de464798a..83bd1bde433 100644
index b290908679e..cb34e6d40c9 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -16872,6 +16872,9 @@ For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
@@ -17959,6 +17959,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}.
+
@item -u @var{symbol}
@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 47fb5802194..d18b5d7b59a 100644
index 33b56e721d2..f82fae23c22 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -1157,6 +1157,7 @@ proper position among the other output files. */
@@ -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 \
@@ -39,3 +39,6 @@ index 47fb5802194..d18b5d7b59a 100644
"%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,8 +1,8 @@
From 666d0aeb808ac9c10d065ae7b196695c81a25a20 Mon Sep 17 00:00:00 2001
From bb3ef1f5acfde9658c922d0aef9283fe60328c33 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:46:22 +0000
Subject: [PATCH] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, ObjC,
ObjC++, if the optimization level is > 0
Subject: [PATCH 04/33] 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 ++++
@@ -10,10 +10,10 @@ Subject: [PATCH] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, ObjC,
2 files changed, 10 insertions(+)
diff --git a/gcc/c-family/c-cppbuiltin.cc b/gcc/c-family/c-cppbuiltin.cc
index 4672ae8486a..573c021e1e8 100644
index 5d64625fcd7..868d69506e4 100644
--- a/gcc/c-family/c-cppbuiltin.cc
+++ b/gcc/c-family/c-cppbuiltin.cc
@@ -1510,6 +1510,10 @@ c_cpp_builtins (cpp_reader *pfile)
@@ -1546,6 +1546,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 4672ae8486a..573c021e1e8 100644
if (flag_gnu89_inline)
cpp_define (pfile, "__GNUC_GNU_INLINE__");
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 83bd1bde433..dda299a9987 100644
index cb34e6d40c9..7f1aa660285 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -10896,6 +10896,12 @@ also turns on the following optimization flags:
@@ -11866,6 +11866,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,6 +38,9 @@ index 83bd1bde433..dda299a9987 100644
+functions. To disable, specify either @option{-U_FORTIFY_SOURCE} or
+@option{-D_FORTIFY_SOURCE=0}.
+
@item -O3
@opindex O3
@item -O3
Optimize yet more. @option{-O3} turns on all optimizations specified
--
2.41.0
@@ -1,8 +1,8 @@
From 75d1a35180cf0967f062765314bf091a64032062 Mon Sep 17 00:00:00 2001
From 0727ad9e4a458d090be6fb0cfbe334d8496cd5e0 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:46:56 +0000
Subject: [PATCH] On linux targets pass --as-needed by default to the linker,
but always link the sanitizer libraries with --no-as-needed.
Subject: [PATCH 05/33] 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 +
@@ -22,7 +22,7 @@ Subject: [PATCH] On linux targets pass --as-needed by default to the linker,
14 files changed, 36 insertions(+), 19 deletions(-)
diff --git a/gcc/config/aarch64/aarch64-linux.h b/gcc/config/aarch64/aarch64-linux.h
index 5e4553d79f5..b516f3ef97f 100644
index 4277f03da2a..b131983a546 100644
--- a/gcc/config/aarch64/aarch64-linux.h
+++ b/gcc/config/aarch64/aarch64-linux.h
@@ -35,6 +35,7 @@
@@ -34,7 +34,7 @@ index 5e4553d79f5..b516f3ef97f 100644
%{shared:-shared} \
%{symbolic:-Bsymbolic} \
diff --git a/gcc/config/alpha/linux-elf.h b/gcc/config/alpha/linux-elf.h
index 17f16a55910..9ec667e9a5e 100644
index 03f783f2ad1..d946e700dda 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 17f16a55910..9ec667e9a5e 100644
%{shared:-shared} \
%{!shared: \
diff --git a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h
index df3da67c4f0..7532bc29f9b 100644
index 7b7b7cbbe14..49c050c6f2c 100644
--- a/gcc/config/arm/linux-elf.h
+++ b/gcc/config/arm/linux-elf.h
@@ -70,6 +70,7 @@
@@ -59,7 +59,7 @@ index df3da67c4f0..7532bc29f9b 100644
SUBTARGET_EXTRA_LINK_SPEC
diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h
index 857c0e077bf..8433e56c3e1 100644
index eda8010b133..b26b17f2f2a 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
@@ -69,9 +69,9 @@ index 857c0e077bf..8433e56c3e1 100644
- 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 "%{static-libhwasan:%{!shared:" \
LD_STATIC_OPTION " --whole-archive -lhwasan --no-whole-archive " \
@@ -145,12 +145,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#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
#define LIBTSAN_EARLY_SPEC "%{!shared:libtsan_preinit%O%s} " \
"%{static-libtsan:%{!shared:" \
LD_STATIC_OPTION " --whole-archive -ltsan --no-whole-archive " \
@@ -87,7 +87,7 @@ index 857c0e077bf..8433e56c3e1 100644
#undef TARGET_F951_OPTIONS
diff --git a/gcc/config/i386/gnu-user.h b/gcc/config/i386/gnu-user.h
index 0102b2a6f3b..994414c1845 100644
index a79b739089d..e0752673dff 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
@@ -100,7 +100,7 @@ index 0102b2a6f3b..994414c1845 100644
%{!static: \
%{!static-pie: \
diff --git a/gcc/config/i386/gnu-user64.h b/gcc/config/i386/gnu-user64.h
index abc8cf624ca..fe656aeae27 100644
index 3b63b99acf6..759bf0db86f 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 +112,7 @@ index abc8cf624ca..fe656aeae27 100644
%{!shared: \
%{!static: \
diff --git a/gcc/config/ia64/linux.h b/gcc/config/ia64/linux.h
index 93510098ccc..3813e536423 100644
index 5dfd428aa17..02656dad7fc 100644
--- a/gcc/config/ia64/linux.h
+++ b/gcc/config/ia64/linux.h
@@ -58,7 +58,7 @@ do { \
@@ -125,7 +125,7 @@ index 93510098ccc..3813e536423 100644
%{!shared: \
%{!static: \
diff --git a/gcc/config/mips/gnu-user.h b/gcc/config/mips/gnu-user.h
index 6aad7192e69..e1256a55add 100644
index a4e5380b589..3cc61bce69f 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,10 +137,10 @@ index 6aad7192e69..e1256a55add 100644
%{!static: \
%{rdynamic:-export-dynamic} \
diff --git a/gcc/config/riscv/linux.h b/gcc/config/riscv/linux.h
index 38803723ba9..3067ed6eac8 100644
index 3e625e0f867..f8c2c351e5a 100644
--- a/gcc/config/riscv/linux.h
+++ b/gcc/config/riscv/linux.h
@@ -58,6 +58,7 @@ along with GCC; see the file COPYING3. If not see
@@ -48,6 +48,7 @@ along with GCC; see the file COPYING3. If not see
"%{mabi=ilp32:_ilp32}"
#define LINK_SPEC "\
@@ -149,7 +149,7 @@ index 38803723ba9..3067ed6eac8 100644
%{mno-relax:--no-relax} \
%{mbig-endian:-EB} \
diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
index b2a7afabc73..34ceb4e4fce 100644
index 9e457033d11..08016bf224d 100644
--- a/gcc/config/rs6000/linux64.h
+++ b/gcc/config/rs6000/linux64.h
@@ -377,13 +377,13 @@ extern int dot_symbols;
@@ -169,10 +169,10 @@ index b2a7afabc73..34ceb4e4fce 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 7e2519de5d4..61215a7a1b3 100644
index ae932fc22f0..c8ff0c6dc8e 100644
--- a/gcc/config/rs6000/sysv4.h
+++ b/gcc/config/rs6000/sysv4.h
@@ -788,7 +788,7 @@ GNU_USER_TARGET_CC1_SPEC
@@ -780,7 +780,7 @@ GNU_USER_TARGET_CC1_SPEC
#define GNU_USER_DYNAMIC_LINKER GLIBC_DYNAMIC_LINKER
#endif
@@ -182,7 +182,7 @@ index 7e2519de5d4..61215a7a1b3 100644
-dynamic-linker " GNU_USER_DYNAMIC_LINKER "}}"
diff --git a/gcc/config/s390/linux.h b/gcc/config/s390/linux.h
index d7b7e7a7b02..d2287f14f2e 100644
index 02aa1edaff8..64df5801134 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 +195,7 @@ index d7b7e7a7b02..d2287f14f2e 100644
%{!shared: \
%{static:-static} \
diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h
index 6a809e9092d..93bfb92d3ff 100644
index 0e33b3cac2c..c2f44546e62 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);
@@ -208,10 +208,10 @@ index 6a809e9092d..93bfb92d3ff 100644
%{!shared: \
%{!static: \
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index d18b5d7b59a..3b76311b544 100644
index f82fae23c22..da6417dd0d1 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -744,8 +744,11 @@ proper position among the other output files. */
@@ -754,8 +754,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 +225,7 @@ index d18b5d7b59a..3b76311b544 100644
STATIC_LIBASAN_LIBS
#else
#define LIBASAN_SPEC "-lasan" STATIC_LIBASAN_LIBS
@@ -780,8 +783,11 @@ proper position among the other output files. */
@@ -790,8 +793,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 +239,7 @@ index d18b5d7b59a..3b76311b544 100644
STATIC_LIBTSAN_LIBS
#else
#define LIBTSAN_SPEC "-ltsan" STATIC_LIBTSAN_LIBS
@@ -798,8 +804,11 @@ proper position among the other output files. */
@@ -808,8 +814,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 +253,7 @@ index d18b5d7b59a..3b76311b544 100644
STATIC_LIBLSAN_LIBS
#else
#define LIBLSAN_SPEC "-llsan" STATIC_LIBLSAN_LIBS
@@ -814,8 +823,11 @@ proper position among the other output files. */
@@ -824,8 +833,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
@@ -267,3 +267,6 @@ index d18b5d7b59a..3b76311b544 100644
STATIC_LIBUBSAN_LIBS
#else
#define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS
--
2.41.0
@@ -1,17 +1,17 @@
From c664283dd30949c5299d1c45bd5740bcfe993d22 Mon Sep 17 00:00:00 2001
From dc3e2f629fe7f8df81c74162c66910339ec5d03d Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:47:43 +0000
Subject: [PATCH] Enable -Wformat and -Wformat-security by default.
Subject: [PATCH 06/33] 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 07da40ef43b..8683f706426 100644
index a75038930ae..b98726f33ed 100644
--- a/gcc/c-family/c.opt
+++ b/gcc/c-family/c.opt
@@ -692,7 +692,7 @@ Warn about function calls with format strings that write past the end
@@ -704,7 +704,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 07da40ef43b..8683f706426 100644
Warn about possible security problems with format functions.
Wformat-signedness
@@ -713,7 +713,7 @@ C ObjC C++ ObjC++ Var(warn_format_zero_length) Warning LangEnabledBy(C ObjC C++
@@ -725,7 +725,7 @@ C ObjC C++ ObjC++ Var(warn_format_zero_length) Warning LangEnabledBy(C ObjC C++
Warn about zero-length formats.
Wformat=
@@ -29,3 +29,6 @@ index 07da40ef43b..8683f706426 100644
Warn about printf/scanf/strftime/strfmon format string anomalies.
Wformat-overflow=
--
2.41.0
@@ -1,17 +1,17 @@
From e4d0ec43e772b6dc7c3708aed5309897df26a125 Mon Sep 17 00:00:00 2001
From d25c373cf839df0720f8d345b5ad55147030515a Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:48:24 +0000
Subject: [PATCH] Enable -Wtrampolines by default.
Subject: [PATCH 07/33] 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 0357868e22c..6d5e5eebe60 100644
index 64c4277c991..c24839d32bc 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -802,7 +802,7 @@ Common Var(warn_system_headers) Warning
@@ -803,7 +803,7 @@ Common Var(warn_system_headers) Warning
Do not suppress warnings from system headers.
Wtrampolines
@@ -20,3 +20,6 @@ index 0357868e22c..6d5e5eebe60 100644
Warn whenever a trampoline is generated.
Wtrivial-auto-var-init
--
2.41.0
@@ -1,8 +1,8 @@
From 27e5d5bd3fed9006a2958d2b09750d15ad07383b Mon Sep 17 00:00:00 2001
From eb58983c3d3126caaab8ed174571b142a095c132 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:49:40 +0000
Subject: [PATCH] Disable ssp on -nostdlib, -nodefaultlibs and -ffreestanding
Change the buffer size.
Subject: [PATCH 08/33] Disable ssp on -nostdlib, -nodefaultlibs and
-ffreestanding Change the buffer size.
---
gcc/gcc.cc | 8 +++++++-
@@ -10,10 +10,10 @@ Subject: [PATCH] Disable ssp on -nostdlib, -nodefaultlibs and -ffreestanding
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index 3b76311b544..cc99d0b7aa1 100644
index da6417dd0d1..b5a6f200635 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -996,6 +996,12 @@ proper position among the other output files. */
@@ -983,6 +983,12 @@ proper position among the other output files. */
#define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
#endif
@@ -26,7 +26,7 @@ index 3b76311b544..cc99d0b7aa1 100644
#ifndef LINK_SSP_SPEC
#ifdef TARGET_LIBC_PROVIDES_SSP
#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
@@ -1295,7 +1301,7 @@ static const char *cc1_options =
@@ -1282,7 +1288,7 @@ static const char *cc1_options =
%{-version:--version}\
%{-help=*:--help=%*}\
%{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
@@ -36,10 +36,10 @@ index 3b76311b544..cc99d0b7aa1 100644
%{fprofile-arcs|fprofile-generate*|coverage:\
%{!fprofile-update=single:\
diff --git a/gcc/params.opt b/gcc/params.opt
index b88e1372005..82a7e25dd2f 100644
index 823cdb2ff85..5b096899b40 100644
--- a/gcc/params.opt
+++ b/gcc/params.opt
@@ -1012,7 +1012,7 @@ Common Joined UInteger Var(param_ssa_name_def_chain_limit) Init(512) Param Optim
@@ -1006,7 +1006,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=
@@ -48,3 +48,6 @@ index b88e1372005..82a7e25dd2f 100644
The lower bound for a buffer to be considered for stack smashing protection.
-param=stack-clash-protection-guard-size=
--
2.41.0
@@ -1,8 +1,8 @@
From 83bf2a316222e2fe0b72968cadf4e334d41173f6 Mon Sep 17 00:00:00 2001
From 823afef2053ca4f79ac13f2b0f52b132282ee705 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:50:33 +0000
Subject: [PATCH] Ensure that msgfmt doesn't encounter problems during gcc
bootstrapping.
Subject: [PATCH 09/33] 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 8f51544989e..5329804d136 100644
index 12d34910830..61b13762b71 100644
--- a/libstdc++-v3/po/Makefile.am
+++ b/libstdc++-v3/po/Makefile.am
@@ -38,6 +38,7 @@ MSGFMT = msgfmt
@@ -38,7 +38,7 @@ index 8f51544989e..5329804d136 100644
all-local: all-local-$(USE_NLS)
diff --git a/libstdc++-v3/po/Makefile.in b/libstdc++-v3/po/Makefile.in
index 243f3db7b72..822210781fa 100644
index 8e93445acd2..d6ff06e5ddb 100644
--- a/libstdc++-v3/po/Makefile.in
+++ b/libstdc++-v3/po/Makefile.in
@@ -561,6 +561,7 @@ uninstall-am:
@@ -49,3 +49,6 @@ index 243f3db7b72..822210781fa 100644
$(MSGFMT) -o $@ $<
all-local: all-local-$(USE_NLS)
--
2.41.0
@@ -1,14 +1,14 @@
From 190064993cd8ddbd48015c1fc1916e4110a97733 Mon Sep 17 00:00:00 2001
From 702cbba342eae468e79d9b42e366b9699c158402 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:52:07 +0000
Subject: [PATCH] Don't declare asprintf if defined as a macro.
Subject: [PATCH 10/33] 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 a65ced9c820..eb20ab0f95f 100644
index 1d5c779fcff..19e3cb1e31c 100644
--- a/include/libiberty.h
+++ b/include/libiberty.h
@@ -652,8 +652,11 @@ extern void *bsearch_r (const void *, const void *,
@@ -23,3 +23,6 @@ index a65ced9c820..eb20ab0f95f 100644
/* Like asprintf but allocates memory without fail. This works like
xmalloc. */
--
2.41.0
@@ -1,14 +1,14 @@
From 838e1daa955d9013c462be3471497cb39641e951 Mon Sep 17 00:00:00 2001
From 18f0ecbdab63b0ee590ef21650ac72879318a8be Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:53:00 +0000
Subject: [PATCH] libiberty: copy PIC objects during build process
Subject: [PATCH 11/33] 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 1b17c2e3a47..8db1176df2e 100644
index 72608f3e4a7..58356884728 100644
--- a/libiberty/Makefile.in
+++ b/libiberty/Makefile.in
@@ -265,6 +265,7 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS)
@@ -19,3 +19,6 @@ index 1b17c2e3a47..8db1176df2e 100644
cd ..; \
else true; fi
--
2.41.0
@@ -1,7 +1,7 @@
From 048c394eb709bfd216e307c1b92ac7f8a7e7758b Mon Sep 17 00:00:00 2001
From e350a47267790a1a624032a645425b4018433e0c 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
Subject: [PATCH 12/33] libgcc_s
---
gcc/config/i386/i386-expand.cc | 4 ++--
@@ -10,10 +10,10 @@ Subject: [PATCH] libgcc_s
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/gcc/config/i386/i386-expand.cc b/gcc/config/i386/i386-expand.cc
index 31780b6daf7..d89898846e1 100644
index 0d817fc3f3b..2e99db00db9 100644
--- a/gcc/config/i386/i386-expand.cc
+++ b/gcc/config/i386/i386-expand.cc
@@ -12338,10 +12338,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget,
@@ -12691,10 +12691,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget,
{
case IX86_BUILTIN_CPU_INIT:
{
@@ -27,7 +27,7 @@ index 31780b6daf7..d89898846e1 100644
return expand_expr (call_expr, target, mode, EXPAND_NORMAL);
}
diff --git a/libgcc/config/i386/cpuinfo.c b/libgcc/config/i386/cpuinfo.c
index dab1d98060f..cf824b4114a 100644
index 50b6d8248a2..724ced402a1 100644
--- a/libgcc/config/i386/cpuinfo.c
+++ b/libgcc/config/i386/cpuinfo.c
@@ -63,7 +63,7 @@ __cpu_indicator_init (void)
@@ -52,3 +52,6 @@ index 8506a635790..564296f788e 100644
-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
@@ -1,30 +0,0 @@
From 717346fbbd6642ba6b0c3af2deb3771794346507 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 06e90973ef3..669e64236c3 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
@@ -1,7 +1,7 @@
From db28b1e0f3b06325026ec5b5e7cdca4e9992e05c Mon Sep 17 00:00:00 2001
From 6ed790bb2e5bf49d186885cad8fd7efc10d8fd36 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
Subject: [PATCH 13/33] nopie
---
gcc/configure | 27 +++++++++++++++++++++++++++
@@ -9,10 +9,10 @@ Subject: [PATCH] nopie
2 files changed, 40 insertions(+)
diff --git a/gcc/configure b/gcc/configure
index e9060112384..2f6b3265a6c 100755
index 8c46369f73f..e59cbee1767 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -32497,6 +32497,33 @@ fi
@@ -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"
@@ -47,10 +47,10 @@ index e9060112384..2f6b3265a6c 100755
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 75a7048045c..e683d3a7a5f 100644
index 5504bf6eb01..57268319de1 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -7681,6 +7681,19 @@ AC_CACHE_CHECK([for -no-pie option],
@@ -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"
@@ -70,3 +70,6 @@ index 75a7048045c..e683d3a7a5f 100644
fi
AC_SUBST([NO_PIE_FLAG])
--
2.41.0
@@ -1,14 +1,14 @@
From fd642f8cd61849a9dc169588be5562ceda96a889 Mon Sep 17 00:00:00 2001
From c7398885b5c2cd91a3ad1a56fde272b719d17ff5 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:59:16 +0000
Subject: [PATCH] ada: fix shared linking
Subject: [PATCH 14/33] 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 a7574efb472..0ad0d66463c 100644
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";
@@ -37,3 +37,6 @@ index a7574efb472..0ad0d66463c 100644
int __gnat_link_max = 8192;
unsigned char __gnat_objlist_file_supported = 1;
const char *__gnat_object_library_extension = ".a";
--
2.41.0
@@ -1,17 +1,17 @@
From a547632f5c7caec4a164e8d5e5b568fb7a461365 Mon Sep 17 00:00:00 2001
From c2861147eacede8c97dbb8d251f7d30ac2116481 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:59:43 +0000
Subject: [PATCH] build: fix CXXFLAGS_FOR_BUILD passing
Subject: [PATCH 15/33] build: fix CXXFLAGS_FOR_BUILD passing
---
Makefile.in | 1 +
1 file changed, 1 insertion(+)
diff --git a/Makefile.in b/Makefile.in
index 593495e1650..b96f60e33e2 100644
index 06a9398e172..6ff2b3f9925 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -176,6 +176,7 @@ BUILD_EXPORTS = \
@@ -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)" \
@@ -19,3 +19,6 @@ index 593495e1650..b96f60e33e2 100644
LDFLAGS="$(LDFLAGS_FOR_BUILD)"
# This is the list of directories to built for the host system.
--
2.41.0
@@ -1,21 +0,0 @@
From 686e85d8a05f9f9e6c983afb13f937bd88fe84dd Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Thu, 6 Jan 2022 03:18:32 +0000
Subject: [PATCH] dlang: use libucontext on mips64
---
libphobos/configure.tgt | 1 +
1 file changed, 1 insertion(+)
diff --git a/libphobos/configure.tgt b/libphobos/configure.tgt
index 0063dd23249..c5e782a1238 100644
--- a/libphobos/configure.tgt
+++ b/libphobos/configure.tgt
@@ -38,6 +38,7 @@ case "${target}" in
;;
mips*-*-linux*)
LIBPHOBOS_SUPPORTED=yes
+ LIBDRUNTIME_NEEDS_UCONTEXT=yes
;;
power*-*-freebsd*)
LIBPHOBOS_SUPPORTED=yes
@@ -1,17 +1,17 @@
From 5bd37f8ee93a0fe1a3f841f48ed6626e7e0aa19d Mon Sep 17 00:00:00 2001
From 736fd338aaa6d0686b15beabac687a20cfb29c27 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 07:01:06 +0000
Subject: [PATCH] add fortify-headers paths
Subject: [PATCH 16/33] 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 74f70793d90..61b07f319f6 100644
index e3aca79cccc..b3537b8fbeb 100644
--- a/gcc/config/linux.h
+++ b/gcc/config/linux.h
@@ -172,6 +172,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
@@ -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 \
@@ -20,3 +20,6 @@ index 74f70793d90..61b07f319f6 100644
{ NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \
{ NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 },
#else
--
2.41.0
@@ -1,11 +1,11 @@
From d2577dc78a1f159e5c41fd0b53e73fa0e264cb52 Mon Sep 17 00:00:00 2001
From f71fef0a3d527ba84faaf63cee2a5ecb2322412e 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] 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.
Subject: [PATCH 17/33] 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.
not seem to fully fix the crosstoolchain and bootstrap sequence wrt.
stack-protector flag usage.
---
@@ -13,10 +13,10 @@ Subject: [PATCH] Alpine musl package provides libssp_nonshared.a. We link to
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index cc99d0b7aa1..c60a75371f8 100644
index b5a6f200635..6cbb726599b 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -1004,8 +1004,7 @@ proper position among the other output files. */
@@ -991,8 +991,7 @@ proper position among the other output files. */
#ifndef LINK_SSP_SPEC
#ifdef TARGET_LIBC_PROVIDES_SSP
@@ -26,3 +26,6 @@ index cc99d0b7aa1..c60a75371f8 100644
#else
#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
"|fstack-protector-strong|fstack-protector-explicit" \
--
2.41.0
@@ -1,7 +1,7 @@
From bbd5c529ef878c2d6096fd4949616714eb82683a Mon Sep 17 00:00:00 2001
From 06624ddc7dfd4dcfb4e41f4549ffcacfbc43b315 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 07:03:42 +0000
Subject: [PATCH] DP: Use --push-state/--pop-state for gold as well when
Subject: [PATCH 18/33] DP: Use --push-state/--pop-state for gold as well when
linking libtsan.
---
@@ -9,10 +9,10 @@ Subject: [PATCH] DP: Use --push-state/--pop-state for gold as well when
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index c60a75371f8..735b2b1bba1 100644
index 6cbb726599b..59390fd39d6 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -745,10 +745,10 @@ proper position among the other output files. */
@@ -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 "}" \
@@ -25,7 +25,7 @@ index c60a75371f8..735b2b1bba1 100644
STATIC_LIBASAN_LIBS
#else
#define LIBASAN_SPEC "-lasan" STATIC_LIBASAN_LIBS
@@ -784,10 +784,10 @@ proper position among the other output files. */
@@ -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 "}" \
@@ -38,7 +38,7 @@ index c60a75371f8..735b2b1bba1 100644
STATIC_LIBTSAN_LIBS
#else
#define LIBTSAN_SPEC "-ltsan" STATIC_LIBTSAN_LIBS
@@ -805,10 +805,10 @@ proper position among the other output files. */
@@ -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 "}" \
@@ -51,7 +51,7 @@ index c60a75371f8..735b2b1bba1 100644
STATIC_LIBLSAN_LIBS
#else
#define LIBLSAN_SPEC "-llsan" STATIC_LIBLSAN_LIBS
@@ -824,10 +824,10 @@ proper position among the other output files. */
@@ -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 "}" \
@@ -64,3 +64,6 @@ index c60a75371f8..735b2b1bba1 100644
STATIC_LIBUBSAN_LIBS
#else
#define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS
--
2.41.0
@@ -1,7 +1,7 @@
From 8fc8d6c26a2a45945182e211bc3ac2eae4d6a11b Mon Sep 17 00:00:00 2001
From cbc762f2d4c8ae714f7a0c762d90453607a5c2e5 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Thu, 6 Jan 2022 03:12:55 +0000
Subject: [PATCH] aarch64: disable multilib support
Subject: [PATCH 19/33] aarch64: disable multilib support
multilib is unsupported on Alpine GCC
---
@@ -9,7 +9,7 @@ multilib is unsupported on Alpine GCC
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/config/aarch64/t-aarch64-linux b/gcc/config/aarch64/t-aarch64-linux
index d0cd546002a..b63a77f4969 100644
index 57bf4100fcd..172894b57ef 100644
--- a/gcc/config/aarch64/t-aarch64-linux
+++ b/gcc/config/aarch64/t-aarch64-linux
@@ -22,7 +22,7 @@ LIB1ASMSRC = aarch64/lib1funcs.asm
@@ -21,3 +21,6 @@ index d0cd546002a..b63a77f4969 100644
MULTIARCH_DIRNAME = $(call if_multiarch,aarch64$(AARCH_BE)-linux-gnu)
MULTILIB_OSDIRNAMES += mabi.ilp32=../libilp32$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu_ilp32)
--
2.41.0
@@ -1,7 +1,7 @@
From 65ad898df141261a1ccd891a99133ad8f9847133 Mon Sep 17 00:00:00 2001
From f820b730e48421ab03e5742dc06e83570690078e Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Thu, 6 Jan 2022 03:13:59 +0000
Subject: [PATCH] s390x: disable multilib support
Subject: [PATCH 20/33] s390x: disable multilib support
multilib is not supported on Alpine GCC at present
---
@@ -20,3 +20,6 @@ index cc6ab367072..7f498ee1cdc 100644
-MULTILIB_OSDIRNAMES += $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:s390-linux-gnu)
+MULTILIB_OSDIRNAMES = m64=../lib
+MULTILIB_OSDIRNAMES+= m32=../lib32
--
2.41.0
@@ -1,45 +0,0 @@
From 714ed6d9649bf9ed42e34fef9c41169921e63921 Mon Sep 17 00:00:00 2001
From: Nils Andreas Svee <me@lochnair.net>
Date: Thu, 21 Dec 2017 03:14:33 +0100
Subject: [PATCH] mips64: disable multilib support
multilib is not supported by Alpine GCC
---
gcc/config/mips/mips.h | 8 ++++----
gcc/config/mips/t-linux64 | 6 +++---
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h
index 858bbba3a36..2d4f553e652 100644
--- a/gcc/config/mips/mips.h
+++ b/gcc/config/mips/mips.h
@@ -3447,11 +3447,11 @@ struct GTY(()) machine_function {
/* If we are *not* using multilibs and the default ABI is not ABI_32 we
need to change these from /lib and /usr/lib. */
#if MIPS_ABI_DEFAULT == ABI_N32
-#define STANDARD_STARTFILE_PREFIX_1 "/lib32/"
-#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib32/"
+#define STANDARD_STARTFILE_PREFIX_1 "/lib/"
+#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/"
#elif MIPS_ABI_DEFAULT == ABI_64
-#define STANDARD_STARTFILE_PREFIX_1 "/lib64/"
-#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib64/"
+#define STANDARD_STARTFILE_PREFIX_1 "/lib/"
+#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/"
#endif
/* Load store bonding is not supported by micromips and fix_24k. The
diff --git a/gcc/config/mips/t-linux64 b/gcc/config/mips/t-linux64
index 2fdd8e00407..406a3676289 100644
--- a/gcc/config/mips/t-linux64
+++ b/gcc/config/mips/t-linux64
@@ -21,6 +21,6 @@ MULTILIB_DIRNAMES = n32 32 64
MIPS_EL = $(if $(filter %el, $(firstword $(subst -, ,$(target)))),el)
MIPS_SOFT = $(if $(strip $(filter MASK_SOFT_FLOAT_ABI, $(target_cpu_default)) $(filter soft, $(with_float))),soft)
MULTILIB_OSDIRNAMES = \
- ../lib32$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabin32$(MIPS_SOFT)) \
- ../lib$(call if_multiarch,:mips$(MIPS_EL)-linux-gnu$(MIPS_SOFT)) \
- ../lib64$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabi64$(MIPS_SOFT))
+ ../lib \
+ ../lib32 \
+ ../lib
@@ -1,7 +1,7 @@
From 3263d8634da6d7e1edb1bfd88e1b2627ce0aa1be Mon Sep 17 00:00:00 2001
From 40c3d28f4d090fcd3486ca2a88d0c7618fdb03ed Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Thu, 6 Jan 2022 03:14:33 +0000
Subject: [PATCH] ppc64[le]: disable multilib support
Subject: [PATCH 21/33] ppc64[le]: disable multilib support
multilib is not presently supported on Alpine GCC
---
@@ -36,7 +36,7 @@ index 4e371255533..128c75c7d39 100644
endif
diff --git a/gcc/config/rs6000/t-linux64 b/gcc/config/rs6000/t-linux64
index 47e0efd5764..f89729af64f 100644
index 01a94242308..b3a76379c03 100644
--- a/gcc/config/rs6000/t-linux64
+++ b/gcc/config/rs6000/t-linux64
@@ -28,8 +28,8 @@
@@ -76,3 +76,6 @@ index 2e63bdb9fc9..c6e1c5db65d 100644
+MULTILIB_OSDIRNAMES := m64=../lib
+MULTILIB_OSDIRNAMES += m32=../lib32
MULTILIB_MATCHES := ${MULTILIB_MATCHES_ENDIAN}
--
2.41.0
@@ -1,7 +1,7 @@
From bf63353ea679e0bbf2c2f17bb64c75ebd590c6e7 Mon Sep 17 00:00:00 2001
From 05cf20eb11b3013c2fbb26c841485f675811058c Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Thu, 6 Jan 2022 03:14:54 +0000
Subject: [PATCH] x86_64: disable multilib support
Subject: [PATCH 22/33] x86_64: disable multilib support
multilib is not presently supported on Alpine GCC
---
@@ -9,7 +9,7 @@ multilib is not presently supported on Alpine GCC
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gcc/config/i386/t-linux64 b/gcc/config/i386/t-linux64
index 5526ad0e6cc..78866afab36 100644
index 138956b0962..bc03dab874f 100644
--- a/gcc/config/i386/t-linux64
+++ b/gcc/config/i386/t-linux64
@@ -33,6 +33,6 @@
@@ -21,3 +21,6 @@ index 5526ad0e6cc..78866afab36 100644
+MULTILIB_OSDIRNAMES = m64=../lib
+MULTILIB_OSDIRNAMES+= m32=../lib32
MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-linux-gnux32)
--
2.41.0
@@ -1,7 +1,7 @@
From 2eed19787020ce52cf07b76a5d167c420ec42b61 Mon Sep 17 00:00:00 2001
From 0920d23e3a345bc17675b9bebc52644c238123e2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
Date: Mon, 3 Jan 2022 07:14:48 +0100
Subject: [PATCH] riscv: disable multilib support
Subject: [PATCH 23/33] riscv: disable multilib support
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -38,15 +38,15 @@ library.
[4]: https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/gcc.c;h=d4c8746b0aa322286decf92aa72a12f0a393b655;hb=HEAD#l9122
[5]: https://gitlab.alpinelinux.org/alpine/aports/-/issues/13369
---
gcc/config/riscv/linux.h | 6 ------
gcc/config/riscv/linux.h | 8 --------
gcc/config/riscv/t-linux | 7 +++++--
2 files changed, 5 insertions(+), 8 deletions(-)
2 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/gcc/config/riscv/linux.h b/gcc/config/riscv/linux.h
index 3067ed6eac8..4c8c85e3285 100644
index f8c2c351e5a..8d9881eadeb 100644
--- a/gcc/config/riscv/linux.h
+++ b/gcc/config/riscv/linux.h
@@ -71,9 +71,3 @@ along with GCC; see the file COPYING3. If not see
@@ -61,11 +61,3 @@ along with GCC; see the file COPYING3. If not see
%{static:-static}}"
#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
@@ -56,6 +56,8 @@ index 3067ed6eac8..4c8c85e3285 100644
- "/usr/lib" XLEN_SPEC "/" ABI_SPEC "/ " \
- "/lib/ " \
- "/usr/lib/ "
-
-#define RISCV_USE_CUSTOMISED_MULTI_LIB select_by_abi
diff --git a/gcc/config/riscv/t-linux b/gcc/config/riscv/t-linux
index 216d2776a18..1a8a863853e 100644
--- a/gcc/config/riscv/t-linux
@@ -69,3 +71,6 @@ index 216d2776a18..1a8a863853e 100644
+MULTILIB_DIRNAMES := $(patsubst rv32%,lib32,$(patsubst rv64%,lib,$(MULTILIB_DIRNAMES)))
MULTILIB_OSDIRNAMES := $(patsubst lib%,../lib%,$(MULTILIB_DIRNAMES))
+MULTILIB_MATCHES := march?rv64gc=march?rv64imafdc
--
2.41.0
@@ -1,7 +1,7 @@
From 51a35c0fa0e793c6a2c64ae1449c0cfd681d8f8a Mon Sep 17 00:00:00 2001
From 5c955776d65f5a018375652904b088a37203899d Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 07:05:41 +0000
Subject: [PATCH] always build libgcc_eh.a
Subject: [PATCH 24/33] always build libgcc_eh.a
highly inspired by:
http://landley.net/hg/aboriginal/file/7e0747a665ab/sources/patches/gcc-core-libgcceh.patch
@@ -10,10 +10,10 @@ highly inspired by:
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in
index 09b3ec8bc2e..c9ca58c64cc 100644
index 6c4dc79ab71..023cede18a7 100644
--- a/libgcc/Makefile.in
+++ b/libgcc/Makefile.in
@@ -957,8 +957,9 @@ ifneq ($(LIBUNWIND),)
@@ -960,8 +960,9 @@ ifneq ($(LIBUNWIND),)
all: libunwind.a
endif
@@ -24,7 +24,7 @@ index 09b3ec8bc2e..c9ca58c64cc 100644
ifneq ($(LIBUNWIND),)
all: libunwind$(SHLIB_EXT)
libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_EXT)
@@ -1160,10 +1161,6 @@ install-libunwind:
@@ -1163,10 +1164,6 @@ install-libunwind:
install-shared:
$(mkinstalldirs) $(DESTDIR)$(inst_libdir)
@@ -35,7 +35,7 @@ index 09b3ec8bc2e..c9ca58c64cc 100644
$(subst @multilib_dir@,$(MULTIDIR),$(subst \
@shlib_base_name@,libgcc_s,$(subst \
@shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL))))
@@ -1180,6 +1177,10 @@ ifeq ($(enable_gcov),yes)
@@ -1183,6 +1180,10 @@ ifeq ($(enable_gcov),yes)
$(RANLIB) $(DESTDIR)$(inst_libdir)/libgcov.a
endif
@@ -46,3 +46,6 @@ index 09b3ec8bc2e..c9ca58c64cc 100644
parts="$(INSTALL_PARTS)"; \
for file in $$parts; do \
rm -f $(DESTDIR)$(inst_libdir)/$$file; \
--
2.41.0
@@ -1,7 +1,7 @@
From 64a1c5f57e278869f41c43ee56cc5defb3dd55c5 Mon Sep 17 00:00:00 2001
From ac6202d063308fbf67e4b617b768536e66a44519 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 07:06:30 +0000
Subject: [PATCH] ada: libgnarl compatibility for musl
Subject: [PATCH 25/33] ada: libgnarl compatibility for musl
---
gcc/ada/libgnarl/s-osinte__linux.ads | 11 ------
@@ -9,7 +9,7 @@ Subject: [PATCH] ada: libgnarl compatibility for musl
2 files changed, 3 insertions(+), 61 deletions(-)
diff --git a/gcc/ada/libgnarl/s-osinte__linux.ads b/gcc/ada/libgnarl/s-osinte__linux.ads
index 7c9e7ca4518..caafc4aa68f 100644
index a5e645d334d..32165347071 100644
--- a/gcc/ada/libgnarl/s-osinte__linux.ads
+++ b/gcc/ada/libgnarl/s-osinte__linux.ads
@@ -403,12 +403,6 @@ package System.OS_Interface is
@@ -38,7 +38,7 @@ index 7c9e7ca4518..caafc4aa68f 100644
sched_priority : int; -- scheduling priority
end record;
diff --git a/gcc/ada/libgnarl/s-taprop__linux.adb b/gcc/ada/libgnarl/s-taprop__linux.adb
index 4ff784f0ea7..b34a12802c6 100644
index 821ceef30e4..ae95b58e01e 100644
--- a/gcc/ada/libgnarl/s-taprop__linux.adb
+++ b/gcc/ada/libgnarl/s-taprop__linux.adb
@@ -198,9 +198,6 @@ package body System.Task_Primitives.Operations is
@@ -130,3 +130,6 @@ index 4ff784f0ea7..b34a12802c6 100644
Result := pthread_rwlock_init (L.RW'Access, RWlock_Attr'Access);
pragma Assert (Result in 0 | ENOMEM);
--
2.41.0
@@ -1,7 +1,7 @@
From 82addb1312f4f58a412a664228944009aa5cb569 Mon Sep 17 00:00:00 2001
From b7404c39a6a76ebe382caa2b9da16006413b21b9 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 07:07:48 +0000
Subject: [PATCH] ada: musl support fixes
Subject: [PATCH 26/33] ada: musl support fixes
---
gcc/ada/Makefile.rtl | 10 +++++-----
@@ -11,10 +11,10 @@ Subject: [PATCH] ada: musl support fixes
4 files changed, 32 insertions(+), 30 deletions(-)
diff --git a/gcc/ada/Makefile.rtl b/gcc/ada/Makefile.rtl
index aaf853e3a2a..e2dd3587ed5 100644
index 96306f8cc9a..090b6770ae5 100644
--- a/gcc/ada/Makefile.rtl
+++ b/gcc/ada/Makefile.rtl
@@ -1633,7 +1633,7 @@ ifeq ($(strip $(filter-out %86 linux%,$(target_cpu) $(target_os))),)
@@ -1549,7 +1549,7 @@ ifeq ($(strip $(filter-out %86 linux%,$(target_cpu) $(target_os))),)
s-intman.adb<libgnarl/s-intman__posix.adb \
s-tpopsp.adb<libgnarl/s-tpopsp__tls.adb \
$(TRASYM_DWARF_UNIX_PAIRS) \
@@ -23,7 +23,7 @@ index aaf853e3a2a..e2dd3587ed5 100644
a-exetim.adb<libgnarl/a-exetim__posix.adb \
a-exetim.ads<libgnarl/a-exetim__default.ads \
s-linux.ads<libgnarl/s-linux.ads \
@@ -2258,7 +2258,7 @@ ifeq ($(strip $(filter-out powerpc% linux%,$(target_cpu) $(target_os))),)
@@ -2174,7 +2174,7 @@ ifeq ($(strip $(filter-out powerpc% linux%,$(target_cpu) $(target_os))),)
s-tasinf.adb<libgnarl/s-tasinf__linux.adb \
s-taspri.ads<libgnarl/s-taspri__posix.ads \
$(TRASYM_DWARF_UNIX_PAIRS) \
@@ -32,7 +32,7 @@ index aaf853e3a2a..e2dd3587ed5 100644
$(ATOMICS_TARGET_PAIRS) \
$(ATOMICS_BUILTINS_TARGET_PAIRS) \
system.ads<libgnat/system-linux-ppc.ads
@@ -2289,7 +2289,7 @@ ifeq ($(strip $(filter-out powerpc% linux%,$(target_cpu) $(target_os))),)
@@ -2205,7 +2205,7 @@ ifeq ($(strip $(filter-out powerpc% linux%,$(target_cpu) $(target_os))),)
endif
# ARM linux, GNU eabi
@@ -41,7 +41,7 @@ index aaf853e3a2a..e2dd3587ed5 100644
LIBGNAT_TARGET_PAIRS = \
a-intnam.ads<libgnarl/a-intnam__linux.ads \
s-inmaop.adb<libgnarl/s-inmaop__posix.adb \
@@ -2504,7 +2504,7 @@ ifeq ($(strip $(filter-out %ia64 linux%,$(target_cpu) $(target_os))),)
@@ -2420,7 +2420,7 @@ ifeq ($(strip $(filter-out %ia64 linux%,$(target_cpu) $(target_os))),)
s-tpopsp.adb<libgnarl/s-tpopsp__tls.adb \
s-taspri.ads<libgnarl/s-taspri__posix-noaltstack.ads \
$(TRASYM_DWARF_UNIX_PAIRS) \
@@ -50,7 +50,7 @@ index aaf853e3a2a..e2dd3587ed5 100644
$(ATOMICS_TARGET_PAIRS) \
$(ATOMICS_BUILTINS_TARGET_PAIRS) \
$(GNATRTL_128BIT_PAIRS) \
@@ -2608,7 +2608,7 @@ ifeq ($(strip $(filter-out %x86_64 linux%,$(target_cpu) $(target_os))),)
@@ -2524,7 +2524,7 @@ ifeq ($(strip $(filter-out %x86_64 linux%,$(target_cpu) $(target_os))),)
s-tpopsp.adb<libgnarl/s-tpopsp__tls.adb \
s-taspri.ads<libgnarl/s-taspri__posix.ads \
$(TRASYM_DWARF_UNIX_PAIRS) \
@@ -58,9 +58,9 @@ index aaf853e3a2a..e2dd3587ed5 100644
+ s-tsmona.adb<libgnat/s-tsmona.adb \
$(ATOMICS_TARGET_PAIRS) \
$(X86_64_TARGET_PAIRS) \
$(GNATRTL_128BIT_PAIRS) \
$(SIMD_PATH_TARGET_PAIRS) \
diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c
index 591d033fbca..a485cbf15b9 100644
index 8522094164e..92b230a462b 100644
--- a/gcc/ada/adaint.c
+++ b/gcc/ada/adaint.c
@@ -91,6 +91,11 @@
@@ -75,7 +75,7 @@ index 591d033fbca..a485cbf15b9 100644
#ifdef __PikeOS__
#define __BSD_VISIBLE 1
@@ -3446,7 +3451,6 @@ __gnat_lwp_self (void)
@@ -3438,7 +3443,6 @@ __gnat_lwp_self (void)
#endif
#if defined (__linux__)
@@ -83,7 +83,7 @@ index 591d033fbca..a485cbf15b9 100644
/* glibc versions earlier than 2.7 do not define the routines to handle
dynamically allocated CPU sets. For these targets, we use the static
@@ -3456,7 +3460,7 @@ __gnat_lwp_self (void)
@@ -3448,7 +3452,7 @@ __gnat_lwp_self (void)
/* Dynamic cpu sets */
@@ -92,7 +92,7 @@ index 591d033fbca..a485cbf15b9 100644
__gnat_cpu_alloc (size_t count)
{
return CPU_ALLOC (count);
@@ -3469,33 +3473,33 @@ __gnat_cpu_alloc_size (size_t count)
@@ -3461,33 +3465,33 @@ __gnat_cpu_alloc_size (size_t count)
}
void
@@ -134,7 +134,7 @@ index 591d033fbca..a485cbf15b9 100644
}
size_t
@@ -3505,23 +3509,23 @@ __gnat_cpu_alloc_size (size_t count ATTRIBUTE_UNUSED)
@@ -3497,23 +3501,23 @@ __gnat_cpu_alloc_size (size_t count ATTRIBUTE_UNUSED)
}
void
@@ -164,10 +164,10 @@ index 591d033fbca..a485cbf15b9 100644
#endif /* !CPU_ALLOC */
#endif /* __linux__ */
diff --git a/gcc/ada/adaint.h b/gcc/ada/adaint.h
index 2631be5ad3e..d442f4bd6cd 100644
index 987432c9307..4d782f07de9 100644
--- a/gcc/ada/adaint.h
+++ b/gcc/ada/adaint.h
@@ -321,13 +321,11 @@ extern void *__gnat_lwp_self (void);
@@ -319,13 +319,11 @@ extern void *__gnat_lwp_self (void);
/* Routines for interface to required CPU set primitives */
@@ -186,10 +186,10 @@ index 2631be5ad3e..d442f4bd6cd 100644
#if defined (_WIN32)
diff --git a/gcc/ada/terminals.c b/gcc/ada/terminals.c
index 32d30a49c7e..d960e32e2d0 100644
index c0ee4a16bb1..ed796a48c1b 100644
--- a/gcc/ada/terminals.c
+++ b/gcc/ada/terminals.c
@@ -1132,7 +1132,7 @@ __gnat_setup_winsize (void *desc ATTRIBUTE_UNUSED,
@@ -1127,7 +1127,7 @@ __gnat_setup_winsize (void *desc ATTRIBUTE_UNUSED,
/* POSIX does not specify how to open the master side of a terminal.Several
methods are available (system specific):
1- using a cloning device (USE_CLONE_DEVICE)
@@ -198,7 +198,7 @@ index 32d30a49c7e..d960e32e2d0 100644
3- openpty (USE_OPENPTY)
When using the cloning device method, the macro USE_CLONE_DEVICE should
@@ -1146,7 +1146,7 @@ __gnat_setup_winsize (void *desc ATTRIBUTE_UNUSED,
@@ -1141,7 +1141,7 @@ __gnat_setup_winsize (void *desc ATTRIBUTE_UNUSED,
#if defined (__APPLE__) || defined (BSD)
#define USE_OPENPTY
#elif defined (__linux__)
@@ -207,7 +207,7 @@ index 32d30a49c7e..d960e32e2d0 100644
#elif defined (__sun__)
#define USE_CLONE_DEVICE "/dev/ptmx"
#elif defined (_AIX)
@@ -1195,8 +1195,8 @@ allocate_pty_desc (pty_desc **desc) {
@@ -1190,8 +1190,8 @@ allocate_pty_desc (pty_desc **desc) {
int master_fd = -1;
char *slave_name = NULL;
@@ -218,3 +218,6 @@ index 32d30a49c7e..d960e32e2d0 100644
#elif defined (USE_OPENPTY)
status = openpty (&master_fd, &slave_fd, NULL, NULL, NULL);
#elif defined (USE_CLONE_DEVICE)
--
2.41.0
@@ -1,7 +1,7 @@
From 573a66e4146c9a65d895af9081a4d3d49cfc9e7a Mon Sep 17 00:00:00 2001
From 401ac3feeea049a8035bf916f550ce6f4e859cba Mon Sep 17 00:00:00 2001
From: Drew DeVault <sir@cmpwn.com>
Date: Wed, 9 Dec 2020 16:07:26 +0000
Subject: [PATCH] configure: Add --enable-autolink-libatomic, use in
Date: Wed, 9 Dec 2020 07:42:06 +0000
Subject: [PATCH 27/33] configure: Add --enable-autolink-libatomic, use in
LINK_GCC_C_SEQUENCE_SPEC [PR81358]
This fixes issues with RISC-V.
@@ -9,19 +9,19 @@ This fixes issues with RISC-V.
Makefile.in | 1 +
gcc/config.in | 6 ++++++
gcc/config/gnu-user.h | 12 +++++++++++-
gcc/configure | 32 ++++++++++++++++++++++++++++++--
gcc/configure.ac | 22 +++++++++++++++++++++-
gcc/configure | 31 ++++++++++++++++++++++++++++++-
gcc/configure.ac | 21 +++++++++++++++++++++
gcc/doc/install.texi | 8 ++++++++
gcc/doc/tm.texi | 8 +++++++-
gcc/doc/tm.texi.in | 8 +++++++-
gcc/gcc.cc | 12 +++++++++++-
9 files changed, 102 insertions(+), 7 deletions(-)
9 files changed, 102 insertions(+), 5 deletions(-)
diff --git a/Makefile.in b/Makefile.in
index b564ddbf792..a95c7407d16 100644
index 6ff2b3f9925..394b105b271 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -232,6 +232,7 @@ HOST_EXPORTS = \
@@ -235,6 +235,7 @@ HOST_EXPORTS = \
RANLIB_FOR_TARGET="$(RANLIB_FOR_TARGET)"; export RANLIB_FOR_TARGET; \
READELF_FOR_TARGET="$(READELF_FOR_TARGET)"; export READELF_FOR_TARGET; \
TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \
@@ -30,7 +30,7 @@ index b564ddbf792..a95c7407d16 100644
GMPLIBS="$(HOST_GMPLIBS)"; export GMPLIBS; \
GMPINC="$(HOST_GMPINC)"; export GMPINC; \
diff --git a/gcc/config.in b/gcc/config.in
index f0fbf123aa8..af84efc4f9e 100644
index 0679fbbf4c6..ee81139b385 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -118,6 +118,12 @@
@@ -47,7 +47,7 @@ index f0fbf123aa8..af84efc4f9e 100644
format instead of DPD */
#ifndef USED_FOR_TARGET
diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h
index 8433e56c3e1..0347f10da8b 100644
index b26b17f2f2a..3f64ea46180 100644
--- a/gcc/config/gnu-user.h
+++ b/gcc/config/gnu-user.h
@@ -109,8 +109,18 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
@@ -71,10 +71,10 @@ index 8433e56c3e1..0347f10da8b 100644
#undef LINK_GCC_C_SEQUENCE_SPEC
diff --git a/gcc/configure b/gcc/configure
index 2f6b3265a6c..6dc65bf4ccb 100755
index e59cbee1767..787c35d4e25 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -981,6 +981,7 @@ with_changes_root_url
@@ -984,6 +984,7 @@ with_changes_root_url
enable_languages
with_multilib_list
with_multilib_generator
@@ -82,7 +82,7 @@ index 2f6b3265a6c..6dc65bf4ccb 100755
with_zstd
with_zstd_include
with_zstd_lib
@@ -1710,6 +1711,9 @@ Optional Features:
@@ -1713,6 +1714,9 @@ Optional Features:
--disable-shared don't provide a shared libgcc
--disable-gcov don't provide libgcov and related host tools
--enable-languages=LIST specify which front-ends to build
@@ -92,7 +92,7 @@ index 2f6b3265a6c..6dc65bf4ccb 100755
--disable-rpath do not hardcode runtime library paths
--enable-sjlj-exceptions
arrange to use setjmp/longjmp exception handling
@@ -8324,7 +8328,6 @@ else
@@ -8329,7 +8333,6 @@ else
fi
@@ -100,7 +100,7 @@ index 2f6b3265a6c..6dc65bf4ccb 100755
# Check whether --with-multilib-generator was given.
if test "${with_multilib_generator+set}" = set; then :
withval=$with_multilib_generator; :
@@ -8332,6 +8335,32 @@ else
@@ -8337,6 +8340,32 @@ else
with_multilib_generator=default
fi
@@ -133,16 +133,11 @@ index 2f6b3265a6c..6dc65bf4ccb 100755
# -------------------------
# Checks for other programs
@@ -34296,4 +34325,3 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
fi
-
diff --git a/gcc/configure.ac b/gcc/configure.ac
index e683d3a7a5f..07c81c78336 100644
index 57268319de1..56bcaa87620 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -1205,6 +1205,27 @@ AC_ARG_WITH(multilib-generator,
@@ -1199,6 +1199,27 @@ AC_ARG_WITH(multilib-generator,
:,
with_multilib_generator=default)
@@ -170,16 +165,11 @@ index e683d3a7a5f..07c81c78336 100644
# -------------------------
# Checks for other programs
# -------------------------
@@ -7839,4 +7860,3 @@ done
],
[subdirs='$subdirs'])
AC_OUTPUT
-
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index 48408d842db..c90be0ee750 100644
index 928fc6b6d4b..81a677014df 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -2295,6 +2295,14 @@ files, but these changed header paths may conflict with some compilation
@@ -2374,6 +2374,14 @@ files, but these changed header paths may conflict with some compilation
environments. Enabled by default, and may be disabled using
@option{--disable-canonical-system-headers}.
@@ -195,7 +185,7 @@ index 48408d842db..c90be0ee750 100644
Tell GCC that when the GNU C Library (glibc) is used on the target it
will be version @var{major}.@var{minor} or later. Normally this can
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index c5006afc00d..56b62c69ae8 100644
index a660e33739b..6183c407a2b 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -381,7 +381,13 @@ the argument @option{-lgcc} to tell the linker to do the search.
@@ -214,7 +204,7 @@ index c5006afc00d..56b62c69ae8 100644
@defmac POST_LINK_SPEC
diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in
index f869ddd5e5b..57c93f24ac3 100644
index f7ab5d48a63..281540aba68 100644
--- a/gcc/doc/tm.texi.in
+++ b/gcc/doc/tm.texi.in
@@ -381,7 +381,13 @@ the argument @option{-lgcc} to tell the linker to do the search.
@@ -233,10 +223,10 @@ index f869ddd5e5b..57c93f24ac3 100644
@defmac POST_LINK_SPEC
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index 735b2b1bba1..f10f3c91aa7 100644
index 59390fd39d6..dae1dd4cf79 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -987,13 +987,23 @@ proper position among the other output files. */
@@ -974,13 +974,23 @@ proper position among the other output files. */
# define ASM_DEBUG_OPTION_SPEC ""
#endif
@@ -261,3 +251,6 @@ index 735b2b1bba1..f10f3c91aa7 100644
#endif
#ifdef ENABLE_DEFAULT_SSP
--
2.41.0
@@ -1,8 +1,8 @@
From 4baaeb9661fa4015d9701e3616ce1ad4e8a07fd8 Mon Sep 17 00:00:00 2001
From cd46156af13743fe93c48d00b0661add2c319226 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
Date: Sun, 29 Aug 2021 09:45:27 +0200
Subject: [PATCH] configure: fix detection of atomic builtins in libatomic
configure script
Date: Sun, 29 Aug 2021 12:23:34 +0200
Subject: [PATCH 28/33] configure: fix detection of atomic builtins in
libatomic configure script
Alpine's --enable-autolink-libatomic (which is enabled for riscv64 by
default) causes the libatomic configure script to incorrectly detect
@@ -22,7 +22,7 @@ See:
1 file changed, 20 insertions(+)
diff --git a/libatomic/configure.tgt b/libatomic/configure.tgt
index 33f8c91ce77..3999db2cf8a 100644
index a92ae9e8309..90b579ca4d8 100644
--- a/libatomic/configure.tgt
+++ b/libatomic/configure.tgt
@@ -30,6 +30,26 @@
@@ -52,3 +52,6 @@ index 33f8c91ce77..3999db2cf8a 100644
case "${target_cpu}" in
alpha*)
# fenv.c needs this option to generate inexact exceptions.
--
2.41.0
Loaded 100 of 684 files, more files were not shown because too many files have changed in this diff. Show more