Tested 2.7.18-1~20.04.4~focal1 # dpkg -s python2.7 | grep Version Version: 2.7.18-1~20.04.4~focal1 # python2 -c "import sysconfig; print(sysconfig.get_config_var('CFLAGS'))" -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-aHqux6/python2.7-2.7.18=. -fstack-protector-strong -Wformat -Werror=format-security # python2 setup.py build_ext --inplace running build_ext There is a workaround to now inherit optimization CFLAGS when compiling wheels. To enable this, set APPLY_LP2002043_UBUNTU_CFLAGS_WORKAROUND in your environment. See LP: https://launchpad.net/bugs/2002043 for further context. APPLY_LP2002043_UBUNTU_CFLAGS_WORKAROUND not detected. building 'test' extension creating build creating build/temp.linux-x86_64-2.7 x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-aHqux6/python2.7-2.7.18=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c testmodule.c -o build/temp.linux-x86_64-2.7/testmodule.o creating build/lib.linux-x86_64-2.7 x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-aHqux6/python2.7-2.7.18=. -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-aHqux6/python2.7-2.7.18=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC build/temp.linux-x86_64-2.7/testmodule.o -o build/lib.linux-x86_64-2.7/test.so No -02 optimization flag was used, now to use WA # rm -rf build/ test.so # export APPLY_LP2002043_UBUNTU_CFLAGS_WORKAROUND="" # python2 setup.py build_ext --inplace running build_ext There is a workaround to now inherit optimization CFLAGS when compiling wheels. To enable this, set APPLY_LP2002043_UBUNTU_CFLAGS_WORKAROUND in your environment. See LP: https://launchpad.net/bugs/2002043 for further context. APPLY_LP2002043_UBUNTU_CFLAGS_WORKAROUND detected, using workaround. building 'test' extension creating build creating build/temp.linux-x86_64-2.7 x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-aHqux6/python2.7-2.7.18=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c testmodule.c -o build/temp.linux-x86_64-2.7/testmodule.o creating build/lib.linux-x86_64-2.7 x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-aHqux6/python2.7-2.7.18=. -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-aHqux6/python2.7-2.7.18=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC build/temp.linux-x86_64-2.7/testmodule.o -o build/lib.linux-x86_64-2.7/test.so copying build/lib.linux-x86_64-2.7/test.so ->