Skip to content

Commit

Permalink
Merge #315: cmake: Fix prefix maps for Guix builds
Browse files Browse the repository at this point in the history
f32f42d fixup! cmake: Migrate Guix build scripts to CMake (Hennadii Stepanov)

Pull request description:

  Fixes #297.

  CMake uses absolute paths for source files when invoking a compiler. This change makes the resulting Guix binaries location independent.

  The resulting behaviour mirrors that of the master branch.

  ---

  NOTE. On the master branch, `HOST_CFLAGS+=" -ffile-prefix-map=${PWD}=."` evaluates to `HOST_CFLAGS+=" -ffile-prefix-map=/bitcoin=."`, which effectively does nothing because there is no such a path among source files being compiled. Binaries appear file path independent because file paths relative to the source directory are used when invoking a compiler.

ACKs for top commit:
  m3dwards:
    ACK f32f42d

Tree-SHA512: 790f010f22394c81f0e3d476934ee67390f8532a5b34f168b31621a56c978ef82563542cbbfc8b583cb38869169f291e814c7820ad86aef3c567b256b8a3c8fd
  • Loading branch information
hebasto committed Aug 10, 2024
2 parents 97bc580 + f32f42d commit 46ff477
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion contrib/guix/libexec/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ CONFIGFLAGS="-DREDUCE_EXPORTS=ON -DBUILD_BENCH=OFF -DBUILD_GUI_TESTS=OFF -DBUILD
HOST_CFLAGS="-O2 -g"
HOST_CFLAGS+=$(find /gnu/store -maxdepth 1 -mindepth 1 -type d -exec echo -n " -ffile-prefix-map={}=/usr" \;)
case "$HOST" in
*linux*) HOST_CFLAGS+=" -ffile-prefix-map=${PWD}=." ;;
*linux*) HOST_CFLAGS+=" -ffile-prefix-map=${DISTSRC}/src=." ;;
*mingw*) HOST_CFLAGS+=" -fno-ident" ;;
*darwin*) unset HOST_CFLAGS ;;
esac
Expand Down

0 comments on commit 46ff477

Please sign in to comment.