From c85a9b26cfa65f311c82157a4b01bbbd6cadcef6 Mon Sep 17 00:00:00 2001 From: Justin Bogner Date: Tue, 4 Aug 2015 06:29:58 +0000 Subject: [PATCH] Remove the configure and cmake checks for sys/wait.h If we don't have sys/wait.h and we're on a unix system there's no way that several of the llvm tools work at all. This includes clang. Just remove the configure and cmake checks entirely - we'll get a build error instead of building something broken now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243957 91177308-0d34-0410-b5e6-96231b3b80d8 --- autoconf/configure.ac | 1 - cmake/config-ix.cmake | 1 - configure | 85 ------------------------------ include/llvm/Config/config.h.cmake | 3 -- include/llvm/Config/config.h.in | 3 -- lib/Support/Unix/Program.inc | 7 --- lib/Support/Unix/Unix.h | 13 +---- 7 files changed, 1 insertion(+), 112 deletions(-) diff --git a/autoconf/configure.ac b/autoconf/configure.ac index 5e7b61f8720..45856cf23ce 100644 --- a/autoconf/configure.ac +++ b/autoconf/configure.ac @@ -1786,7 +1786,6 @@ dnl Generally we're looking for POSIX headers. AC_HEADER_DIRENT AC_HEADER_MMAP_ANONYMOUS AC_HEADER_STAT -AC_HEADER_SYS_WAIT AC_HEADER_TIME AC_LANG_PUSH([C++]) diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake index 74cd76e5167..c9ad80e6122 100755 --- a/cmake/config-ix.cmake +++ b/cmake/config-ix.cmake @@ -67,7 +67,6 @@ check_include_file(sys/resource.h HAVE_SYS_RESOURCE_H) check_include_file(sys/stat.h HAVE_SYS_STAT_H) check_include_file(sys/time.h HAVE_SYS_TIME_H) check_include_file(sys/uio.h HAVE_SYS_UIO_H) -check_include_file(sys/wait.h HAVE_SYS_WAIT_H) check_include_file(termios.h HAVE_TERMIOS_H) check_include_file(unistd.h HAVE_UNISTD_H) check_include_file(utime.h HAVE_UTIME_H) diff --git a/configure b/configure index a62fadd263d..ce067bbe7d9 100755 --- a/configure +++ b/configure @@ -11124,90 +11124,6 @@ _ACEOF fi -{ echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5 -echo $ECHO_N "checking for sys/wait.h that is POSIX.1 compatible... $ECHO_C" >&6; } -if test "${ac_cv_header_sys_wait_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#ifndef WEXITSTATUS -# define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8) -#endif -#ifndef WIFEXITED -# define WIFEXITED(stat_val) (((stat_val) & 255) == 0) -#endif - -int -main () -{ - int s; - wait (&s); - s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_header_sys_wait_h=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_header_sys_wait_h=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 -echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6; } -if test $ac_cv_header_sys_wait_h = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_SYS_WAIT_H 1 -_ACEOF - -fi - { echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6; } if test "${ac_cv_header_time+set}" = set; then @@ -19793,4 +19709,3 @@ echo "$as_me: error: $ac_sub_configure failed for $ac_dir" >&2;} cd "$ac_popdir" done fi - diff --git a/include/llvm/Config/config.h.cmake b/include/llvm/Config/config.h.cmake index b9fd4504ad7..0917762cd59 100644 --- a/include/llvm/Config/config.h.cmake +++ b/include/llvm/Config/config.h.cmake @@ -324,9 +324,6 @@ /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_UIO_H ${HAVE_SYS_UIO_H} -/* Define to 1 if you have that is POSIX.1 compatible. */ -#cmakedefine HAVE_SYS_WAIT_H ${HAVE_SYS_WAIT_H} - /* Define if the setupterm() function is supported this platform. */ #cmakedefine HAVE_TERMINFO ${HAVE_TERMINFO} diff --git a/include/llvm/Config/config.h.in b/include/llvm/Config/config.h.in index 09706499ea3..08d1ad0a60f 100644 --- a/include/llvm/Config/config.h.in +++ b/include/llvm/Config/config.h.in @@ -318,9 +318,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_UIO_H -/* Define to 1 if you have that is POSIX.1 compatible. */ -#undef HAVE_SYS_WAIT_H - /* Define if the setupterm() function is supported this platform. */ #undef HAVE_TERMINFO diff --git a/lib/Support/Unix/Program.inc b/lib/Support/Unix/Program.inc index 8947b62e4dc..a8d1fe3c07d 100644 --- a/lib/Support/Unix/Program.inc +++ b/lib/Support/Unix/Program.inc @@ -323,7 +323,6 @@ namespace llvm { ProcessInfo sys::Wait(const ProcessInfo &PI, unsigned SecondsToWait, bool WaitUntilTerminates, std::string *ErrMsg) { -#ifdef HAVE_SYS_WAIT_H struct sigaction Act, Old; assert(PI.Pid && "invalid pid to wait on, process not started?"); @@ -417,12 +416,6 @@ ProcessInfo sys::Wait(const ProcessInfo &PI, unsigned SecondsToWait, // signal during execution as opposed to failing to execute. WaitResult.ReturnCode = -2; } -#else - if (ErrMsg) - *ErrMsg = "Program::Wait is not implemented on this platform yet!"; - ProcessInfo WaitResult; - WaitResult.ReturnCode = -2; -#endif return WaitResult; } diff --git a/lib/Support/Unix/Unix.h b/lib/Support/Unix/Unix.h index e16a226a8ea..871e612f6c1 100644 --- a/lib/Support/Unix/Unix.h +++ b/lib/Support/Unix/Unix.h @@ -29,6 +29,7 @@ #include #include #include +#include #ifdef HAVE_UNISTD_H #include @@ -43,22 +44,10 @@ #endif #include -#ifdef HAVE_SYS_WAIT_H -# include -#endif - #ifdef HAVE_DLFCN_H # include #endif -#ifndef WEXITSTATUS -# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) -#endif - -#ifndef WIFEXITED -# define WIFEXITED(stat_val) (((stat_val) & 255) == 0) -#endif - /// This function builds an error message into \p ErrMsg using the \p prefix /// string and the Unix error number given by \p errnum. If errnum is -1, the /// default then the value of errno is used. -- 2.34.1