From: Brenden Blanco Date: Thu, 11 Jun 2015 23:20:49 +0000 (-0700) Subject: Cleanups for some build/compile failures X-Git-Tag: v0.1.2~47^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=260d516d7b1c365047ff62d1ec37c5f053a58814;p=platform%2Fupstream%2Fbcc.git Cleanups for some build/compile failures * Change ftw to nftw, and do depth-first tmpdir cleanup * Scrub CROSS_COMPILE variable before kbuild_helpers Signed-off-by: Brenden Blanco --- diff --git a/src/cc/kbuild_helper.cc b/src/cc/kbuild_helper.cc index 1c476ed..3d7d5f5 100644 --- a/src/cc/kbuild_helper.cc +++ b/src/cc/kbuild_helper.cc @@ -52,7 +52,7 @@ int KBuildHelper::learn_flags(const string &tmpdir, const char *uname_release, c if (!cf) return -1; } - string cmd = "make -s"; + string cmd = "make CROSS_COMPILE= -s"; cmd += " -C " KERNEL_MODULES_DIR "/" + string(uname_release) + "/build"; cmd += " M=" + tmpdir + " dummy.o"; int rc = ::system(cmd.c_str()); diff --git a/src/cc/kbuild_helper.h b/src/cc/kbuild_helper.h index 6cb505c..a21d6d5 100644 --- a/src/cc/kbuild_helper.h +++ b/src/cc/kbuild_helper.h @@ -57,7 +57,7 @@ class DirStack { char cwd_[256]; }; -static int ftw_cb(const char *path, const struct stat *, int) { +static int ftw_cb(const char *path, const struct stat *, int, struct FTW *) { return ::remove(path); } @@ -73,7 +73,7 @@ class TmpDir { ok_ = true; } ~TmpDir() { - if (::ftw(prefix_.c_str(), ftw_cb, 20) < 0) + if (::nftw(prefix_.c_str(), ftw_cb, 20, FTW_DEPTH) < 0) ::perror("ftw"); else ::remove(prefix_.c_str());