Skip to content

Commit 9dfb01b

Browse files
committed
detect strerror_r check failure
Signed-off-by: Jay Lee <[email protected]>
1 parent 63fae55 commit 9dfb01b

File tree

3 files changed

+41
-7
lines changed

3 files changed

+41
-7
lines changed

jemalloc-sys/build.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,9 @@ fn main() {
145145
println!("cargo:rustc-link-lib={}={}", kind, &stem[3..]);
146146
return;
147147
}
148-
let mut build = cc::Build::new();
149-
if env::var("JEMALLOC_SYS_RUN_JEMALLOC_TESTS").is_err() {
150-
// Disable -Wall unless in CI.
151-
build.warnings(false);
152-
}
153-
let compiler = build.get_compiler();
148+
// Disable -Wextra warnings - jemalloc doesn't compile free of warnings with
149+
// it enabled: https://github.com/jemalloc/jemalloc/issues/1196
150+
let compiler = cc::Build::new().extra_warnings(false).get_compiler();
154151
let cflags = compiler
155152
.args()
156153
.iter()

jemalloc-sys/configure/configure

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14143,6 +14143,41 @@ fi
1414314143
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $je_cv_strerror_r_returns_char_with_gnu_source" >&5
1414414144
$as_echo "$je_cv_strerror_r_returns_char_with_gnu_source" >&6; }
1414514145

14146+
if test "x${je_cv_strerror_r_returns_char_with_gnu_source}" = "xno" ; then
14147+
14148+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r header only is compilable" >&5
14149+
$as_echo_n "checking whether strerror_r header only is compilable... " >&6; }
14150+
if ${je_cv_strerror_r_header_pass+:} false; then :
14151+
$as_echo_n "(cached) " >&6
14152+
else
14153+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14154+
/* end confdefs.h. */
14155+
14156+
#include <errno.h>
14157+
#include <stdio.h>
14158+
#include <stdlib.h>
14159+
#include <string.h>
14160+
14161+
int
14162+
main ()
14163+
{
14164+
14165+
;
14166+
return 0;
14167+
}
14168+
_ACEOF
14169+
if ac_fn_c_try_link "$LINENO"; then :
14170+
je_cv_strerror_r_header_pass=yes
14171+
else
14172+
je_cv_strerror_r_header_pass=no
14173+
fi
14174+
rm -f core conftest.err conftest.$ac_objext \
14175+
conftest$ac_exeext conftest.$ac_ext
14176+
fi
14177+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $je_cv_strerror_r_header_pass" >&5
14178+
$as_echo "$je_cv_strerror_r_header_pass" >&6; }
14179+
14180+
fi
1414614181
CONFIGURE_CFLAGS="${SAVED_CONFIGURE_CFLAGS}"
1414714182
if test "x${CONFIGURE_CFLAGS}" = "x" -o "x${SPECIFIED_CFLAGS}" = "x" ; then
1414814183
CFLAGS="${CONFIGURE_CFLAGS}${SPECIFIED_CFLAGS}"
@@ -14155,6 +14190,8 @@ if test "x${je_cv_strerror_r_returns_char_with_gnu_source}" = "xyes" ; then
1415514190

1415614191
$as_echo "#define JEMALLOC_STRERROR_R_RETURNS_CHAR_WITH_GNU_SOURCE " >>confdefs.h
1415714192

14193+
elif test "x${je_cv_strerror_r_header_pass}" = "xno" ; then
14194+
as_fn_error $? "cannot determine return type of strerror_r" "$LINENO" 5
1415814195
fi
1415914196

1416014197
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5

jemalloc-sys/jemalloc

0 commit comments

Comments
 (0)