OCaml 4.14.0 rebuild
[arch-packages.git] / pacman / trunk / makepkg-use-ffile-prefix-map-instead-of-fdebug-prefi.patch
blobca667d88f29d74a7df9b9834adb1203a9da66162
1 From e37f7d8b6b4d2f9accf97eb96d0eacbddf2a1345 Mon Sep 17 00:00:00 2001
2 From: Xiretza <xiretza@xiretza.xyz>
3 Date: Sat, 1 Jan 2022 14:40:24 +0100
4 Subject: [PATCH] makepkg: use -ffile-prefix-map instead of -fdebug-prefix-map
6 >From gcc(1):
8 -ffile-prefix-map=old=new
9 [...] Specifying this option is equivalent to specifying all the
10 individual -f*-prefix-map options. This can be used to make reproducible
11 builds that are location independent.
13 Specifically, this additionally enables -fmacro-prefix-map=, which causes
14 prefix mapping to be applied to expansions of __FILE__ and similar macros.
16 Without this option, if source files are compiled by passing the
17 absolute file path to the compiler (as done by e.g. cmake), any
18 expansions of __FILE__ (e.g. from uses of assert()) will contain
19 $srcdir.
21 Signed-off-by: Allan McRae <allan@archlinux.org>
22 ---
23 scripts/libmakepkg/buildenv/debugflags.sh.in | 4 ++--
24 1 file changed, 2 insertions(+), 2 deletions(-)
26 diff --git a/scripts/libmakepkg/buildenv/debugflags.sh.in b/scripts/libmakepkg/buildenv/debugflags.sh.in
27 index e0a1ed00..84ca7b71 100644
28 --- a/scripts/libmakepkg/buildenv/debugflags.sh.in
29 +++ b/scripts/libmakepkg/buildenv/debugflags.sh.in
30 @@ -30,8 +30,8 @@ buildenv_functions+=('buildenv_debugflags')
32 buildenv_debugflags() {
33 if check_option "debug" "y"; then
34 - DEBUG_CFLAGS+=" -fdebug-prefix-map=$srcdir=${DBGSRCDIR:-/usr/src/debug}"
35 - DEBUG_CXXFLAGS+=" -fdebug-prefix-map=$srcdir=${DBGSRCDIR:-/usr/src/debug}"
36 + DEBUG_CFLAGS+=" -ffile-prefix-map=$srcdir=${DBGSRCDIR:-/usr/src/debug}"
37 + DEBUG_CXXFLAGS+=" -ffile-prefix-map=$srcdir=${DBGSRCDIR:-/usr/src/debug}"
38 DEBUG_RUSTFLAGS+=" --remap-path-prefix=$srcdir=${DBGSRCDIR:-/usr/src/debug}"
39 CFLAGS+=" $DEBUG_CFLAGS"
40 CXXFLAGS+=" $DEBUG_CXXFLAGS"