Comment 3 for bug 2002043

Revision history for this message
Fabio Augusto Miranda Martins (fabio.martins) wrote :

Hi Nafees,

Thank you for the reproducer and instructions.

Per your comments, I would expect this to work well with python3 on 20.04, however, my tests indicated that python2 and python3 are both behaving the same way. In the example below, I'm using python3 and I also don't see the -O2 optimization:

ubuntu@ip-172-31-80-78:~/python-bug/testprog-python3-pip$ python3 setup.py build_ext --inplace
running build_ext
building 'test' extension
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-80-78:~/python-bug/testprog-python3-pip$ strings test.so | grep -- -O

(output from the command above was empty)

On the other hand, I do see the -O2 with python2 in a 22.04 instance.

Can you clarify if this is the same for you and, if not, provide some details on versions being used?

Regards,
Fabio Martins