dash/contrib/gitian-descriptors
fanquake 87de9c8f5c Merge #17929: build: add linker optimisation flags to gitian & guix (Linux)
f2b5b0a3b48f9241971c14238040048f8b630811 build: add linker optimization flags to guix (fanquake)
b8b050a8d642e38c81d1e451750c2c8db92fee5e build: add linker optimization flags to gitian descriptors (fanquake)

Pull request description:

  This PR adds `-Wl,O2` to our gitian and guix LDFLAGS. This makes the linker perform certain optimisations (and is different from LTO).

  Any -O argument will enable optimizations in GNU ld. We can use -O2 here, as this matches our compile flags. Note that this would also enable additional optimizations if using the lld or gold linkers, when compared to -O0.

  A nice writeup + diagrams of some of these optimizations is  available here: http://lwn.net/Articles/192624/.

  #### master
  ```bash
  # bitcoind
  Histogram for `.gnu.hash' bucket list length (total of 3 buckets)
   Length  Number     % of total  Coverage
        0  1          ( 33.3%)       0.0%
        1  0          (  0.0%)       0.0%
        2  1          ( 33.3%)      40.0%
        3  1          ( 33.3%)     100.0%
  ```
  ```bash
  # bitcoin-qt
  Histogram for `.gnu.hash' bucket list length (total of 3 buckets)
   Length  Number     % of total  Coverage
        0  0          (  0.0%)       0.0%
        1  1          ( 33.3%)      10.0%
        2  0          (  0.0%)      10.0%
        3  0          (  0.0%)      10.0%
        4  1          ( 33.3%)      50.0%
        5  1          ( 33.3%)     100.0%
  ```

  #### this PR:
  ```bash
  # bitcoind
  Histogram for `.gnu.hash' bucket list length (total of 8 buckets)
   Length  Number     % of total  Coverage
        0  3          ( 37.5%)       0.0%
        1  5          ( 62.5%)     100.0%
  ```
  ```bash
  # bitcoin-qt
  Histogram for `.gnu.hash' bucket list length (total of 19 buckets)
   Length  Number     % of total  Coverage
        0  9          ( 47.4%)       0.0%
        1  10         ( 52.6%)     100.0%
  ```

  #### GNU ld -O

  > If level is a numeric values greater than zero ld optimizes the output. This might take significantly longer and therefore probably should only be enabled for the final binary. At the moment this option only affects ELF shared library generation. Future releases of the linker may make more use of this option. Also currently there is no difference in the linker’s behaviour for different non-zero values of this option. Again this may change with future releases.

  #### lld -O

  > Optimize output file size

ACKs for top commit:
  dongcarl:
    ACK f2b5b0a3b48f9241971c14238040048f8b630811
  laanwj:
    ACK f2b5b0a3b48f9241971c14238040048f8b630811

Tree-SHA512: e53f3a4338317dbec65d3a93b57b5a6204aabdf9ac82d99447847a3c8627facc53c58c2cf947376f13edd979fc8129a80f18d9ebeccd191a576c83f1dad5c513
2023-02-20 09:09:23 -06:00
..
assign_DISTNAME partial merge #18741: guix: Make source tarball using git-archive 2021-12-03 18:13:01 +03:00
gitian-linux.yml Merge #17929: build: add linker optimisation flags to gitian & guix (Linux) 2023-02-20 09:09:23 -06:00
gitian-osx-signer.yml bump signapple to the latest commit used in bitcoin atm 2022-08-17 18:35:47 +03:00
gitian-osx.yml Merge #17863: scripts: Add MACHO dylib checks to symbol-check.py 2022-10-03 16:08:31 -04:00
gitian-win-signer.yml partial merge #21036: gitian: Bump descriptors to Focal for 22.0 2021-12-03 18:13:02 +03:00
gitian-win.yml partial bitcoin#19077: Add sqlite as an alternative wallet database and use it for new descriptor wallets 2023-02-07 10:53:33 -06:00
README.md Merge #10680: Fix inconsistencies and grammar in various files 2020-01-10 10:33:53 -06:00

Gavin's notes on getting Gitian builds up and running using KVM

These instructions distilled from https://help.ubuntu.com/community/KVM/Installation.

You need the right hardware: you need a 64-bit-capable CPU with hardware virtualization support (Intel VT-x or AMD-V). Not all modern CPUs support hardware virtualization.

You probably need to enable hardware virtualization in your machine's BIOS.

You need to be running a recent version of 64-bit-Ubuntu, and you need to install several prerequisites:

sudo apt-get install ruby apache2 git apt-cacher-ng python-vm-builder qemu-kvm

Sanity checks:

sudo service apt-cacher-ng status  # Should return apt-cacher-ng is running
ls -l /dev/kvm   # Should show a /dev/kvm device

Once you've got the right hardware and software:

git clone git://github.com/dashpay/dash.git
git clone git://github.com/devrandom/gitian-builder.git
mkdir gitian-builder/inputs
cd gitian-builder/inputs

# Create base images
cd gitian-builder
bin/make-base-vm --suite bionic --arch amd64
cd ..

# Get inputs (see doc/release-process.md for exact inputs needed and where to get them)
...

# For further build instructions see doc/release-process.md
...

gitian-builder now also supports building using LXC. See help.ubuntu.com for how to get LXC up and running under Ubuntu.

If your main machine is a 64-bit Mac or PC with a few gigabytes of memory and at least 10 gigabytes of free disk space, you can gitian-build using LXC running inside a virtual machine.

Here's a description of Gavin's setup on OSX 10.6:

  1. Download and install VirtualBox from https://www.virtualbox.org/

  2. Download the 64-bit Ubuntu Desktop 12.04 LTS .iso CD image from http://www.ubuntu.com/

  3. Run VirtualBox and create a new virtual machine, using the Ubuntu .iso (see the VirtualBox documentation for details). Create it with at least 2 gigabytes of memory and a disk that is at least 20 gigabytes big.

  4. Inside the running Ubuntu desktop, install:

     sudo apt-get install debootstrap lxc ruby apache2 git apt-cacher-ng python-vm-builder
    
  5. Still inside Ubuntu, tell gitian-builder to use LXC, then follow the "Once you've got the right hardware and software" instructions above:

     export USE_LXC=1
     git clone git://github.com/dashpay/dash.git
     ... etc