From bcacb00fc89c04ec0b5e7ebefe3b605b266cef57 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Sun, 6 Oct 2019 21:33:41 -0400 Subject: makepkg: add rust support for *FLAGS and debug-prefix-map The rust language supports $RUSTFLAGS to be used automatically in all rustc invocations. Allow setting this in makepkg.conf (e.g. for optimization or debuginfo support), and teach debug+strip to pass the rustc command line argument necessary to rewrite source file paths in the debugging symbols. Signed-off-by: Eli Schwartz Signed-off-by: Allan McRae --- scripts/libmakepkg/buildenv/buildflags.sh.in | 2 +- scripts/libmakepkg/buildenv/debugflags.sh.in | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'scripts/libmakepkg/buildenv') diff --git a/scripts/libmakepkg/buildenv/buildflags.sh.in b/scripts/libmakepkg/buildenv/buildflags.sh.in index daccc9cc..85ee80fc 100644 --- a/scripts/libmakepkg/buildenv/buildflags.sh.in +++ b/scripts/libmakepkg/buildenv/buildflags.sh.in @@ -30,6 +30,6 @@ buildenv_functions+=('buildenv_buildflags') buildenv_buildflags() { if check_option "buildflags" "n"; then - unset CPPFLAGS CFLAGS DEBUG_CFLAGS CXXFLAGS DEBUG_CXXFLAGS LDFLAGS + unset CPPFLAGS CFLAGS DEBUG_CFLAGS CXXFLAGS DEBUG_CXXFLAGS LDFLAGS RUSTFLAGS DEBUG_RUSTFLAGS fi } diff --git a/scripts/libmakepkg/buildenv/debugflags.sh.in b/scripts/libmakepkg/buildenv/debugflags.sh.in index ce9c1556..4cd5d003 100644 --- a/scripts/libmakepkg/buildenv/debugflags.sh.in +++ b/scripts/libmakepkg/buildenv/debugflags.sh.in @@ -32,7 +32,9 @@ buildenv_debugflags() { if check_option "debug" "y"; then DEBUG_CFLAGS+=" -fdebug-prefix-map=$srcdir=${DBGSRCDIR:-/usr/src/debug}" DEBUG_CXXFLAGS+=" -fdebug-prefix-map=$srcdir=${DBGSRCDIR:-/usr/src/debug}" + DEBUG_RUSTFLAGS+=" --remap-path-prefix=$srcdir=${DBGSRCDIR:-/usr/src/debug}" CFLAGS+=" $DEBUG_CFLAGS" CXXFLAGS+=" $DEBUG_CXXFLAGS" + RUSTFLAGS+=" $DEBUG_RUSTFLAGS" fi } -- cgit v1.2.3-54-g00ecf