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

Windows support #11

Merged
merged 7 commits into from
Feb 5, 2024
Merged

Conversation

torkelrogstad
Copy link
Collaborator

@torkelrogstad torkelrogstad commented Jan 22, 2024

Adds support for building Windows binaries. This happens through cross-compiling from Linux. Some notes on this:

  1. I don't have a totally precise understanding of exactly what's needed on the builder machine. There are some notes scattered around the Zcash repo. I ended up using a Docker image provided by the Zcash team: electriccoinco/zcashd-build-ubuntu-jammy. I was not able to find the source for this Docker image, and therefore do not know precisely what it contains.
  2. The same build instructions we use for Linux and macOS work, with the sole exception of having to also link against libssp. This is needed in order to find a hardened version of memcpy.
  3. I have not been able to actually run this binary successfully. It runs for a few seconds, and then exits with a segmentation fault. Will have to dig into the underlying issues of this.
# from the root of this repo
docker run -ti -v $PWD:/zside --workdir /zside electriccoinco/zcashd-build-ubuntu-jammy bash

HOST=x86_64-w64-mingw32 make -C depends V=1 -j8
export CONFIG_SITE=$PWD/depends/x86_64-w64-mingw32/share/config.site
./autogen.sh
./configure --disable-tests --disable-bench --disable-hardening --enable-online-rust
make -C src cargo-build-lib
BRIDGE_LOCATION=$(dirname $(./contrib/devtools/find-libcxxbridge.sh))
export LDFLAGS="-L$BRIDGE_LOCATION -lcxxbridge1" 
./configure --disable-tests --disable-bench --disable-hardening --enable-online-rust
make -j8

# final result is in ./src/zsided.exe

str4d and others added 5 commits January 22, 2024 10:25
In practice we are using 14.0.0 in most cases, as the LLVM Project have
not published Ubuntu binaries for any point release after 14.0.0 (which
we are using here).
- We update Windows cross-compile builds to 15.0.7 because binaries are
  provided for it, but not currently for any other platform we need.
- We update native x84_64 macOS builds to 15.0.4 because no 15.0.6
  binaries are provided, and the 15.0.7 ones appear to be targeted at a
  newer Darwin version.
- We keep FreeBSD on 14.0.6 because no Clang 15 binaries are provided,
  and as FreeBSD is a Tier 3 platform it doesn't block us from upgrading
  the remaining platforms.
@torkelrogstad torkelrogstad force-pushed the windows-support branch 2 times, most recently from 78c7a6f to 6880b5a Compare January 23, 2024 12:46
@torkelrogstad torkelrogstad marked this pull request as ready for review January 25, 2024 09:07
@Ash-L2L Ash-L2L self-requested a review January 29, 2024 15:19
Copy link
Collaborator

@Ash-L2L Ash-L2L left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Ash-L2L Ash-L2L merged commit f4c92f1 into LayerTwo-Labs:master Feb 5, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants