Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sailfishos][build] Enable elf-hack. Fixes JB#57563 #146

Merged
merged 2 commits into from Apr 7, 2022

Conversation

llewelld
Copy link
Member

Applies the upstream patches to allow elf-hack support on aarch64 (thanks @krnlyng for identifying them), and enables elf-hack to run for all Sailfish architectures.

@llewelld llewelld marked this pull request as draft March 24, 2022 09:22
@llewelld llewelld force-pushed the jb57563 branch 2 times, most recently from 3cabcd1 to e960500 Compare March 29, 2022 06:14
@llewelld llewelld marked this pull request as ready for review March 29, 2022 06:15
@llewelld llewelld changed the title [sailfishos][build] Enable elf-hack. Fixes JB#57694 [sailfishos][build] Enable elf-hack. Fixes JB#57563 Mar 29, 2022
@llewelld
Copy link
Member Author

I had to make some additional changes to get this to work across all platforms.

  1. Use 64-bit integers for file positions in elfhack.
  2. Disable the build-time elfhack tests. These cause a qemu segfault, but pass fine on the actual hardware.

@llewelld
Copy link
Member Author

Rebased.

@rainemak
Copy link
Member

rainemak commented Apr 6, 2022

Rebase before merging. Let's get this to the master.

Fixes elfhack to use 64 bit file positions, since otherwise the position
variables overflow.

Disables the elfhack tests during the build since these fail to execute
correctly under quemu, although they run fine on real arm hardware. Note
that the CROSS_COMPILE define isn't set because HOST is the same as
TARGET when building using the Sailfish SDK.

In addition, the following two upstream changes are applied.

1. mozilla/gecko-dev@8918f41
2. mozilla/gecko-dev@523b155

Details of these follow.

commit 8918f41
Author: Mike Hommey <mh+mozilla@glandium.org>
Date:   Wed Dec 29 01:18:29 2021 +0000

Bug 1495733 - Use a 64-bits internal representation in elfhack.
r=gsvelto

Elfhack currently can't deal with files larger than 4GiB because it
translates all ELF data structures to the 32-bits variant, even for
64-bits ELF files. So if the original file has e.g. sections that start
after the 4GiB boundary, they can't be represented in memory.

Practically speaking, this is not causing problems, but has prevented a
working elfhack for aarch64 because e.g. some relocation types don't fit
in the 32-bits ELF representation.

Differential Revision: https://phabricator.services.mozilla.com/D134745

commit 523b155
Author: Mike Hommey <mh+mozilla@glandium.org>
Date:   Thu Dec 30 20:52:55 2021 +0000

Bug 1747783 - Add support for aarch64 to elfhack. r=gsvelto

Differential Revision: https://phabricator.services.mozilla.com/D134764
The elf-hack decreases the binary size and reduces start-up time.
@llewelld
Copy link
Member Author

llewelld commented Apr 7, 2022

Rebased.

@llewelld llewelld merged commit 3184ea0 into sailfishos:master Apr 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants