Skip to content

Conversation

dongcarl
Copy link
Contributor

@dongcarl dongcarl commented Aug 8, 2020

  • Use $($(package)_cmake) instead of invoking cmake directly
  • Use well-known env vars instead of overriding CMake variables

Specify well-known env vars instead of using a workaround to split up CC
and CXX.
@DrahtBot
Copy link
Contributor

DrahtBot commented Aug 9, 2020

Guix builds

File commit 4b705b1
(master)
commit dd4a337
(master and this pull)
*-aarch64-linux-gnu-debug.tar.gz 7166f9d857e0beb3... e79f20c0b5ef525e...
*-aarch64-linux-gnu.tar.gz b41a668d77e98e8a... d9614c3a2450c2db...
*-arm-linux-gnueabihf-debug.tar.gz 96451f6f65702fdc... d2e8d52a6a19c8c2...
*-arm-linux-gnueabihf.tar.gz 7de1306dfbe540a4... e96b9030cdf76f21...
*-riscv64-linux-gnu-debug.tar.gz 19b4bf2bab5c713b... 39aea6ae56d8ba32...
*-riscv64-linux-gnu.tar.gz 640f95fea6056d32... 87aab213f5983975...
*-win-unsigned.tar.gz 733b9c59a0c0de46... 845e0f3dfe3763f3...
*-win64-debug.zip cc5b9f59f0b7ccdf... 74c0d5a545ac9d15...
*-win64-setup-unsigned.exe 1529ca094f7042eb... 5144bd5f06d99a5b...
*-win64.zip 3d91c73314927262... 8cfea9922721d0ba...
*-x86_64-linux-gnu-debug.tar.gz 697a9e8329e58c73... bc8001a2341d0c5c...
*-x86_64-linux-gnu.tar.gz 4a4a75fd54a32041... d85022e7651a1f3d...
*.tar.gz 863a380cc97a348c... b83af45bb80e8ad3...
guix_build.log 6c70fec424aa8e86... a8454e851dc9d2c0...
guix_build.log.diff 0e1c3d9801c966c3...

@DrahtBot
Copy link
Contributor

Gitian builds

File commit e349eee
(master)
commit adeefd4
(master and this pull)
bitcoin-core-linux-0.21-res.yml 0372e71b46f9d40f... b9e1666aecfaafa0...
bitcoin-core-osx-0.21-res.yml 4f923c053e78ef5e... da4e9481bbe31c84...
bitcoin-core-win-0.21-res.yml 7a08e17dd15907f2... 5f6f5160bfeeacdb...
*-aarch64-linux-gnu-debug.tar.gz 1a8a9205d549cab5... 7aa17c216a83bee1...
*-aarch64-linux-gnu.tar.gz 2bcce0777ecbc17b... 8d226aa2a22b28de...
*-arm-linux-gnueabihf-debug.tar.gz 0cbe42a72681e406... f0392e393e967b0d...
*-arm-linux-gnueabihf.tar.gz 951b6567da5d8704... 28f8c3b66df45352...
*-osx-unsigned.dmg 974bde7a4f342f60... ac24bdd5810d4d92...
*-osx64.tar.gz cf93dde281a4e117... 509c21259796f8df...
*-riscv64-linux-gnu-debug.tar.gz e63d0e4944f3805d... 949702d0f003e967...
*-riscv64-linux-gnu.tar.gz 3222f97768080388... d335cb170a0edefb...
*-win64-debug.zip aa92bd07339a7aeb... 45d1f772ccb6daad...
*-win64-setup-unsigned.exe 193b161053b71ddc... b1a647fb85ad3028...
*-win64.zip 2a263b5a2e06c4d9... e32ee7a013ee1152...
*-x86_64-linux-gnu-debug.tar.gz bb51dfd2db8dbbe6... fc9ad674819014ad...
*-x86_64-linux-gnu.tar.gz 0bbeb146a04fb504... 571973663029dfbd...
*.tar.gz f172e2db5f1742fd... 59ac8ad405932cea...
linux-build.log a43872b660fbbc1b... 12f03158aade41f4...
osx-build.log 90c5e013fb2ebb9b... 417a0564d02d6ca3...
win-build.log a1a826271b9ac0b4... 8cc5545298301cd8...
bitcoin-core-linux-0.21-res.yml.diff 5cfca0aae5e3a7f5...
bitcoin-core-osx-0.21-res.yml.diff ec27540431bee8d9...
bitcoin-core-win-0.21-res.yml.diff 3698ec4789f04b3f...
linux-build.log.diff 8454299b662fdccc...
osx-build.log.diff cc526a43ee86467f...
win-build.log.diff aaa779c52514d673...

@fanquake
Copy link
Member

Concept ACK. @ryanofsky could you take a look re multiprocess.

Copy link
Contributor

@ryanofsky ryanofsky left a comment

Choose a reason for hiding this comment

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

Code review ACK 8c7cd0c. Looks good, and I tested the native linux and linux->mac cross builds. It would have made sense to favor using CC/CXX environment variables over -DCMAKE_C_COMPILER and -DCMAKE_CXX_COMPILER for cmake cross compiles in #18677, but I didn't know at the time that cmake actually used these environment variables: https://cmake.org/cmake/help/latest/manual/cmake-env-variables.7.html

ifneq ($($(1)_type),build)
ifneq ($(host),$(build))
$(1)_cmake += -DCMAKE_SYSTEM_NAME=$($(host_os)_cmake_system) -DCMAKE_SYSROOT=$(host_prefix)
Copy link
Contributor

@ryanofsky ryanofsky Aug 12, 2020

Choose a reason for hiding this comment

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

In commit "depends: More robust cmake invocation" (8c7cd0c)

Note: Seems to makes sense -DCMAKE_SYSROOT setting here can be dropped if cmake picks up sysroot from CC/CXX variables. It apparently does if I run make -C depends HOST=x86_64-apple-darwin16 MULTIPROCESS=1 NO_QT=1 V=1 libmultiprocess_built, looking at CMAKE_CXX_COMPILER_ARG1 in CMakeCache.txt

I am still unsure of when we should and shouldn't use sysroot (#18915), but as long as values that are set are passed along that's probably good.

@dongcarl
Copy link
Contributor Author

Took another look and found a few very simple things I can add. Sorry for invalidating reviews @ryanofsky

@DrahtBot
Copy link
Contributor

Gitian builds

File commit e9b3012
(master)
commit 9bcab79
(master and this pull)
bitcoin-core-linux-0.21-res.yml cea1ba265603d02f... 79fcfe88f6c9f421...
bitcoin-core-osx-0.21-res.yml 77d7884f6a574134... 2b58e9a46bc9cd98...
bitcoin-core-win-0.21-res.yml 0b0f6bbbd9a5c0ef... c8e9bc95cd44836b...
*-aarch64-linux-gnu-debug.tar.gz 4ed42dd1dc70bea9... 5cfc51a821d8c415...
*-aarch64-linux-gnu.tar.gz 8a7a6ef9cccbae35... b34d71d590bf482d...
*-arm-linux-gnueabihf-debug.tar.gz e40e4858ee8bd4d1... 8dbdd5182bf9b7ea...
*-arm-linux-gnueabihf.tar.gz 7ddca7cad75ef53b... 434bc8e242ed464a...
*-osx-unsigned.dmg 79a2858ea685e8b0... d8c6d588e46e1e87...
*-osx64.tar.gz e77905a2f3abb599... e3b303bc5673de88...
*-riscv64-linux-gnu-debug.tar.gz 4ccc4f940f998b62... 62b08797adb775df...
*-riscv64-linux-gnu.tar.gz 561c5ed7ebaf0ea5... 36ef473441506df1...
*-win64-debug.zip e0b30b67a2217a50... b8af63844191d264...
*-win64-setup-unsigned.exe 3e5025cde6a4d3d5... 83458af5fc9d0879...
*-win64.zip caee7761af12305b... c5f0cb64cd9c944e...
*-x86_64-linux-gnu-debug.tar.gz 4036b1cb7c0177b0... d6c34fc426fa4735...
*-x86_64-linux-gnu.tar.gz e15879353155c44c... a1d71ca983461eba...
*.tar.gz e8cbb99f0f9f02a0... cd0f1b5bc4a42bb3...
linux-build.log 43933168846d907b... e3acec54b5912899...
osx-build.log f0d612ea7fbc1c07... 1a80d9948402e1b3...
win-build.log 54a3cd2d3d8f9dd4... 77eb45af6bcbe821...
bitcoin-core-linux-0.21-res.yml.diff cb59f8c6212eb61a...
bitcoin-core-osx-0.21-res.yml.diff 9cdb93e7ab76b049...
bitcoin-core-win-0.21-res.yml.diff 7daaf540c8f0b89f...
linux-build.log.diff 48a8716c113c8afd...
osx-build.log.diff ef9cf83c177dc970...
win-build.log.diff 972a3fcb1afed1a7...

@DrahtBot
Copy link
Contributor

Guix builds

File commit 197450f
(master)
commit 2deadc0
(master and this pull)
*-aarch64-linux-gnu-debug.tar.gz 8943872ac3d5df7c... dcd8b6876032eddb...
*-aarch64-linux-gnu.tar.gz 7307c4ee3d4934bd... dfe62392f391e516...
*-arm-linux-gnueabihf-debug.tar.gz fccc26d7c7dfa90b... 7c3b67f683846da0...
*-arm-linux-gnueabihf.tar.gz 34e1140f65a0f606... 79cf3f300a4844d3...
*-riscv64-linux-gnu-debug.tar.gz a94385d318571b00... d773b917d0fd0246...
*-riscv64-linux-gnu.tar.gz 3abb016b01e33949... aadb507dd10a561a...
*-win-unsigned.tar.gz f35d661c7f1bbdae... ec6b208ece6d8d11...
*-win64-debug.zip 62437d10c94cfef6... 716455789c2e80e7...
*-win64-setup-unsigned.exe 5e2b6831dd645b79... bb859d1c6dc47a5e...
*-win64.zip c9829996dc3386f5... f8f6e54b084001d1...
*-x86_64-linux-gnu-debug.tar.gz effc996453960003... 147de28b6b81f20f...
*-x86_64-linux-gnu.tar.gz 7ef18c4f4cd4f2e2... fc0154fcdca968f0...
*.tar.gz 5c60a590f5e9971c... ba72c4ff88c31457...
guix_build.log 3eca0392f5149475... 85ba55336e64951b...
guix_build.log.diff e05f02ebeb39c23d...

Copy link
Contributor

@ryanofsky ryanofsky left a comment

Choose a reason for hiding this comment

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

Code review ACK b893688. Only changes since last review are new commits adding whitespace, cppflags and ldflags to cmake invocation

@fanquake fanquake merged commit 8845b38 into bitcoin:master Sep 2, 2020
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Sep 3, 2020
b893688 depends: Specify LDFLAGS to cmake as well (Carl Dong)
b3f541f depends: Prepend CPPFLAGS to C{,XX}FLAGS for CMake (Carl Dong)
8e121e5 depends: Cleanup CMake invocation (Carl Dong)
8c7cd0c depends: More robust cmake invocation (Carl Dong)
3ecf0ec depends: Use $($(package)_cmake) instead of cmake (Carl Dong)

Pull request description:

  - Use `$($(package)_cmake)` instead of invoking `cmake` directly
  - Use well-known env vars instead of overriding CMake variables

ACKs for top commit:
  ryanofsky:
    Code review ACK b893688. Only changes since last review are new commits adding whitespace, cppflags and ldflags to cmake invocation

Tree-SHA512: cfcd8cc9dcd0b336cf48b82fca9fe4bbc7930ed397cb7a68a07066680eb4c1906a6a9b5bd2589b4b4999e8f16232fa30ee9b376b60f4456d0fff931fbf9cc19a
@ryanofsky
Copy link
Contributor

Still confirming but it seems like this PR might be causing an error on travis: "/home/travis/build/bitcoin/bitcoin/depends/x86_64-pc-linux-gnu/share/../native/bin/mpgen: error while loading shared libraries: libcapnpc-0.7.0.so: cannot open shared object file: No such file or directory" error in https://travis-ci.org/github/bitcoin/bitcoin/jobs/726983595#L2545

Running CI scripts locally, I'm able to reproduce the error. But if I revert the changes in this PR the error goes away. The difference seems to be caused by cmake no longer setting RUNPATH after this PR. With this PR, RUNPATH is empty, but if this PR is reverted, readelf shows:

$ readelf -d depends/x86_64-pc-linux-gnu/native/bin/mpgen | grep RUNPATH
 0x000000000000001d (RUNPATH)            Library runpath: [/home/russ/src/bitcoin/depends/x86_64-pc-linux-gnu/native/lib]

I need to dig in more but two questions I have are:

  1. Why did travis not catch this problem when this PR was being worked on or after this PR was merged. Is there a cache that we failed to clear? Is there a cache we should be clearing when we update depends scripts in the future? (The travis error above started happening after I pushed a PR update that bumped the depends/packages/native_libmultiprocess.mk package, so I think that accounts for why a cache might have been avoided in the failing run above).

  2. What change in this PR might be clobbering the cmake RUNPATH? If I had to guess it might be happening because the LDFLAGS environment variable was unset previously, but now it is set

@fanquake
Copy link
Member

@ryanofsky thanks for following up here. Did your digging turn anything up? I've opened #19981 in the interim so this doesn't get lost.

ryanofsky added a commit to ryanofsky/bitcoin that referenced this pull request Sep 24, 2020
After bitcoin#19685 started setting LDFLAGS, the INSTALL_RPATH_USE_LINK_PATH cmake
option used in the libmultiprocess build seems to no longer work so it is
neccessary to set CMAKE_INSTALL_RPATH as a fallback.

It's unclear currently whether the bad interaction between
INSTALL_RPATH_USE_LINK_PATH and LDFLAGS is a bug, but the issue is reported:

bitcoin#19981 (comment)
https://discourse.cmake.org/t/install-rpath-use-link-path-not-working-when-cmake-exe-linker-flags-ldflags-is-set/1892
ryanofsky added a commit to ryanofsky/bitcoin that referenced this pull request Sep 30, 2020
After bitcoin#19685 started setting LDFLAGS, the INSTALL_RPATH_USE_LINK_PATH cmake
option used in the libmultiprocess build no longer works, so it is neccessary
to set CMAKE_INSTALL_RPATH as a fallback.

It's unclear currently whether the bad interaction between
INSTALL_RPATH_USE_LINK_PATH and LDFLAGS is a bug, but the issue is reported:

bitcoin#19981 (comment)
https://discourse.cmake.org/t/install-rpath-use-link-path-not-working-when-cmake-exe-linker-flags-ldflags-is-set/1892

Fixes bitcoin#19981
ryanofsky added a commit to ryanofsky/bitcoin that referenced this pull request Oct 1, 2020
After bitcoin#19685 started setting LDFLAGS, the INSTALL_RPATH_USE_LINK_PATH cmake
option used in the libmultiprocess build no longer works, so it is neccessary
to set CMAKE_INSTALL_RPATH as a fallback.

It's unclear currently whether the bad interaction between
INSTALL_RPATH_USE_LINK_PATH and LDFLAGS is a bug, but the issue is reported:

bitcoin#19981 (comment)
https://discourse.cmake.org/t/install-rpath-use-link-path-not-working-when-cmake-exe-linker-flags-ldflags-is-set/1892

Fixes bitcoin#19981
ryanofsky added a commit to ryanofsky/bitcoin that referenced this pull request Oct 1, 2020
After bitcoin#19685 started setting LDFLAGS, the INSTALL_RPATH_USE_LINK_PATH cmake
option used in the libmultiprocess build no longer works, so it is neccessary
to set CMAKE_INSTALL_RPATH as a fallback.

It's unclear currently whether the bad interaction between
INSTALL_RPATH_USE_LINK_PATH and LDFLAGS is a bug, but the issue is reported:

bitcoin#19981 (comment)
https://discourse.cmake.org/t/install-rpath-use-link-path-not-working-when-cmake-exe-linker-flags-ldflags-is-set/1892

Fixes bitcoin#19981
ryanofsky added a commit to ryanofsky/bitcoin that referenced this pull request Oct 1, 2020
After bitcoin#19685 started setting LDFLAGS, the INSTALL_RPATH_USE_LINK_PATH cmake
option used in the libmultiprocess build no longer works, so it is neccessary
to set CMAKE_INSTALL_RPATH as a fallback.

It's unclear currently whether the bad interaction between
INSTALL_RPATH_USE_LINK_PATH and LDFLAGS is a bug, but the issue is reported:

bitcoin#19981 (comment)
https://discourse.cmake.org/t/install-rpath-use-link-path-not-working-when-cmake-exe-linker-flags-ldflags-is-set/1892

Fixes bitcoin#19981
ryanofsky added a commit to ryanofsky/bitcoin that referenced this pull request Oct 1, 2020
After bitcoin#19685 started setting LDFLAGS, the INSTALL_RPATH_USE_LINK_PATH cmake
option used in the libmultiprocess build no longer works, so it is neccessary
to set CMAKE_INSTALL_RPATH as a fallback.

It's unclear currently whether the bad interaction between
INSTALL_RPATH_USE_LINK_PATH and LDFLAGS is a bug, but the issue is reported:

bitcoin#19981 (comment)
https://discourse.cmake.org/t/install-rpath-use-link-path-not-working-when-cmake-exe-linker-flags-ldflags-is-set/1892

Fixes bitcoin#19981
ryanofsky added a commit to ryanofsky/bitcoin that referenced this pull request Oct 2, 2020
After bitcoin#19685 started setting LDFLAGS, the INSTALL_RPATH_USE_LINK_PATH cmake
option used in the libmultiprocess build no longer works, so it is neccessary
to set CMAKE_INSTALL_RPATH as a fallback.

It's unclear currently whether the bad interaction between
INSTALL_RPATH_USE_LINK_PATH and LDFLAGS is a bug, but the issue is reported:

  bitcoin#19981 (comment)
  https://discourse.cmake.org/t/install-rpath-use-link-path-not-working-when-cmake-exe-linker-flags-ldflags-is-set/1892

Commands useful for building / testing this change

  make -C depends MULTIPROCESS=1 print-libmultiprocess_cmake
  make -C depends MULTIPROCESS=1 print-native_libmultiprocess_cmake
  make -C depends MULTIPROCESS=1 HOST=x86_64-apple-darwin16 print-libmultiprocess_cmake

  rm -rvf depends/x86_64-pc-linux-gnu/native depends/work/staging depends/work/build
  make -C depends MULTIPROCESS=1 V=1 native_libmultiprocess_staged
  for f in `find -name mpgen`; do echo == $f ==; readelf -d $f | grep -i path; done

  make -C depends MULTIPROCESS=1 V=1 native_libmultiprocess_built
  find -name CMakeCache.txt

Fixes bitcoin#19981
ryanofsky added a commit to ryanofsky/bitcoin that referenced this pull request Oct 2, 2020
After bitcoin#19685 started setting LDFLAGS, the INSTALL_RPATH_USE_LINK_PATH cmake
option used in the libmultiprocess build no longer works, so it is neccessary
to set CMAKE_INSTALL_RPATH as a fallback.

It's unclear currently whether the bad interaction between
INSTALL_RPATH_USE_LINK_PATH and LDFLAGS is a bug, but the issue is reported:

  bitcoin#19981 (comment)
  https://discourse.cmake.org/t/install-rpath-use-link-path-not-working-when-cmake-exe-linker-flags-ldflags-is-set/1892

Commands useful for building / testing this change

  make -C depends MULTIPROCESS=1 print-libmultiprocess_cmake
  make -C depends MULTIPROCESS=1 print-native_libmultiprocess_cmake
  make -C depends MULTIPROCESS=1 HOST=x86_64-apple-darwin16 print-libmultiprocess_cmake

  rm -rvf depends/x86_64-pc-linux-gnu/native depends/work/staging depends/work/build
  make -C depends MULTIPROCESS=1 V=1 native_libmultiprocess_staged
  for f in `find -name mpgen`; do echo == $f ==; readelf -d $f | grep -i path; done

  make -C depends MULTIPROCESS=1 V=1 native_libmultiprocess_built
  find -name CMakeCache.txt

Fixes bitcoin#19981
ryanofsky added a commit to ryanofsky/bitcoin that referenced this pull request Nov 25, 2020
depends: Set CMAKE_INSTALL_RPATH for native packages

After bitcoin#19685 started setting LDFLAGS, the INSTALL_RPATH_USE_LINK_PATH cmake
option used in the libmultiprocess build no longer works, so it is neccessary
to set CMAKE_INSTALL_RPATH as a fallback.

It's unclear currently whether the bad interaction between
INSTALL_RPATH_USE_LINK_PATH and LDFLAGS is a bug, but the issue is reported:

  bitcoin#19981 (comment)
  https://discourse.cmake.org/t/install-rpath-use-link-path-not-working-when-cmake-exe-linker-flags-ldflags-is-set/1892

Commands useful for building / testing this change

  make -C depends MULTIPROCESS=1 print-libmultiprocess_cmake
  make -C depends MULTIPROCESS=1 print-native_libmultiprocess_cmake
  make -C depends MULTIPROCESS=1 HOST=x86_64-apple-darwin16 print-libmultiprocess_cmake

  rm -rvf depends/x86_64-pc-linux-gnu/native depends/work/staging depends/work/build
  make -C depends MULTIPROCESS=1 V=1 native_libmultiprocess_staged
  for f in `find -name mpgen`; do echo == $f ==; readelf -d $f | grep -i path; done

  make -C depends MULTIPROCESS=1 V=1 native_libmultiprocess_built
  find -name CMakeCache.txt

Fixes bitcoin#19981
fanquake added a commit that referenced this pull request Dec 10, 2020
7d0271b depends: Set CMAKE_INSTALL_RPATH for native packages (Russell Yanofsky)

Pull request description:

  This PR is part of the [process separation project](https://github.com/bitcoin/bitcoin/projects/10).

  ---

  After #19685 started setting `LDFLAGS`, the `INSTALL_RPATH_USE_LINK_PATH` cmake option used in the libmultiprocess build no longer works, so it is neccessary to set `CMAKE_INSTALL_RPATH` as a fallback.

  It's unclear currently whether the bad interaction between `INSTALL_RPATH_USE_LINK_PATH` and `LDFLAGS` is a bug, but the issue is reported:

  - #19981 (comment)
  - https://discourse.cmake.org/t/install-rpath-use-link-path-not-working-when-cmake-exe-linker-flags-ldflags-is-set/1892

  Fixes #19981

ACKs for top commit:
  fanquake:
    ACK 7d0271b - I haven't looked in depth, but I've re-read through #19981 and checked the failure by testing #19160 (with this reverted):
  dongcarl:
    ACK 7d0271b Looked into this a bit, it makes sense that for the things we build in depends, we want the library search to start in depends. It seems reasonable to expect this to happen automatically when `CMAKE_INSTALL_PREFIX` and `INSTALL_RPATH_USE_LINK_PATH` are set, but oh well...

Tree-SHA512: 97cc5801c3204c14cd33004423631456ca0701e2127ee5146810a76e2f4aac9de1f4b5437402a4329cda54e022dc99270fee7e38c2995765f36b3848215fa78e
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Dec 10, 2020
…ages

7d0271b depends: Set CMAKE_INSTALL_RPATH for native packages (Russell Yanofsky)

Pull request description:

  This PR is part of the [process separation project](https://github.com/bitcoin/bitcoin/projects/10).

  ---

  After bitcoin#19685 started setting `LDFLAGS`, the `INSTALL_RPATH_USE_LINK_PATH` cmake option used in the libmultiprocess build no longer works, so it is neccessary to set `CMAKE_INSTALL_RPATH` as a fallback.

  It's unclear currently whether the bad interaction between `INSTALL_RPATH_USE_LINK_PATH` and `LDFLAGS` is a bug, but the issue is reported:

  - bitcoin#19981 (comment)
  - https://discourse.cmake.org/t/install-rpath-use-link-path-not-working-when-cmake-exe-linker-flags-ldflags-is-set/1892

  Fixes bitcoin#19981

ACKs for top commit:
  fanquake:
    ACK 7d0271b - I haven't looked in depth, but I've re-read through bitcoin#19981 and checked the failure by testing bitcoin#19160 (with this reverted):
  dongcarl:
    ACK 7d0271b Looked into this a bit, it makes sense that for the things we build in depends, we want the library search to start in depends. It seems reasonable to expect this to happen automatically when `CMAKE_INSTALL_PREFIX` and `INSTALL_RPATH_USE_LINK_PATH` are set, but oh well...

Tree-SHA512: 97cc5801c3204c14cd33004423631456ca0701e2127ee5146810a76e2f4aac9de1f4b5437402a4329cda54e022dc99270fee7e38c2995765f36b3848215fa78e
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Feb 15, 2022
$(1)_cmake += -DCMAKE_SYSTEM_NAME=$($(host_os)_cmake_system) -DCMAKE_SYSROOT=$(host_prefix)
$(1)_cmake += -DCMAKE_C_COMPILER_TARGET=$(host) -DCMAKE_C_COMPILER=$(firstword $($($(1)_type)_CC)) -DCMAKE_C_FLAGS="$(wordlist 2,1000,$($($(1)_type)_CC))"
$(1)_cmake += -DCMAKE_CXX_COMPILER_TARGET=$(host) -DCMAKE_CXX_COMPILER=$(firstword $($($(1)_type)_CXX)) -DCMAKE_CXX_FLAGS="$(wordlist 2,1000,$($($(1)_type)_CXX))"
$(1)_cmake += -DCMAKE_SYSTEM_NAME=$($(host_os)_cmake_system)
Copy link
Member

Choose a reason for hiding this comment

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

Cross posting @fanquake's comment:

The cmake docs say that CMAKE_SYSTEM_VERSION must also be set explicitly when cross-compiling:

When the CMAKE_SYSTEM_NAME variable is set explicitly to enable cross compiling then the value of CMAKE_SYSTEM_VERSION must also be set explicitly to specify the target system version.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants