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

What the compile command and os of generating async-profiler-2.9-linux-x64.tar.gz #745

Closed
tdy218 opened this issue May 4, 2023 · 5 comments

Comments

@tdy218
Copy link

tdy218 commented May 4, 2023

I compiled the libasyncProfiler.so file for Linux x86-64 glibc-based os just using make command on CentOS 7.9 x86-64, then i got /lib64/libc.so.6: version `GLIBC_2.14' not found error message when i ran it under CentOS 6.10 x86-64.

# libasyncProfiler-linux-x64.so was built by myself 
root# objdump -T libasyncProfiler-linux-x64.so | grep GLIBC_2.14
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.14  memcpy

# async-profiler-2.9-linux-x64/build/libasyncProfiler.so was built in this repository download page.
root# objdump -T async-profiler-2.9-linux-x64/build/libasyncProfiler.so  | grep GLIBC_2.14
root# objdump -T async-profiler-2.9-linux-x64/build/libasyncProfiler.so  | grep memcpy
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 memcpy

root#  cat /etc/system-release
CentOS release 6.10 (Final)
root#  uname -m
x86_64
root# strings /lib64/libc.so.6 |grep GLIBC_ 
GLIBC_2.2.5
GLIBC_2.2.6
GLIBC_2.3
GLIBC_2.3.2
GLIBC_2.3.3
GLIBC_2.3.4
GLIBC_2.4
GLIBC_2.5
GLIBC_2.6
GLIBC_2.7
GLIBC_2.8
GLIBC_2.9
GLIBC_2.10
GLIBC_2.11
GLIBC_2.12
GLIBC_PRIVATE

So, what the compile command and os of generating async-profiler-2.9-linux-x64.tar.gz

@Jongy
Copy link
Contributor

Jongy commented May 4, 2023

You need to build on CentOS 6, or CentOS 7 with glibc-compat (which is glibc of CentOS 6)

@tdy218
Copy link
Author

tdy218 commented May 4, 2023

You need to build on CentOS 6, or CentOS 7 with glibc-compat (which is glibc of CentOS 6)

It not works for C++ 11 atomic

root# cat /etc/system-release
CentOS Linux release 7.9.2009 (Core)
root# uname -m
x86_64
root# yum install -y compat-glibc compat-glibc-headers compat-libstdc++-33 compat-gcc-44 compat-gcc-44-c++
root# yum install -y java-11-openjdk-devel git
root# mv /usr/bin/gcc /usr/bin/gcc.orig
root# ln -s /usr/bin/gcc44 /usr/bin/gcc
root# ln -s /usr/bin/g++44 /usr/bin/g++
root# git clone https://github.com/async-profiler/async-profiler.git
root# cd async-profiler
root# make
for f in src/*.cpp; do echo '#include "'$f'"'; done |\
g++  -O3 -fno-exceptions -fno-omit-frame-pointer -fvisibility=hidden -Wl,-z,defs -fwhole-program -momit-leaf-frame-pointer -DPROFILER_VERSION=\"2.10\" -I/usr/lib/jvm/java-11-openjdk-11.0.19.0.7-1.el7_9.x86_64/include -Isrc/helper -I/usr/lib/jvm/java-11-openjdk-11.0.19.0.7-1.el7_9.x86_64/include/linux -fPIC -shared -o build/lib/libasyncProfiler.so -xc++ - -ldl -lpthread -lrt
In file included from src/os.h:23,
                 from src/event.h:21,
                 from src/allocTracer.h:23,
                 from src/allocTracer.cpp:17,
                 from <stdin>:1:
src/arch.h: In function ‘u64 loadAcquire(u64&)’:
src/arch.h:35: error: ‘__ATOMIC_ACQUIRE’ was not declared in this scope
src/arch.h:35: error: ‘__atomic_load_n’ was not declared in this scope
src/arch.h: In function ‘void storeRelease(u64&, u64)’:
src/arch.h:39: error: ‘__ATOMIC_RELEASE’ was not declared in this scope
src/arch.h:39: error: ‘__atomic_store_n’ was not declared in this scope
src/arch.h:39: error: return-statement with a value, in function returning 'void'
In file included from src/profiler.h:25,
                 from src/allocTracer.cpp:18,
                 from <stdin>:1:
src/callTraceStorage.h: In member function ‘CallTrace* CallTraceSample::acquireTrace()’:
src/callTraceStorage.h:40: error: ‘__ATOMIC_ACQUIRE’ was not declared in this scope
src/callTraceStorage.h:40: error: ‘__atomic_load_n’ was not declared in this scope
src/callTraceStorage.h: In member function ‘void CallTraceSample::setTrace(CallTrace*)’:
src/callTraceStorage.h:44: error: ‘__ATOMIC_RELEASE’ was not declared in this scope
src/callTraceStorage.h:44: error: ‘__atomic_store_n’ was not declared in this scope
src/callTraceStorage.h:44: error: return-statement with a value, in function returning 'void'
In file included from src/profiler.h:26,
                 from src/allocTracer.cpp:18,
                 from <stdin>:1:
..................
...........

@apangin
Copy link
Collaborator

apangin commented May 4, 2023

For the releases, I uses CentOS 6 with gcc 4.7.2.

@tdy218
Copy link
Author

tdy218 commented May 4, 2023

For the releases, I uses CentOS 6 with gcc 4.7.2.

Thx, and async-profiler-2.9-linux-arm64/build/libasyncProfiler.so is built under CentOS 7.x aarch64 ?

@apangin
Copy link
Collaborator

apangin commented May 4, 2023

It was built on Oracle Linux 7.

@tdy218 tdy218 closed this as completed May 8, 2023
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