Ⅰ. Issue Description
The configure script printed the following error message while building Tengine:
Ⅱ. Describe what happened
checking for jemalloc library ... found
auto/lib/jemalloc/conf: line 36: [: too many arguments
creating objs/Makefile
The corresponding part of the code looks like this:
tengine/auto/lib/jemalloc/conf
Lines 35 to 40 in ae3ff46
| | if [ $ngx_found = yes ]; then |
| | if [ $CC = gcc ]; then |
| | CFLAGS="$CFLAGS -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free" |
| | fi |
| | CORE_LIBS="$CORE_LIBS $ngx_feature_libs" |
| | JEMALLOC=YES |
The $CC = gcc
conditional expression has the following errors:
- The
CC
environment variable may contain spaces, e.g. when using CCache (CC='ccache gcc'
) or distcc - The check doesn't verify the case where the compiler command has invoked gcc indirectly(refer to the CCache example above).
Ⅲ. Describe what you expected to happen
IMO the compiler check should be fixed by checking the invoked program's specific characteristics(e.g. gcc --version
) instead of simply comparing the command name.
Also, the CC
environment variable should be wrapped with double quotes, as it may contain space characters.
Ⅳ. How to reproduce it (as minimally and precisely as possible)
- Install jemalloc build dependencies and CCache
- Run the configure program with
CC
environment variable set toccache gcc
Ⅴ. Anything else we need to know?
N/A
Ⅵ. Environment:
- Tengine version (use
sbin/nginx -V
): 2.3.3 - OS (e.g. from /etc/os-release): Ubuntu 21.04 AMD64
- Kernel (e.g.
uname -a
): 5.11.0-17-generic
1条答案
按热度按时间ao218c7q1#
I made a patch that fixes the problem, however I currently unable to send a pull request: