Comment 4 for bug 2002043

Revision history for this message
Nafees (nafeabd) wrote :

Thanks for looking into this. On python3, can we make sure if we are looking into right output file?

From your pasted output on Python3, I do see, there is -O2 but I see from next command the query is against test.so file which seems incorrect. From the compilation output, the file name when python3 is used is test.cpython-38-aarch64-linux-gnu.so.

On my machine (Ubuntu 20.04) with Python3:-
ubuntu@ip-172-31-18-56:~/test$ python3 setup.py build_ext --inplace
running build_ext
building 'test' extension
creating build
creating build/temp.linux-aarch64-3.8
aarch64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.8 -c testmodule.c -o build/temp.linux-aarch64-3.8/testmodule.o
creating build/lib.linux-aarch64-3.8
aarch64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fwrapv -O2 -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-aarch64-3.8/testmodule.o -o build/lib.linux-aarch64-3.8/test.cpython-38-aarch64-linux-gnu.so
copying build/lib.linux-aarch64-3.8/test.cpython-38-aarch64-linux-gnu.so ->
ubuntu@ip-172-31-18-56:~/test$ strings test.cpython-38-aarch64-linux-gnu.so | grep -- -O
GNU C17 9.4.0 -mlittle-endian -mabi=lp64 -g -g -g -g -O2 -O2 -fstack-protector-strong -fwrapv -fstack-protector-strong -fPIC -fasynchronous-unwind-tables -fstack-protector-strong -fstack-clash-protection