Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make编译时候报文件内部函数语法错误是什么原因,是我git文件有误吗? #267

Open
melinetssamant opened this issue Apr 18, 2024 · 6 comments

Comments

@melinetssamant
Copy link

Description

make编译时候报文件内部函数语法错误是什么原因,是我git文件有误吗?
报错具体如下:
src/ctl.c:3120:32: error: expected declaration specifiers or ‘...’ before ‘tsd_t
experimental_hooks_install_ctl(tsd_t *tsd, const size_t *mib, size_t miblen,
^~~~~
src/ctl.c:3148:31: error: expected declaration specifiers or ‘...’ before ‘tsd_t
experimental_hooks_remove_ctl(tsd_t *tsd, const size_t *mib, size_t miblen,
^~~~~
src/ctl.c:3231:36: error: expected declaration specifiers or ‘...’ before ‘tsd_t
experimental_utilization_query_ctl(tsd_t *tsd, const size_t *mib,
^~~~~
src/ctl.c:3356:42: error: expected declaration specifiers or ‘...’ before ‘tsd_t
experimental_utilization_batch_query_ctl(tsd_t *tsd, const size_t *mib,
^~~~~
src/ctl.c:3384:31: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ befor
static const ctl_named_node_t *
^
src/ctl.c:3401:36: error: expected declaration specifiers or ‘...’ before ‘tsd_t
experimental_arenas_i_pactivep_ctl(tsd_t *tsd, const size_t *mib,
^~~~~
In file included from include/jemalloc/internal/assert.h:1,
from include/jemalloc/internal/bit_util.h:4,
from include/jemalloc/internal/bitmap.h:5,
from include/jemalloc/internal/arena_structs_a.h:4,
from include/jemalloc/internal/jemalloc_internal_includes.h:53,
from src/ctl.c:3:
include/jemalloc/internal/malloc_io.h:54:8: error: old-style parameter declarati
size_t malloc_snprintf(char *str, size_t size, const char *format, ...)
^~~~~~~~~~~~~~~
src/ctl.c:3435: error: expected ‘{’ at end of input
}

src/ctl.c:3435:1: warning: control reaches end of non-void function [-Wreturn-ty
}
^
make[3]: *** [Makefile:389: src/ctl.sym.o] Error 1
make[3]: Leaving directory '/root/setup/Tendis/src/thirdparty/jemalloc'
make[2]: *** [CMakeFiles/build_jemalloc.dir/build.make:61: ../src/thirdparty/jem
make[2]: Leaving directory '/root/setup/Tendis/build'
make[1]: *** [CMakeFiles/Makefile2:746: CMakeFiles/build_jemalloc.dir/all] Error
make[1]: *** Waiting for unfinished jobs....
[ 18%] Linking CXX static library ../../../lib/libsession_ctx.a
make[2]: Leaving directory '/root/setup/Tendis/build'
[ 18%] Built target session_ctx
make[1]: Leaving directory '/root/setup/Tendis/build'
make: *** [Makefile:152: all] Error 2

Expected Behavior

Current Behavior

Possible Solution

Steps to Reproduce (for bugs)

Context

Your Environment

  • Operating System and version:
    NAME="openEuler"
    VERSION="20.03 (LTS)"
    ID="openEuler"
    VERSION_ID="20.03"
    PRETTY_NAME="openEuler 20.03 (LTS)"
    ANSI_COLOR="0;31"

  • Machine Specifications:

  • Tendis Version:
    Tendis-2.7.0-rocksdb-v8.5.3

  • Tendis Configuration:

  • IO/Network used:

  • Link to your project:

@raffertyyu
Copy link
Contributor

看着像是gcc版本较低,推荐安装软件源中提供的,或者自行编译至少11以上版本的gcc编译器进行编译。

@melinetssamant
Copy link
Author

melinetssamant commented Apr 18, 2024

看着像是gcc版本较低,推荐安装软件源中提供的,或者自行编译至少11以上版本的gcc编译器进行编译。

gcc都是8.5.0,版本还低是吗??我看他们都是5.5.0的都编译了,我试试11以上的版本,一会反馈

[root@bcrj-hwkp setup]# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/root/setup/gcc-8.5.0/build-gcc/libexec/gcc/aarch64-unknown-linux-gnu/8.5.0/lto-wrapper
Target: aarch64-unknown-linux-gnu
Configured with: /root/setup/gcc-8.5.0/configure --prefix=/root/setup/gcc-8.5.0/build-gcc -enable-checking=release -enable-languages=c,c++ -disable-multili
Thread model: posix
gcc version 8.5.0 (GCC)
[root@bcrj-hwkp setup]# g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/root/setup/gcc-8.5.0/build-gcc/libexec/gcc/aarch64-unknown-linux-gnu/8.5.0/lto-wrapper
Target: aarch64-unknown-linux-gnu
Configured with: /root/setup/gcc-8.5.0/configure --prefix=/root/setup/gcc-8.5.0/build-gcc -enable-checking=release -enable-languages=c,c++ -disable-multili
Thread model: posix
gcc version 8.5.0 (GCC)

@melinetssamant
Copy link
Author

看着像是gcc版本较低,推荐安装软件源中提供的,或者自行编译至少11以上版本的gcc编译器进行编译。

已经升级了gcc到13.2.0,cmake已经显示了gcc版本是13.2.0,cmake没有报错,但是make的时候问题依旧,一样的报错
[root@bcrj-hwkp build]# cmake ../
-- The C compiler identification is GNU 13.2.0
-- The CXX compiler identification is GNU 13.2.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
compile optimize with lto
pgo_dir: /root/setup/Tendis/pgo

@pscxtc
Copy link

pscxtc commented May 17, 2024

想问下,解决了么,我在 arm64 环境下编译 2.7.0 版本,遇到的问题相同
gcc 11.3
g++ 11.3
cmake 3.20
只要编译到 jemalloc 就报错

@pscxtc
Copy link

pscxtc commented May 17, 2024

搞定了,是 jemalloc 的问题, 把 源码 src/thirdparty/jemalloc 替换成 jemalloc 5.2.1 的源码,就可以编译通过了

@melinetssamant
Copy link
Author

melinetssamant commented May 17, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants