aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2014-07-05 20:23:23 -0400
committerTheodore Ts'o <tytso@mit.edu>2014-07-05 20:49:52 -0400
commite7822c1f40281195dbae84a83faf0f57e7e7eb81 (patch)
treecae413e6a59f569ecda61d6857910de4b4649532 /util
parent2d7583bd42a884d9d9fe6413a9f1a8356e7bb803 (diff)
downloadandroid_external_e2fsprogs-e7822c1f40281195dbae84a83faf0f57e7e7eb81.tar.gz
android_external_e2fsprogs-e7822c1f40281195dbae84a83faf0f57e7e7eb81.tar.bz2
android_external_e2fsprogs-e7822c1f40281195dbae84a83faf0f57e7e7eb81.zip
fix cross-compilation support
Commit 2500ebfc89 (util: fix make dependencies for subst) broke cross compilation because it unconditionally used config.h without setting a includes path so that the config.h file could be found. The proposed fix of adding the include path (such as was proposed at http://patchwork.ozlabs.org/patch/355662/ or in Debian Bug #753375) isn't really the right way to go, since the information in config.h is for the target environment, and not the build environment. So using config.h when building helper programs used as part of the build can potentially cause more problems than it solves. In general, build helpers must be written to be as portable as possible, and to not require any autoconf defined #ifdef's whenever possible. The subst program broke this rule to (1) address a Coverity security complaint by using futimes(2) instad of utimes(2) if present, and (2) to preserve the nanosecond portion of the file timestamp. Oh, well. We won't be able to do the latter when cross compiling, and as to the former, if an attacker has write access to your build tree while you are building programs that will be run as root, you've got bigger problems. :-) Fix the problem that commit 2500ebfc89 was trying to address by explicitly adding @DEFS@ to CFLAGS, so that -DHAVE_CONFIG_H is passed to make depend. This fixes up the make depend without forcing the use of config.h when cross-compiling. Addresses-Debian-Bug: #753375 Signed-off-by: Theodore Ts'o <tytso@mit.edu> Tested-by: Gustavo Zacarias <gustavo@zacarias.com.ar> Cc: Helmut Grohne <helmut@subdivi.de> Cc: 753375@bugs.debian.org
Diffstat (limited to 'util')
-rw-r--r--util/subst.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/util/subst.c b/util/subst.c
index 6a5eab1b..62448312 100644
--- a/util/subst.c
+++ b/util/subst.c
@@ -5,7 +5,9 @@
*
*/
+#ifdef HAVE_CONFIG_H
#include "config.h"
+#endif
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>