Project

General

Profile

Actions

Bug #20500

closed

Non-system directories are not searched when checking for jemalloc headers and libs, and building `enc`

Added by lish82 (Hiroki Katagiri) 7 months ago. Updated 2 months ago.

Status:
Closed
Target version:
-
[ruby-core:117957]

Description

I found a problem similar to #20494 on jemalloc
It's similar to #20494, but it has a few more issues

Problems:

  • Non-system directories (specified by --with-opt-dir) are not searched when checking jemalloc headers (almost the same as #20494)
  • Non-system directories are not searched when checking jemalloc libs
  • Non-system directories are not searched when building the enc directory sources

I have confirmed that this problem can be fixed by applying the following patch:

diff --git a/configure.ac b/configure.ac
index 169662c..b2dce70 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1392,6 +1392,8 @@ AC_ARG_WITH([jemalloc],
   [with_jemalloc=$withval], [with_jemalloc=no])
 AS_IF([test "x$with_jemalloc" != xno],[
   # find jemalloc header first
+  save_CPPFLAGS="${CPPFLAGS}"
+  CPPFLAGS="${INCFLAGS} ${CPPFLAGS}"
   malloc_header=
   AC_CHECK_HEADER(jemalloc/jemalloc.h, [malloc_header=jemalloc/jemalloc.h], [
     AC_CHECK_HEADER(jemalloc.h, [malloc_header=jemalloc.h])
@@ -1423,6 +1425,8 @@ AS_IF([test "x$with_jemalloc" != xno],[
       done
     done
   ])
+  CPPFLAGS="${save_CPPFLAGS}"
+  unset save_CPPFLAGS
   with_jemalloc=${rb_cv_jemalloc_library}
   AS_CASE(["$with_jemalloc"],
   [no],
diff --git a/enc/Makefile.in b/enc/Makefile.in
index 6920bc9..ce93fdd 100644
--- a/enc/Makefile.in
+++ b/enc/Makefile.in
@@ -52,7 +52,7 @@ optflags = @optflags@
 debugflags = @debugflags@
 warnflags = @warnflags@
 CCDLFLAGS = @CCDLFLAGS@
-INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir) -I$(top_srcdir)
+INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir) -I$(top_srcdir) @incflags@
 DEFS = @DEFS@
 CPPFLAGS = @CPPFLAGS@ -DONIG_ENC_REGISTER=rb_enc_register
 LDFLAGS = @LDFLAGS@

On a side note, I think there might be other parts affected by the changes bellow:
https://github.com/ruby/ruby/pull/8449

I thought it might be a good idea to review everything thoroughly

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0